| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- #ifndef __ATAIR720__
- #define __ATAIR720__
- #include <stdint.h>
- #include "type-spec.h"
- #include "queue.h"
- #define AT_AIR720_DEBUG_EN 1
- #ifdef AT_AIR720_DEBUG_EN
- #define AT_AIR720_DEBUG(fmt, x...) \
- do \
- { \
- printf(fmt,##x); \
- }while(0)
- #define AT_AIR720_DEBUG_NB(fmt, x...) \
- do \
- { \
- UART4_SendNByte(fmt,##x); \
- }while(0)
- #define AT_AIR720_DEBUG_String(fmt, x...) \
- do \
- { \
- UART4_SendString(fmt,##x); \
- }while(0)
- #define AT_AIR720_DEBUG_1B(fmt, x...) \
- do \
- { \
- UART4_SendByte(fmt,##x); \
- }while(0)
- #define AT_AIR720_DEBUG_H(fmt, x...) \
- do \
- { \
- USART_printfHex(fmt,##x); \
- }while(0)
- #define AT_AIR720_DEBUG_F(fmt, x...) \
- do \
- { \
- printf("%s %s(Line %d): "fmt,__FILE__,__FUNCTION__,__LINE__, ##x); \
- }while(0)
- #else
- #define AT_AIR720_DEBUG(fmt, x...)
- #define AT_AIR720_DEBUG_1B(fmt, x...)
- #define AT_AIR720_DEBUG_NB(fmt, x...)
- #define AT_AIR720_DEBUG_String(fmt, x...)
- #define AT_AIR720_DEBUG_H(fmt, x...)
- #define AT_AIR720_DEBUG_F(fmt, x...)
- #endif
- void thread_atair720(void* parameter);
- void Air720_Init(void);
- #define buflen 256
- #define loraidbuflen 20
- typedef struct USART_BUF{
-
- unsigned char rxbufindex;
-
- //unsigned char txbufindex;
-
- unsigned char rxbuf[buflen];
-
- //unsigned char txbuf[buflen];
-
- } USART_BUF_t;
- uint16_t UDP_0D_frame_l(uint8_t td);
- uint16_t UDP_0D_frame_N(uint8_t td);
- uint16_t UDP_0D_frame_NT(uint8_t td);
- void AT_aire720_process(DEV_WORK_MODE_T *pmode);
- typedef enum
- {
- AT_AIRE720_STATE_IDLE=0,
- AT_AIRE720_STATE_INIT,
- AT_AIRE720_STATE_CONNECTING,
- AT_AIRE720_STATE_CONNECT_OK,
- AT_AIRE720_STATE_RE_CONNECT,
- } tAT_AIRE720_StateCodes;//AT_aire720_State
- typedef struct{
- uint8_t rsv;
- uint8_t firmWareType; //固件,类型,0:APP,1:BootLoader,2:SET配置区
- uint8_t desDeviceType; //被升级设备类型(1Byte)
- uint8_t desDeviceID[4]; //被升级设备ID(4Byte)
- uint8_t desDeviceChannel; //被升级设备通道号(1Byte)
- uint8_t softWareOldVer[4]; //前版本(4Byte)
- uint8_t softWareNewVer[4]; //后版本(4Byte)
- uint8_t srcUrlLen; //固件路径URL的长度(1B)
- uint8_t ppath[80]; //固件路径URL
- }tUpdare_Paras;
- int8_t Air720_Update_Down(void);
- uint8_t air_send_IMEI_Cmd(uint16_t waittime);
- uint8_t air_send_ICCID_Cmd(uint16_t waittime);
- extern sequeue_t * Air720_Send_Sq;
- extern tCounterTimeOut_t time_gw_force_rst;
- void set_at_aire720_workState(tAT_AIRE720_StateCodes mode);
- #endif
|