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

Restyle [binding] Make binding table an attribute #14953

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -235,24 +235,16 @@ server cluster BinaryInputBasic = 15 {
}

server cluster Binding = 30 {
readonly global attribute int16u clusterRevision = 65533;

request struct BindRequest {
NODE_ID nodeId = 0;
GROUP_ID groupId = 1;
ENDPOINT_NO endpointId = 2;
CLUSTER_ID clusterId = 3;
struct TargetStruct {
FABRIC_IDX fabricIdx = 0;
nullable NODE_ID nodeId = 1;
nullable GROUP_ID groupId = 2;
nullable ENDPOINT_NO endpointId = 3;
nullable CLUSTER_ID clusterId = 4;
}

request struct UnbindRequest {
NODE_ID nodeId = 0;
GROUP_ID groupId = 1;
ENDPOINT_NO endpointId = 2;
CLUSTER_ID clusterId = 3;
}

command Bind(BindRequest): DefaultSuccess = 0;
command Unbind(UnbindRequest): DefaultSuccess = 1;
attribute TargetStruct bindingList[] = 0;
readonly global attribute int16u clusterRevision = 65533;
}

server cluster BooleanState = 69 {
Expand Down
70 changes: 33 additions & 37 deletions examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -877,24 +877,7 @@
"define": "BINDING_CLUSTER",
"side": "client",
"enabled": 0,
"commands": [
{
"name": "Bind",
"code": 0,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 1
},
{
"name": "Unbind",
"code": 1,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 1
}
],
"commands": [],
"attributes": [
{
"name": "ClusterRevision",
Expand Down Expand Up @@ -922,6 +905,21 @@
"enabled": 1,
"commands": [],
"attributes": [
{
"name": "binding list",
"code": 0,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 0,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "ClusterRevision",
"code": 65533,
Expand Down Expand Up @@ -8706,24 +8704,7 @@
"define": "BINDING_CLUSTER",
"side": "client",
"enabled": 0,
"commands": [
{
"name": "Bind",
"code": 0,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 1
},
{
"name": "Unbind",
"code": 1,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 1
}
],
"commands": [],
"attributes": [
{
"name": "ClusterRevision",
Expand Down Expand Up @@ -8751,6 +8732,21 @@
"enabled": 1,
"commands": [],
"attributes": [
{
"name": "binding list",
"code": 0,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 0,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "ClusterRevision",
"code": 65533,
Expand Down Expand Up @@ -21103,4 +21099,4 @@
"deviceIdentifier": 256
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ static void BoundDeviceChangedHandler(const EmberBindingTableEntry * binding, ch
return;
}

if (binding->type == EMBER_UNICAST_BINDING && binding->local == 1 && binding->clusterId == Clusters::OnOff::Id)
if (binding->type == EMBER_UNICAST_BINDING && binding->local == 1 && binding->clusterId.HasValidValue() &&
binding->clusterId.Value() == Clusters::OnOff::Id)
{
auto onSuccess = [](const ConcreteCommandPath & commandPath, const StatusIB & status, const auto & dataResponse) {
ChipLogProgress(NotSpecified, "OnOff command succeeds");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,24 +142,16 @@ server cluster Basic = 40 {
}

server cluster Binding = 30 {
readonly global attribute int16u clusterRevision = 65533;

request struct BindRequest {
NODE_ID nodeId = 0;
GROUP_ID groupId = 1;
ENDPOINT_NO endpointId = 2;
CLUSTER_ID clusterId = 3;
struct TargetStruct {
FABRIC_IDX fabricIdx = 0;
nullable NODE_ID nodeId = 1;
nullable GROUP_ID groupId = 2;
nullable ENDPOINT_NO endpointId = 3;
nullable CLUSTER_ID clusterId = 4;
}

request struct UnbindRequest {
NODE_ID nodeId = 0;
GROUP_ID groupId = 1;
ENDPOINT_NO endpointId = 2;
CLUSTER_ID clusterId = 3;
}

command Bind(BindRequest): DefaultSuccess = 0;
command Unbind(UnbindRequest): DefaultSuccess = 1;
attribute TargetStruct bindingList[] = 0;
readonly global attribute int16u clusterRevision = 65533;
}

client cluster ColorControl = 768 {
Expand Down
67 changes: 32 additions & 35 deletions examples/light-switch-app/light-switch-common/light-switch-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -936,24 +936,7 @@
"define": "BINDING_CLUSTER",
"side": "client",
"enabled": 0,
"commands": [
{
"name": "Bind",
"code": 0,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 0
},
{
"name": "Unbind",
"code": 1,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 0
}
],
"commands": [],
"attributes": []
},
{
Expand All @@ -965,6 +948,21 @@
"enabled": 1,
"commands": [],
"attributes": [
{
"name": "binding list",
"code": 0,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 0,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "AttributeList",
"code": 65531,
Expand Down Expand Up @@ -5939,22 +5937,6 @@
"side": "client",
"enabled": 0,
"commands": [
{
"name": "Bind",
"code": 0,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 1
},
{
"name": "Unbind",
"code": 1,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 1
}
],
"attributes": [
{
Expand Down Expand Up @@ -5998,6 +5980,21 @@
"enabled": 1,
"commands": [],
"attributes": [
{
"name": "binding list",
"code": 0,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 0,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "AttributeList",
"code": 65531,
Expand Down Expand Up @@ -7093,4 +7090,4 @@
"deviceIdentifier": 259
}
]
}
}
24 changes: 8 additions & 16 deletions examples/thermostat/thermostat-common/thermostat.matter
Original file line number Diff line number Diff line change
Expand Up @@ -142,24 +142,16 @@ server cluster Basic = 40 {
}

server cluster Binding = 30 {
readonly global attribute int16u clusterRevision = 65533;

request struct BindRequest {
NODE_ID nodeId = 0;
GROUP_ID groupId = 1;
ENDPOINT_NO endpointId = 2;
CLUSTER_ID clusterId = 3;
struct TargetStruct {
FABRIC_IDX fabricIdx = 0;
nullable NODE_ID nodeId = 1;
nullable GROUP_ID groupId = 2;
nullable ENDPOINT_NO endpointId = 3;
nullable CLUSTER_ID clusterId = 4;
}

request struct UnbindRequest {
NODE_ID nodeId = 0;
GROUP_ID groupId = 1;
ENDPOINT_NO endpointId = 2;
CLUSTER_ID clusterId = 3;
}

command Bind(BindRequest): DefaultSuccess = 0;
command Unbind(UnbindRequest): DefaultSuccess = 1;
attribute TargetStruct bindingList[] = 0;
readonly global attribute int16u clusterRevision = 65533;
}

server cluster Descriptor = 29 {
Expand Down
Loading