Skip to content

serialport isse! #42

@alexptbg

Description

@alexptbg

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 use require('serialport') instead of require('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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions