Send error state over RS485
This commit is contained in:
parent
6920c548e9
commit
8dd5c8121f
12
src/main.c
12
src/main.c
|
@ -154,6 +154,12 @@ static void report_status(struct MeasurementResult *meas_data)
|
|||
|
||||
fxp_format(meas_data->temperature, number, 2);
|
||||
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");
|
||||
}
|
||||
|
||||
|
@ -186,6 +192,12 @@ static void report_averaged(struct MeasurementResult *meas_data)
|
|||
|
||||
fxp_format(meas_data->avg_temperature, number, 2);
|
||||
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");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue