Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var serialport = (require("serialport/package").version.split(".")[0] > 3 ? require("serialport") : require("serialport").SerialPort);
var stream = require("../stream");
var pdu = require("modbus-pdu");
function Driver() {
}
Driver.connect = function (device, options) {
options = options || {};
options.autoOpen = false;
options.baudRate = options.baudRate || 9600;
options.dataBits = options.dataBits || 8;
options.stopBits = options.stopBits || 1;
options.parity = options.parity || "none";