Would love to have a function which should only read a single byte from the serialPort object, alternative to .readAll()
But maybe you designed in a way that user code needs to take care of the buffering?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
My hope hereby is that it more similar to a pipe. As the call to the sub is async, it might be that other subs reading from the buffer at the same time.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Would love to have a function which should only read a single byte from the serialPort object, alternative to .readAll()
But maybe you designed in a way that user code needs to take care of the buffering?
Yes, the user has to take care of it. What I usually do is this:
Last edit: Stefan Zieker 2024-01-18
Agreed, i do it the same way, but using push
My hope hereby is that it more similar to a pipe. As the call to the sub is async, it might be that other subs reading from the buffer at the same time.