Skip to content

Commit 83372e0

Browse files
restyled-commitsarun-silabs
authored andcommitted
Restyled by clang-format
1 parent 7f2085b commit 83372e0

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

153153
bool OvenModeDelegate::IsSupportedMode(uint8_t mode)
154154
{
155-
for (auto const & opt : skModeOptions)
156-
{
157-
if (opt.mode == mode)
155+
for (auto const & opt : skModeOptions)
158156
{
159-
return true;
157+
if (opt.mode == mode)
158+
{
159+
return true;
160+
}
160161
}
161-
}
162-
return false;
162+
return false;
163163
}

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

5656
// Initialize TemperatureControl cluster numeric temperature attributes for endpoint 2 (silent on failure)
5757
{
58-
Status tcStatus = TemperatureControl::Attributes::TemperatureSetpoint::Set(kTemperatureControlledCabinetEndpoint2, 0);
59-
VerifyOrReturn(tcStatus == Status::Success,
60-
ChipLogError(AppServer, "Endpoint2 TemperatureSetpoint init failed"));
58+
Status tcStatus = TemperatureControl::Attributes::TemperatureSetpoint::Set(kTemperatureControlledCabinetEndpoint2, 0);
59+
VerifyOrReturn(tcStatus == Status::Success, ChipLogError(AppServer, "Endpoint2 TemperatureSetpoint init failed"));
6160

62-
tcStatus = TemperatureControl::Attributes::MinTemperature::Set(kTemperatureControlledCabinetEndpoint2, 0);
63-
VerifyOrReturn(tcStatus == Status::Success,
64-
ChipLogError(AppServer, "Endpoint2 MinTemperature init failed"));
61+
tcStatus = TemperatureControl::Attributes::MinTemperature::Set(kTemperatureControlledCabinetEndpoint2, 0);
62+
VerifyOrReturn(tcStatus == Status::Success, ChipLogError(AppServer, "Endpoint2 MinTemperature init failed"));
6563

66-
tcStatus = TemperatureControl::Attributes::MaxTemperature::Set(kTemperatureControlledCabinetEndpoint2, 30000);
67-
VerifyOrReturn(tcStatus == Status::Success,
68-
ChipLogError(AppServer, "Endpoint2 MaxTemperature init failed"));
64+
tcStatus = TemperatureControl::Attributes::MaxTemperature::Set(kTemperatureControlledCabinetEndpoint2, 30000);
65+
VerifyOrReturn(tcStatus == Status::Success, ChipLogError(AppServer, "Endpoint2 MaxTemperature init failed"));
6966

70-
tcStatus = TemperatureControl::Attributes::Step::Set(kTemperatureControlledCabinetEndpoint2, 500);
71-
VerifyOrReturn(tcStatus == Status::Success, ChipLogError(AppServer, "Endpoint2 Step init failed"));
67+
tcStatus = TemperatureControl::Attributes::Step::Set(kTemperatureControlledCabinetEndpoint2, 500);
68+
VerifyOrReturn(tcStatus == Status::Success, ChipLogError(AppServer, "Endpoint2 Step init failed"));
7269
}
7370

7471
// Register the shared TemperatureLevelsDelegate for all the cooksurface endpoints
@@ -175,10 +172,11 @@ void OvenManager::OnOffAttributeChangeHandler(EndpointId endpointId, AttributeId
175172
return;
176173
}
177174

178-
void OvenManager::OvenModeAttributeChangeHandler(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value, uint16_t size)
175+
void OvenManager::OvenModeAttributeChangeHandler(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value,
176+
uint16_t size)
179177
{
180178
VerifyOrReturn(endpointId == kTemperatureControlledCabinetEndpoint2,
181-
ChipLogError(AppServer, "Command received over Unsupported Endpoint"));
179+
ChipLogError(AppServer, "Command received over Unsupported Endpoint"));
182180
// TODO: Update the LCD with the new Oven Mode
183181
return;
184182
}
@@ -211,9 +209,9 @@ bool OvenManager::InitiateAction(int32_t aActor, Action_t aAction, uint8_t * aVa
211209
mState = new_state;
212210

213211
AppEvent event;
214-
event.Type = AppEvent::kEventType_Oven;
215-
event.OvenEvent.Context = this;
216-
event.Handler = ActuatorMovementHandler;
212+
event.Type = AppEvent::kEventType_Oven;
213+
event.OvenEvent.Context = this;
214+
event.Handler = ActuatorMovementHandler;
217215
AppTask::GetAppTask().PostEvent(&event);
218216
}
219217

@@ -297,10 +295,10 @@ void OvenManager::ProcessOvenModeChange(chip::EndpointId endpointId, uint8_t new
297295

298296
// Read Current Oven Mode
299297
uint8_t currentMode;
300-
Status attrStatus = OvenMode::Attributes::CurrentMode::Get(endpointId, &currentMode);
298+
Status attrStatus = OvenMode::Attributes::CurrentMode::Get(endpointId, &currentMode);
301299
if (attrStatus != Status::Success)
302300
{
303-
ChipLogError(AppServer, "OvenManager: Failed to read CurrentMode");
301+
ChipLogError(AppServer, "OvenManager: Failed to read CurrentMode");
304302
response.status = to_underlying(ModeBase::StatusCode::kGenericFailure);
305303
response.statusText.SetValue(CharSpan::fromCharString("Read CurrentMode failed"));
306304
return;
@@ -326,7 +324,7 @@ void OvenManager::ProcessOvenModeChange(chip::EndpointId endpointId, uint8_t new
326324
Status writeStatus = OvenMode::Attributes::CurrentMode::Set(endpointId, newMode);
327325
if (writeStatus != Status::Success)
328326
{
329-
ChipLogError(AppServer, "OvenManager: Failed to write CurrentMode");
327+
ChipLogError(AppServer, "OvenManager: Failed to write CurrentMode");
330328
response.status = to_underlying(ModeBase::StatusCode::kGenericFailure);
331329
response.statusText.SetValue(CharSpan::fromCharString("Write CurrentMode failed"));
332330
return;

0 commit comments

Comments
 (0)