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.

52 lines
992 B

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