common.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef __COMMON__H__
  2. #define __COMMON__H__
  3. #ifdef ENABLE_GWSD_POC
  4. #define IP_DOMAIN_SIZE 50
  5. #define TRUE 1 ///< 逻辑值 真
  6. #define FALSE 0 ///< 逻辑之 假
  7. #ifndef NULL
  8. #define NULL 0
  9. #endif
  10. typedef enum{
  11. IPD_IP,
  12. IPD_DOMAIN
  13. }IPD_ENUM;
  14. typedef char T_INT8;
  15. typedef unsigned char T_UINT8;
  16. typedef short T_INT16;
  17. typedef unsigned short T_UINT16;
  18. typedef int T_INT32;
  19. typedef unsigned int T_UINT32;
  20. typedef char T_BOOL;
  21. T_BOOL checkIpDomain(T_INT8 *src, T_UINT16 len, T_INT8 * ipDomain, IPD_ENUM *type);
  22. T_INT8 restoreDataFormatByHex(T_UINT8 *src, T_UINT16 len);
  23. void fillByHexFormat(T_INT8 *src, T_INT8 *data, T_INT32 len);
  24. void MakeStringToUpperCap(T_UINT8 *data, T_UINT16 len);
  25. T_INT16 fitStrForIndex(T_INT8 *Str,T_INT8 *Para);
  26. unsigned char AscToHex(unsigned char aHex);
  27. void AscStrTurnHexStr(char *AscStr, char *HexStr);
  28. unsigned char bcdToDec(unsigned char value);
  29. #endif
  30. char msgCmp(char *msg, char *target);
  31. int GetParaFromStr(char *Str,char *Para,char *Value);
  32. void LwEndingToBiEndingStr(char *data, int len);
  33. #endif