duino
duino copied to clipboard
'connected' event triggers before the SerialPort is opened
If I run the examples/basic.js the application crashes because the serial port is not opened on the 'connected' event. Shouldn't the 'connected' event only be emitted after the SerialPort 'open' event?
Here https://github.com/ecto/duino/blob/master/lib/board.js#L28, instead of:
self.emit('connected');
do this:
self.serial.on('open', function(){
self.emit('connected');
});