Bluecell_operate.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*
  2. * Bluecell_operate.h
  3. *
  4. * Created on: 2020. 4. 3.
  5. * Author: YJ
  6. */
  7. #ifndef BLUECELL_OPERATE_H_
  8. #define BLUECELL_OPERATE_H_
  9. #include <stdbool.h>
  10. #include "Bluecell_operate.h"
  11. /*
  12. SYN
  13. Sub-UID
  14. R-Code
  15. TR-ID
  16. Seq-Num
  17. TTL
  18. Time
  19. 오류 응답
  20. CMD
  21. Length
  22. Header Checksum
  23. SUB-DATA
  24. SUB-DATA-CRC
  25. ETX
  26. */
  27. /*
  28. *
  29. 0 80 전체 상태 조회 모든 AID 항목에 대한 상태 요청 및 응답 (요청 Frame의 SUB-DATA 는 길이는 0)
  30. 1 81 제어 요청 제어 요청의 REQ는 0x01 이고 응답은 전체 데이터 상태를 응답
  31. 10 90 Download Notification 다운로드 통지
  32. 11 91 Download Data 다운로드 data
  33. 12 92 Download Confirm 다운로드 확인
  34. 13 93 Download Complete Download Complete Command
  35. 14 94 System-Reboot System Rebooting Command
  36. 40 C0 테이블 조회 및 응답
  37. 41 C1 테이블 설정 및 응답
  38. *
  39. *
  40. */
  41. typedef enum{
  42. AllDataReq = 0, // -> Response 80
  43. DataCtrlReq, // -> Response 81
  44. DownNotification, // -> Response 90
  45. DownData, // -> Response 91
  46. DownConfirm , // -> Response 92
  47. DownComplete, // -> Response 93
  48. SystemReboot, // -> Response 94
  49. TableDataReq = 40,
  50. };
  51. typedef enum{
  52. MBIC_PREAMBLE_0 = 0,
  53. MBIC_PREAMBLE_1,
  54. MBIC_PREAMBLE_2,
  55. MBIC_PREAMBLE_3,
  56. MBIC_SUBUID_0,
  57. MBIC_SUBUID_1,
  58. MBIC_RCODE_0,
  59. MBIC_TRID_0,
  60. MBIC_TRID_1,
  61. MBIC_SEQSUM_0, // 10byte
  62. MBIC_TTL_0,
  63. MBIC_TIME_0,
  64. MBIC_TIME_1,
  65. MBIC_TIME_2,
  66. MBIC_TIME_3,
  67. MBIC_TIME_4,
  68. MBIC_TIME_5,
  69. MBIC_ERRRESPONSE_0,
  70. MBIC_CMD_0,
  71. MBIC_LENGTH_0, // 20byte
  72. MBIC_LENGTH_1,
  73. MBIC_HEADERCHECKSUM_0,
  74. MBIC_PAYLOADSTART,
  75. /*
  76. * PayLoadSTART
  77. */
  78. };
  79. #define MBIC_PREAMBLE0 0x16
  80. #define MBIC_PREAMBLE1 0x16
  81. #define MBIC_PREAMBLE2 0x16
  82. #define MBIC_PREAMBLE3 0x16
  83. #define MBIC_SUBUID0 0x00
  84. #define MBIC_SUBUID1 0xF1
  85. #define MBIC_RCODE
  86. #define MBIC_TRID
  87. #define MBIC_SEQNUM
  88. #define MBIC_TTL
  89. #define MBIC_TIME
  90. #define MBIC_ERRRESPONSE
  91. #define MBIC_CMD
  92. #define MBIC_LENGTH
  93. #define MBIC_CHECKSHUM
  94. #define MBIC_ETX 0x03
  95. #endif /* BLUECELL_OPERATE_H_ */