Browse Source

update

master
zhaohe 1 year ago
parent
commit
d8f3b31ed1
  1. 94
      iflytop_canbus_protocol.hpp

94
iflytop_canbus_protocol.hpp

@ -1,6 +1,8 @@
#pragma once
#include <stdint.h>
#define PROTOCOL_VERSION 1
extern "C" {
#pragma pack(1)
typedef struct {
@ -35,23 +37,103 @@ typedef enum {
} BoardType_t;
typedef enum {
klarge_space_disinfection_machine = 1, // 大空间消毒机
ksmall_space_disinfection_machine = 2, // 小空间消毒机
kpipe_disinfection_machine = 3, // 管道式消毒机
kdraw_bar_disinfection_box = 4, // 手持拉杆箱消毒机
} ProjectID_t;
typedef enum {
kerr_noerror = 0,
// 驱动器错误
kmotor_reset = 100,
kmotor_unkownError = 100,
} ErrorCode_t;
typedef enum {
/***********************************************************************************************************************
* *
***********************************************************************************************************************/
kcmd_read_board_info = 1, // cmd:no, ack:read_board_info_ack_t
kreport_heatpacket = 50, // cmd:no ack:no report:heatpacket_t
kreport_error = 51, // report:error_code,subid
/***********************************************************************************************************************
* *
***********************************************************************************************************************/
/**
* (id,)
*
*
* TMC参数
* TMC参数
* 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_heatpacket_report = 0 * 100,
kcmd_read_board_info = 0 * 100 + 1,
/***********************************************************************************************************************
* *
***********************************************************************************************************************/
/**
* @brief
* /
*
*
*
*
*/
kcmd_heater_ctrl = 200, // cmd: power_state
kcmd_heater_is_support_temperature_sensor = 202, // cmd:no, ack:bool
kreport_heater_temperature_data = 250, // report:temperature(0.01)
kreport_heater_electric_current = 251, // report:electric_current(ma)
/***********************************************************************************************************************
* *
***********************************************************************************************************************/
/**
* @brief
* /
*
*
*/
/***********************************************************************************************************************
* *
***********************************************************************************************************************/
kcmd_triple_warning_light_ctl = 300, // cmd: r,g,b,warning
/***********************************************************************************************************************
* *
***********************************************************************************************************************/
kreport_pressure_data = 400, // report:subid pressure(0.1pa)
} cmd_t;
#define HEART_OVERTIME_MS (10 * 1000)
#pragma pack(1)
/***********************************************************************************************************************
* *
***********************************************************************************************************************/
typedef struct {
zcanbus_packet_t packet;
uint8_t boardType;
} heatpacket_report_t;
typedef struct {
zcanbus_packet_t packet;
uint8_t boardType;
uint8_t projectId;
uint16_t protcol_version;
uint16_t software_version;
uint16_t hardware_version;
} read_board_info_ack_t;
#pragma pack()
}
Loading…
Cancel
Save