AT-Command/README.md

36 lines
750 B
Markdown
Raw Normal View History

2020-06-13 03:41:25 +00:00
# AT Command
#### 介绍
2020-06-13 04:24:28 +00:00
一种AT命令通信管理模块(支持单行发)支持裸机和OS版本。适用于modem、WIFI模块、蓝牙通信。
2020-06-13 03:41:25 +00:00
#### 软件架构
软件架构说明
2020-06-13 04:24:28 +00:00
at_chat.c at_chat.h用于无OS版本使用链式队列及异步回调方式处理AT命令收发支持URC处理。
at_core.c at_core.h用于OS版本
#### 使用说明
2020-06-13 03:41:25 +00:00
2020-06-13 04:24:28 +00:00
##### at_chat 模块(无OS)
2020-06-13 03:41:25 +00:00
2020-06-13 04:24:28 +00:00
1. 定义AT管理器
at_core_t at;
2. AT管理器配置参数
2020-06-14 06:23:42 +00:00
const at_core_conf_t conf = {
2020-06-13 04:24:28 +00:00
};
2020-06-13 03:41:25 +00:00
2020-06-13 04:24:28 +00:00
3. 初始化AT管理器
2020-06-14 06:23:42 +00:00
at_core_init(&at, &conf);
2020-06-13 03:41:25 +00:00
2020-06-13 04:24:28 +00:00
4. 将AT管理器放入任务中轮询
at_poll_task(&at);
2020-06-13 03:41:25 +00:00
2020-06-13 04:24:28 +00:00
5. 发送单行命令
2020-06-13 03:41:25 +00:00
2020-06-14 06:23:42 +00:00
static void read_csq_callback(at_response_t *r)
{
/*...*/
}
at_send_singlline(&at, read_csq_callback, "AT+CSQ");
2020-06-13 03:41:25 +00:00