mincasoft
mincasoft

Reputation: 311

How to identify and concatenate fragmented long SMS messages into a complete SMS in PDU mode?

I am working with GSM modem via AT Command interface to read all the messages stored on SM memory, PDU mode.

AT+CMGF=1
AT+CMGL=4

The return is

+CMGL: 1,"REC READ","53030303","","2017/07/10 13:04:37+24"
050003FF0301A66FB93C0FCABFEB72103AEC26CFCB7410F95D9E83DC6FBA625E87C3DF723A285     
CA7BFDB617A7A0C9A97E9F4B4FB3C7781B2EF3AC85D2E9341F43788FC06D1D165D0BC4CA7A7DD
E739A81D76D7C36C76DEA530BEE5A0A4935A943A8B549D022A7F9BD3EC32C8196E977520D1110    
A4A3AA945A9B34815298250A70E243AC3D36E7A59EE2ED345

+CMGL: 2,"REC READ","53030303","","2017/07/10 13:04:37+24"
050003FF030214C6B71CD46C4E750AA8FC6D4EB3CB2067B85DD681444728A8D99C8A1450F91B9
FD781DC75365B017DCBE93A90BBCE662BAA52A60E2442D3E970DDEBD56ECFC7AEB33CDC2E97DD
70F4DB5D768DDFEDD7BC2CB7B3CBF4F9ABDD9E8B1441A85307129DE1EDF65CA480B2CBE179196   
44FCFD37450FE5D9783DCE5B0BC3CA7838ED021C8FC9683D0

+CMGL: 3,"REC READ","53030303","","2017/07/10 13:04:37+24"
050003FF0303CA6C38

Here 1,2,3 number messages are multipart. And I want to combine the three parts of this message into one complete message. Especially supports both unicode characters.

Upvotes: 1

Views: 580

Answers (1)

Caius Jard
Caius Jard

Reputation: 74605

The Wikipedia article is helpful for this. In a nutshell, bytes 5 and 6 of each message denote the placement:

  • 050003FF0301... 3 parts, part 1
  • 050003FF0302... 3 parts, part 2
  • 050003FF0303... 3 parts, part 3

There are other things to consider with the header, and any PDU spec will go into detail on them, but this message header answers your question of how to identify and concat them in the right order

Upvotes: 1

Related Questions