Skip to content

Commit

Permalink
Restyled by clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits authored and Thirsrin committed Sep 6, 2023
1 parent cb8811e commit a9bcd58
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 28 deletions.
48 changes: 25 additions & 23 deletions examples/thermostat/silabs/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion examples/thermostat/silabs/src/ZclCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#ifdef DIC_ENABLE
#include "AppTask.h"
#endif //DIC_ENABLE
#endif // DIC_ENABLE

using namespace ::chip;
using namespace ::chip::app::Clusters;
Expand Down
10 changes: 6 additions & 4 deletions examples/window-app/silabs/src/WindowManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,22 +507,24 @@ void WindowManager::Cover::CallbackPositionSet(intptr_t arg)
WindowManager::Cover::CoverWorkData * data = reinterpret_cast<WindowManager::Cover::CoverWorkData *>(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);
Expand Down

0 comments on commit a9bcd58

Please sign in to comment.