Reputation: 5645
recently I'm developing a simple application to work with my GSM modem and i have a problem to send USD command. After some research i found my modem logs and found my modem send this command to get balance.
AT+CUSD=1,"AA182DA68A8D1A",15
I sent this command with my application and got result, it works fine but when i check my modem encoding mode by this command
AT+CSCS?
it return this mode "IRA" but i do not know how to convert my balance command text *141*1# to this type of string.
From modem logs i found that this string "AA182DA68A8D1A" is converted form of this "*141*1#".
Upvotes: 1
Views: 2130
Reputation: 2075
First of all what you are seeing in your logs is a hex string depicting a 7-Bit encoded USSD command (see GSM 03.38 from 3GPP for more information about 7-bit).
Binary 7-Bit Decoded 7-Bit
######### ######## #############
1 0101010 010 1010 *
00 011000 011 0001 1
001 01101 011 0100 4
1010 0110 011 0001 1
10001 010 010 1010 *
100011 01 011 0001 1
0001101 0 010 0011 #
000 1101 <CR>
There are millions of tools to decode 7-Bit but did it quickly by hand here :)
USSD command texts can either be encoded via 7-Bit or UC-2 and most modems they do it themselves. So the host application can actually just send the USSD command as ascii and the modem will figure things out. So you just need to send the command:
AT+CUSD=1,"*141*1#",15
Try it out by hand via telnet or screen. Then you can get a better feel for whats going on without having to fight with a host application.
Upvotes: 1