Skip to content

Commit af4ef43

Browse files
restyled-commitsarun-silabs
authored andcommitted
Restyled by clang-format
1 parent 38cdc4f commit af4ef43

File tree

6 files changed

+34
-36
lines changed

6 files changed

+34
-36
lines changed

examples/oven-app/oven-app-common/src/CookSurfaceEndpoint.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ bool CookSurfaceEndpoint::GetOnOffState()
4141
void CookSurfaceEndpoint::SetOnOffState(bool state)
4242
{
4343
CommandId commandId = state ? OnOff::Commands::On::Id : OnOff::Commands::Off::Id;
44-
auto status = OnOffServer::Instance().setOnOffValue(mEndpointId, commandId, false);
44+
auto status = OnOffServer::Instance().setOnOffValue(mEndpointId, commandId, false);
4545
if (status != Protocols::InteractionModel::Status::Success)
4646
{
4747
ChipLogError(AppServer, "ERR: updating on/off %x", to_underlying(status));

examples/oven-app/oven-app-common/src/CookTopEndpoint.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ CHIP_ERROR CookTopEndpoint::Init()
3030
void CookTopEndpoint::SetOnOffState(bool state)
3131
{
3232
CommandId commandId = state ? OnOff::Commands::On::Id : OnOff::Commands::Off::Id;
33-
auto status = OnOffServer::Instance().setOnOffValue(mEndpointId, commandId, false);
33+
auto status = OnOffServer::Instance().setOnOffValue(mEndpointId, commandId, false);
3434
if (status == chip::Protocols::InteractionModel::Status::Success)
3535
{
3636
currentOnOffState = state;

examples/oven-app/oven-app-common/src/OvenEndpoint.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
*/
1818

1919
#include "OvenEndpoint.h"
20-
#include <app-common/zap-generated/cluster-objects.h>
2120
#include <app-common/zap-generated/attributes/Accessors.h>
21+
#include <app-common/zap-generated/cluster-objects.h>
2222

2323
#include "OvenManager.h"
2424
#include <app/clusters/mode-base-server/mode-base-cluster-objects.h>
@@ -95,8 +95,8 @@ CHIP_ERROR OvenModeDelegate::Init()
9595

9696
void OvenModeDelegate::HandleChangeToMode(uint8_t NewMode, ModeBase::Commands::ChangeToModeResponse::Type & response)
9797
{
98-
ChipLogProgress(Zcl, "OvenModeDelegate forwarding mode change to OvenManager (ep=%u newMode=%u)", mEndpointId, NewMode);
99-
OvenManager::GetInstance().ProcessOvenModeChange(mEndpointId, NewMode, response);
98+
ChipLogProgress(Zcl, "OvenModeDelegate forwarding mode change to OvenManager (ep=%u newMode=%u)", mEndpointId, NewMode);
99+
OvenManager::GetInstance().ProcessOvenModeChange(mEndpointId, NewMode, response);
100100
}
101101

102102
CHIP_ERROR OvenModeDelegate::GetModeLabelByIndex(uint8_t modeIndex, MutableCharSpan & label)
@@ -154,12 +154,12 @@ CHIP_ERROR OvenEndpoint::Init()
154154

155155
bool OvenModeDelegate::IsSupportedMode(uint8_t mode)
156156
{
157-
for (auto const & opt : skModeOptions)
158-
{
159-
if (opt.mode == mode)
157+
for (auto const & opt : skModeOptions)
160158
{
161-
return true;
159+
if (opt.mode == mode)
160+
{
161+
return true;
162+
}
162163
}
163-
}
164-
return false;
164+
return false;
165165
}

examples/oven-app/silabs/include/OvenManager.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@
2727
#pragma once
2828

2929
#include "AppSupportedTemperatureLevelsDelegate.h"
30-
#include "OvenEndpoint.h"
31-
#include "CookTopEndpoint.h"
3230
#include "CookSurfaceEndpoint.h"
31+
#include "CookTopEndpoint.h"
32+
#include "OvenEndpoint.h"
3333

3434
#include "AppEvent.h"
3535

3636
#include <app-common/zap-generated/ids/Attributes.h>
37-
#include <app/clusters/on-off-server/on-off-server.h>
3837
#include <app/clusters/mode-base-server/mode-base-cluster-objects.h>
38+
#include <app/clusters/on-off-server/on-off-server.h>
3939
#include <lib/core/DataModelTypes.h>
4040

4141
class OvenManager

examples/oven-app/silabs/src/DataModelCallbacks.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ void MatterPostAttributeChangeCallback(const app::ConcreteAttributePath & attrib
4646
ChipLogValueMEI(attributeId), type, *value, size);
4747
break;
4848
case app::Clusters::OnOff::Id:
49-
ChipLogProgress(Zcl, "OnOff cluster ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u",
50-
ChipLogValueMEI(attributeId), type, *value, size);
49+
ChipLogProgress(Zcl, "OnOff cluster ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", ChipLogValueMEI(attributeId),
50+
type, *value, size);
5151
OvenManager::GetInstance().OnOffAttributeChangeHandler(attributePath.mEndpointId, attributeId, value, size);
5252
break;
5353
case app::Clusters::TemperatureControl::Id:

examples/oven-app/silabs/src/OvenManager.cpp

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
#include "CookTopEndpoint.h"
2222
#include "OvenEndpoint.h"
2323

24-
#include <app-common/zap-generated/cluster-objects.h>
2524
#include <app-common/zap-generated/attributes/Accessors.h>
25+
#include <app-common/zap-generated/cluster-objects.h>
2626
#include <app/clusters/mode-base-server/mode-base-cluster-objects.h>
2727

2828
#include "AppConfig.h"
@@ -51,20 +51,17 @@ void OvenManager::Init()
5151

5252
// Initialize TemperatureControl cluster numeric temperature attributes for endpoint 2 (silent on failure)
5353
{
54-
Status tcStatus = TemperatureControl::Attributes::TemperatureSetpoint::Set(kTemperatureControlledCabinetEndpoint2, 0);
55-
VerifyOrReturn(tcStatus == Status::Success,
56-
ChipLogError(AppServer, "Endpoint2 TemperatureSetpoint init failed"));
54+
Status tcStatus = TemperatureControl::Attributes::TemperatureSetpoint::Set(kTemperatureControlledCabinetEndpoint2, 0);
55+
VerifyOrReturn(tcStatus == Status::Success, ChipLogError(AppServer, "Endpoint2 TemperatureSetpoint init failed"));
5756

58-
tcStatus = TemperatureControl::Attributes::MinTemperature::Set(kTemperatureControlledCabinetEndpoint2, 0);
59-
VerifyOrReturn(tcStatus == Status::Success,
60-
ChipLogError(AppServer, "Endpoint2 MinTemperature init failed"));
57+
tcStatus = TemperatureControl::Attributes::MinTemperature::Set(kTemperatureControlledCabinetEndpoint2, 0);
58+
VerifyOrReturn(tcStatus == Status::Success, ChipLogError(AppServer, "Endpoint2 MinTemperature init failed"));
6159

62-
tcStatus = TemperatureControl::Attributes::MaxTemperature::Set(kTemperatureControlledCabinetEndpoint2, 30000);
63-
VerifyOrReturn(tcStatus == Status::Success,
64-
ChipLogError(AppServer, "Endpoint2 MaxTemperature init failed"));
60+
tcStatus = TemperatureControl::Attributes::MaxTemperature::Set(kTemperatureControlledCabinetEndpoint2, 30000);
61+
VerifyOrReturn(tcStatus == Status::Success, ChipLogError(AppServer, "Endpoint2 MaxTemperature init failed"));
6562

66-
tcStatus = TemperatureControl::Attributes::Step::Set(kTemperatureControlledCabinetEndpoint2, 500);
67-
VerifyOrReturn(tcStatus == Status::Success, ChipLogError(AppServer, "Endpoint2 Step init failed"));
63+
tcStatus = TemperatureControl::Attributes::Step::Set(kTemperatureControlledCabinetEndpoint2, 500);
64+
VerifyOrReturn(tcStatus == Status::Success, ChipLogError(AppServer, "Endpoint2 Step init failed"));
6865
}
6966

7067
// Register the shared TemperatureLevelsDelegate for all the cooksurface endpoints
@@ -140,10 +137,11 @@ void OvenManager::OnOffAttributeChangeHandler(EndpointId endpointId, AttributeId
140137
return;
141138
}
142139

143-
void OvenManager::OvenModeAttributeChangeHandler(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value, uint16_t size)
140+
void OvenManager::OvenModeAttributeChangeHandler(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value,
141+
uint16_t size)
144142
{
145143
VerifyOrReturn(endpointId == kTemperatureControlledCabinetEndpoint2,
146-
ChipLogError(AppServer, "Command received over Unsupported Endpoint"));
144+
ChipLogError(AppServer, "Command received over Unsupported Endpoint"));
147145
// TODO: Update the LCD with the new Oven Mode
148146
return;
149147
}
@@ -176,9 +174,9 @@ bool OvenManager::InitiateAction(int32_t aActor, Action_t aAction, uint8_t * aVa
176174
mState = new_state;
177175

178176
AppEvent event;
179-
event.Type = AppEvent::kEventType_Oven;
180-
event.OvenEvent.Context = this;
181-
event.Handler = ActuatorMovementHandler;
177+
event.Type = AppEvent::kEventType_Oven;
178+
event.OvenEvent.Context = this;
179+
event.Handler = ActuatorMovementHandler;
182180
AppTask::GetAppTask().PostEvent(&event);
183181
}
184182

@@ -262,10 +260,10 @@ void OvenManager::ProcessOvenModeChange(chip::EndpointId endpointId, uint8_t new
262260

263261
// Read Current Oven Mode
264262
uint8_t currentMode;
265-
Status attrStatus = OvenMode::Attributes::CurrentMode::Get(endpointId, &currentMode);
263+
Status attrStatus = OvenMode::Attributes::CurrentMode::Get(endpointId, &currentMode);
266264
if (attrStatus != Status::Success)
267265
{
268-
ChipLogError(AppServer, "OvenManager: Failed to read CurrentMode");
266+
ChipLogError(AppServer, "OvenManager: Failed to read CurrentMode");
269267
response.status = to_underlying(ModeBase::StatusCode::kGenericFailure);
270268
response.statusText.SetValue(CharSpan::fromCharString("Read CurrentMode failed"));
271269
return;
@@ -291,7 +289,7 @@ void OvenManager::ProcessOvenModeChange(chip::EndpointId endpointId, uint8_t new
291289
Status writeStatus = OvenMode::Attributes::CurrentMode::Set(endpointId, newMode);
292290
if (writeStatus != Status::Success)
293291
{
294-
ChipLogError(AppServer, "OvenManager: Failed to write CurrentMode");
292+
ChipLogError(AppServer, "OvenManager: Failed to write CurrentMode");
295293
response.status = to_underlying(ModeBase::StatusCode::kGenericFailure);
296294
response.statusText.SetValue(CharSpan::fromCharString("Write CurrentMode failed"));
297295
return;

0 commit comments

Comments
 (0)