Skip to content

Commit

Permalink
Restyled by clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits authored and sreeramIfx committed Jan 30, 2023
1 parent 2b8622f commit 7306a6d
Showing 1 changed file with 26 additions and 29 deletions.
55 changes: 26 additions & 29 deletions examples/lock-app/infineon/psoc6/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ void AppTask::Init()
0);

chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, reinterpret_cast<intptr_t>(nullptr));

}

void AppTask::AppTaskMain(void * pvParameter)
Expand Down Expand Up @@ -390,45 +389,43 @@ void AppTask::LockActionEventHandler(AppEvent * event)

switch (event->Type)
{
case AppEvent::kEventType_Lock:
{
action = static_cast<LockManager::Action_t>(event->LockEvent.Action);
actor = event->LockEvent.Actor;
break;
}
case AppEvent::kEventType_Lock: {
action = static_cast<LockManager::Action_t>(event->LockEvent.Action);
actor = event->LockEvent.Actor;
break;
}

case AppEvent::kEventType_Button:
{
case AppEvent::kEventType_Button: {

P6_LOG("%s [Action: %d]", __FUNCTION__, event->ButtonEvent.Action);
P6_LOG("%s [Action: %d]", __FUNCTION__, event->ButtonEvent.Action);

if (event->ButtonEvent.Action == APP_BUTTON_LONG_PRESS)
{
P6_LOG("Sending a lock jammed event");
if (event->ButtonEvent.Action == APP_BUTTON_LONG_PRESS)
{
P6_LOG("Sending a lock jammed event");

/* Generating Door Lock Jammed event */
DoorLockServer::Instance().SendLockAlarmEvent(1 /* Endpoint Id */, AlarmCodeEnum::kLockJammed);
/* Generating Door Lock Jammed event */
DoorLockServer::Instance().SendLockAlarmEvent(1 /* Endpoint Id */, AlarmCodeEnum::kLockJammed);

return;
return;
}
else
{
if (LockMgr().NextState() == true)
{
action = LockManager::LOCK_ACTION;
}
else
{
if (LockMgr().NextState() == true)
{
action = LockManager::LOCK_ACTION;
}
else
{
action = LockManager::UNLOCK_ACTION;
}

actor = AppEvent::kEventType_Button;
action = LockManager::UNLOCK_ACTION;
}
break;

actor = AppEvent::kEventType_Button;
}
break;
}

default:
return;
default:
return;
}

if (!LockMgr().InitiateAction(actor, action))
Expand Down

0 comments on commit 7306a6d

Please sign in to comment.