Skip to content

Commit

Permalink
fix identify init
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimitri Mizenko committed Oct 25, 2021
1 parent d47bbd9 commit 9b76e76
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/app/clusters/identify-server/identify-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ static inline void reg(Identify * inst)
if (nullptr == instances[i])
{
instances[i] = inst;
break;
}
}
}
Expand All @@ -105,7 +106,7 @@ static inline void unreg(Identify * inst)

void emberAfIdentifyClusterServerInitCallback(EndpointId endpoint)
{
(void) endpoint;
(void) Clusters::Identify::Attributes::IdentifyType::Set(endpoint, inst(endpoint)->mIdentifyType);
}

static void onIdentifyClusterTick(chip::System::Layer * systemLayer, void * appState)
Expand Down Expand Up @@ -315,11 +316,10 @@ Identify::Identify(chip::EndpointId endpoint, onIdentifyStartCb onIdentifyStart,
EmberAfIdentifyIdentifyType identifyType, onEffectIdentifierCb onEffectIdentifier,
EmberAfIdentifyEffectIdentifier effectIdentifier, EmberAfIdentifyEffectVariant effectVariant) :
mEndpoint(endpoint),
mOnIdentifyStart(onIdentifyStart), mOnIdentifyStop(onIdentifyStop), mOnEffectIdentifier(onEffectIdentifier),
mCurrentEffectIdentifier(effectIdentifier), mTargetEffectIdentifier(effectIdentifier),
mOnIdentifyStart(onIdentifyStart), mOnIdentifyStop(onIdentifyStop), mIdentifyType(identifyType),
mOnEffectIdentifier(onEffectIdentifier), mCurrentEffectIdentifier(effectIdentifier), mTargetEffectIdentifier(effectIdentifier),
mEffectVariant(static_cast<uint8_t>(effectVariant))
{
(void) Clusters::Identify::Attributes::IdentifyType::Set(endpoint, identifyType);
reg(this);
};

Expand Down
1 change: 1 addition & 0 deletions src/app/clusters/identify-server/identify-server.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ struct Identify
chip::EndpointId mEndpoint;
onIdentifyStartCb mOnIdentifyStart = nullptr;
onIdentifyStopCb mOnIdentifyStop = nullptr;
EmberAfIdentifyIdentifyType mIdentifyType;
onEffectIdentifierCb mOnEffectIdentifier;
EmberAfIdentifyEffectIdentifier mCurrentEffectIdentifier;
EmberAfIdentifyEffectIdentifier mTargetEffectIdentifier;
Expand Down

0 comments on commit 9b76e76

Please sign in to comment.