Shop OBEX P1 Docs P2 Docs Learn Events
Bug in Dns.spin W5100 / W5200 driver/demo — Parallax Forums

Bug in Dns.spin W5100 / W5200 driver/demo

msrobotsmsrobots Posts: 3,709
edited 2013-08-05 00:03 in Propeller 1
Some misshaped code does not what it is supposed to do in Dns.spin.
PUB ResolveDomain(url) | ptr, dnsPtr
  bytefill(@ip1, 0, @dnsIps-@ip1)
  bytemove(@urlBuff, url, strsize(url))

  byte[strsize(url)] := 0  ' <--- wrong
...  

should be
PUB ResolveDomain(url) | ptr, dnsPtr
  bytefill(@ip1, 0, @dnsIps-@ip1)
  bytemove(@urlBuff, url, strsize(url))

  byte[@urlBuff][strsize(url)] := 0  ' <--- better
...  

or should it be
PUB ResolveDomain(url) | ptr, dnsPtr
  bytefill(@ip1, 0, @dnsIps-@ip1)
  bytemove(@urlBuff, url, strsize(url)+1) ' <-- same result one line less
...  

Enjoy!

Mike

Comments

  • Mike GMike G Posts: 2,702
    edited 2013-08-04 05:04
    Thanks for that... I'll update the source ASAP.

    Edit: Repo updated.
  • msrobotsmsrobots Posts: 3,709
    edited 2013-08-05 00:03
    Thank you Mike G.

    found the change in the repo before looking at the forum...:smile:

    You did a lot of work there and well written code. Nice to read and extend.

    I am using the spinnerette, so sockets are a very expensive resource.

    I like the DHCP object, it needs one socket as far as I followed. But just once in a while. This can be shared with NetBIOS.

    But the bummer is your NetBiosUnitTest. I bow deep. I was just reading some wonderful book (http://book.huihoo.com/implementing-cifs/NetBIOS.html) over implementing CIFS. And stumbled over it in the w5200 driver section of the code.
    You are almost there! Wow. NetBIOS over TCP/IP on the prop...

    If my time allows me to do I will dig deeper into this.

    NetBIOS name registration/resolution is nice on the spinnerette. it will make life way more easier.

    changed the prefix to SOLVED...

    Enjoy!

    Mike
Sign In or Register to comment.