arduino-libraries / ArduinoMDNS

mDNS Library for Arduino
40 stars 13 forks source link

Missing character #4

Closed jaapcammeraat closed 1 year ago

jaapcammeraat commented 5 years ago

During my tests I found that a character is missing.

In my code I use: mDNS.addServiceRecord("_ewillie._tcp", 1883, MDNSServiceTCP, "testdata");

When I look with Discovery.app ( www.tildesoft.com ), I only see the text: estdata The first character is missing.

schermafbeelding 2019-02-02 om 13 07 00
jaapcammeraat commented 5 years ago

Ofcourse the best way would be reading the whole zeroconf manual and do something like this: mDNS.addServiceRecord("_ewillie._tcp", 1883, MDNSServiceTCP, "\x09version=2\x07model=2");

schermafbeelding 2019-02-02 om 13 39 52

In this case there aren't missing characters.

per1234 commented 1 year ago

Thanks @jaapcammeraat. I see that the required format is documented and demonstrated in the example sketches (which serve as the library's user documentation):

https://github.com/arduino-libraries/ArduinoMDNS/blob/a4fbf1e0a9ddb85f3dc3b25e02070cfc59ae760e/examples/Ethernet/RegisteringServicesWithTxtRecord/RegisteringServicesWithTxtRecord.ino#L72-L84

https://github.com/arduino-libraries/ArduinoMDNS/blob/a4fbf1e0a9ddb85f3dc3b25e02070cfc59ae760e/examples/WiFi/WiFiRegisteringServicesWithTxtRecord/WiFiRegisteringServicesWithTxtRecord.ino#L91-L103

Ideally there would be a better explanation of the "length byte", but I think that what is provided now is all that is realistically feasible for us to achieve given the available resources for maintaining this library. So I'll close this. I will commit to making some reasonable effort to assist if anyone wants to submit a pull request to improve the explanation of the required format in the examples.