From 7cf64770e1e06e66488e778a994d128870852a37 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Sat, 27 Apr 2024 20:09:43 +0800 Subject: [PATCH] update protocol --- iflytop_canbus_protocol.hpp | 88 +++++++++++++++++++++++---------------------- 1 file changed, 46 insertions(+), 42 deletions(-) diff --git a/iflytop_canbus_protocol.hpp b/iflytop_canbus_protocol.hpp index 33cb58c..cb0e588 100644 --- a/iflytop_canbus_protocol.hpp +++ b/iflytop_canbus_protocol.hpp @@ -88,12 +88,15 @@ static inline const char *ProjectIDToString(uint32_t id) { } typedef enum { - kerr_noerror = 0, - kerr_overtime = 1, + kerr_noerror = 0, + kerr_overtime = 1, + kerr_invalid_param = 2, + kerr_invalid_param_num = 3, // 驱动器错误 - kerr_motorReset = 100, - kerr_motorUnkownError = 101, + kerr_motor_reset_error = 100, + kerr_motor_offline = 101, + kerr_motor_error_status = 102, kerr_AirBlowerError = 200, // 空压机异常 kerr_HeaterError = 201, // 加热片异常 @@ -104,20 +107,6 @@ typedef enum { static inline const char *ErrorCodeToString(uint32_t code) { switch (code) { - case kerr_noerror: - return "no error"; - case kerr_motorReset: - return "motor reset"; - case kerr_motorUnkownError: - return "motor unkown error"; - case kerr_AirBlowerError: - return "air blower error"; - case kerr_HeaterError: - return "heater error"; - case kerr_BlowerError: - return "blower error"; - case kerr_ProportionalValveError: - return "proportional valve error"; default: return "unkown error"; } @@ -132,7 +121,7 @@ typedef enum { kcmd_read_sysinfo = 3, // cmd:no, ack:ack_sysinfo_t kcmd_read_taskinfo = 4, // cmd:taskoff, ack:ask_taskinfo_t kcmd_heart_ping = 5, // cmd:taskoff, ack:ask_taskinfo_t - kreport_heatpacket_pong = 50, // cmd:no ack:no report:heatpacket_t + kreport_heatpacket_pong = 50, // cmd:no ack:no report:heatpacket_t kreport_exception_error = 51, // report:error_code,subid /*********************************************************************************************************************** @@ -147,21 +136,48 @@ typedef enum { * 设置ihold,irun,idelay * */ - kcmd_pump_rotate = 100, // cmd: rpm - kcmd_pump_stop = 101, // cmd: rpm - kcmd_pump_set_subic_reg = 102, // cmd: add,val - kcmd_pump_get_subic_reg = 103, // cmd: add,ack:val - kcmd_pump_set_irun_ihold = 104, // cmd: irun,ihold,idelay + kcmd_pump_rotate = 100, // cmd: index rpm ack:none + kcmd_pump_stop = 101, // cmd: index rpm ack:none + kcmd_pump_set_irun_ihold = 102, // cmd: index irun,ihold,idelay ack:none + kcmd_pump_set_acc = 104, // cmd: index acc ack:none + + kcmd_pump_set_subic_reg = 110, // cmd: index,val ack:none + kcmd_pump_get_subic_reg = 111, // cmd: index, ack:val /*********************************************************************************************************************** - * 报警指示灯控制 * + * 喷液MINI真空泵 * ***********************************************************************************************************************/ - kcmd_triple_warning_light_ctl = 200, // cmd: r,g,b,warning + /** + * @brief Spray liquid mini air compressor + * 打开/关闭 + */ + kcmd_sl_mini_ac_ctrl = 200, // cmd: power(0-100) + + /*********************************************************************************************************************** + * 气密性测试MINI真空泵 * + ***********************************************************************************************************************/ + /** + * @brief air Tightness Test AirCompressor + * 打开/关闭 + * 电流上报 + */ + kcmd_atta_mini_air_compressor_ctrl = 300, // cmd: power(0-100) + + /*********************************************************************************************************************** + * 压力传感器数据上报 * + ***********************************************************************************************************************/ + kcmd_read_pressure_data = 400, // cmd:subid ack:pressure(0.1pa) + kcmd_set_pressure_data_report_period_ms = 401, // cmd:subid,period + kreport_pressure_data = 450, // report:subid pressure(0.1pa) + +#if 0 /*********************************************************************************************************************** - * 压力传感器读取 * + * 报警指示灯控制 * ***********************************************************************************************************************/ - kreport_pressure_data = 300, // report:subid pressure(0.1pa) + kcmd_triple_warning_light_ctl = 200, // cmd: r,g,b,warning + + /*********************************************************************************************************************** * H2O2传感器数值上报 * @@ -215,20 +231,6 @@ typedef enum { kreport_airCompressor_electric_current = 751, // report:electric_current(ma) /*********************************************************************************************************************** - * 气密性测试专用空压机 * - ***********************************************************************************************************************/ - /** - * @brief air Tightness Test AirCompressor - * 打开/关闭 - * 电流上报 - * - * - */ - - kcmd_ATTAirCompressor_ctrl = 800, // cmd: power(0-100) - kcmd_ATTAirCompressor_ctrl_safe_valve = 801, // cmd: valve_state - - /*********************************************************************************************************************** * 电磁阀控制 * ***********************************************************************************************************************/ @@ -268,6 +270,8 @@ typedef enum { kreport_evaporation_bin_water_sensor = 1200, // report:state //蒸发仓水浸 kreport_device_bottom_water_sensor = 1201, // report:state //设备底部水浸 +#endif + } cmd_t; #pragma pack(1)