123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- #ifndef __PARA_H_
- #define __PARA_H_
- #include "datatype.h"
- #include "platform.h"
- #define DEFAULT_POC_PORT 11390
- #pragma pack(push)
- #pragma pack(1)
- typedef enum{
- CODE_GBK,
- CODE_UNICODE
- }MSG_CODE_ENUM;
- typedef enum{
- ENCODE_EVRC,
- ENCODE_EVRC_FULL,
- ENCODE_AMRNB
- }ENCODE_ENUM;
- typedef enum{
- DEFINE_SER,
- DEFINE_COM
- }DEFINE_ENUM;
- typedef struct{
- T_UINT16 port;
- T_INT8 addr[IP_DOMAIN_SIZE+1];//ip or domain
- T_INT8 ip[20];
- }DSER_DEF;
- typedef struct{
- T_UINT8 gpsSwitch:1; //GPS是否工作
- DSER_DEF gpsServer;
- T_UINT8 gpsAuthCode[7];
- T_UINT16 gpsInterval;
- }GPSPARA_DEF;
- #define DEFAULT_BYTES 100
- typedef struct{
- //int dbmark;//用于识别
- T_BOOL pocEnable;
- T_UINT32 psn;
- T_INT8 pass[30];
- DSER_DEF pocServer;
- MSG_CODE_ENUM msgCode;
- ENCODE_ENUM encodeType;
- DEFINE_ENUM udpModifyPriType;
- T_UINT8 udpHeartTick_4G;
- T_UINT8 udpHeartTick_none_4G;
- T_INT8 groupServer[IP_DOMAIN_SIZE+1];
- T_INT8 fotaServer[IP_DOMAIN_SIZE+1];
- GPSPARA_DEF gps;
- T_UINT8 defaultZone[DEFAULT_BYTES];//保留,后面扩展时用,这样就不用重置参数区了
- }PARA_DEF;
- #pragma pack(pop)
- extern PARA_DEF paras;
- void para_inits(void);
- T_UINT8 setNewPara(T_UINT8 *data, T_UINT16 len);
- void SaveNewPara(void);
- void saveAuthEncode(T_UINT8 *encode, T_UINT16 length);
- T_BOOL readAuthEncode(T_UINT8 *outEncode, T_UINT16 readLen);
- int hdataRead(unsigned char *outdata, int outsize);
- void hdataSave(unsigned char *indata, unsigned int len);
- void showStatus(void);
- #endif
|