Skip to content

Commit 6613eea

Browse files
restyled-commitsarun-silabs
authored andcommitted
Restyled by clang-format
1 parent f4a5bf4 commit 6613eea

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)
@@ -140,12 +140,12 @@ CHIP_ERROR OvenEndpoint::Init()
140140

141141
bool OvenModeDelegate::IsSupportedMode(uint8_t mode)
142142
{
143-
for (auto const & opt : skModeOptions)
144-
{
145-
if (opt.mode == mode)
143+
for (auto const & opt : skModeOptions)
146144
{
147-
return true;
145+
if (opt.mode == mode)
146+
{
147+
return true;
148+
}
148149
}
149-
}
150-
return false;
150+
return false;
151151
}

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

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

3030
#include "AppSupportedTemperatureLevelsDelegate.h"
31-
#include "OvenEndpoint.h"
32-
#include "CookTopEndpoint.h"
3331
#include "CookSurfaceEndpoint.h"
32+
#include "CookTopEndpoint.h"
33+
#include "OvenEndpoint.h"
3434

3535
#include "AppEvent.h"
3636

3737
#include <app-common/zap-generated/ids/Attributes.h>
38-
#include <app/clusters/on-off-server/on-off-server.h>
3938
#include <app/clusters/mode-base-server/mode-base-cluster-objects.h>
39+
#include <app/clusters/on-off-server/on-off-server.h>
4040
#include <lib/core/DataModelTypes.h>
4141

4242
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"
@@ -59,20 +59,17 @@ void OvenManager::Init()
5959

6060
// Initialize TemperatureControl cluster numeric temperature attributes for endpoint 2 (silent on failure)
6161
{
62-
Status tcStatus = TemperatureControl::Attributes::TemperatureSetpoint::Set(kTemperatureControlledCabinetEndpoint2, 0);
63-
VerifyOrReturn(tcStatus == Status::Success,
64-
ChipLogError(AppServer, "Endpoint2 TemperatureSetpoint init failed"));
62+
Status tcStatus = TemperatureControl::Attributes::TemperatureSetpoint::Set(kTemperatureControlledCabinetEndpoint2, 0);
63+
VerifyOrReturn(tcStatus == Status::Success, ChipLogError(AppServer, "Endpoint2 TemperatureSetpoint init failed"));
6564

66-
tcStatus = TemperatureControl::Attributes::MinTemperature::Set(kTemperatureControlledCabinetEndpoint2, 0);
67-
VerifyOrReturn(tcStatus == Status::Success,
68-
ChipLogError(AppServer, "Endpoint2 MinTemperature init failed"));
65+
tcStatus = TemperatureControl::Attributes::MinTemperature::Set(kTemperatureControlledCabinetEndpoint2, 0);
66+
VerifyOrReturn(tcStatus == Status::Success, ChipLogError(AppServer, "Endpoint2 MinTemperature init failed"));
6967

70-
tcStatus = TemperatureControl::Attributes::MaxTemperature::Set(kTemperatureControlledCabinetEndpoint2, 30000);
71-
VerifyOrReturn(tcStatus == Status::Success,
72-
ChipLogError(AppServer, "Endpoint2 MaxTemperature init failed"));
68+
tcStatus = TemperatureControl::Attributes::MaxTemperature::Set(kTemperatureControlledCabinetEndpoint2, 30000);
69+
VerifyOrReturn(tcStatus == Status::Success, ChipLogError(AppServer, "Endpoint2 MaxTemperature init failed"));
7370

74-
tcStatus = TemperatureControl::Attributes::Step::Set(kTemperatureControlledCabinetEndpoint2, 500);
75-
VerifyOrReturn(tcStatus == Status::Success, ChipLogError(AppServer, "Endpoint2 Step init failed"));
71+
tcStatus = TemperatureControl::Attributes::Step::Set(kTemperatureControlledCabinetEndpoint2, 500);
72+
VerifyOrReturn(tcStatus == Status::Success, ChipLogError(AppServer, "Endpoint2 Step init failed"));
7673
}
7774

7875
// Register the shared TemperatureLevelsDelegate for all the cooksurface endpoints
@@ -181,10 +178,11 @@ void OvenManager::OnOffAttributeChangeHandler(EndpointId endpointId, AttributeId
181178
return;
182179
}
183180

184-
void OvenManager::OvenModeAttributeChangeHandler(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value, uint16_t size)
181+
void OvenManager::OvenModeAttributeChangeHandler(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value,
182+
uint16_t size)
185183
{
186184
VerifyOrReturn(endpointId == kTemperatureControlledCabinetEndpoint2,
187-
ChipLogError(AppServer, "Command received over Unsupported Endpoint"));
185+
ChipLogError(AppServer, "Command received over Unsupported Endpoint"));
188186
// TODO: Update the LCD with the new Oven Mode
189187
return;
190188
}
@@ -217,9 +215,9 @@ bool OvenManager::InitiateAction(int32_t aActor, Action_t aAction, uint8_t * aVa
217215
mState = new_state;
218216

219217
AppEvent event;
220-
event.Type = AppEvent::kEventType_Oven;
221-
event.OvenEvent.Context = this;
222-
event.Handler = ActuatorMovementHandler;
218+
event.Type = AppEvent::kEventType_Oven;
219+
event.OvenEvent.Context = this;
220+
event.Handler = ActuatorMovementHandler;
223221
AppTask::GetAppTask().PostEvent(&event);
224222
}
225223

@@ -303,10 +301,10 @@ void OvenManager::ProcessOvenModeChange(chip::EndpointId endpointId, uint8_t new
303301

304302
// Read Current Oven Mode
305303
uint8_t currentMode;
306-
Status attrStatus = OvenMode::Attributes::CurrentMode::Get(endpointId, &currentMode);
304+
Status attrStatus = OvenMode::Attributes::CurrentMode::Get(endpointId, &currentMode);
307305
if (attrStatus != Status::Success)
308306
{
309-
ChipLogError(AppServer, "OvenManager: Failed to read CurrentMode");
307+
ChipLogError(AppServer, "OvenManager: Failed to read CurrentMode");
310308
response.status = to_underlying(ModeBase::StatusCode::kGenericFailure);
311309
response.statusText.SetValue(CharSpan::fromCharString("Read CurrentMode failed"));
312310
return;
@@ -332,7 +330,7 @@ void OvenManager::ProcessOvenModeChange(chip::EndpointId endpointId, uint8_t new
332330
Status writeStatus = OvenMode::Attributes::CurrentMode::Set(endpointId, newMode);
333331
if (writeStatus != Status::Success)
334332
{
335-
ChipLogError(AppServer, "OvenManager: Failed to write CurrentMode");
333+
ChipLogError(AppServer, "OvenManager: Failed to write CurrentMode");
336334
response.status = to_underlying(ModeBase::StatusCode::kGenericFailure);
337335
response.statusText.SetValue(CharSpan::fromCharString("Write CurrentMode failed"));
338336
return;

0 commit comments

Comments
 (0)