How to send SMS by GSM modem in PDU mode?

后端 未结 2 1068
孤城傲影
孤城傲影 2021-01-13 18:10

I want to send SMSs in PDU mode. I have checked the spec for my modem, and it supports PDU mode.

I have developed a PDU encoder and decoder, but now I do not know

2条回答
  •  半阙折子戏
    2021-01-13 18:53

    length of PDU string = ( PDUlength - 2 - ServiceCentreNumber length ) / 2

    ServiceCentreNumber length is first byte of PDU string. (2 Hex char = 8 bit)

    Command for send sms in PDU mode:

    send:AT+CMGF=0                 //recieved "\r\nOK\r\n"
    send:AT+CMGS=          //recieved "\r\n> "
    send:    //recieved "\r\n+CMGS: 59\r\n\r\nOK\r\n"
    

    Another variant is to use instead +CMGS command +CMGW to write msg to memory (code same above) and then use +CMSS to send the message from memory.

提交回复
热议问题