sci-bots / base-node-rpc

Base classes for Arduino RPC node/device
0 stars 2 forks source link

Use asynchronous reading from serial streams #5

Open cfobel opened 7 years ago

cfobel commented 7 years ago

Reading from serial stream currently uses polling with a default delay of 10ms between polls.

Ideally, we should use an asynchronous mechanism for reading from serial streams to reduce latency. In Linux/OSX, etc., the select() can be used to achieve asynchronous reads from a serial port. However, this method does not seem appropriate for Windows.

See here and here for some leads on how we might implement cross-platform support for asynchronous reads from serial streams. It might also be worth looking into pyuv.