mirror of
https://github.com/siemens-mobile-hacks/node-serialport-bindings-cpp.git
synced 2026-11-26 02:47:17 +00:00
14 lines
342 B
JavaScript
14 lines
342 B
JavaScript
var SerialPort = require('serialport').SerialPort;
|
|
|
|
process.stdin.on('data', function() {});
|
|
|
|
process.stdin.on('end', function() {
|
|
var sp = new SerialPort('/dev/tty.usbmodemfd121');
|
|
sp.on('open', function() {
|
|
console.log('SerialPort FD:', sp.fd);
|
|
|
|
sp.write('this will not get sent');
|
|
|
|
setTimeout(process.exit, 100);
|
|
});
|
|
});
|