AT+CMGF=0
This sets the modem to PDU mode. The modem will respond
OK
.
Before sending a message, we need to understand how a PDU message is built. A PDU
message is built using octets, which are 8 bits. The octet can be expressed as 2
hexadecimal digits, such as 7B or A3. As a reminder, a hexadecimal digit represents 4
bits by using one of these 16 characters: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. The
character 7, for instance, represents 0111. If we want to represent 00000111, we can do
that by using the octet 07. The 0111 is called a nibble. Each octet consists of 2 nibbles.
In this case, the 0 represents the first nibble (or high nibble) and the 7 represents the
second nibble (or low nibble). In SMS messaging, phone numbers are stored using the
low nibble first of the octet. If the octet 07 is part of our phone number, it would be stored
with the low nibble first as 70. For example, the phone number 5551234567, consists of
5 octets. These octets are 55, 51, 23, 45, and 67. This phone number would be stored
with the low nibble first for each octet: 55 15 32 54 76.
The PDU message itself consists of 2 parts. The first part of the message contains the
information about the Service Center Address (SCA). The second part of the message
contains the TPDU (Transfer Protocol Data Unit).
The PDU looks like this:
SCA TPDU
Creating the SCA Parameter of your PDU
Let’s first examine the Service Center Address (SCA) parameter. You can omit the SCA
if you are using the modem’s stored SCA. To check the modem’s stored SCA, use the
AT+CSCA?
command. If this address is correct, you can omit this information from the
PDU. Otherwise the SCA consists of the SCA length, the Number Type, and the actual
SMS Center (SC) phone number.
The SCA parameter of your PDU is shown below:
Length (in
hexadecimal
octets)
Number Type
(one octet, 91 or
81)
SC Phone
Number (in
hexadecimal
octets)
25