24 #include "driver/uart.h"
28 #define AT_MODU_NAME "nb_neul95"
30 #define AT_NB_OPEN_RF "AT+CFUN=1\r"
31 #define AT_NB_CLOSE_PSM "AT+CPSMS=0\r"
32 #define AT_NB_CLOSE_EDRX "AT+CEDRXS=0,5\r"
33 #define AT_NB_CGATT_ATTACH "AT+CGATT=1\r"
34 #define AT_NB_REPORT_PREFIX "AT+NMGS="
37 #define AT_NB_LINE_END "\r\n"
38 #define AT_NB_reboot "AT+NRB\r"
39 #define AT_NB_hw_detect "AT+CFUN?\r"
40 #define AT_NB_get_auto_connect "AT+NCONFIG?\r"
41 #define AT_CMD_PREFIX "\r\n+NNMI:"
42 #define AT_DATAF_PREFIX "+NSONMI:"
43 #define CGATT "AT+CGATT?\r"
44 #define CGATT_DEATTACH "AT+CGATT=0\r"
46 #define AT_LINE_END "\r\n"
47 #define AT_CMD_BEGIN "\r\n"
49 #define AT_USART_PORT 3
50 #define AT_BUARDRATE 9600
51 #define AT_CMD_TIMEOUT 10000 //ms
52 #define AT_MAX_LINK_NUM 4
54 #define NB_STAT_LOCALPORT 56
56 #define MAX_SOCK_NUM 5
59 #if defined STM32F103xE
60 #define MAX_AT_USERDATA_LEN (1024*2)
62 #define MAX_AT_USERDATA_LEN (1024*5)
65 #define AT_MAX_PAYLOADLEN 512
79 int str_to_hex(
const char *bufin,
int len,
char *bufout);
int32_t nb_cmd_match(const char *buf, char *featurestr, int len)
void NB_ReportData(uint8 mid, uint8 *data_str)
上报数据到云端
Definition: nb_bc35.c:42
int32_t nb_send_payload(const char *buf, int len)
void NB_Init(void)
Definition: nb_bc35.c:140
void NB_ResponseTimerCb(void *arg)
uint8 response_msg[128]
Definition: nb_bc35.c:23
int32_t nb_check_csq(void)
signed int int32_t
Definition: c_types.h:36
unsigned char uint8_t
Definition: c_types.h:28
unsigned int uint32_t
Definition: c_types.h:34
int32_t nb_set_cdpserver(char *host, char *port)
void NB_SendCmd(uint8 *cmd, uint8 cmd_len, uint8 *response_msg)
向NB模组发送指令
Definition: nb_bc35.c:70
unsigned char uint8
Definition: c_types.h:43
int32_t nb_set_no_encrypt(void)
int32_t nb_get_netstat(void)
int32_t nb_send_psk(char *pskid, char *psk)
int str_to_hex(const char *bufin, int len, char *bufout)
将十六进制码流转换为字符串形式
Definition: nb_bc35.c:196
int32_t nb_recv_timeout(int32_t id, uint8_t *buf, uint32_t len, char *ipaddr, int *port, int32_t timeout)
int32_t nb_hw_detect(void)
void NB_RxMsgHandler(uint8 *nb_msg)
NB消息处理函数
Definition: nb_bc35.c:106