You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I listen to a port in real time, I use the nodejs serialport module, but I use the same port to send other information. I use this following code which prevents me from using the port:
port.on('readable', function () {
if(port.read() === "h"){
}
})
I was thinking of something like checking the number of bytes in the buffer like in python serialport and arduino, the objective is to avoid blocking the port as the previous code does.
I was thinking of using port.read() to evaluate the buffer bits but it always returns null .
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
hello
I listen to a port in real time, I use the nodejs serialport module, but I use the same port to send other information. I use this following code which prevents me from using the port:
I was thinking of something like checking the number of bytes in the buffer like in python serialport and arduino, the objective is to avoid blocking the port as the previous code does.
I was thinking of using
port.read()
to evaluate the buffer bits but it always returns null .Beta Was this translation helpful? Give feedback.
All reactions