From 81529a15c57000f73cc5bd4b7276f567099b9988 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Mon, 26 Aug 2024 17:00:08 +0800 Subject: [PATCH] change zscanprotocol.hpp to zscanprotocol.h --- zscanprotocol.h | 29 +++++++++++++++++++++++++++++ zscanprotocol.hpp | 51 --------------------------------------------------- 2 files changed, 29 insertions(+), 51 deletions(-) create mode 100644 zscanprotocol.h delete mode 100644 zscanprotocol.hpp diff --git a/zscanprotocol.h b/zscanprotocol.h new file mode 100644 index 0000000..6fdf1b2 --- /dev/null +++ b/zscanprotocol.h @@ -0,0 +1,29 @@ +#pragma once +#include +typedef enum { + kcmd, + kreceipt, + kerror_receipt, + kreport, +} packet_type_t; + +typedef enum { + kpriority_emergency_report = 7, + kpriority_cmd = 8, + kpriority_receipt = 9, + kpriority_report = 10, +} priority_t; + +typedef struct { + uint8_t frameNumAndFrameId; + uint8_t to; + uint8_t from; + uint8_t pad; +} zcanid_t; + +typedef struct { + uint8_t ptype; + uint8_t index; + uint16_t function_id; + uint8_t params[]; +} zcanbus_packet_t; diff --git a/zscanprotocol.hpp b/zscanprotocol.hpp deleted file mode 100644 index 5c8621a..0000000 --- a/zscanprotocol.hpp +++ /dev/null @@ -1,51 +0,0 @@ -#pragma once -#include - -namespace iflytop { -namespace zscanprotocol { - -#pragma pack(1) - -/** - * @brief 消息格式 12bit from,1bit emergency - * H L - * [1] [4bit] [8bit] [8bit] [4bit/4bit] - * , from to frameNum/frameId - */ - -// 数值越大优先级越低 - -typedef enum { - kcmd, - kreceipt, - kerror_receipt, - kreport, -} packet_type_t; - -typedef enum { - kpriority_emergency_report = 7, - kpriority_cmd = 8, - kpriority_receipt = 9, - kpriority_report = 10, -} priority_t; - -typedef struct { - uint8_t frameNumAndFrameId; - uint8_t to; - uint8_t from; - uint8_t pad; -} zcanid_t; - -typedef struct { - uint8_t ptype; - uint8_t index; - uint16_t function_id; - uint8_t params[]; -} zcanbus_packet_t; - -#pragma pack() - -} // namespace zscanprotocol -namespace err { -} -} // namespace iflytop