Skip to content

Commit 17e72b9

Browse files
restyled-commitsarun-silabs
authored andcommitted
Restyled by clang-format
1 parent 49a6cbb commit 17e72b9

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ class OvenManager
6868
kCookSurfaceState_NoAction,
6969
} State;
7070

71-
7271
bool InitiateAction(int32_t aActor, Action_t aAction, uint8_t * aValue, chip::EndpointId endpointId = kCookTopEndpoint);
7372
typedef void (*Callback_fn_initiated)(Action_t, int32_t aActor, uint8_t * value);
7473
typedef void (*Callback_fn_completed)(Action_t);
@@ -139,11 +138,11 @@ class OvenManager
139138
// Disallowed OvenMode Transitions.
140139
static constexpr BlockedTransition kBlockedTransitions[3] = {
141140
{ chip::to_underlying(chip::app::Clusters::TemperatureControlledCabinet::OvenModeDelegate::OvenModes::kModeGrill),
142-
chip::to_underlying(chip::app::Clusters::TemperatureControlledCabinet::OvenModeDelegate::OvenModes::kModeProofing) },
141+
chip::to_underlying(chip::app::Clusters::TemperatureControlledCabinet::OvenModeDelegate::OvenModes::kModeProofing) },
143142
{ chip::to_underlying(chip::app::Clusters::TemperatureControlledCabinet::OvenModeDelegate::OvenModes::kModeProofing),
144-
chip::to_underlying(chip::app::Clusters::TemperatureControlledCabinet::OvenModeDelegate::OvenModes::kModeClean) },
143+
chip::to_underlying(chip::app::Clusters::TemperatureControlledCabinet::OvenModeDelegate::OvenModes::kModeClean) },
145144
{ chip::to_underlying(chip::app::Clusters::TemperatureControlledCabinet::OvenModeDelegate::OvenModes::kModeClean),
146-
chip::to_underlying(chip::app::Clusters::TemperatureControlledCabinet::OvenModeDelegate::OvenModes::kModeBake) },
145+
chip::to_underlying(chip::app::Clusters::TemperatureControlledCabinet::OvenModeDelegate::OvenModes::kModeBake) },
147146
};
148147

149148
static OvenManager sOvenMgr;

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

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -173,15 +173,17 @@ void OvenManager::OnOffAttributeChangeHandler(EndpointId endpointId, AttributeId
173173
switch (endpointId)
174174
{
175175
case kCookTopEndpoint:
176-
InitiateAction(AppEvent::kEventType_CookTop, *value ? OvenManager::ON_ACTION : OvenManager::OFF_ACTION, value, kCookTopEndpoint);
176+
InitiateAction(AppEvent::kEventType_CookTop, *value ? OvenManager::ON_ACTION : OvenManager::OFF_ACTION, value,
177+
kCookTopEndpoint);
177178
// Update CookSurface states accordingly
178179
mCookSurfaceEndpoint1.SetOnOffState(*value);
179180
mCookSurfaceEndpoint2.SetOnOffState(*value);
180181
break;
181182
case kCookSurfaceEndpoint1:
182183
case kCookSurfaceEndpoint2:
183184
// Handle On/Off attribute changes for the cook surface endpoints
184-
InitiateAction(AppEvent::kEventType_CookSurface, *value ? OvenManager::ON_ACTION : OvenManager::OFF_ACTION, value, endpointId);
185+
InitiateAction(AppEvent::kEventType_CookSurface, *value ? OvenManager::ON_ACTION : OvenManager::OFF_ACTION, value,
186+
endpointId);
185187
{
186188
bool cookSurfaceEndpoint1State;
187189
bool cookSurfaceEndpoint2State;
@@ -225,17 +227,17 @@ bool OvenManager::InitiateAction(int32_t aActor, Action_t aAction, uint8_t * aVa
225227
if (endpointId == kCookTopEndpoint)
226228
{
227229
currentState = &mCookTopState;
228-
eventType = AppEvent::kEventType_CookTop;
230+
eventType = AppEvent::kEventType_CookTop;
229231
}
230232
else if (endpointId == kCookSurfaceEndpoint1)
231233
{
232234
currentState = &mCookSurfaceState1;
233-
eventType = AppEvent::kEventType_CookSurface;
235+
eventType = AppEvent::kEventType_CookSurface;
234236
}
235237
else if (endpointId == kCookSurfaceEndpoint2)
236238
{
237239
currentState = &mCookSurfaceState2;
238-
eventType = AppEvent::kEventType_CookSurface;
240+
eventType = AppEvent::kEventType_CookSurface;
239241
}
240242
else
241243
{
@@ -249,12 +251,12 @@ bool OvenManager::InitiateAction(int32_t aActor, Action_t aAction, uint8_t * aVa
249251
if (*currentState == kCookTopState_OffCompleted && aAction == ON_ACTION)
250252
{
251253
action_initiated = true;
252-
new_state = kCookTopState_OnInitiated;
254+
new_state = kCookTopState_OnInitiated;
253255
}
254256
else if (*currentState == kCookTopState_OnCompleted && aAction == OFF_ACTION)
255257
{
256258
action_initiated = true;
257-
new_state = kCookTopState_OffInitiated;
259+
new_state = kCookTopState_OffInitiated;
258260
}
259261
}
260262
else
@@ -263,12 +265,12 @@ bool OvenManager::InitiateAction(int32_t aActor, Action_t aAction, uint8_t * aVa
263265
if (*currentState == kCookSurfaceState_OffCompleted && aAction == ON_ACTION)
264266
{
265267
action_initiated = true;
266-
new_state = kCookSurfaceState_OnInitiated;
268+
new_state = kCookSurfaceState_OnInitiated;
267269
}
268270
else if (*currentState == kCookSurfaceState_OnCompleted && aAction == OFF_ACTION)
269271
{
270272
action_initiated = true;
271-
new_state = kCookSurfaceState_OffInitiated;
273+
new_state = kCookSurfaceState_OffInitiated;
272274
}
273275
}
274276

@@ -277,11 +279,11 @@ bool OvenManager::InitiateAction(int32_t aActor, Action_t aAction, uint8_t * aVa
277279
*currentState = new_state;
278280

279281
AppEvent event;
280-
event.Type = eventType;
282+
event.Type = eventType;
281283
event.OvenEvent.Context = this;
282284
event.OvenEvent.Action = aAction;
283285
event.OvenEvent.Actor = endpointId; // Store endpoint ID in Actor field
284-
event.Handler = ActuatorMovementHandler;
286+
event.Handler = ActuatorMovementHandler;
285287

286288
AppTask::GetAppTask().PostEvent(&event);
287289
}

0 commit comments

Comments
 (0)