You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.3 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. #pragma once
  2. #include <stdint.h>
  3. extern "C" {
  4. #pragma pack(1)
  5. typedef struct {
  6. uint8_t ptype;
  7. uint16_t index;
  8. uint16_t board_id;
  9. uint16_t function_id;
  10. uint8_t params[];
  11. } zcanbus_packet_t;
  12. typedef struct {
  13. zcanbus_packet_t packet;
  14. uint8_t boardType;
  15. } heatpacket_t;
  16. #pragma pack()
  17. typedef enum {
  18. kcmd,
  19. kreceipt,
  20. kerror_receipt,
  21. kreport,
  22. kheat, // 心跳
  23. } packet_type_t;
  24. typedef enum {
  25. kMainBoard = 0, // 主机
  26. kBoardType_LiquidCtrl = 1, // 液路板
  27. kBoardType_PowerControl = 2, // 电源板
  28. kBoardType_ExtBallValveCtrl = 3, // 外部球阀控制板
  29. kBoardType_H2O2Sensor = 4, // H2O2传感器板
  30. } BoardType_t;
  31. typedef enum {
  32. kcmd_heatpacket_report = 0 * 100,
  33. kcmd_read_board_info = 0 * 100 + 1,
  34. } cmd_t;
  35. #define HEART_OVERTIME_MS (10 * 1000)
  36. #pragma pack(1)
  37. /***********************************************************************************************************************
  38. * *
  39. ***********************************************************************************************************************/
  40. typedef struct {
  41. zcanbus_packet_t packet;
  42. uint8_t boardType;
  43. } heatpacket_report_t;
  44. #pragma pack()
  45. }