From 34f1ec0a415763cadbefbbcc016e4e89b7743e45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=94=E7=BD=97=E6=8A=80=E6=9C=AF?= Date: Sat, 4 Jul 2020 21:11:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0readme=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 36 ++++++++++++++++++++++++++++++------ at_chat.c | 18 +++++++++++------- at_chat.h | 18 +++++++++++------- 3 files changed, 52 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 3a9c10a..0f08239 100644 --- a/README.md +++ b/README.md @@ -11,25 +11,49 @@ at_core.c at_core.h用于OS版本 ##### at_chat 模块(无OS) -1. 定义AT管理器 - at_core_t at; - -2. AT管理器配置参数 -const at_core_conf_t conf = { + +``` + +static at_core_t at; //定义AT管理器 + +const at_core_conf_t conf = { //AT管理器配置参数 }; +``` + 3. 初始化AT管理器 + +``` at_core_init(&at, &conf); +``` + 4. 将AT管理器放入任务中轮询 -at_poll_task(&at); + +``` +void main(void) +{ + /*do something ...*/ + while (1) { + /*do something ...*/ + + at_poll_task(&at); + } +} + +``` + 5. 发送单行命令 + +``` static void read_csq_callback(at_response_t *r) { /*...*/ } at_send_singlline(&at, read_csq_callback, "AT+CSQ"); +``` + diff --git a/at_chat.c b/at_chat.c index 35d7cfd..ac6dad3 100644 --- a/at_chat.c +++ b/at_chat.c @@ -1,12 +1,16 @@ -/******************************************************************************* -* @brief AT ͨŹ(OS汾) -* -* Change Logs -* Date Author Notes +/****************************************************************************** + * @brief AT ͨŹ(OS汾) + * + * Copyright (c) 2019, + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes * 2016-01-22 Morro Initial version. * 2018-02-11 Morro ʹʽйATҵ -* 2020-05-21 Morro ֶ֧AT -*******************************************************************************/ +* 2020-05-21 Morro ֧at_core + ******************************************************************************/ #include "at_chat.h" #include diff --git a/at_chat.h b/at_chat.h index 8869f87..b539e6d 100644 --- a/at_chat.h +++ b/at_chat.h @@ -1,12 +1,16 @@ -/******************************************************************************* -* @brief AT ͨŹ(OS汾) -* -* Change Logs -* Date Author Notes +/****************************************************************************** + * @brief AT ͨŹ(OS汾) + * + * Copyright (c) 2019, + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes * 2016-01-22 Morro Initial version. * 2018-02-11 Morro ʹʽйATҵ -* 2020-05-21 Morro ֶ֧AT -*******************************************************************************/ +* 2020-05-21 Morro ֧at_core + ******************************************************************************/ #ifndef _ATCHAT_H_ #define _ATCHAT_H_