Cleanup the bindings layer
reconbot opened this issue · 1 comments
reconbot commented
For the purposes of this issue, I'm defining the bindings as the SerialPortBindings
object the the following functions and the poller.
- list
- open
- update unix
- update windows
- write
- close
- flush
- set
- get
- drain
- request for data
I see a few steps to support this.
- Isolate all the js shims for Bindings from the main serialport code
- Documenting the binding interfaces
- Finish normalizing the binding interfaces so we can remove the platform checks from the main code
The current status of binding isolation is as follows.
- There is no
read()
method. There are two method of read operations. Linux and OSX use libuvUV_READABLE
and windows does aReadFile
loop in c++. Because of this Windows bindings can read the data and call our callbacks, and OSX and Linux repeatedly does afs.read
. We need work out the differences and provide a unified interface. - Disconnect events are communicated in different ways between unix and windows
- A few methods do different things on different platforms (eg
flush
)