Skip to content

Commit 2014ada

Browse files
restyled-commitsarun-silabs
authored andcommitted
Restyled by clang-format
1 parent d455593 commit 2014ada

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
@@ -67,7 +67,6 @@ class OvenManager
6767
kCookSurfaceState_NoAction,
6868
} State;
6969

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

148147
static OvenManager sOvenMgr;

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

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,17 @@ void OvenManager::OnOffAttributeChangeHandler(EndpointId endpointId, AttributeId
153153
switch (endpointId)
154154
{
155155
case kCookTopEndpoint:
156-
InitiateAction(AppEvent::kEventType_CookTop, *value ? OvenManager::ON_ACTION : OvenManager::OFF_ACTION, value, kCookTopEndpoint);
156+
InitiateAction(AppEvent::kEventType_CookTop, *value ? OvenManager::ON_ACTION : OvenManager::OFF_ACTION, value,
157+
kCookTopEndpoint);
157158
// Update CookSurface states accordingly
158159
mCookSurfaceEndpoint1.SetOnOffState(*value);
159160
mCookSurfaceEndpoint2.SetOnOffState(*value);
160161
break;
161162
case kCookSurfaceEndpoint1:
162163
case kCookSurfaceEndpoint2:
163164
// Handle On/Off attribute changes for the cook surface endpoints
164-
InitiateAction(AppEvent::kEventType_CookSurface, *value ? OvenManager::ON_ACTION : OvenManager::OFF_ACTION, value, endpointId);
165+
InitiateAction(AppEvent::kEventType_CookSurface, *value ? OvenManager::ON_ACTION : OvenManager::OFF_ACTION, value,
166+
endpointId);
165167
{
166168
bool cookSurfaceEndpoint1State;
167169
bool cookSurfaceEndpoint2State;
@@ -205,17 +207,17 @@ bool OvenManager::InitiateAction(int32_t aActor, Action_t aAction, uint8_t * aVa
205207
if (endpointId == kCookTopEndpoint)
206208
{
207209
currentState = &mCookTopState;
208-
eventType = AppEvent::kEventType_CookTop;
210+
eventType = AppEvent::kEventType_CookTop;
209211
}
210212
else if (endpointId == kCookSurfaceEndpoint1)
211213
{
212214
currentState = &mCookSurfaceState1;
213-
eventType = AppEvent::kEventType_CookSurface;
215+
eventType = AppEvent::kEventType_CookSurface;
214216
}
215217
else if (endpointId == kCookSurfaceEndpoint2)
216218
{
217219
currentState = &mCookSurfaceState2;
218-
eventType = AppEvent::kEventType_CookSurface;
220+
eventType = AppEvent::kEventType_CookSurface;
219221
}
220222
else
221223
{
@@ -229,12 +231,12 @@ bool OvenManager::InitiateAction(int32_t aActor, Action_t aAction, uint8_t * aVa
229231
if (*currentState == kCookTopState_OffCompleted && aAction == ON_ACTION)
230232
{
231233
action_initiated = true;
232-
new_state = kCookTopState_OnInitiated;
234+
new_state = kCookTopState_OnInitiated;
233235
}
234236
else if (*currentState == kCookTopState_OnCompleted && aAction == OFF_ACTION)
235237
{
236238
action_initiated = true;
237-
new_state = kCookTopState_OffInitiated;
239+
new_state = kCookTopState_OffInitiated;
238240
}
239241
}
240242
else
@@ -243,12 +245,12 @@ bool OvenManager::InitiateAction(int32_t aActor, Action_t aAction, uint8_t * aVa
243245
if (*currentState == kCookSurfaceState_OffCompleted && aAction == ON_ACTION)
244246
{
245247
action_initiated = true;
246-
new_state = kCookSurfaceState_OnInitiated;
248+
new_state = kCookSurfaceState_OnInitiated;
247249
}
248250
else if (*currentState == kCookSurfaceState_OnCompleted && aAction == OFF_ACTION)
249251
{
250252
action_initiated = true;
251-
new_state = kCookSurfaceState_OffInitiated;
253+
new_state = kCookSurfaceState_OffInitiated;
252254
}
253255
}
254256

@@ -257,11 +259,11 @@ bool OvenManager::InitiateAction(int32_t aActor, Action_t aAction, uint8_t * aVa
257259
*currentState = new_state;
258260

259261
AppEvent event;
260-
event.Type = eventType;
262+
event.Type = eventType;
261263
event.OvenEvent.Context = this;
262264
event.OvenEvent.Action = aAction;
263265
event.OvenEvent.Actor = endpointId; // Store endpoint ID in Actor field
264-
event.Handler = ActuatorMovementHandler;
266+
event.Handler = ActuatorMovementHandler;
265267

266268
AppTask::GetAppTask().PostEvent(&event);
267269
}

0 commit comments

Comments
 (0)