From 0c0d21c3f8306a3a90921f3ed2bc56f01bc85040 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Thu, 25 Apr 2024 15:34:20 +0800 Subject: [PATCH] init --- iflytop_canbus_protocol.hpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 iflytop_canbus_protocol.hpp diff --git a/iflytop_canbus_protocol.hpp b/iflytop_canbus_protocol.hpp new file mode 100644 index 0000000..1976cb9 --- /dev/null +++ b/iflytop_canbus_protocol.hpp @@ -0,0 +1,20 @@ +#pragma once +#include +extern "C" { +#pragma pack(1) +typedef struct { + uint8_t ptype; + uint16_t index; + uint16_t board_id; + uint16_t function_id; + uint8_t params[]; +} zcanbus_packet_t; +#pragma pack() + +typedef enum { + kcmd, + kreceipt, + kerror_receipt, + kreport, +} packet_type_t; +}