Skip to content

Commit

Permalink
Add group feature map support (project-chip#20458)
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 authored Jul 9, 2022
1 parent 4dd048f commit f241dd2
Show file tree
Hide file tree
Showing 29 changed files with 144 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ server cluster Identify = 3 {
}

server cluster Groups = 4 {
bitmap GroupClusterFeature : BITMAP32 {
kGroupNames = 0x1;
}

readonly attribute bitmap8 nameSupport = 0;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ server cluster Identify = 3 {
}

server cluster Groups = 4 {
bitmap GroupClusterFeature : BITMAP32 {
kGroupNames = 0x1;
}

readonly attribute bitmap8 nameSupport = 0;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ server cluster Identify = 3 {
}

server cluster Groups = 4 {
bitmap GroupClusterFeature : BITMAP32 {
kGroupNames = 0x1;
}

readonly attribute bitmap8 nameSupport = 0;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ server cluster Identify = 3 {
}

server cluster Groups = 4 {
bitmap GroupClusterFeature : BITMAP32 {
kGroupNames = 0x1;
}

readonly attribute bitmap8 nameSupport = 0;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand Down
8 changes: 8 additions & 0 deletions examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ server cluster Identify = 3 {
}

client cluster Groups = 4 {
bitmap GroupClusterFeature : BITMAP32 {
kGroupNames = 0x1;
}

readonly attribute bitmap8 nameSupport = 0;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand All @@ -54,6 +58,10 @@ client cluster Groups = 4 {
}

server cluster Groups = 4 {
bitmap GroupClusterFeature : BITMAP32 {
kGroupNames = 0x1;
}

readonly attribute bitmap8 nameSupport = 0;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ server cluster Identify = 3 {
}

server cluster Groups = 4 {
bitmap GroupClusterFeature : BITMAP32 {
kGroupNames = 0x1;
}

readonly attribute bitmap8 nameSupport = 0;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ server cluster Identify = 3 {
}

client cluster Groups = 4 {
bitmap GroupClusterFeature : BITMAP32 {
kGroupNames = 0x1;
}

readonly attribute bitmap8 nameSupport = 0;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand All @@ -54,6 +58,10 @@ client cluster Groups = 4 {
}

server cluster Groups = 4 {
bitmap GroupClusterFeature : BITMAP32 {
kGroupNames = 0x1;
}

readonly attribute bitmap8 nameSupport = 0;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ server cluster Identify = 3 {
}

client cluster Groups = 4 {
bitmap GroupClusterFeature : BITMAP32 {
kGroupNames = 0x1;
}

readonly attribute bitmap8 nameSupport = 0;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand All @@ -54,6 +58,10 @@ client cluster Groups = 4 {
}

server cluster Groups = 4 {
bitmap GroupClusterFeature : BITMAP32 {
kGroupNames = 0x1;
}

readonly attribute bitmap8 nameSupport = 0;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ server cluster Identify = 3 {
}

server cluster Groups = 4 {
bitmap GroupClusterFeature : BITMAP32 {
kGroupNames = 0x1;
}

readonly attribute bitmap8 nameSupport = 0;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ server cluster Identify = 3 {
}

server cluster Groups = 4 {
bitmap GroupClusterFeature : BITMAP32 {
kGroupNames = 0x1;
}

readonly attribute bitmap8 nameSupport = 0;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ server cluster Identify = 3 {
}

client cluster Groups = 4 {
bitmap GroupClusterFeature : BITMAP32 {
kGroupNames = 0x1;
}

readonly attribute bitmap8 nameSupport = 0;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand All @@ -54,6 +58,10 @@ client cluster Groups = 4 {
}

server cluster Groups = 4 {
bitmap GroupClusterFeature : BITMAP32 {
kGroupNames = 0x1;
}

readonly attribute bitmap8 nameSupport = 0;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand Down
4 changes: 4 additions & 0 deletions examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ server cluster Identify = 3 {
}

server cluster Groups = 4 {
bitmap GroupClusterFeature : BITMAP32 {
kGroupNames = 0x1;
}

readonly attribute bitmap8 nameSupport = 0;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ server cluster Identify = 3 {
}

client cluster Groups = 4 {
bitmap GroupClusterFeature : BITMAP32 {
kGroupNames = 0x1;
}

readonly attribute bitmap8 nameSupport = 0;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand All @@ -54,6 +58,10 @@ client cluster Groups = 4 {
}

server cluster Groups = 4 {
bitmap GroupClusterFeature : BITMAP32 {
kGroupNames = 0x1;
}

readonly attribute bitmap8 nameSupport = 0;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand Down
4 changes: 4 additions & 0 deletions examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ server cluster Identify = 3 {
}

server cluster Groups = 4 {
bitmap GroupClusterFeature : BITMAP32 {
kGroupNames = 0x1;
}

readonly attribute bitmap8 nameSupport = 0;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ server cluster Identify = 3 {
}

server cluster Groups = 4 {
bitmap GroupClusterFeature : BITMAP32 {
kGroupNames = 0x1;
}

readonly attribute bitmap8 nameSupport = 0;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ server cluster Identify = 3 {
}

server cluster Groups = 4 {
bitmap GroupClusterFeature : BITMAP32 {
kGroupNames = 0x1;
}

readonly attribute bitmap8 nameSupport = 0;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;
Expand Down
4 changes: 4 additions & 0 deletions examples/lighting-app/lighting-common/lighting-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ server cluster Identify = 3 {
}

server cluster Groups = 4 {
bitmap GroupClusterFeature : BITMAP32 {
kGroupNames = 0x1;
}

readonly attribute bitmap8 nameSupport = 0;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;
Expand Down
4 changes: 4 additions & 0 deletions examples/lock-app/lock-common/lock-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ server cluster Identify = 3 {
}

server cluster Groups = 4 {
bitmap GroupClusterFeature : BITMAP32 {
kGroupNames = 0x1;
}

readonly attribute bitmap8 nameSupport = 0;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;
Expand Down
4 changes: 4 additions & 0 deletions examples/placeholder/linux/apps/app1/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ server cluster Identify = 3 {
}

server cluster Groups = 4 {
bitmap GroupClusterFeature : BITMAP32 {
kGroupNames = 0x1;
}

readonly attribute bitmap8 nameSupport = 0;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;
Expand Down
4 changes: 4 additions & 0 deletions examples/placeholder/linux/apps/app2/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ server cluster Identify = 3 {
}

server cluster Groups = 4 {
bitmap GroupClusterFeature : BITMAP32 {
kGroupNames = 0x1;
}

readonly attribute bitmap8 nameSupport = 0;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;
Expand Down
4 changes: 4 additions & 0 deletions examples/thermostat/thermostat-common/thermostat.matter
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ server cluster Identify = 3 {
}

server cluster Groups = 4 {
bitmap GroupClusterFeature : BITMAP32 {
kGroupNames = 0x1;
}

readonly attribute bitmap8 nameSupport = 0;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ server cluster Identify = 3 {
}

server cluster Groups = 4 {
bitmap GroupClusterFeature : BITMAP32 {
kGroupNames = 0x1;
}

readonly attribute bitmap8 nameSupport = 0;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;
Expand Down
4 changes: 4 additions & 0 deletions examples/window-app/common/window-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ server cluster Identify = 3 {
}

server cluster Groups = 4 {
bitmap GroupClusterFeature : BITMAP32 {
kGroupNames = 0x1;
}

readonly attribute bitmap8 nameSupport = 0;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand Down
13 changes: 11 additions & 2 deletions src/app/clusters/groups-server/groups-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,21 @@ static EmberAfStatus GroupRemove(FabricIndex fabricIndex, EndpointId endpointId,
void emberAfGroupsClusterServerInitCallback(EndpointId endpointId)
{
// The most significant bit of the NameSupport attribute indicates whether or not group names are supported
static constexpr uint8_t nameSupport = 0x80;
EmberAfStatus status = Attributes::NameSupport::Set(endpointId, nameSupport);
//
// According to spec, highest bit (Group Names supported) MUST match feature bit 0 (Group Names supported)
static constexpr uint8_t kNameSuppportFlagGroupNamesSupported = 0x80;

EmberAfStatus status = Attributes::NameSupport::Set(endpointId, kNameSuppportFlagGroupNamesSupported);
if (status != EMBER_ZCL_STATUS_SUCCESS)
{
ChipLogDetail(Zcl, "ERR: writing name support %x", status);
}

status = Attributes::FeatureMap::Set(endpointId, static_cast<uint32_t>(GroupClusterFeature::kGroupNames));
if (status != EMBER_ZCL_STATUS_SUCCESS)
{
ChipLogDetail(Zcl, "ERR: writing group feature map %x", status);
}
}

bool emberAfGroupsClusterAddGroupCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath,
Expand Down
6 changes: 5 additions & 1 deletion src/app/zap-templates/zcl/data-model/silabs/general.xml
Original file line number Diff line number Diff line change
Expand Up @@ -456,5 +456,9 @@ limitations under the License.
<field name="OnOff" mask="0x1"/>
<field name="Lighting" mask="0x2"/>
<field name="Frequency" mask="0x4"/>
</bitmap>
</bitmap>
<bitmap name="GroupClusterFeature" type="BITMAP32">
<cluster code="0x0004"/>
<field name="GroupNames" mask="0x1"/>
</bitmap>
</configurator>
4 changes: 4 additions & 0 deletions src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ client cluster Identify = 3 {
}

client cluster Groups = 4 {
bitmap GroupClusterFeature : BITMAP32 {
kGroupNames = 0x1;
}

readonly attribute bitmap8 nameSupport = 0;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand Down
4 changes: 4 additions & 0 deletions src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions zzz_generated/app-common/app-common/zap-generated/enums.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f241dd2

Please sign in to comment.