From 5161e29f77f08d1e1bea60827b0ee937fa7943bf Mon Sep 17 00:00:00 2001 From: zhaohe Date: Wed, 7 Aug 2024 16:18:18 +0800 Subject: [PATCH] update --- zscanprotocol.hpp | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/zscanprotocol.hpp b/zscanprotocol.hpp index 4c4873e..bbb24ea 100644 --- a/zscanprotocol.hpp +++ b/zscanprotocol.hpp @@ -12,36 +12,41 @@ // 数值越大优先级越低 -typedef enum -{ +typedef enum { kcmd, kreceipt, kerror_receipt, kreport, } packet_type_t; -typedef enum -{ +typedef enum { kpriority_emergency_report = 7, - kpriority_cmd = 8, - kpriority_receipt = 9, - kpriority_report = 10, + kpriority_cmd = 8, + kpriority_receipt = 9, + kpriority_report = 10, } priority_t; -typedef struct -{ +typedef struct { uint8_t frameNumAndFrameId; uint8_t to; uint8_t from; uint8_t pad; } zcanid_t; -typedef struct -{ - uint8_t ptype; - uint8_t index; +typedef struct { + uint8_t ptype; + uint8_t index; uint16_t function_id; - uint8_t params[]; + uint8_t params[]; } zcanbus_packet_t; +typedef enum { + kerr_noerror = 0, + kerr_overtime = 1, + kerr_invalid_param = 2, + kerr_invalid_param_num = 3, + kerr_subdevice_offline = 4, + kerr_function_not_support = 5, + +} common_ecode_t; #pragma pack()