Main Site Documentation

Questions on TinyCLR OS UART EventHandlers


#1

Hello,

I am using the latest version of TinyCLR OS on a BrainPad hooked up to an ESP8266-01s WiFi module. I can send commands to the module and received the results of those commands successfully. However, I am using the polling technique by creating a read thread that is responsible for checking the received buffer length. This tends to be pretty consistent, but I have some questions about the event handlers alternative to polling.

Questions:

  1. What constitute the DataReceived event being triggered?

  2. I get a lot of ‘Frame Error’ on the ErrorReceived event handler, what would trigger these and are there any remedies for fixing?

Thanks.


#2

DataReceived is raised when there is initially data available to read. It won’t be raised on every byte but on some longer interval to not overload the system.

If you’re getting frame errors, I’d check the wiring and other end to ensure there’s nothing configured incorrectly.


#3

Thanks for the reply. I will continue with my polling method as the seems to work much better for me at the present moment.