提交 405fce91 编写于 作者: armink_ztl's avatar armink_ztl

[component][at] Move at log from at.h to at_log.h .

上级 e9ffd2b2
...@@ -79,7 +79,7 @@ if RT_USING_AT ...@@ -79,7 +79,7 @@ if RT_USING_AT
config AT_SW_VERSION_NUM config AT_SW_VERSION_NUM
int int
default 0x10100 default 0x10200
help help
sfotware module version number sfotware module version number
......
...@@ -34,10 +34,8 @@ ...@@ -34,10 +34,8 @@
#include <dfs_poll.h> #include <dfs_poll.h>
#endif #endif
#ifdef DBG_SECTION_NAME #define LOG_TAG "at.skt"
#undef DBG_SECTION_NAME #include <at_log.h>
#define DBG_SECTION_NAME "AT_SOC"
#endif
#define HTONS_PORT(x) ((((x) & 0x00ffUL) << 8) | (((x) & 0xff00UL) >> 8)) #define HTONS_PORT(x) ((((x) & 0x00ffUL) << 8) | (((x) & 0xff00UL) >> 8))
#define NIPQUAD(addr) \ #define NIPQUAD(addr) \
......
...@@ -32,17 +32,7 @@ ...@@ -32,17 +32,7 @@
extern "C" { extern "C" {
#endif #endif
#define AT_SW_VERSION "1.1.0" #define AT_SW_VERSION "1.2.0"
#define DBG_ENABLE
#define DBG_SECTION_NAME "AT"
#ifdef AT_DEBUG
#define DBG_LEVEL DBG_LOG
#else
#define DBG_LEVEL DBG_INFO
#endif /* AT_DEBUG */
#define DBG_COLOR
#include <rtdbg.h>
#define AT_CMD_NAME_LEN 16 #define AT_CMD_NAME_LEN 16
#define AT_END_MARK_LEN 4 #define AT_END_MARK_LEN 4
...@@ -51,11 +41,6 @@ extern "C" { ...@@ -51,11 +41,6 @@ extern "C" {
#define AT_CMD_MAX_LEN 128 #define AT_CMD_MAX_LEN 128
#endif #endif
/* client receive idle timeout, client will wait this timeout when send data, unit: ms */
#ifndef AT_CLIENT_RECV_IDEL
#define AT_CLIENT_RECV_IDEL 50
#endif
/* the server AT commands new line sign */ /* the server AT commands new line sign */
#if defined(AT_CMD_END_MARK_CRLF) #if defined(AT_CMD_END_MARK_CRLF)
#define AT_CMD_END_MARK "\r\n" #define AT_CMD_END_MARK "\r\n"
......
/*
* File : at_log.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
* 2018-10-12 armink first version
*/
/*
* NOTE: DO NOT include this file on the header file.
*/
#define DBG_ENABLE
#define DBG_COLOR
#ifndef LOG_TAG
#define DBG_SECTION_NAME "at"
#else
#define DBG_SECTION_NAME LOG_TAG
#endif /* LOG_TAG */
#ifdef AT_DEBUG
#define DBG_LEVEL DBG_LOG
#else
#define DBG_LEVEL DBG_INFO
#endif /* AT_DEBUG */
#include <rtdbg.h>
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
#include <rtdevice.h> #include <rtdevice.h>
#ifdef AT_USING_SERVER
#define AT_ECHO_MODE_CLOSE 0 #define AT_ECHO_MODE_CLOSE 0
#define AT_ECHO_MODE_OPEN 1 #define AT_ECHO_MODE_OPEN 1
...@@ -129,3 +131,5 @@ static at_result_t at_uart_setup(const char *args) ...@@ -129,3 +131,5 @@ static at_result_t at_uart_setup(const char *args)
} }
AT_CMD_EXPORT("AT+UART", "=<baudrate>,<databits>,<stopbits>,<parity>,<flow_control>", RT_NULL, at_uart_query, at_uart_setup, RT_NULL); AT_CMD_EXPORT("AT+UART", "=<baudrate>,<databits>,<stopbits>,<parity>,<flow_control>", RT_NULL, at_uart_query, at_uart_setup, RT_NULL);
#endif /* AT_USING_SERVER */
...@@ -29,6 +29,11 @@ ...@@ -29,6 +29,11 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#define LOG_TAG "at.clnt"
#include <at_log.h>
#ifdef AT_USING_CLIENT
#define AT_RESP_END_OK "OK" #define AT_RESP_END_OK "OK"
#define AT_RESP_END_ERROR "ERROR" #define AT_RESP_END_ERROR "ERROR"
#define AT_RESP_END_FAIL "FAIL" #define AT_RESP_END_FAIL "FAIL"
...@@ -924,3 +929,4 @@ __exit: ...@@ -924,3 +929,4 @@ __exit:
return result; return result;
} }
#endif /* AT_USING_CLIENT */
...@@ -30,6 +30,11 @@ ...@@ -30,6 +30,11 @@
#include <rthw.h> #include <rthw.h>
#define LOG_TAG "at.svr"
#include <at_log.h>
#ifdef AT_USING_SERVER
#define AT_CMD_CHAR_0 '0' #define AT_CMD_CHAR_0 '0'
#define AT_CMD_CHAR_9 '9' #define AT_CMD_CHAR_9 '9'
#define AT_CMD_QUESTION_MARK '?' #define AT_CMD_QUESTION_MARK '?'
...@@ -565,3 +570,5 @@ RT_WEAK void at_port_factory_reset(void) ...@@ -565,3 +570,5 @@ RT_WEAK void at_port_factory_reset(void)
{ {
LOG_E("The factory reset for AT server is not implement."); LOG_E("The factory reset for AT server is not implement.");
} }
#endif /* AT_USING_SERVER */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册