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.

60 lines
1.1 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 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
12 months ago
1 year ago
1 year ago
12 months ago
1 year ago
  1. #pragma once
  2. #include <stdint.h>
  3. namespace iflytop {
  4. namespace zscanprotocol {
  5. #pragma pack(1)
  6. /**
  7. * @brief 12bit from,1bit emergency
  8. * H L
  9. * [1] [4bit] [8bit] [8bit] [4bit/4bit]
  10. * , from to frameNum/frameId
  11. */
  12. // 数值越大优先级越低
  13. typedef enum {
  14. kcmd,
  15. kreceipt,
  16. kerror_receipt,
  17. kreport,
  18. } packet_type_t;
  19. typedef enum {
  20. kpriority_emergency_report = 7,
  21. kpriority_cmd = 8,
  22. kpriority_receipt = 9,
  23. kpriority_report = 10,
  24. } priority_t;
  25. typedef struct {
  26. uint8_t frameNumAndFrameId;
  27. uint8_t to;
  28. uint8_t from;
  29. uint8_t pad;
  30. } zcanid_t;
  31. typedef struct {
  32. uint8_t ptype;
  33. uint8_t index;
  34. uint16_t function_id;
  35. uint8_t params[];
  36. } zcanbus_packet_t;
  37. #pragma pack()
  38. } // namespace zscanprotocol
  39. namespace err {
  40. typedef enum {
  41. kerr_noerror = 0,
  42. kerr_overtime = 1,
  43. kerr_invalid_param = 2,
  44. kerr_invalid_param_num = 3,
  45. kerr_subdevice_offline = 4,
  46. kerr_function_not_support = 5,
  47. kerr_subdevice_overtime = 6,
  48. } common_ecode_t;
  49. }
  50. } // namespace iflytop