How do I detect receipt of a break character in serial read?
Posted: Thu Oct 01, 2020 1:29 am
I have googled uart breaks on esp8266 and found that support is lacking for break characters in general. Correct me if I'm wrong.
I've seen two methods to send a break, both of which are messy. One is to send a zero byte with a slow baud rate. The other method is to turn off serial, use the gpio, and turn serial back on. I will use one of these ugly methods to send breaks.
However, I can't find anything about how to detect a break when receiving. From my testing it appears that Serial.read() just returns a byte value of zero which is useless.
Does anyone know a way to detect a received break? I'm stuck on this because the protocol I'm receviing uses breaks to separate transmissions.
I've seen two methods to send a break, both of which are messy. One is to send a zero byte with a slow baud rate. The other method is to turn off serial, use the gpio, and turn serial back on. I will use one of these ugly methods to send breaks.
However, I can't find anything about how to detect a break when receiving. From my testing it appears that Serial.read() just returns a byte value of zero which is useless.
Does anyone know a way to detect a received break? I'm stuck on this because the protocol I'm receviing uses breaks to separate transmissions.