Skip to content

Commit

Permalink
Set valid device types for application endpoints
Browse files Browse the repository at this point in the history
Several samples are using the root node device type for application
endpoints. This prevents proper identification of the device. Add
types to all non-root endpoints in examples/.

all-clusters-app does not correspond well with any single device type.
This sets it to on/off light. It may be useful to reorganize this
sample into additional endpoints each with a coherent device type.

Multiple root nodes is not compliant. From the spec, "Endpoint
Composition" section: There SHALL be only one root node endpoint for the
node.
  • Loading branch information
mspang committed Jan 17, 2022
1 parent 40b4079 commit abdd0c7
Show file tree
Hide file tree
Showing 11 changed files with 303 additions and 129 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1090,8 +1090,8 @@ server cluster EthernetNetworkDiagnostics = 55 {
}

server cluster FixedLabel = 64 {
attribute(readonly) LabelStruct labelList[] = 0;
attribute(readonly) int16u clusterRevision = 65533;
attribute(readonly, reportable) LabelStruct labelList[] = 0;
attribute(readonly, reportable) int16u clusterRevision = 65533;
}

server cluster FlowMeasurement = 1028 {
Expand Down Expand Up @@ -1808,7 +1808,7 @@ server cluster NetworkCommissioning = 49 {
attribute(readonly) NetworkCommissioningStatus lastNetworkingStatus = 5;
attribute(readonly) octet_string lastNetworkID = 6;
attribute(readonly) int32u lastConnectErrorValue = 7;
attribute(readonly, reportable) bitmap32 featureMap = 65532;
attribute(readonly) bitmap32 featureMap = 65532;
attribute(readonly, reportable) int16u clusterRevision = 65533;

request struct AddOrUpdateThreadNetworkRequest {
Expand Down
22 changes: 11 additions & 11 deletions examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -7204,9 +7204,9 @@
]
},
{
"name": "MA-rootdevice",
"deviceTypeName": "MA-rootdevice",
"deviceTypeCode": 22,
"name": "MA-onofflight",
"deviceTypeName": "MA-onofflight",
"deviceTypeCode": 256,
"deviceTypeProfileId": 259,
"clusters": [
{
Expand Down Expand Up @@ -17119,9 +17119,9 @@
]
},
{
"name": "MA-rootdevice",
"deviceTypeName": "MA-rootdevice",
"deviceTypeCode": 22,
"name": "MA-onofflight",
"deviceTypeName": "MA-onofflight",
"deviceTypeCode": 256,
"deviceTypeProfileId": 259,
"clusters": [
{
Expand Down Expand Up @@ -20121,22 +20121,22 @@
"deviceIdentifier": 22
},
{
"endpointTypeName": "MA-rootdevice",
"endpointTypeName": "MA-onofflight",
"endpointTypeIndex": 1,
"profileId": 259,
"endpointId": 1,
"networkId": 0,
"endpointVersion": 1,
"deviceIdentifier": 22
"deviceIdentifier": 256
},
{
"endpointTypeName": "MA-rootdevice",
"endpointTypeName": "MA-onofflight",
"endpointTypeIndex": 2,
"profileId": 259,
"endpointId": 2,
"networkId": 0,
"endpointVersion": 1,
"deviceIdentifier": 22
"deviceIdentifier": 256
}
]
}
}
36 changes: 18 additions & 18 deletions examples/lighting-app/lighting-common/lighting-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,24 @@ client cluster OnOff = 6 {
attribute(writable, reportable) enum8 startUpOnOff = 16387;
attribute(readonly, reportable) bitmap32 featureMap = 65532;
attribute(readonly, reportable) int16u clusterRevision = 65533;

request struct OffWithEffectRequest {
OnOffEffectIdentifier effectId = 0;
OnOffDelayedAllOffEffectVariant effectVariant = 1;
}

request struct OnWithTimedOffRequest {
OnOffControl onOffControl = 0;
int16u onTime = 1;
int16u offWaitTime = 2;
}

command Off(): DefaultSuccess = 0;
command OffWithEffect(OffWithEffectRequest): DefaultSuccess = 64;
command On(): DefaultSuccess = 1;
command OnWithRecallGlobalScene(): DefaultSuccess = 65;
command OnWithTimedOff(OnWithTimedOffRequest): DefaultSuccess = 66;
command Toggle(): DefaultSuccess = 2;
}

server cluster OnOff = 6 {
Expand All @@ -981,24 +999,6 @@ server cluster OnOff = 6 {
attribute(writable, reportable) enum8 startUpOnOff = 16387;
attribute(readonly, reportable) bitmap32 featureMap = 65532;
attribute(readonly, reportable) int16u clusterRevision = 65533;

request struct OffWithEffectRequest {
OnOffEffectIdentifier effectId = 0;
OnOffDelayedAllOffEffectVariant effectVariant = 1;
}

request struct OnWithTimedOffRequest {
OnOffControl onOffControl = 0;
int16u onTime = 1;
int16u offWaitTime = 2;
}

command Off(): DefaultSuccess = 0;
command OffWithEffect(OffWithEffectRequest): DefaultSuccess = 64;
command On(): DefaultSuccess = 1;
command OnWithRecallGlobalScene(): DefaultSuccess = 65;
command OnWithTimedOff(OnWithTimedOffRequest): DefaultSuccess = 66;
command Toggle(): DefaultSuccess = 2;
}

server cluster OnOffSwitchConfiguration = 7 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2471,10 +2471,10 @@
]
},
{
"name": "MA-rootdevice",
"deviceTypeName": "MA-rootdevice",
"name": "MA-tempsensor",
"deviceTypeName": "MA-tempsensor",
"deviceTypeCode": 22,
"deviceTypeProfileId": 259,
"deviceTypeProfileId": 770,
"clusters": [
{
"name": "Power Configuration",
Expand Down Expand Up @@ -3400,13 +3400,13 @@
"deviceIdentifier": 22
},
{
"endpointTypeName": "MA-rootdevice",
"endpointTypeName": "MA-tempsensor",
"endpointTypeIndex": 1,
"profileId": 259,
"endpointId": 1,
"networkId": 0,
"endpointVersion": 1,
"deviceIdentifier": 22
"deviceIdentifier": 770
}
]
}
}
20 changes: 10 additions & 10 deletions examples/tv-casting-app/tv-casting-common/tv-casting-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -6536,9 +6536,9 @@
]
},
{
"name": "MA-rootdevice",
"deviceTypeName": "MA-rootdevice",
"deviceTypeCode": 22,
"name": "MA-videoplayer",
"deviceTypeName": "MA-videoplayer",
"deviceTypeCode": 35,
"deviceTypeProfileId": 259,
"clusters": [
{
Expand Down Expand Up @@ -13559,9 +13559,9 @@
]
},
{
"name": "Anonymous Endpoint Type",
"deviceTypeName": "MA-rootdevice",
"deviceTypeCode": 22,
"name": "MA-occupancysensor",
"deviceTypeName": "MA-occupancysensor",
"deviceTypeCode": 263,
"deviceTypeProfileId": 259,
"clusters": [
{
Expand Down Expand Up @@ -16486,22 +16486,22 @@
"deviceIdentifier": 22
},
{
"endpointTypeName": "MA-rootdevice",
"endpointTypeName": "MA-videoplayer",
"endpointTypeIndex": 1,
"profileId": 259,
"endpointId": 1,
"networkId": 0,
"endpointVersion": 1,
"deviceIdentifier": 22
"deviceIdentifier": 35
},
{
"endpointTypeName": "Anonymous Endpoint Type",
"endpointTypeName": "MA-occupancysensor",
"endpointTypeIndex": 2,
"profileId": 259,
"endpointId": 2,
"networkId": 0,
"endpointVersion": 1,
"deviceIdentifier": 22
"deviceIdentifier": 263
}
]
}

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

Loading

0 comments on commit abdd0c7

Please sign in to comment.