Commit 48751f6728b00148d427a07b5884fdec0ca63dc6
1 parent
4a065542a0
Exists in
master
baudRate
Showing 2 changed files with 4 additions and 3 deletions Side-by-side Diff
lib/modem/index.js
... | ... | @@ -28,16 +28,17 @@ function debugLog(msg) { |
28 | 28 | |
29 | 29 | |
30 | 30 | class Modem extends EventEmitter { |
31 | - constructor(portName) { | |
31 | + constructor(portName, portOptions) { | |
32 | 32 | super(); |
33 | 33 | this.portName = portName; |
34 | + this.portOptions = portOptions; | |
34 | 35 | } |
35 | 36 | |
36 | 37 | open(cb) { |
37 | 38 | const self = this; |
38 | 39 | |
39 | 40 | debugLog('MODEM: opening ' + this.portName); |
40 | - this.port = new SerialPort(this.portName); | |
41 | + this.port = new SerialPort(this.portName, portOptions); | |
41 | 42 | |
42 | 43 | this.port.on('error', function(err) { |
43 | 44 | debugLog('MODEM: error opening ' + this.portName); |
lib/partner-mkios.js
... | ... | @@ -26,7 +26,7 @@ const pendingArchive = require('./pending-archive'); |
26 | 26 | const patternMatcher = require('./pattern-rule-matcher'); |
27 | 27 | const smsHandler = require('./sms-handler'); |
28 | 28 | |
29 | -const modem = new Modem(config.partner.modem.dev); | |
29 | +const modem = new Modem(config.partner.modem.dev, {baudRate: 115200}); | |
30 | 30 | |
31 | 31 | const resumeHandlers = {}; |
32 | 32 |