Skip to content

Commit

Permalink
[examples] Use correct endpoints for lock and lighting clusters (#7128)
Browse files Browse the repository at this point in the history
The commissioners assume that device clusters involved in
the commissioning process are on endpoint 0. On the other
hand, application clusters like OnOff or LevelControl should
be on other endpoints. Lock and lighting examples don't meet
these requirements. In particular, it's impossible to
commision the lock-app into a network using standard
commissioners.
  • Loading branch information
Damian-Nordic authored May 27, 2021
1 parent c8f286f commit 575dc2d
Show file tree
Hide file tree
Showing 10 changed files with 3,545 additions and 200 deletions.
2 changes: 1 addition & 1 deletion examples/lighting-app/efr32/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ void AppTask::UpdateClusterState(void)
uint8_t newValue = LightMgr().IsLightOn();

// write the new on/off value
EmberAfStatus status = emberAfWriteAttribute(0, ZCL_ON_OFF_CLUSTER_ID, ZCL_ON_OFF_ATTRIBUTE_ID, CLUSTER_MASK_SERVER,
EmberAfStatus status = emberAfWriteAttribute(1, ZCL_ON_OFF_CLUSTER_ID, ZCL_ON_OFF_ATTRIBUTE_ID, CLUSTER_MASK_SERVER,
(uint8_t *) &newValue, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
if (status != EMBER_ZCL_STATUS_SUCCESS)
{
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/k32w/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ void AppTask::UpdateClusterState(void)
uint8_t newValue = !LightingMgr().IsTurnedOff();

// write the new on/off value
EmberAfStatus status = emberAfWriteAttribute(0, ZCL_ON_OFF_CLUSTER_ID, ZCL_ON_OFF_ATTRIBUTE_ID, CLUSTER_MASK_SERVER,
EmberAfStatus status = emberAfWriteAttribute(1, ZCL_ON_OFF_CLUSTER_ID, ZCL_ON_OFF_ATTRIBUTE_ID, CLUSTER_MASK_SERVER,
(uint8_t *) &newValue, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
if (status != EMBER_ZCL_STATUS_SUCCESS)
{
Expand Down
4 changes: 2 additions & 2 deletions examples/lighting-app/lighting-common/gen/af-gen-event.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
void emberAfLevelControlClusterServerTickCallbackWrapperFunction1(void) \
{ \
clusterTickWrapper(&emberAfLevelControlClusterServerTickCallbackControl1, emberAfLevelControlClusterServerTickCallback, \
0); \
1); \
}

// EmberEventData structs used to populate the EmberEventData table
Expand All @@ -67,6 +67,6 @@

// EmberAfEventContext structs used to populate the EmberAfEventContext table
#define EMBER_AF_GENERATED_EVENT_CONTEXT \
{ 0x0, 0x8, false, EMBER_AF_LONG_POLL, EMBER_AF_OK_TO_SLEEP, &emberAfLevelControlClusterServerTickCallbackControl1 },
{ 0x1, 0x8, false, EMBER_AF_LONG_POLL, EMBER_AF_OK_TO_SLEEP, &emberAfLevelControlClusterServerTickCallbackControl1 },

#endif // __AF_GEN_EVENT__
151 changes: 71 additions & 80 deletions examples/lighting-app/lighting-common/gen/endpoint_config.h

Large diffs are not rendered by default.

Loading

0 comments on commit 575dc2d

Please sign in to comment.