|
|
@ -18,7 +18,7 @@ namespace transmit_disfection_protocol { |
|
|
|
|
|
|
|
#define MAX_PACKET_LEN 120
|
|
|
|
|
|
|
|
#define PROTOCOL_VERSION 7
|
|
|
|
#define PROTOCOL_VERSION 8
|
|
|
|
#define HEART_OVERTIME (30 * 1000)
|
|
|
|
#define SWITCH_CASE_STR(key) \
|
|
|
|
case key: \ |
|
|
@ -136,6 +136,7 @@ typedef enum { |
|
|
|
kfn_clear_reset_flag = 6, // cmd:taskoff, ack:ask_taskinfo_t
|
|
|
|
kfn_enable_report = 7, // cmd:enable
|
|
|
|
kfn_reset_board = 8, // cmd:
|
|
|
|
kfn_enable_period_log = 9, // cmd: 使能周期日志
|
|
|
|
kreport_heatpacket_pong = 50, // cmd:no ack:no report:heatpacket_t
|
|
|
|
kreport_exception_error = 51, // report:error_code,subid
|
|
|
|
kreport_device_reset = 52, // report:error_code,subid
|
|
|
@ -211,9 +212,11 @@ typedef enum { |
|
|
|
kfn_blower_ctrl = 1000, // cmd: power(0-100)
|
|
|
|
kfn_blower_ctrl_safe_valve = 1001, // cmd: valve_state
|
|
|
|
kfn_blower_read_ei = 1002, // cmd: electric_current(ma)
|
|
|
|
kfn_blower_is_error = 1003, // cmd: ack:{error}
|
|
|
|
kfn_blower_read_ei_adc_raw = 1004, // cmd: electric_current(ma)
|
|
|
|
kfn_blower_is_open = 1005, // cmd: index, ack:open
|
|
|
|
// kfn_blower_is_error = 1003, // cmd: ack:{error} !deleted!
|
|
|
|
// kfn_blower_read_ei_adc_raw = 1004, // cmd: electric_current(ma) !deleted!
|
|
|
|
kfn_blower_is_open = 1005, // cmd: index, !deleted!
|
|
|
|
kfn_blower_read_type = 1006, // cmd: 返回风机类型
|
|
|
|
kfn_blower_read_state = 1007, // cmd: 返回风机状态, 不同类型返回的状态代表的含义不一样
|
|
|
|
|
|
|
|
/***********************************************************************************************************************
|
|
|
|
* 空压机 * |
|
|
@ -221,8 +224,10 @@ typedef enum { |
|
|
|
kfn_air_compressor_ctrl = 1100, // cmd: power(0-100)
|
|
|
|
kfn_air_compressor_ctrl_safe_valve = 1101, // cmd: valve_state
|
|
|
|
kfn_air_compressor_read_ei = 1102, // report:electric_current(ma)
|
|
|
|
kfn_air_compressor_read_ei_adc_raw = 1103, // report:electric_current(ma)
|
|
|
|
// kfn_air_compressor_read_ei_adc_raw = 1103, // report:electric_current(ma)
|
|
|
|
kfn_air_compressor_is_open = 1104, // cmd: index, ack:open
|
|
|
|
kfn_air_compressor_read_type = 1105, // cmd: 返回空压机类型
|
|
|
|
kfn_air_compressor_read_state = 1106, // cmd: index, ack:open
|
|
|
|
|
|
|
|
/***********************************************************************************************************************
|
|
|
|
* 气密性测试空压机 * |
|
|
@ -323,6 +328,28 @@ typedef struct { |
|
|
|
uint16_t sysHasRun; |
|
|
|
} ack_sysinfo_t; |
|
|
|
|
|
|
|
typedef struct { |
|
|
|
int16_t power; |
|
|
|
int16_t state0; |
|
|
|
int16_t state1; |
|
|
|
int16_t state2; |
|
|
|
} ack_blower_state_t; |
|
|
|
|
|
|
|
// typedef struct {
|
|
|
|
// int16_t power;
|
|
|
|
// int16_t blowerI; // 风机电流 ma
|
|
|
|
// int16_t coolfanI; // 冷却风扇电流 ma
|
|
|
|
// int16_t blowerFbCNT; // 风机反馈CNT
|
|
|
|
// int16_t coolfanFbCnt; // 冷却风扇反馈CNT
|
|
|
|
// int16_t subDeviceErrorCode; // 从设备错误码
|
|
|
|
// } ack_blower_state_t;
|
|
|
|
|
|
|
|
typedef struct { |
|
|
|
int16_t power; |
|
|
|
int16_t airCompressorI; // 空压机电流 ma
|
|
|
|
int16_t airCompressorFbCnt; // 空压机反馈 CNT
|
|
|
|
} ack_ac_state_t; |
|
|
|
|
|
|
|
static inline const char* PSType2Str(int type) { |
|
|
|
switch (type) { |
|
|
|
case 0: |
|
|
|