mirror of
https://github.com/siemens-mobile-hacks/node-serialport-bindings-cpp.git
synced 2026-11-25 18:37:19 +00:00
- Move Parsers into a directory - Move Bindings into a directory - Add a linter for require calls
13 lines
372 B
JavaScript
13 lines
372 B
JavaScript
/* eslint-disable require-path-exists/exists */
|
|
'use strict';
|
|
|
|
// Constructor callback example
|
|
const SerialPort = require('serialport');
|
|
const port = new SerialPort('/dev/tty-usbserial1', () => {
|
|
console.log('Port Opened');
|
|
});
|
|
|
|
port.write('main screen turn on', (err) => {
|
|
if (err) { return console.log('Error: ', err.message) }
|
|
console.log('message written');
|
|
});
|