From c4e1315478f154d4745847f145088df2c260189c Mon Sep 17 00:00:00 2001 From: adrien balleyguier Date: Thu, 7 May 2026 08:44:32 +0200 Subject: [PATCH] feat(nodes): adding management of read error on each values, hence Closes: #65 --- nodes/src/supervisor.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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