AT command programming

xiaoxiao2021-03-06  47

1. Related GSM AT instructions related to SMS (from GSM07.05) as shown in Table 1: Table 1 related GSM AT instruction

AT command function

AT CMGC Send An SMS Command (issued a short message command)

AT CMGD DELETE SMS Message (Delete SM card memory short message)

AT CMGF SELECT SMS Message Formate: 0-PDU; 1-Text)

AT CMGL List SMS Message from Preferred Store (List short message PDU / text: 0 / "REC Unread" in the SIM card - unread, 1 / "limited" - read, 2 / "STO unsent" - stay Send, 3 / "STO SENT" - has been sent, 4 / "all" - all)

AT CMGR Read SMS Message (read short message)

AT CMGS Send SMS Message (Send Short Message)

AT CMGW Write SMS Message To Memory (write to the short message to be sent) in SIM memory)

AT CMSS Send SMS Message from Storage (send short messages from SIN | M memory)

AT CNMI NEW SMS Message INDICATIONS (Show new short message)

AT CPMS Preferred SMS Message Storage (Select short message memory)

AT CSCA SMS Service Center Address (Short Message Center Address)

AT CSCB SELECT CELL BROADCAST MESSAGES (Select cellular broadcast message)

AT CSMP SET SMS TEXT MODE Parameters (Set Short Message Text Mode Parameters)

AT CSMS SELECT MESSAGE Service (Select Short Message Service)

There are three ways to control short message: Block Mode

PDU Mode based on AT command

TEXT MODE based on AT command

Using the Block mode requires mobile manufacturer to provide driver support. At present, PDU Mode has replaced Block Mode, and Text Mode is relatively simple. This article focuses on mode PDU Mode, taking Siemens' product TC35t as an example. 2. Communication (1) RS232 serial port connection due to TC35T with RS232 serial port due to the TC35T, which is only necessary to connect it to the computer serial port. Open the hyper terminal, select the corresponding serial port, set the port parameters to: rate -4800, parity bit - no, data bit-8, stop bit -1, traffic control - hardware. (2) Connection test input "AT" and then enter the return, the "OK" on the screen indicates that the computer and TC35T have been successfully connected, and TC35T can work normally. At this time, you can test all kinds of AT commands. When the test command "AT CMGS =?", If the "OK" indicates that the TC35T supports the instruction. The full syntax of the instruction is as follows: If the TC35T is in PDU Mode (ie "AT CMGF?" To return "0")

AT cmgs = PDU is Given <^ z / esc> Returns "OK" if the short message is sent, and the information number: cmgs: [,] If the short message is sent, return to the following information number: CMS Error: If the TC35T is in TEXT MODE (ie "AT CMGF?" Returns "1") at cmgs = [, TODA] text is entered <^ z / esc> Returns "OK" if the short message is successful And display the information number: cmgs: [,] If the short message is sent, return to the following information number: cms error: In addition, the TC35T is used, when there is a new short message arrival, TC35T is required to create a prompt, Use the command "AT CNMI". The full syntax of the instruction is as follows: AT CNMI = [] [,] [,] [,] [,] If there is a new short message, the TC35T will automatically return to the following tips: CMTI: "SM", this Read, then read the short message content with the "At CMGR" instruction. 3. PDU data format analysis: For example, we have to send characters "hi" characters to destination "13677328099" PDU string is: 08 91 683108701305F0 11 00 0D 91 3176378290F9 00 00 00 02 C834 (1) 08-Short message center address length. Refers to the length of (91) (683108701305F0). (2 )91- Short message center number type. 91 is Ton / NPI complies with the International / E.164 standard, refers to the number of ' ' before the number; there are other values, but 91 is most common. 91-10010001 Bit NO. 7 6 5 4 3 2 1 0

Name 1 numerical type number authentication

Numeric type (Type of Number): 000- Unknown, 001- International, 010-Domestic, 111-Reissue; Numbering Plan Identification: 0000- Unknown, 0001-ISDN / Phone Number (E.164 / E .163), 1111 - Reissue; (3) 683108701305F0- Short message center number. The actual number should be: 8613800731500 (letter F means length 1). This requires corresponding modifications according to different geographies. (1), (2), (3) Generally known as the short message center address (Address of the SMSC). ⑷11- file header bytes. 11 & h = 00010001 & B Bit No. 7 6 5 4 3 2 1 0

NAME TP-RP TP-UDHI TP-SPR TP-VFP TP-RD TP-MTI

Value 0 0 0 1 0 0 0 1

Answering Path - TP-RP (TP-Reply-Path): 0- Not set; 1 - Set User Data Skand Identifies - TP-UDHL (TP-User-Data-Header-Indicator): 0 - Does not include any header information; 1- Head information status report Requires -tp-SPR (TP-STATUS-REPORT-REQUEST): 0- Need report; 1- does not need to report validity formats -TP-VPF (TP-Validity-Period-Format): 00- Not provided; 10-integer (standard); 01-reserved; 11- SEMI-OCTET REPRESENTED Refuse to replicate -TP-RD (TP-REET-DUPLICATES): 0 - Accept replication; 1-Refuse to copy information Type prompt - TP-MTI (TP-Message-Type-Indicator): 00-Read (Deliver); 01-Submit (Submit) ⑸00-Information type (TP-Message-Reference) ⑹0B-called number length. ⑺91- The called number type (same (2)). ⑻3176378290f9-called number, after displacement processing, the actual number is "13677328099". ⑹, ⑺, ⑻⑻ ⑻称 目 地址 地址 地址 (TP-Destination-Address). ⑼00-protocol identifies TP-PID (TP-Protocol-Identifier) ​​Bit No. 7 6 5 4 3 2 1 0bit No. 7 and Bit No. 6: 00 - Distribution Bit No.0-bit No.5 as defined below 01- See the GSM03.40 protocol identification is completely defined; 10- Reserved; 11- Assign bit No.0-bit No. 5 for the Service Center (SC) special purpose. These two positions are usually 00. Bit No.5: 0- Do not use the remote network, just the protocol between short message devices; 1-Using the remote network. Bit No.0-Bits No.4: 00000- implied; 00001-electrical; 00010-Group 3 TELEFAX; 00100-speech; 00101-European wireless information system (ERMES); 00110-domestic system; 10001- .400 public information processing system; 10010-email. ⑽00-data coding scheme TP-DCS (TP-DATA-CODING-Scheme) Bit No. 7 6 5 4 3 2 1 0

Bit No.7 and Bit No.6: Totally set to 00; Bit No. 5: 0- Text is not compressed, 1-text compressed with GSM standard compression algorithm; Bit No. 4: 0- Represents Bit No.1, Bit NO.0 is reserved, free of information type information, 1-Represents Bit No.1, Bit No.0 contains information type information; Bit No. 3 and Bit No.2: 00- Default alphabet, 01-8bit 10-USC2 (16bit), 11-Reserved; Bit No.1 and Bit No.0: 00-Class 0,01-Class 1, 10-Class 2 (SIM Card Specific Information), 11-Class 3. ⑾00- Validity TP-VP (TP-Valid-Period) VP Value (& H) The corresponding period 00 to 8F (VP 1) * 5 minutes

90 TO A7 12 hours (VP-143) * 30 minutes

A8 to C4 (VP-166) * 1 day

C5 to FF (VP-192) * 1 week

转载请注明原文地址:https://www.9cbs.com/read-80452.html

New Post(0)