12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- /********************************************************************************
- * File Name: HgsTcpProc.h
- * Function Describe: Header file for HgsTcpProc.c
- * Explain:
- * Writer: wuzhao
- * Date: 2016-12-8
- *******************************************************************************/
- #ifndef __HGSTCPPROC_H
- #define __HGSTCPPROC_H
- /************************************file begin*******************************/
-
- #define CONFIG_SER_SOCKET 2
- #define CONFIG_TCP_MAX_CONNECT 3
- #define CONFIG_TCP_RETRY_CNT 3//如因网络延迟连接TCP慢返回,最久等多久
- #define CONF_PASS1 2
- #define CONF_PASS2 1
- #define CONF_PASS3 3
- typedef struct
- {
- unsigned short g_usOptionCnt;
- unsigned char g_ubConfigFlag :1;//是否进入配置管理功能
- #if(USE_CONFIG_FUN==1)
- unsigned char g_ubConfigTcpStatus:1;
-
- unsigned char g_ubConfigKeyStart:1;
- unsigned char g_ubConfigFinished:1;//完成数据交互,可上传结果
- unsigned char g_ucConfigKeyStep;
- unsigned char g_ucConfigKeyPCnt;
- unsigned char g_ucConfigKeyNCnt;
- unsigned char g_ucConfigKeyPN;//0没旋,1正2负
- /////////////////////////////////
- unsigned char g_ucTcpRetryNum;//多久没连接成功,再发起一次连接
- unsigned char g_ucTcpConnectTime;//发起连接次数
- unsigned char g_ucTcpSendRetryNum;//多久没数据应答,再发起一次数据发送
- unsigned char g_ucTcpSendDateTime;//发送数据次数
- unsigned char g_ucConfigStatus;//配置终端发送类型:上报列表/上报结果
- unsigned char g_ucConfigValue;//当g_ucConfigStatus为2时有用
- unsigned char g_ucConfigSerAckStatus;//服务器响应结果
- /////////////////////////////////
- #endif
- }__attribute__ ((packed)) CONFIG_SER_DEF;
-
- extern CONFIG_SER_DEF sutConfig;
- void ConfigCtrHandle(void);
- extern unsigned char CCID[];
- extern unsigned char HigosSendFlag;
- extern unsigned char HgsConnetCnt,HgsConnetStatus;
- extern unsigned char tcpControl;
- //int ModemGetCCID(void);
- void SendHgsData(void);
- void HigosTick(void);
- unsigned short SendTcpSeverPack(unsigned char *,unsigned char,unsigned short);
- void HigosInit(void);
- void Hgs_Data_RecvHandle(char *, unsigned short);
- void HigosStartCnt(unsigned char);
- void HigosStopCnt(void);
- void PrintTcpData(unsigned char *tcpData, unsigned short len);
- /************************************file end ******************************************/
- #endif
|