futomi / node-sms-pdu

The node-sms-pdu is a SMS-SUBMIT PDU (Packet Data Unit) generator and SMS-SUBMIT/DELIVER PDU parser. This module supports the GSM 7-bit default alphabet encoding and the UCS-2 16-bit alphabet encoding. Besides, it supports the Concatenated (or Multipart or Long) SMS.
MIT License
16 stars 6 forks source link

Error: The length of the data is insufficient. #3

Open KimEJ opened 3 years ago

KimEJ commented 3 years ago

Parsing the PDU data below: 07912801929190650400A100000211019090656304F4F29C0E

I get the following error:

{ error: Error: The length of the data is insufficient. at SmsPdu._parseDetails (webpack:///./node_modules/node-sms-pdu/lib/sms-pdu.js?:359:15) at SmsPdu.parse (webpack:///./node_modules/node-sms-pdu/lib/sms-pdu.js?:238:22) at eval (webpack:///./src/atCmdParser.js?:137:29) at Array.forEach () at Object.module.exports.smsParse (webpack:///./src/atCmdParser.js?:134:14) at ReadLineParser.eval (webpack:///./src/background.js?:487:19) at ReadLineParser.emit (events.js:200:13) at addChunk (_stream_readable.js:294:12) at readableAddChunk (_stream_readable.js:271:13) at ReadLineParser.Readable.push (_stream_readable.js:210:10) }

samsonho commented 3 years ago

I noticed when I fed your PDU data into this web site https://smspdu.benjaminerhart.com/. It gives you the same error.

The web site give you this response. VIOLATION | PDU shorter than expected!