diff --git a/examples/thermostat/silabs/src/AppTask.cpp b/examples/thermostat/silabs/src/AppTask.cpp index 8473e9bf32afd5..252850cf03663a 100644 --- a/examples/thermostat/silabs/src/AppTask.cpp +++ b/examples/thermostat/silabs/src/AppTask.cpp @@ -185,55 +185,57 @@ void AppTask::ButtonEventHandler(uint8_t button, uint8_t btnAction) } #ifdef DIC_ENABLE -void AppTask::DIC_AttrubiteHandler(AttributeId attributeId){ +void AppTask::DIC_AttrubiteHandler(AttributeId attributeId) +{ switch (attributeId) { case ThermAttr::LocalTemperature::Id: { int8_t CurrentTemp = TempMgr().GetCurrentTemp(); char buffer[BYTE]; itoa(CurrentTemp, buffer, DECIMAL); - dic_sendmsg("LocalTemperature/Temp",(const char *)(buffer)); + dic_sendmsg("LocalTemperature/Temp", (const char *) (buffer)); } break; case ThermAttr::OccupiedCoolingSetpoint::Id: { - int8_t coolingTemp = TempMgr().GetCoolingSetPoint(); + int8_t coolingTemp = TempMgr().GetCoolingSetPoint(); char buffer[BYTE]; itoa(coolingTemp, buffer, DECIMAL); - dic_sendmsg("OccupiedCoolingSetpoint/coolingTemp",(const char *)(buffer)); + dic_sendmsg("OccupiedCoolingSetpoint/coolingTemp", (const char *) (buffer)); } break; case ThermAttr::OccupiedHeatingSetpoint::Id: { int8_t heatingTemp = TempMgr().GetHeatingSetPoint(); char buffer[BYTE]; itoa(heatingTemp, buffer, DECIMAL); - dic_sendmsg("OccupiedHeatingSetpoint/heatingTemp", (const char *)(buffer)); + dic_sendmsg("OccupiedHeatingSetpoint/heatingTemp", (const char *) (buffer)); } break; case ThermAttr::SystemMode::Id: { int8_t mode = TempMgr().GetMode(); char buffer[BYTE]; - const char* Mode; - switch (mode){ - case 0: - Mode = "OFF"; - break; - case 1: - Mode = "HEAT&COOL"; - break; - case 3: - Mode ="COOL"; - break; - case 4: - Mode ="HEAT"; - break; - default: - Mode = "INVALID MODE"; - break; + const char * Mode; + switch (mode) + { + case 0: + Mode = "OFF"; + break; + case 1: + Mode = "HEAT&COOL"; + break; + case 3: + Mode = "COOL"; + break; + case 4: + Mode = "HEAT"; + break; + default: + Mode = "INVALID MODE"; + break; } uint16_t current_temp = TempMgr().GetCurrentTemp(); itoa(current_temp, buffer, DECIMAL); dic_sendmsg("thermostat/systemMode", Mode); - dic_sendmsg("thermostat/currentTemp", (const char *)(buffer)); + dic_sendmsg("thermostat/currentTemp", (const char *) (buffer)); } break; diff --git a/examples/thermostat/silabs/src/ZclCallbacks.cpp b/examples/thermostat/silabs/src/ZclCallbacks.cpp index 19a4f4d7978fda..06f6417cdf80a1 100644 --- a/examples/thermostat/silabs/src/ZclCallbacks.cpp +++ b/examples/thermostat/silabs/src/ZclCallbacks.cpp @@ -30,7 +30,7 @@ #ifdef DIC_ENABLE #include "AppTask.h" -#endif //DIC_ENABLE +#endif // DIC_ENABLE using namespace ::chip; using namespace ::chip::app::Clusters; diff --git a/examples/window-app/silabs/src/WindowManager.cpp b/examples/window-app/silabs/src/WindowManager.cpp index 0dbf5daf26404b..d8e010d5307418 100644 --- a/examples/window-app/silabs/src/WindowManager.cpp +++ b/examples/window-app/silabs/src/WindowManager.cpp @@ -507,22 +507,24 @@ void WindowManager::Cover::CallbackPositionSet(intptr_t arg) WindowManager::Cover::CoverWorkData * data = reinterpret_cast(arg); position.SetNonNull(data->percent100ths); - if (data->isTilt){ + if (data->isTilt) + { TiltPositionSet(data->mEndpointId, position); #ifdef DIC_ENABLE uint16_t value = data->percent100ths; char buffer[BYTE]; itoa(value, buffer, DECIMAL); - dic_sendmsg("tilt/position set", (const char *)(buffer)); + dic_sendmsg("tilt/position set", (const char *) (buffer)); #endif // DIC_ENABLE } - else{ + else + { LiftPositionSet(data->mEndpointId, position); #ifdef DIC_ENABLE uint16_t value = data->percent100ths; char buffer[BYTE]; itoa(value, buffer, DECIMAL); - dic_sendmsg("lift/position set",(const char *)(buffer)); + dic_sendmsg("lift/position set", (const char *) (buffer)); #endif // DIC_ENABLE } chip::Platform::Delete(data);