|
|
@@ -76,8 +76,15 @@ void process_bms_message(can_frame_t *frame, int len){
|
|
|
bresp.max_temp = measure_value()->pack_temp[i];
|
|
|
}
|
|
|
}
|
|
|
- bresp.cycle = soc_get_cycle();
|
|
|
- bresp.calibrated = (get_soc()->flags & SOC_FLAG_CALIBRATED) != 0;
|
|
|
+ bresp.health = *((uint32_t *)bms_health());
|
|
|
+ stat_cmd_resp_t sresp;
|
|
|
+ sresp.insert = bms_insert;
|
|
|
+ sresp.is_charging = bms_state_get()->charging;
|
|
|
+ sresp.discharger_fet = ml5238_is_discharging();
|
|
|
+ sresp.charger_fet = ml5238_is_charging();
|
|
|
+ sresp.small_power = AUX_VOL_IS_OPEN();
|
|
|
+ sresp.is_balancing = bms_state_get()->pack_balancing;
|
|
|
+ bresp.state = *((uint8_t*)&sresp);
|
|
|
data = (uint8_t *)&bresp;
|
|
|
data_len = sizeof(bresp);
|
|
|
protocol_send_bms_info(frame->head.can_addr, frame->key, data, data_len);
|
|
|
@@ -147,6 +154,8 @@ void process_bms_message(can_frame_t *frame, int len){
|
|
|
soc.c_discharger = get_soc()->dischrger_coulomb/36.0f;
|
|
|
soc.c_charger = get_soc()->charger_coulomb/36.0f;
|
|
|
soc.c_totol = soc_get_cycle();
|
|
|
+ soc.cycle = soc_get_cycle();
|
|
|
+ soc.calibrated = (get_soc()->flags & SOC_FLAG_CALIBRATED) != 0;
|
|
|
data = (uint8_t *)&soc;
|
|
|
data_len = sizeof(soc);
|
|
|
protocol_send_bms_info(frame->head.can_addr, frame->key, data, data_len);
|