Skip to content

Commit

Permalink
add Identify implementation example
Browse files Browse the repository at this point in the history
  • Loading branch information
tx2rx committed Jul 18, 2023
1 parent 4a8b963 commit 672ba24
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions examples/platform/asr/CHIPDeviceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include "CHIPDeviceManager.h"
#include <app/ConcreteAttributePath.h>
#include <app/clusters/identify-server/identify-server.h>
#include <app/util/basic-types.h>
#include <support/CHIPMem.h>
#include <support/CodeUtils.h>
Expand Down Expand Up @@ -74,3 +75,40 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath &
cb->PostAttributeChangeCallback(path.mEndpointId, path.mClusterId, path.mAttributeId, type, size, value);
}
}

void OnIdentifyStart(Identify *)
{
ChipLogProgress(Zcl, "OnIdentifyStart");
}

void OnIdentifyStop(Identify *)
{
ChipLogProgress(Zcl, "OnIdentifyStop");
}

void OnTriggerEffect(Identify * identify)
{
switch (identify->mCurrentEffectIdentifier)
{
case Clusters::Identify::EffectIdentifierEnum::kBlink:
ChipLogProgress(Zcl, "Clusters::Identify::EffectIdentifierEnum::kBlink");
break;
case Clusters::Identify::EffectIdentifierEnum::kBreathe:
ChipLogProgress(Zcl, "Clusters::Identify::EffectIdentifierEnum::kBreathe");
break;
case Clusters::Identify::EffectIdentifierEnum::kOkay:
ChipLogProgress(Zcl, "Clusters::Identify::EffectIdentifierEnum::kOkay");
break;
case Clusters::Identify::EffectIdentifierEnum::kChannelChange:
ChipLogProgress(Zcl, "Clusters::Identify::EffectIdentifierEnum::kChannelChange");
break;
default:
ChipLogProgress(Zcl, "No identifier effect");
return;
}
}

static Identify gIdentify1 = {
chip::EndpointId{ 1 }, OnIdentifyStart, OnIdentifyStop, Clusters::Identify::IdentifyTypeEnum::kVisibleIndicator,
OnTriggerEffect,
};

0 comments on commit 672ba24

Please sign in to comment.