#ifndef __AUTH_NEW_H_ #define __AUTH_NEW_H_ #define PRO_HEADER 0x89 #define TX_RX_SEED 0x86 #define PRO_AUTH_REQ 0x34 //终端向我申请鉴权 #define PRO_AUTH_OK 0x35 //终端通知我它鉴权码与自己算出来的一样 #define PRO_AUTH_SUC 0x36 //我向终端通知鉴权码 #define PRO_AUTH_FAI 0x37 //终端通知我它鉴权码与自己算出来的不一样 #define UNIQUE_ID_BYTES 12 #define AUTH_FLAG '@' #define AUTH_UDP_SOCKET 1 #define AUTH_REQ_ID 0x0930 #define AUTH_ACK_ID 0x8930 #define CHANNEL_NUM 1 char authHandleData(char ,unsigned char *data, unsigned short len); void authNewInit(void); void ModemSendAuthReqHandle(void); typedef struct{ unsigned char root;//表示是否有有效数据 unsigned char reqTime;//请求鉴权计数 unsigned char result;//鉴权结果 0 无鉴权请求 1 正在鉴权 2 鉴权成功 3 鉴权失败 unsigned char id[UNIQUE_ID_BYTES]; unsigned int encodeValue; unsigned int waitTime; }__attribute__((packed)) CHANNEL_DEF; typedef enum{ CHL_UART1, CHL_TOTAL }CHANNEL_TYPEENUM; typedef enum{ SER_AUTH_IDLE, SER_AUTH_BUSY, SER_AUTH_OK, SER_AUTH_WAIT, SER_AUTH_FAILED, SER_AUTH_DEV_OK_DLY, SER_AUTH_DEV_OK, SER_AUTH_DEV_FAI }SER_AUTH_RESULT_DEF; extern CHANNEL_DEF channel[CHANNEL_NUM]; extern unsigned char authSocketStatus; void authLedShow(); void authBubiaoHandleRecv(unsigned char *msg); #endif