AT Instruction Set

Source: Internet
Author: User
Tags ftp client

A serial port tool uses the AT command to communicate with the data card. I read some documents when I first came into contact with AT commands, but I am still confused about how to use these commands. Because the general document does not have specific examples returned. It is best to use a mobile phone, data card, modem, and other simple query tests to experience it. Of course, we need to use a Super Terminal for writing and querying. It is very convenient, very common, and very simple. In general, the AT command is relatively simple, at least easy to start.
At command
At refers to attention. The AT Instruction Set is from the terminal device (terminal equipment, Te) or data terminal device (data terminal equipment, DTE) to the terminal adapter (terminal adapter, Ta) or sent by data circuit terminal equipment (DCE. Send AT commands via TA and te to control the functions of Mobile Station (MS) and interact with GSM network services. You can use AT commands to control calls, text messages, phone books, data services, and faxes.
In early 1990s, the AT command was only used for modem operations. There is no precedent for controlling mobile phone text messages. Only one protocol called SMS blockmode has been developed to completely control SMS through Terminal devices (TE) or computers. Several years later, major mobile phone manufacturers Nokia, Ericsson, Motorola, and HP jointly developed a complete set of AT commands for GSM, including SMS control. On this basis, the AT command is evolved and added to the GSM 07.05 standard and the current GSM 07.07 standard, which is fully standardized and sound. For example, there are three ways to control SMS: initial block mode, text mode based on AT command, and PDU Mode Based on at command. Till now, the PDU mode has replaced blockmode, and the latter gradually fades out.
The communication protocol between the GSM module and the computer is some at instruction sets. The at Command is a string starting with at and ending with characters, and the response packet of AT command is in. If each command is successfully executed, a corresponding response is returned. For other unexpected information (such as dialing in, line without signal), the module will have corresponding information prompts, and the receiving end can process it accordingly.
Example: CDMA modem DTE
Input: at <CR>
Return Value: <LF> OK <LF>
Input: attest <CR>
Return Value: <CR> error <LF>
If the AT command is successfully executed, the "OK" string is returned. If the AT command syntax is incorrect or the AT command fails to be executed, the "error" string is returned. <CR> <LF> is the control character, namely, carriage return and line feed.
Each company provides different at instruction sets for devices. At commands allow users to customize their AT commands. Generally, ^ characters are customized.
I just used some basic commands, but nothing better. Add more content later. For a real understanding, see the English documents of 3GPP. I haven't seen it yet.
When sending AT commands using a self-compiled serial port program, you must note that when sending the AT command string to the serial port, you may find that no response is returned. This may be because the serial port is not enabled or the baud rate is not set. These can be checked. However, the format of the AT command is easy to ignore. The at command string to be sent must contain the carriage return and line feed characters at the end of the command, and pay attention to the order, that is, '\ r'' \ n '. This is a very difficult problem. You may not have found any other errors after checking for a long time. However, when you think about whether the AT command format is incorrect, you cannot see such instructions in the relevant documents. See the appendix.
This is also a problem with the Super Terminal. After the device is installed, check the serial ports in the Device Manager. You cannot determine which comport to use for communication. Check whether the communication works. After the connection, enter at and press Enter. However, you may not be able to see the entered content because the command echo function of the device is disabled (ate0 command ). In this case, select the character to display in the connection property. Sometimes enter a to display AA, because the command echo function is enabled, and the input characters in the connection property are also checked.

Appendix: line breaks in various systems (this is related to programming, that is, how to implement <CR> <LF> above)

From http://www.cslog.cn/articles/trackback/255

In text processing, Cr, lf, CR/LF are linefeeds used on different operating systems.
DOS and Windows use carriage return + line feed Cr/LF to represent the next line,
In Unix/Linux, the line break lf indicates the next line,
The Mac OS system uses the carriage return (CR) to indicate the next line.
Cr is represented by '\ R'. the ASCII code in decimal format is 13 and the hexadecimal code is 0x0d;
Lf uses the '\ n' symbol. the ASCII code is 10 and the hexadecimal value is 0x0a.
Therefore, on Windows, line breaks are represented by 0d 0a in text files, while on UNIX and Apple platforms, line breaks are represented by 0a or 0d in one byte.
Generally, the Runtime library on the operating system automatically determines the line feed format of text files. for example, if a program runs on Windows, a text file in CR/LF line feed format is generated, and a text file in LF format is generated when it runs on Linux.
Using another line break file on one platform may cause unexpected problems, especially when editing program code. sometimes the code is displayed normally in the editor, but an error occurs due to line breaks during editing.
Many text/code Editors Use the line break Conversion Function to swap line breaks in text files in different formats.
When FTP software is used to transfer files between different platforms, some FTP client programs automatically convert the line feed format in ASCII text transmission mode. the number of bytes transmitted may change. if you do not want to modify the original file via FTP, you can use bin mode (binary mode) to transfer text.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.