![]() |
MT2523 API Reference
LinkIt SDK v4
|
This section introduces the ATCI driver APIs including terms and acronyms, software architecture, supported features, details on how to use this driver, ATCI function groups, enums, structures and functions. More...
This section introduces the ATCI driver APIs including terms and acronyms, software architecture, supported features, details on how to use this driver, ATCI function groups, enums, structures and functions.
The ATCI header file provides the interface for target communication using AT commands though UART. The ATCI module APIs to register the AT command handler, send and receive UART data, and a parser to search for the registered AT command handler. The command handler gets and parses the input AT command data, then performs corresponding operation according to the specified behavior and parameters.
| Acronyms | Definition |
|---|---|
| ATCI | AT command interface. For more details about the AT command, please refer to Hayes command set in Wikipedia. |
| CMD | Command. |
| URC | Unsolicited result code. For the details of URC, please refer to Data communication over the telephone network. |
| UART | Universal Asynchronous Receiver/Transmitter is usually an individual (or part of an) integrated circuit (IC) used for serial communications over a micro-controller unit(MCU) or peripheral device serial port. For an introduction to UART, please refer to UART in Wikipedia. |
| Command mode | Input command | Response command |
|---|---|---|
| Read command mode | AT+<CMD>?<\r><\n> | +<CMD>:<values><\r><\n>OK<\r><\n> |
| Test command mode | AT+<CMD>=?<\r><\n> | +<CMD>:<values><\r><\n>OK<\r><\n> |
| Active command mode | AT+<CMD><\r><\n> | OK<\r><\n> |
| Execute command mode | AT+<CMD>=<p1>,<p2>...<\r><\n> | OK<\r><\n> |
The software architecture is shown in the figure below.
The ATCI module contains the data transfer and parser sub-modules. The data transfer sub-module can receive UART data, then send to parser sub-module to find the right registered command handler. When the command handler is called to handle input command data, the command handler needs to give a response, then the ATCI data transfer module will send the response data through the UART. If the modules want provide some AT commands, they could use ATCI module register the command handlers to add more AT commands in the target. Also the command handler can send the URC data actively without receiving one input command data.
The folder structure of ATCI module is shown in the figure below.
Functions | |
| atci_status_t | atci_register_handler (atci_cmd_hdlr_item_t *table, int32_t hdlr_number) |
| This function registers the AT command handler. More... | |
| atci_status_t | atci_send_response (atci_response_t *response) |
| This function sends the AT command response data or the URC data. More... | |
| atci_status_t | atci_init (uint16_t port) |
| This function initializes the ATCI module. More... | |
| void | atci_processing (void) |
| This function parses the input command to find the corresponding command handler and handle the response data. More... | |
Modules | |
| Define | |
| Enums | |
| Structures | |
| Typedef | |
| atci_status_t atci_init | ( | uint16_t | port | ) |
This function initializes the ATCI module.
It is used to set the port configuration for data transmission.
| [in] | port | is the serial port number used to data transmission for ATCI. For more details about this parameter, please refer to hal_uart_port_t or serial_port_dev_t. |
| void atci_processing | ( | void | ) |
This function parses the input command to find the corresponding command handler and handle the response data.
| atci_status_t atci_register_handler | ( | atci_cmd_hdlr_item_t * | table, |
| int32_t | hdlr_number | ||
| ) |
This function registers the AT command handler.
It is used to receive, parse and handle the registered input command data.
| [in] | table | is the registered handler parameter. For more details about this parameter, please refer to atci_cmd_hdlr_item_t. |
| [in] | hdlr_number | is the registered table handler size. |
| atci_status_t atci_send_response | ( | atci_response_t * | response | ) |
This function sends the AT command response data or the URC data.
| [in] | response | is the response data. For more details about this parameter, please refer to atci_response_t. |