Send error state over RS485

This commit is contained in:
Thomas Kolb 2021-09-19 14:21:00 +02:00
parent 6920c548e9
commit 8dd5c8121f

View file

@ -154,6 +154,12 @@ static void report_status(struct MeasurementResult *meas_data)
fxp_format(meas_data->temperature, number, 2); fxp_format(meas_data->temperature, number, 2);
rs485_enqueue(number); rs485_enqueue(number);
rs485_enqueue(":");
rs485_enqueue(charge_control_is_charge_blocked() ? "1" : "0");
rs485_enqueue(":");
rs485_enqueue(charge_control_is_discharge_blocked() ? "1" : "0");
rs485_enqueue("\n"); rs485_enqueue("\n");
} }
@ -186,6 +192,12 @@ static void report_averaged(struct MeasurementResult *meas_data)
fxp_format(meas_data->avg_temperature, number, 2); fxp_format(meas_data->avg_temperature, number, 2);
rs485_enqueue(number); rs485_enqueue(number);
rs485_enqueue(":");
rs485_enqueue(charge_control_is_charge_blocked() ? "1" : "0");
rs485_enqueue(":");
rs485_enqueue(charge_control_is_discharge_blocked() ? "1" : "0");
rs485_enqueue("\n"); rs485_enqueue("\n");
} }