|
|
|
|
|
by MootWoop
4161 days ago
|
|
Hi I'm the person who wrote this example. In fact you don't need to check that stop bits are ones because one is the default: when nothing is being written on the line, it is high all the time. This is why it's just a matter of convention (number of stop bits) rather than a specific pattern. EDIT: available checks that data is available on a port. If the test is true, then you can read from the port; if you don't read from the port, this is equivalent to an implicit read and data is discarded. |
|
This mechanism allows for timing differences between either end, and some immunity to electrical noise.
Also, sampling and validating the stop bit(s) will reveal framing errors.