diff --git a/nodes/src/supervisor.c b/nodes/src/supervisor.c index 555d50f..d1fd00a 100644 --- a/nodes/src/supervisor.c +++ b/nodes/src/supervisor.c @@ -31,6 +31,18 @@ enum error_code supervisor_run(){ thermo_status = thermo_get_value(&thermo_value); window_status = window_get_value(&window_value); // 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); if((co2_lvl_value > CO2_LEVEL_EMPTY_ROOM) || (window_value == open)){ // there are people in the room, or someone forgot to close the window