common.h 897 B

123456789101112131415161718192021222324252627
  1. #ifndef __COMMON_H_
  2. #define __COMMON_H_
  3. #include "datatype.h"
  4. #define USER_TIME_ZONE 8
  5. typedef struct{
  6. unsigned short year;
  7. unsigned char month;
  8. unsigned char day;
  9. unsigned char hour;
  10. unsigned char min;
  11. unsigned char sec;
  12. }MY_CLOCK;
  13. T_BOOL checkIpDomain(T_INT8 *address, T_UINT16 len, T_INT8 * ipDomain, IPD_ENUM *type);
  14. void hecPrint(T_UINT8 *data, T_UINT16 len);
  15. T_INT8 restoreDataFormatByHex(T_UINT8 *src, T_UINT16 len);
  16. void fillByHexFormat(T_INT8 *src, T_INT8 *data, T_INT32 len);
  17. void MakeStringToUpperCap(T_UINT8 *data, T_UINT16 len);
  18. T_INT16 fitStrForIndex(T_INT8 *Str,T_INT8 *Para);
  19. T_INT16 matchCmdList(const char **cmdlist,T_UINT8 *data);
  20. unsigned char decToBCD(unsigned char value);
  21. int findByteFromStr(unsigned char *src, int len,unsigned char target,unsigned char index);
  22. unsigned char bcdToDec(unsigned char value);
  23. char isBytesAreHex(unsigned char *info, int len);
  24. #endif