diff --git a/iflytop_canbus_protocol.hpp b/iflytop_canbus_protocol.hpp index 1281ed6..5fd8452 100644 --- a/iflytop_canbus_protocol.hpp +++ b/iflytop_canbus_protocol.hpp @@ -126,8 +126,34 @@ typedef enum { static inline const char *ErrorCodeToString(uint32_t code) { switch (code) { + case kerr_noerror: + return "noerror"; + case kerr_overtime: + return "overtime"; + case kerr_invalid_param: + return "invalid_param"; + case kerr_invalid_param_num: + return "invalid_param_num"; + case kerr_subdevice_offline: + return "subdevice_offline"; + case kerr_motor_reset_error: + return "motor_reset_error"; + case kerr_motor_subdevice_offline: + return "motor_subdevice_offline"; + case kerr_motor_driver_error: + return "motor_driver_error"; + case kerr_motor_undervoltage_error: + return "motor_undervoltage_error"; + case kerr_AirBlowerError: + return "AirBlowerError"; + case kerr_HeaterError: + return "HeaterError"; + case kerr_BlowerError: + return "BlowerError"; + case kerr_ProportionalValveError: + return "ProportionalValveError"; default: - return "unkown error"; + return "unkown"; } } typedef enum { @@ -139,7 +165,7 @@ typedef enum { kcmd_force_report = 2, // cmd:no, ack:none 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 + kcmd_heart_ping = 5, // cmd:pingindex, ack:ask_taskinfo_t kcmd_clear_reset_flag = 6, // cmd:taskoff, ack:ask_taskinfo_t kreport_heatpacket_pong = 50, // cmd:no ack:no report:heatpacket_t kreport_exception_error = 51, // report:error_code,subid @@ -187,9 +213,9 @@ typedef enum { /*********************************************************************************************************************** * 压力传感器数据上报 * ***********************************************************************************************************************/ - 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) + kcmd_pressure_sensor_bus_read_data = 400, // cmd:subid ack:pressure(0.1pa) + kcmd_pressure_sensor_bus_set_report_period_ms = 401, // cmd:subid,period + kreport_pressure_data = 450, // report:subid pressure(0.1pa) #if 0