Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[nrfconnect] Added handling Identify TriggerEffect command #19522

Merged
merged 1 commit into from
Jun 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions examples/all-clusters-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <app-common/zap-generated/attribute-id.h>
#include <app-common/zap-generated/attribute-type.h>
#include <app-common/zap-generated/cluster-id.h>
#include <app/clusters/identify-server/identify-server.h>
#include <app/util/attribute-storage.h>

#include <credentials/DeviceAttestationCredsProvider.h>
Expand Down Expand Up @@ -63,6 +64,40 @@ k_timer sFunctionTimer;

chip::DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider;

constexpr EndpointId kIdentifyEndpointId = 1;

void OnIdentifyTriggerEffect(Identify * identify)
{
ChipLogProgress(Zcl, "OnIdentifyTriggerEffect");
switch (identify->mCurrentEffectIdentifier)
{
case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BLINK:
ChipLogProgress(Zcl, "Effect: EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BLINK");
break;
case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BREATHE:
ChipLogProgress(Zcl, "Effect: EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BREATHE");
break;
case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_OKAY:
ChipLogProgress(Zcl, "Effect: EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_OKAY");
break;
case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_CHANNEL_CHANGE:
ChipLogProgress(Zcl, "Effect: EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_CHANNEL_CHANGE");
break;
default:
ChipLogProgress(Zcl, "Effect: No identifier effect");
break;
}
return;
}

Identify sIdentify = {
chip::EndpointId{ kIdentifyEndpointId },
[](Identify *) { ChipLogProgress(Zcl, "OnIdentifyStart"); },
[](Identify *) { ChipLogProgress(Zcl, "OnIdentifyStop"); },
EMBER_ZCL_IDENTIFY_IDENTIFY_TYPE_NONE,
OnIdentifyTriggerEffect,
};

} // namespace

constexpr EndpointId kNetworkCommissioningEndpointSecondary = 0xFFFE;
Expand Down