Search code examples
c#gsmmodempdu

how to realize delivery message and incoming message in PDU format?


i read my modem inbox and get to type of message one message is my send text's delivery report and another one is a received message how can i detect which one is delivery report and which one is incoming message?

AT+CMGL=4

+CMGL: 0,1,,25
0791893905004100063E0C91893975567721515040717485815150407184108100
+CMGL: 1,1,,22
0791893905004100240C9189397556772100005150407155628103D7F71D
+CMGL: 2,1,,25

Solution

  • You need to look for the PDU header byte which is directly after the SMSC.

    0791893905004100 >>06<< 3E0C91893975567721515040717485815150407184108100
    
    0791893905004100 >>24<< 0C9189397556772100005150407155628103D7F71D
    

    When you inspect the PDU header byte you need to look at bits 1 and 0. Take a look at the 3GPP ETSI 03.40 spec 9.2.3.1 TP Message Type Indicator (TP MTI). In this section it explains how to decode the SMS message type.

    In your case you want bit1 = 1 and bit0 = 0 to spot the Status Report. So in your explain looking at 06 and 24 you would see the following:

    06 ==> 0000 0110 ==> SMS-STATUS-REPORT
    24 ==> 0010 0100 ==> SMS-DELIVER