ESP8266 Centre + NB
at_custom.h
浏览该文件的文档.
1 /*
2  * ESPRSSIF MIT License
3  *
4  * Copyright (c) 2016 <ESPRESSIF SYSTEMS (SHANGHAI) PTE LTD>
5  *
6  * Permission is hereby granted for use on ESPRESSIF SYSTEMS ESP8266 only, in which case,
7  * it is free of charge, to any person obtaining a copy of this software and associated
8  * documentation files (the "Software"), to deal in the Software without restriction, including
9  * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  * and/or sell copies of the Software, and to permit persons to whom the Software is furnished
11  * to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all copies or
14  * substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22  *
23  */
24 
25 #ifndef CUSTOM_AT_H_
26 #define CUSTOM_AT_H_
27 
28 #include "c_types.h"
29 
30 typedef struct
31 {
32  char *at_cmdName;
34  void (*at_testCmd)(uint8_t id);
35  void (*at_queryCmd)(uint8_t id);
36  void (*at_setupCmd)(uint8_t id, char *pPara);
37  void (*at_exeCmd)(uint8_t id);
39 
40 typedef void (*at_custom_uart_rx_intr)(uint8* data,int32 len);
41 
42 typedef void (*at_custom_response_func_type)(const char *str);
43 
44 typedef void (*at_fake_uart_tx_func_type)(const uint8*data,uint32 length);
45 
46 extern uint8 at_customLinkMax;
47 
53 void at_response_ok(void);
59 void at_response_error(void);
67 void at_response(const char *str);
80 void at_cmd_array_regist(at_funcationType *custom_at_cmd_array,uint32 cmd_num);
89 bool at_get_next_int_dec(char **p_src,int*result,int* err);
97 int32 at_data_str_copy(char *p_dest, char **p_src, int32 max_len);
98 
104 void at_init(void);
110 void at_port_print(const char *str);
116 void at_set_custom_info(char* info);
123 void at_enter_special_state(void);
129 void at_leave_special_state(void);
139 uint32 at_get_version(void);
140 
155 uint32 at_fake_uart_rx(uint8* data,uint32 length);
156 
163 bool at_fake_uart_enable(bool enable,at_fake_uart_tx_func_type at_fake_uart_tx_func);
164 
171 
172 #endif
void at_port_print(const char *str)
print string to at port
void at_register_response_func(at_custom_response_func_type response_func)
register custom response function.
int int32
Definition: c_types.h:57
void(* at_fake_uart_tx_func_type)(const uint8 *data, uint32 length)
Definition: at_custom.h:44
signed char int8_t
Definition: c_types.h:30
uint32 at_get_version(void)
get at version
Definition: at_custom.h:30
uint32 at_fake_uart_rx(uint8 *data, uint32 length)
notify at module that has receive data
void at_set_custom_info(char *info)
print custom information when AT+GMR
char * at_cmdName
Definition: at_custom.h:32
void at_register_uart_rx_intr(at_custom_uart_rx_intr rx_func)
register custom uart rx interrupt function
void at_response_ok(void)
Response "OK" to uart.
void at_response(const char *str)
Response string. It is equivalent to at_port_print,if not call at_register_response_func or call at_r...
unsigned char uint8_t
Definition: c_types.h:28
void at_leave_special_state(void)
uint8 at_customLinkMax
bool at_fake_uart_enable(bool enable, at_fake_uart_tx_func_type at_fake_uart_tx_func)
enable fake uart,and register fake uart tx
int32 at_data_str_copy(char *p_dest, char **p_src, int32 max_len)
get string form at cmd line.the maybe alter pSrc
unsigned char uint8
Definition: c_types.h:43
void at_enter_special_state(void)
if current at command is processing,you can call at_enter_special_state, then if other comamnd coming...
void at_response_error(void)
Response "ERROR" to uart.
unsigned int uint32
Definition: c_types.h:52
bool at_set_escape_character(uint8 ch)
set at escape character
void at_init(void)
initialize at module
int8_t at_cmdLen
Definition: at_custom.h:33
void(* at_custom_response_func_type)(const char *str)
Definition: at_custom.h:42
bool at_get_next_int_dec(char **p_src, int *result, int *err)
get digit form at cmd line.the maybe alter pSrc
void(* at_custom_uart_rx_intr)(uint8 *data, int32 len)
Definition: at_custom.h:40
void at_cmd_array_regist(at_funcationType *custom_at_cmd_array, uint32 cmd_num)
Task of process command or txdata.