Skip to content

Commit

Permalink
[Telink]: Restyled
Browse files Browse the repository at this point in the history
  • Loading branch information
s07641069 committed May 11, 2022
1 parent 2c658a4 commit 1282123
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
23 changes: 12 additions & 11 deletions examples/light-switch-app/telink/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,35 +95,36 @@ following states:

- **1** ID of endpoint

3. Add an ACL to the development kit that is programmed with the Lighting Application Example by running the following command:
4. Add an ACL to the development kit that is programmed with the Lighting
Application Example by running the following command:

```
${CHIP_TOOL_DIR}/chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}, {"fabricIndex": 1, "privilege": 3, "authMode": 2, "subjects": [<light-switch-node-id>], "targets": [{"cluster": 6, "endpoint": 1, "deviceType": null}, {"cluster": 8, "endpoint": 1, "deviceType": null}]}]' <lighting-node-id> 0
```

In this command:

- `{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}`
is an ACL for the communication with the CHIP Tool.
- `{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [<light-switch-node-id>], "targets": [{"cluster": 6, "endpoint": 1, "deviceType": null}, {"cluster": 8, "endpoint": 1, "deviceType": null}]}`
is an ACL for binding (cluster no. 6 is the On/Off cluster and the
cluster no. 8 is the Level Control cluster).
- `{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}`
is an ACL for the communication with the CHIP Tool.
- `{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [<light-switch-node-id>], "targets": [{"cluster": 6, "endpoint": 1, "deviceType": null}, {"cluster": 8, "endpoint": 1, "deviceType": null}]}`
is an ACL for binding (cluster no. 6 is the On/Off cluster and the cluster
no. 8 is the Level Control cluster).

This command adds permissions on the lighting application device that allows
it to receive commands from the light switch device.

4. Add a binding table to the Light Switch binding cluster:
5. Add a binding table to the Light Switch binding cluster:

```
${CHIP_TOOL_DIR}/chip-tool binding write binding '[{"fabricIndex": 1, "node": <lighting-node-id>, "endpoint": 1, "cluster": 6}, {"fabricIndex": 1, "node": <lighting-node-id>, "endpoint": 1, "cluster": 8}]' <light-switch-node-id> 1
```

In this command:

- `{"fabricIndex": 1, "node": <lighting-node-id>, "endpoint": 1, "cluster": 6}` is a
binding for the On/Off cluster.
- `{"fabricIndex": 1, "node": <lighting-node-id>, "endpoint": 1, "cluster": 8}` is a
binding for the Level Control cluster.
- `{"fabricIndex": 1, "node": <lighting-node-id>, "endpoint": 1, "cluster": 6}`
is a binding for the On/Off cluster.
- `{"fabricIndex": 1, "node": <lighting-node-id>, "endpoint": 1, "cluster": 8}`
is a binding for the Level Control cluster.

### Testing the communication

Expand Down
2 changes: 1 addition & 1 deletion examples/light-switch-app/telink/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ CHIP_ERROR AppTask::Init()
{
LOG_ERR("InitBindingHandler() failed");
return ret;
}
}

PrintOnboardingCodes(chip::RendezvousInformationFlags(chip::RendezvousInformationFlag::kBLE));

Expand Down
5 changes: 2 additions & 3 deletions examples/light-switch-app/telink/src/ZclCallbacks.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath &

if (clusterId == OnOffSwitchConfiguration::Id)
{
ChipLogProgress(
Zcl, "OnOff Switch Configuration attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u",
ChipLogValueMEI(attributeId), type, *value, size);
ChipLogProgress(Zcl, "OnOff Switch Configuration attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u",
ChipLogValueMEI(attributeId), type, *value, size);

// WIP Apply attribute change to Light
}
Expand Down

0 comments on commit 1282123

Please sign in to comment.