From a885e0e37411a0003ed605c9f9f9fcf100832df6 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Thu, 25 Apr 2024 15:56:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=8D=8F=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- iflytop_canbus_protocol.hpp | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/iflytop_canbus_protocol.hpp b/iflytop_canbus_protocol.hpp index 1976cb9..262f2c4 100644 --- a/iflytop_canbus_protocol.hpp +++ b/iflytop_canbus_protocol.hpp @@ -1,5 +1,6 @@ #pragma once #include + extern "C" { #pragma pack(1) typedef struct { @@ -9,6 +10,12 @@ typedef struct { uint16_t function_id; uint8_t params[]; } zcanbus_packet_t; + +typedef struct { + zcanbus_packet_t packet; + uint8_t boardType; +} heatpacket_t; + #pragma pack() typedef enum { @@ -16,5 +23,35 @@ typedef enum { kreceipt, kerror_receipt, kreport, + kheat, // 心跳 } packet_type_t; + +typedef enum { + kMainBoard = 0, // 主机 + kBoardType_LiquidCtrl = 1, // 液路板 + kBoardType_PowerControl = 2, // 电源板 + kBoardType_ExtBallValveCtrl = 3, // 外部球阀控制板 + kBoardType_H2O2Sensor = 4, // H2O2传感器板 +} BoardType_t; + +typedef enum { + + kcmd_heatpacket_report = 0 * 100, + kcmd_read_board_info = 0 * 100 + 1, + +} cmd_t; + +#define HEART_OVERTIME_MS (10 * 1000) + +#pragma pack(1) + +/*********************************************************************************************************************** + * 心跳包 * + ***********************************************************************************************************************/ +typedef struct { + zcanbus_packet_t packet; + uint8_t boardType; +} heatpacket_report_t; + +#pragma pack() }