feat(nodes): adding management of read error on each values, hence
Closes: #65
This commit is contained in:
@@ -31,6 +31,18 @@ enum error_code supervisor_run(){
|
|||||||
thermo_status = thermo_get_value(&thermo_value);
|
thermo_status = thermo_get_value(&thermo_value);
|
||||||
window_status = window_get_value(&window_value);
|
window_status = window_get_value(&window_value);
|
||||||
// todo : manage non-success error codes
|
// todo : manage non-success error codes
|
||||||
|
if(success != co2_lvl_status){
|
||||||
|
co2_lvl_value = -1;
|
||||||
|
}else{}
|
||||||
|
if(success != hygro_status){
|
||||||
|
hygro_value = -1;
|
||||||
|
}else{}
|
||||||
|
if(success != thermo_status){
|
||||||
|
thermo_value = -1;
|
||||||
|
}else{}
|
||||||
|
if(success != window_status){
|
||||||
|
window_value = unknown;
|
||||||
|
}else{}
|
||||||
ble_advertise(window_value, hygro_value, thermo_value, co2_lvl_value);
|
ble_advertise(window_value, hygro_value, thermo_value, co2_lvl_value);
|
||||||
if((co2_lvl_value > CO2_LEVEL_EMPTY_ROOM) || (window_value == open)){
|
if((co2_lvl_value > CO2_LEVEL_EMPTY_ROOM) || (window_value == open)){
|
||||||
// there are people in the room, or someone forgot to close the window
|
// there are people in the room, or someone forgot to close the window
|
||||||
|
|||||||
Reference in New Issue
Block a user