phasecheck.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #ifndef _ENG_PHASE_CHECK_H
  2. #define _ENG_PHASE_CHECK_H
  3. #define NUM_ELEMS(x) (sizeof(x) / sizeof(x[0]))
  4. #define RW_MASK 0x80 //(BIT_7)
  5. #define WRITE_MODE 0
  6. #define RM_VALID_CMD_MASK 0x7f
  7. #define DIAG_CMD_GPS_AUTO_TEST 0x3A
  8. #define MSG_NACK 0
  9. #define MSG_ACK 1
  10. #define HASH_LEN 40
  11. #ifndef MAX_SN_LEN
  12. #define MAX_SN_LEN 24
  13. #endif
  14. #ifndef MAX_STATION_NUM
  15. #define MAX_STATION_NUM 15
  16. #endif
  17. #ifndef MAX_STATION_NAME_LEN
  18. #define MAX_STATION_NAME_LEN 10
  19. #endif
  20. #ifndef MAX_LAST_DESCRIPTION_LEN
  21. #define MAX_LAST_DESCRIPTION_LEN 32
  22. #endif
  23. #define SP09_SPPH_MAGIC_NUMBER 0x53503039
  24. #define SP15_MAX_SN_LEN 64
  25. #define SP15_MAX_STATION_NUM 20
  26. #define SP15_MAX_STATION_NAME_LEN 15
  27. #define SP15_SPPH_MAGIC_NUMBER 0x53503135
  28. #define MAXSIZE_CALIPARAM_PHASECHECK (4096)
  29. typedef struct _SP09_PHASE_CHECK_HEADER
  30. {
  31. unsigned int Magic; //"SP09"
  32. unsigned char SN[MAX_SN_LEN]; //SN,SN_LEN=24
  33. unsigned char SN2[MAX_SN_LEN]; //Add for Mobile
  34. unsigned int StationNum; //The test station number of the testing
  35. unsigned char StationName[MAX_STATION_NUM][MAX_STATION_NAME_LEN];
  36. unsigned char Reserved[13]; //value: 0
  37. unsigned char SignFlag; // internal flag
  38. char szLastFailDescription[MAX_LAST_DESCRIPTION_LEN];
  39. unsigned short iTestSign; // Bit0~Bit14 --> station0 ~ station14 if tested. 0:tested,1:not tested.
  40. unsigned short iItem; // Part1:Bit0~Bit14 indicate test station,0:pass,1:fail
  41. // Part2:Bit15 set to 0;
  42. } SP09_TEST_TRACK_HEADER_T;
  43. typedef struct _SP09_PHASE_CHECK_S
  44. {
  45. SP09_TEST_TRACK_HEADER_T header;
  46. } SP09_TEST_DATA_INFO_T;
  47. /**/
  48. typedef struct _SP15_PHASE_CHECK_HEADER
  49. {
  50. unsigned int Magic; //"SP15"
  51. unsigned char SN[SP15_MAX_SN_LEN]; //SN,SN_LEN=24
  52. unsigned char SN2[SP15_MAX_SN_LEN]; //Add for Mobile
  53. unsigned int StationNum; //The test station number of the testing
  54. unsigned char StationName[SP15_MAX_STATION_NUM][SP15_MAX_STATION_NAME_LEN];
  55. unsigned char Reserved[13]; //value: 0
  56. unsigned char SignFlag; // internal flag
  57. char szLastFailDescription[MAX_LAST_DESCRIPTION_LEN];
  58. unsigned long iTestSign; // Bit0~Bit14 --> station0 ~ station14 if tested. 0:tested,1:not tested.
  59. unsigned long iItem; // Part1:Bit0~Bit14 indicate test station,0:pass,1:fail
  60. // Part2:Bit15 set to 0;
  61. } SP15_TEST_TRACK_HEADER_T;
  62. typedef struct _SP15_PHASE_CHECK_S
  63. {
  64. SP15_TEST_TRACK_HEADER_T header;
  65. } SP15_TEST_DATA_INFO_T;
  66. int direct_phschk(char *buf, int len, char *rsp, int rsplen);
  67. #endif