Closed MatzElectronics closed 8 years ago
A terminating character should be appended to the string that gets sent, typically \r or \n. This keeps writeStr compatible with more receiving devices. By automatically adding a 0 to the string that gets sent, it would make it difficult to communicate with devices for which \0x0 has a different meaning. That is why the onus is on the sender to append the correct terminating character for the intended receiving device.
P.S. Off the top of my head, examples of receiving devices where 0x00 has another meaning include the Parallax Serial LCD, XBee, and Parallax software terminals.
Good to know. It's easy to just append the zero.
On Sep 4, 2016 10:09 AM, "Andy Lindsay" notifications@github.com wrote:
P.S. Off the top of my head, examples of receiving devices where 0x00 has another meaning include the Parallax Serial LCD, XBee, and Parallax software terminals.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/parallaxinc/Simple-Libraries/issues/39#issuecomment-244615138, or mute the thread https://github.com/notifications/unsubscribe-auth/AS0quKvhw2IobUKTR-YzAHG5k2uIo5cfks5qmvtOgaJpZM4J0fgy .
Go ahead and close the issue... I know now how I want to handle this. Thanks!
On Sep 4, 2016 10:35 AM, "Matt Matz" mmatz@parallax.com wrote:
Good to know. It's easy to just append the zero.
On Sep 4, 2016 10:09 AM, "Andy Lindsay" notifications@github.com wrote:
P.S. Off the top of my head, examples of receiving devices where 0x00 has another meaning include the Parallax Serial LCD, XBee, and Parallax software terminals.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/parallaxinc/Simple-Libraries/issues/39#issuecomment-244615138, or mute the thread https://github.com/notifications/unsubscribe-auth/AS0quKvhw2IobUKTR-YzAHG5k2uIo5cfks5qmvtOgaJpZM4J0fgy .
Okay, thanks Matt.
When I used writeStr() and readStr() together, I had to send a send a 0 (null) character after the string. Otherwise readStr() filled it's limit with the send string in a sort of loop.