-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Description
Hi,
gsm.js
`
function err(message) {
console.log('Usage: node send_sms.js /path/to/device xxxxyyzz "Foo Bar"');
process.exit();
}
var device = process.argv[2];
var receiver = process.argv[3];
var text = process.argv[4];
if(!device || !receiver || !text) err();
var modem = require('modem').Modem();
modem.open('/dev/ttyS0', function() {
modem.sms({
receiver:receiver,
text:text,
encoding:'7bit'
}, function(err, sent_ids) {
console.log('>>', arguments);
if(err)
console.log('Error sending sms:', err);
else
console.log('Message sent successfully, here are reference ids:', sent_ids.join(','));
});
});
`
console error:
node gsm.js /dev/ttyS0 +359894587672 "test node"
DEPRECATION: Please userequire('serialport')instead ofrequire('serialport').SerialPort
^C
modem.js
1: var pdu = require('pdu');
2: var sp = require('serialport');
3: var EventEmitter = require('events').EventEmitter;
......
81: modem.open = function(device, callback) {
82: modem.port = new sp.SerialPort(device, {
83: parser: sp.parsers.raw
84: });
Cant find that DEPRECATION error!
Metadata
Metadata
Assignees
Labels
No labels