SoftwareSerial::read()

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
Post Reply
bastibart
Posts: 23
Joined: 12 Dec 2018 16:37

SoftwareSerial::read()

Post by bastibart »

Dear developers

The Z-Uno implementation of SoftwareSerial::read() has two problems

1.
If the buffer is empty, read() returns 0
whereas the Arduino implementation returns -1.

2.
read() will return data beyond the end pointer of the buffer and wrap around to previously read data.

I think many would appreciate the implemention to be changed to match the standard implentation.
The neccessary changes in the source code are minimal.

Cheers
Sebastian
Last edited by bastibart on 16 Dec 2018 17:02, edited 1 time in total.
User avatar
PoltoS
Posts: 7565
Joined: 26 Jan 2011 19:36

Re: SoftwareSerial::read()

Post by PoltoS »

Thank you for your feedback. We will add it to our list
bastibart
Posts: 23
Joined: 12 Dec 2018 16:37

Re: SoftwareSerial::read()

Post by bastibart »

Great - thanks.

I made a huge mistake in my initial post.
read() returns of course -1 when the buffer is empty. I edited my post.
Post Reply