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.
57 lines
1.3 KiB
57 lines
1.3 KiB
#pragma once
|
|
#include <stdint.h>
|
|
|
|
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;
|
|
|
|
typedef struct {
|
|
zcanbus_packet_t packet;
|
|
uint8_t boardType;
|
|
} heatpacket_t;
|
|
|
|
#pragma pack()
|
|
|
|
typedef enum {
|
|
kcmd,
|
|
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()
|
|
}
|