Basic

Dependencies:   MQTT

Committer:
lwtroach
Date:
Wed Apr 24 05:03:00 2019 +0000
Branch:
Flash_Exam
Revision:
7:e556528beeba
Parent:
6:86eea1bcf499
Recover to this version, because I don't know why the erase in IAP doesn't work. But it seems fine when I was programming in the morning.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lwtroach 0:6bdfb6ccd136 1
lwtroach 0:6bdfb6ccd136 2 #include "mbed.h"
lwtroach 0:6bdfb6ccd136 3 #include "LPG_Config.h"
lwtroach 0:6bdfb6ccd136 4
lwtroach 7:e556528beeba 5 typedef enum /*枚举类型:接收的状态*/
lwtroach 0:6bdfb6ccd136 6 {
lwtroach 0:6bdfb6ccd136 7 e_SUCCESS_REC = 0, /*成功*/
lwtroach 7:e556528beeba 8 e_TIME_OUT, /*超时*/
lwtroach 0:6bdfb6ccd136 9 e_NO_REC /*未收到*/
lwtroach 0:6bdfb6ccd136 10 }teATStatus;
lwtroach 0:6bdfb6ccd136 11
lwtroach 7:e556528beeba 12 typedef struct /*定义的数据结构,用数据结构来完成AT指令的发送、应答、超时、状态、重发*/
lwtroach 0:6bdfb6ccd136 13 {
lwtroach 7:e556528beeba 14 char* st_ATSendStr; /*向NB-IOT发送字符串(AT命令)*/
lwtroach 7:e556528beeba 15 char *st_ATRecStr; /*NB-IOT返回给MCU的字符串*/
lwtroach 7:e556528beeba 16 uint16_t st_TimeOut; /*设置超时*/
lwtroach 7:e556528beeba 17 teATStatus st_ATStatus; /*接收状态*/
lwtroach 7:e556528beeba 18 uint8_t st_RtyNum; /*重发次数*/
lwtroach 0:6bdfb6ccd136 19 }tsATCmds;
lwtroach 0:6bdfb6ccd136 20
lwtroach 0:6bdfb6ccd136 21 typedef enum{
lwtroach 0:6bdfb6ccd136 22 e_ATCFUN0,
lwtroach 0:6bdfb6ccd136 23 e_ATCFUN1,
lwtroach 7:e556528beeba 24 e_ATGATT1
lwtroach 0:6bdfb6ccd136 25 }teATCmdNum;
lwtroach 0:6bdfb6ccd136 26
lwtroach 0:6bdfb6ccd136 27 void LPG_ATCmd_Processing_WriteCommand(const char* command, RawSerial TransPort, RawSerial DebugPort);
lwtroach 0:6bdfb6ccd136 28 void LPG_ATCmd_Processing_WriteCommand(const char* command, RawSerial TransPort);
lwtroach 0:6bdfb6ccd136 29 void LPG_ATCmd_Processing_Receive();
lwtroach 0:6bdfb6ccd136 30
lwtroach 0:6bdfb6ccd136 31
lwtroach 0:6bdfb6ccd136 32
lwtroach 0:6bdfb6ccd136 33