zabsalahid / serialport-gsm

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

getSimInbox should handle Submit messages #3

Closed karianpour closed 5 years ago

karianpour commented 5 years ago

When I execute modem.setModemMode(callback) I get the error TypeError: message.getScts is not a function.

I checked the matter and I found that in my modem there is a Submit message ( it is kind of un-sent message), the rest of the messages are Deliver.

I guess that in modem.js line 755 we have to check the type of message parameter. If it does not have getScts, then assigning null :

dateTimeSent: (message.getScts ? new Date(message.getScts().getIsoString()) : null) || null,
zabsalahid commented 5 years ago

@karianpour will update the code. Thanks!

zabsalahid commented 5 years ago

Hello @karianpour ! Just updated the code base on your suggestion. Thanks for checking out serialport-gsm!