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.
101 lines
4.3 KiB
101 lines
4.3 KiB
#pragma once
|
|
#include <stdint.h>
|
|
#pragma pack(1)
|
|
|
|
typedef struct {
|
|
uint16_t packetindex;
|
|
uint16_t cmdid;
|
|
uint8_t subcmdid;
|
|
uint8_t packetType;
|
|
uint8_t data[];
|
|
} transmit_disinfection_protocol_header_t;
|
|
|
|
#pragma pack()
|
|
|
|
typedef enum {
|
|
kpt_cmd = 0,
|
|
kpt_ack = 1,
|
|
kpt_error_ack = 2,
|
|
kpt_status_report = 3,
|
|
} PacketType_t;
|
|
|
|
typedef enum {
|
|
kcmd_ping = 0,
|
|
kcmd_read_io = 1,
|
|
kcmd_set_io = 2,
|
|
kcmd_readadc_raw = 3,
|
|
|
|
kcmd_m211887_operation = 1000, // 维萨拉压力传感器
|
|
kcmd_read_presure_sensor = 1001,
|
|
kcmd_triple_warning_light_ctl = 1002,
|
|
kcmd_peristaltic_pump_ctl = 1004,
|
|
kcmd_read_huacheng_pressure_sensor = 1005,
|
|
kcmd_proportional_set_valve = 1006, // 设置比例阀 {4:valveId,4:valveValue}
|
|
kcmd_air_compressor_ch_select = 1007, // 空压机通道选择 {4:val}
|
|
kcmd_air_compressor_valve1_set = 1008, // 空压机阀门1控制 {4:val}
|
|
kcmd_air_compressor_valve2_set = 1009, // 空压机阀门2控制 {4:val}
|
|
kcmd_air_compressor_read_pressure = 1010, // 空压机阀读取压力 {}{4:val}
|
|
kcmd_proportional_read_state = 1011,
|
|
|
|
|
|
kcmd_read_device_bottom_water_detection_sensor = 1101, // ack(4)
|
|
kcmd_read_evaporation_bin_water_detection = 1102, // ack(4)
|
|
|
|
/***********************************************************************************************************************
|
|
* 消毒机拉杆箱下位机指令 *
|
|
***********************************************************************************************************************/
|
|
// kcmd_peristaltic_pump_ctl
|
|
//
|
|
kcmd_dbdb_liquid_path_ctrl_board_read_pressure_sensor = 1200, // cmd:index(4) ack:pressure(4)
|
|
kcmd_dbdb_spray_air_compressor_power_ctrl = 1201, // 喷雾空压机控制 {4:ID}{4:val}
|
|
kcmd_dbdb_air_tightness_test_air_compressor_power_ctrl = 1202, // 气密性空压机控制 {4:ID}{4:val}
|
|
|
|
kcmd_dbdb_heater_ctrl = 1300, // 加热片控制
|
|
kcmd_dbdb_heater_ctrl_safe_valve = 1301, // 加热片安全电磁阀
|
|
kcmd_dbdb_heater_read_electric_current = 1302, // 加热片读取电流
|
|
kcmd_dbdb_heater_read_temperature_data = 1303, // 加热片读取温度
|
|
|
|
kcmd_dbdb_mini_pwm_blower_ctrl = 1305, // 小鼓风机控制
|
|
kcmd_dbdb_mini_pwm_blower_read_fbcount = 1306, // 小鼓风机读取反馈计数
|
|
|
|
kcmd_dbdb_ext_valve_ctrl = 1307, // 外部阀门控制
|
|
|
|
/***********************************************************************************************************************
|
|
* 上报 *
|
|
***********************************************************************************************************************/
|
|
kreport_h2o2_sensor_data = 2000, // h2o2传感器信息
|
|
kreport_dbdb_ext_valve_board_heart_packet = 2001, // 外部阀门板心跳包
|
|
|
|
} tdp_cmdid_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,
|
|
} tdp_error_t;
|
|
|
|
/***********************************************************************************************************************
|
|
* 上报包 *
|
|
***********************************************************************************************************************/
|
|
#pragma pack(1)
|
|
typedef struct {
|
|
uint8_t sensorid;
|
|
uint8_t sensor_error; // 传感器异常
|
|
uint16_t h2o2; // ppm * 10
|
|
uint16_t humid; // %RH * 10
|
|
uint16_t temp; // °C * 10
|
|
uint16_t saturation; // %RS * 10
|
|
} report_h2o2_data_t;
|
|
#pragma pack()
|
|
|
|
typedef enum {
|
|
kFixBoardId_MainBoard = 1, // 主机
|
|
kFixBoardId_LiquidCtrl = 2, // 液路板
|
|
kFixBoardId_PowerControl = 3, // 电源板
|
|
kFixBoardId_PowerControlMiniBoard = 4, // 电源控制Mini板,用于拉杆箱箱消毒机
|
|
kFixBoardId_ExtBallValveCtrl = 5, // 外部球阀控制板
|
|
kFixBoardId_H2O2SensorStart = 100, // H2O2传感器板
|
|
} FixBoardId_t;
|