Click here to Skip to main content
15,889,892 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
+CMGL: 0,"REC READ","+84963225103",,"16/01/25,15:05:19+28"
003A00290020006D1EDB0069002000681ED300690020007300E1006E0067002001110061006E00670020007400ED006E00680020006800F90020007400721EC50020006D1EA500790020006E006700E000790020003A002900290020006D00E0002000731EE300200061006E00680020006C006F0020003A00330020006E00EA006E00200074


How to parse
003A00290020006D1EDB0069002000681ED300690020007300E1006E0067002001110061006E00670020007400ED006E00680020006800F90020007400721EC50020006D1EA500790020006E006700E000790020003A002900290020006D00E0002000731EE300200061006E00680020006C006F0020003A00330020006E00EA006E00200074
to text ?

What I have tried:

How to parse Message from module GSM ?
Posted
Updated 7-Aug-17 22:45pm
Comments
Mehdi Gholam 8-Aug-17 1:04am    
Looks like 4 character/2 byte unicode values.
Member 12050240 8-Aug-17 1:34am    
Cound you exam for me
Patrice T 8-Aug-17 2:43am    
Hexadecimal encoded utf16 ?
Richard MacCutchan 8-Aug-17 3:47am    
Check the documentation for the module that is generating the information.

1 solution

Search the net for "AT+CMGL". You will find descriptions for the list SMS messages command.

Those should also mention that there are two modes for the message output format: Text mode and PDU mode which can be selected with AT+CMGF.

So you might switch to text mode to get readable output.

Otheriwse you have to convert the hex data string. How to do this depends on the PDU format used by your modem (check the documentation) and which programming language you want to use.

Your data are obviously 16-bit hex values. So get sub strings of 4 characters, convert them to binary (e.g. using strtol() with C/C++) and write those values to a buffer. If the decoding is UCS2, conversion is simple because that is UTF-16 BE but converting the string will swap the bytes so that the result is UTF-16 LE as used by Windows internally and also supported by Linux. If it is something else it might be necessary to get a decoder (e.g. using a GSM library that supports the used encoding).

Related links:
Short Message Peer-to-Peer - Wikipedia[^]
SMS Alphabets · bitcoder/ruby_ucp Wiki · GitHub[^]
 
Share this answer
 
Comments
CPallini 8-Aug-17 5:22am    
5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900