zabsalahid / serialport-gsm

SerialPort-GSM is a simplified plugin for communicating with gsm modems. (Primarily for sms) (Focused in PDU mode)
MIT License
90 stars 47 forks source link

modem.open missing arguments #5

Closed karianpour closed 5 years ago

karianpour commented 5 years ago

modem.open method is missing some arguments if you do not send callback in order to use promise.

modem.js line 53

    if (callback == undefined) {
      return new Promise((resolve, reject) => {
        modem.open((error, result) => {
          if (error) {

should be set to

    if (callback == undefined) {
      return new Promise((resolve, reject) => {
        modem.open(device, options, (error, result) => {
          if (error) {

otherwise it traps in a infinite loop.

zabsalahid commented 5 years ago

@karianpour thanks again man.