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.

31 lines
707 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. #pragma once
  2. #include <stdint.h>
  3. typedef enum {
  4. kcmd,
  5. kreceipt,
  6. kerror_receipt,
  7. kreport,
  8. kevent, // 非周期上报, 相同的indexid, 表明是事件, 上层可过滤掉
  9. kevent_confirm, // 事件确认,收到事件确认后, 说明上层已收到该事件, 不再重复上报
  10. } packet_type_t;
  11. typedef enum {
  12. kpriority_emergency_report = 7,
  13. kpriority_cmd = 8,
  14. kpriority_receipt = 9,
  15. kpriority_report = 10,
  16. } priority_t;
  17. typedef struct {
  18. uint8_t frameNumAndFrameId;
  19. uint8_t to;
  20. uint8_t from;
  21. uint8_t pad;
  22. } zcanid_t;
  23. typedef struct {
  24. uint8_t ptype;
  25. uint8_t index;
  26. uint16_t function_id;
  27. uint8_t params[];
  28. } zcanbus_packet_t;