diff --git a/commands.c b/commands.c index 4fefbc22..28a93cb2 100644 --- a/commands.c +++ b/commands.c @@ -1163,6 +1163,20 @@ void commands_process_packet(unsigned char *data, unsigned int len, reply_func(send_buffer, ind); } break; + case COMM_GET_BATTERY_CUT: { + int32_t ind = 0; + uint8_t send_buffer[60]; + mc_configuration *mcconf = mempools_alloc_mcconf(); + *mcconf = *mc_interface_get_configuration(); + + send_buffer[ind++] = packet_id; + buffer_append_float32(send_buffer, mcconf->l_battery_cut_start, 1e3, &ind); + buffer_append_float32(send_buffer, mcconf->l_battery_cut_end, 1e3, &ind); + + mempools_free_mcconf(mcconf); + reply_func(send_buffer, ind); + } break; + case COMM_SET_CAN_MODE: { int32_t ind = 0; bool store = data[ind++]; diff --git a/datatypes.h b/datatypes.h index d0a1f82a..ff424703 100644 --- a/datatypes.h +++ b/datatypes.h @@ -965,6 +965,7 @@ typedef enum { COMM_BMS_FWD_CAN_RX, COMM_BMS_HW_DATA, + COMM_GET_BATTERY_CUT, } COMM_PACKET_ID; // CAN commands