serialport/node-serialport

Cleanup the bindings layer

reconbot opened this issue · 1 comments

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 libuv UV_READABLE and windows does a ReadFile loop in c++. Because of this Windows bindings can read the data and call our callbacks, and OSX and Linux repeatedly does a fs.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)

Closed by #906