Skip to content

Commit

Permalink
Feature: Add OnIdentifyTriggerEffect handler
Browse files Browse the repository at this point in the history
  • Loading branch information
shchen-Lab committed Jan 12, 2024
1 parent 866e453 commit 1c08997
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
23 changes: 23 additions & 0 deletions examples/lighting-app/bouffalolab/common/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ Identify sIdentify = {
AppTask::IdentifyStartHandler,
AppTask::IdentifyStopHandler,
Clusters::Identify::IdentifyTypeEnum::kLightOutput,
AppTask::OnIdentifyTriggerEffect,
};

} // namespace
Expand Down Expand Up @@ -429,6 +430,28 @@ void AppTask::IdentifyHandleOp(app_event_t event)
}
}

void AppTask::OnIdentifyTriggerEffect(Identify * identify)
{
switch (identify->mCurrentEffectIdentifier)
{
case Clusters::Identify::EffectIdentifierEnum::kBlink:
ChipLogProgress(NotSpecified,"Clusters::Identify::EffectIdentifierEnum::kBlink");
break;
case Clusters::Identify::EffectIdentifierEnum::kBreathe:
ChipLogProgress(NotSpecified,"Clusters::Identify::EffectIdentifierEnum::kBreathe");
break;
case Clusters::Identify::EffectIdentifierEnum::kOkay:
ChipLogProgress(NotSpecified,"Clusters::Identify::EffectIdentifierEnum::kOkay");
break;
case Clusters::Identify::EffectIdentifierEnum::kChannelChange:
ChipLogProgress(NotSpecified,"Clusters::Identify::EffectIdentifierEnum::kChannelChange");
break;
default:
ChipLogProgress(NotSpecified,"No identifier effect");
break;
}
return;
}
void AppTask::ButtonEventHandler(uint8_t btnIdx, uint8_t btnAction)
{
GetAppTask().PostEvent(APP_EVENT_FACTORY_RESET);
Expand Down
1 change: 1 addition & 0 deletions examples/lighting-app/bouffalolab/common/AppTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class AppTask
static void IdentifyStartHandler(Identify *);
static void IdentifyStopHandler(Identify *);
static void IdentifyHandleOp(app_event_t event);
static void OnIdentifyTriggerEffect(Identify * identify);

private:
friend void StartAppTask(void);
Expand Down

0 comments on commit 1c08997

Please sign in to comment.