serial-port-stream
Serial port as a duplex stream.
Works in node via node-serialport and in chrome with browserify via chrome.serial
Features:
- auto open;
- auto close;
- real
Duplex
stream; - work with browserify in chrome extensions and apps.
Install
npm install serial-port-stream
and then:
var SerialPortStream = ;
Usage:
new SerialPortStream(path, options)
orSerialPortStream(path, options)
;
Options:
autoClose
— auto close onfinish
,true
by default;baudRate
;dataBits
;stopBits
;parity
.
Methods:
close
;destroy
.
Just like fs
streams.
Events:
open
;close
;error
.
Example:
var SerialPortStream = ;var stream = '/dev/ttyUSB0' baudRate : 9600 ; stream;
License
MIT