8 changed files with 169 additions and 86 deletions
-
2iflytop_canbus_protocol
-
105usrc/base/hardware.cpp
-
66usrc/base/hardware.hpp
-
16usrc/protocol_impl/function_impl/afunction_impl.hpp
-
24usrc/protocol_impl/function_impl/cmd_air_compressor_fn_impl.cpp
-
24usrc/protocol_impl/function_impl/cmd_blowser_fn_impl.cpp
-
16usrc/protocol_impl/protocol_impl_service.cpp
-
2zsdk
@ -1 +1 @@ |
|||
Subproject commit 955c39e8b8aa1480b0846a1ae26aaa6ba4e38ce0 |
|||
Subproject commit cf9895020ce2ad2ee628dd27ee4d74d633b832e6 |
@ -0,0 +1,24 @@ |
|||
|
|||
#include "afunction_impl.hpp"
|
|||
using namespace iflytop; |
|||
|
|||
#define TAG "PROTO-AIR_COMP"
|
|||
|
|||
void fn_cmd_air_compressor_ctrl(uint8_t from, uint8_t to, zcanbus_packet_t* packet, size_t len) { |
|||
CHECK_PARAM_LEN(PARAM_LEN(), 1); |
|||
Hardware::ins().air_compressor_ctrl(GET_PARAM(packet->params, 0)); |
|||
zcanbus_send_ack(packet, NULL, 0); |
|||
} |
|||
|
|||
void fn_cmd_air_compressor_ctrl_safe_valve(uint8_t from, uint8_t to, zcanbus_packet_t* packet, size_t len) { |
|||
CHECK_PARAM_LEN(PARAM_LEN(), 1); |
|||
Hardware::ins().air_compressor_ctrl_safe_valve(GET_PARAM(packet->params, 0)); |
|||
zcanbus_send_ack(packet, NULL, 0); |
|||
} |
|||
|
|||
void fn_cmd_air_compressor_read_electric_current(uint8_t from, uint8_t to, zcanbus_packet_t* packet, size_t len) { |
|||
int32_t current = Hardware::ins().air_compressor_read_electric_current(); |
|||
zcanbus_send_ack(packet, (uint8_t*)¤t, sizeof(current)); |
|||
} |
|||
|
|||
void air_compressor_fn_impl_init() {} |
@ -0,0 +1,24 @@ |
|||
|
|||
#include "afunction_impl.hpp"
|
|||
using namespace iflytop; |
|||
|
|||
#define TAG "PROTO-BLOWER"
|
|||
|
|||
void fn_cmd_blower_ctrl(uint8_t from, uint8_t to, zcanbus_packet_t* packet, size_t len) { |
|||
CHECK_PARAM_LEN(PARAM_LEN(), 1); |
|||
Hardware::ins().blower_ctrl(GET_PARAM(packet->params, 0)); |
|||
zcanbus_send_ack(packet, NULL, 0); |
|||
} |
|||
|
|||
void fn_cmd_blower_ctrl_safe_valve(uint8_t from, uint8_t to, zcanbus_packet_t* packet, size_t len) { |
|||
CHECK_PARAM_LEN(PARAM_LEN(), 1); |
|||
Hardware::ins().blower_ctrl_safe_valve(GET_PARAM(packet->params, 0)); |
|||
zcanbus_send_ack(packet, NULL, 0); |
|||
} |
|||
|
|||
void fn_cmd_blower_read_electric_current(uint8_t from, uint8_t to, zcanbus_packet_t* packet, size_t len) { |
|||
int32_t current = Hardware::ins().blower_read_electric_current(); |
|||
zcanbus_send_ack(packet, (uint8_t*)¤t, sizeof(current)); |
|||
} |
|||
|
|||
void blower_fn_impl_init() {} |
@ -1 +1 @@ |
|||
Subproject commit 59955298ef676c401438a09236f699520d114f86 |
|||
Subproject commit c88c14bebbce81a3b6e0d461588e958eb0e839d3 |
Write
Preview
Loading…
Cancel
Save
Reference in new issue