{"id":841,"date":"2020-03-07T13:45:26","date_gmt":"2020-03-07T12:45:26","guid":{"rendered":"https:\/\/mobiletidings.com\/?p=841"},"modified":"2020-12-18T08:16:12","modified_gmt":"2020-12-18T07:16:12","slug":"more-on-the-sms-pdu","status":"publish","type":"post","link":"https:\/\/techsofar.com\/more-on-the-sms-pdu\/","title":{"rendered":"More Sending SMS In PDU Mode"},"content":{"rendered":"
As discussed in an\u00a0earlier post<\/a>, you can connect to a GSM modem and use AT commands to send SMS messages. There are 2 possible methods: text mode and PDU mode.<\/p>\n It turns out that most devices support PDU mode, but only a few support text mode.<\/p>\n Here is an example AT command to submit a PDU:<\/p>\n The most significant of these is the UDH indicator. More on these fields in a future post.<\/td>\n<\/tr>\n So \u2018915121551532f4\u2019 translates to +1 512 555 1234.<\/td>\n<\/tr>\n \u2018There are other (fun) uses for this byte that I\u2019ll show in a future post.<\/td>\n<\/tr>\n This particular string represents \u201cHowdy y\u2019all!\u201d<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n The GSM-7 payload encoding is hard to explain, I\u2019ll show how it works with the example above. Each character is represented by the bits with the same color:<\/p>\nAT+CMGS=24<crlf>\n> 0001000B915121551532F400000CC8F79D9C07E54F61363B04<Ctrl-Z><\/pre>\n<\/div>\n
\n\n
\n Size<\/strong><\/td>\n Value<\/strong><\/td>\n Description<\/strong><\/td>\n<\/tr>\n \n 1 octet<\/td>\n 00<\/td>\n This indicates that we don\u2019t supply an SMSC number. The one that is configured in the device will be used.<\/td>\n<\/tr>\n \n 1 octet<\/td>\n 01<\/td>\n PDU type and options. This is a one octet bit-field that controls:<\/p>\n \n
\n 1 octet<\/td>\n 00<\/td>\n Our message reference. In case there is an error delivering the message, this number will be part of the error response so we can see which message failed.<\/td>\n<\/tr>\n \n 1 octet<\/td>\n 0B<\/td>\n Size of the destination telephone number (in digits)<\/td>\n<\/tr>\n \n 1 octet<\/td>\n 91<\/td>\n International numbering plan. This indicates that what follows is an international telephone number.<\/td>\n<\/tr>\n \n 6 octets<\/td>\n 5121551532f4<\/td>\n Telephone number. This is the destination phone number is a reverse nibble encoding:<\/p>\n \n
\n 1 octet<\/td>\n 00<\/td>\n Protocol identifier. This can be used to indicate a higher-level protocol. \u20180\u2019 indicates no higher-level protocol.<\/td>\n<\/tr>\n \n 1 octet<\/td>\n 00<\/td>\n This represents the Data Coding Scheme. A \u20180\u2019 indicates that the messages are encoded in the GSM 7 (default) alphabet.<\/p>\n \n
\n 1 octet<\/td>\n 0c<\/td>\n Payload size in septets (characters). This field is also called User Data Length.<\/td>\n<\/tr>\n \n 11 octets<\/td>\n C8f79D9C07E5
\n4F61363B04<\/td>\nThe payload, also known as User Data. In this case, it is just GSM encoded text. This is the tricky encoding:<\/p>\n \n