forked from project-chip/connectedhomeip
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pull request project-chip#59: V0.3.0 doc updates
Merge in WMN_TOOLS/matter from v0.3.0_doc_updates to silabs Squashed commit of the following: commit d51fe5832aad2e40f6755491fff1b5275bd10d29 Author: Ezra Hale <ezra.hale@silabs.com> Date: Fri Sep 2 09:33:58 2022 -0400 did a clean pass through the doc to make command line notation consistent and some other changes commit 202605849b82dd5982a3031d2792cf1de21a6b04 Author: Ezra Hale <ezra.hale@silabs.com> Date: Thu Sep 1 15:20:12 2022 -0400 fixed all references to wifi which should be Wi-Fi for consistency and correctness commit 1c67f5512f4fff4a6016e72ca9e8efcef1399eb4 Author: Ezra Hale <ezra.hale@silabs.com> Date: Thu Sep 1 14:58:58 2022 -0400 removed duplication of pre-req documentation in favor of HARDWARE_REQUIREMENTS.md and SOFTWARE_REQUIREMENTS.md commit e718c90368ff1f1f55c818affa4eec6bf8d1c8db Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Thu Sep 1 14:25:55 2022 -0400 Added git instructions to Software Reqs commit 563524bbab46e1f91a103e0f75920371974b7329 Author: Ezra Hale <ezra.hale@silabs.com> Date: Thu Sep 1 14:22:16 2022 -0400 cleaning up references to software and hardware requriements commit 0ccc40e8f50880b92d19c1f90bc0553b5e50d910 Author: Ezra Hale <ezra.hale@silabs.com> Date: Thu Sep 1 13:48:26 2022 -0400 langugage for hardware and software requirements note commit d3c195366cd40c0802ab4f52e34fec3070e05bc9 Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Thu Sep 1 13:40:12 2022 -0400 Added 'Software Requirements' main page commit d8b5b4e0ecf6ffd7dcc93375a7cf947e67d4359b Author: Ezra Hale <ezra.hale@silabs.com> Date: Thu Sep 1 13:36:20 2022 -0400 adding a central location for hardware requirements commit 497410247ebb83a694747de05cee0c6da144d3ef Author: Ezra Hale <ezra.hale@silabs.com> Date: Thu Sep 1 09:57:31 2022 -0400 added prereqs from the BUILDING.md page to this commit 5404e7b70120e84954d775a3111cac791919a982 Author: Ezra Hale <ezra.hale@silabs.com> Date: Thu Sep 1 08:53:42 2022 -0400 adding --recursive flag back into usage of update script commit bb8c4823be7f88b867b323901a1aeed61785d5c8 Author: Ezra Hale <ezra.hale@silabs.com> Date: Thu Sep 1 08:38:12 2022 -0400 comment from Rehan, added link to CUSTOM_MATTER_DEVICE.md commit 6689bb9897a81222863d3f54aff4261ec044c830 Author: Ezra Hale <ezra.hale@silabs.com> Date: Thu Sep 1 08:25:53 2022 -0400 updates from Rehan's comments on the PR commit 14831e91967252e58985238538165c5eccfd1137 Author: Ezra Hale <ezra.hale@silabs.com> Date: Wed Aug 31 13:47:39 2022 -0400 updated naming for wifi build end device so it is consistent with Thread and less confusing commit 1e5da86864b815dc92bc0c8be4bfb22b7333c885 Author: Ezra Hale <ezra.hale@silabs.com> Date: Wed Aug 31 12:02:11 2022 -0400 adding more doc on WIRESHARK.md commit 897c34befd894070001cd69ac2900c363b11aa93 Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Wed Aug 31 11:45:51 2022 -0400 Added Mac OS (silicon) steps to software reqs/VS code env setup commit 194e85b311e7ee0f4f1f2d73bd6807a02150a5d5 Author: Ezra Hale <ezra.hale@silabs.com> Date: Wed Aug 31 11:32:30 2022 -0400 adding first pass at WIRESHARK documentation commit b49cecf022abb4a520537e53aea52b731cd0f8b9 Author: Ezra Hale <ezra.hale@silabs.com> Date: Wed Aug 31 10:14:46 2022 -0400 added pointer to credentials example README.md from ToC commit 91ad980b9f0789195d9a51a3fec865554295458f Author: Ezra Hale <ezra.hale@silabs.com> Date: Wed Aug 31 10:05:15 2022 -0400 fixed typo in ATTESTATION_CRED.md commit 9e228633dbf09ac84473086bb82e68c2c6f10066 Author: Ezra Hale <ezra.hale@silabs.com> Date: Tue Aug 30 13:46:41 2022 -0400 added doc for Energy Profiler commit c8b9ae004791c9abf4bd3a868074b9619fee22fb Author: Ezra Hale <ezra.hale@silabs.com> Date: Tue Aug 30 13:26:45 2022 -0400 added bottom nav ... and 14 more commits
- Loading branch information
1 parent
ea3dea4
commit 551577d
Showing
28 changed files
with
1,183 additions
and
632 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
# Custom Matter Device Development | ||
|
||
Build a customizable lighting app using the Matter protocol | ||
|
||
## Overview | ||
|
||
This guide will cover the basics of building a customizable lighting application | ||
using Matter. | ||
|
||
## Using Matter with Clusters | ||
|
||
In Matter, commands can be issued by using a cluster. A cluster is a set of | ||
attributes and commands which are grouped together under a relevant theme. | ||
|
||
Attributes store values (think of them as variables). Commands are used to | ||
modify the value of attributes. | ||
|
||
For example, the "On/Off" cluster has an attribute named "OnOff" of type | ||
boolean. The value of this attribute can be set to "1" by sending an "On" | ||
command or it can be set to "0" by sending an "Off" command. | ||
|
||
The C++ implementation of these clusters is located in the clusters directory. | ||
Note that you can also create your own custom cluster. | ||
|
||
## ZAP configuration | ||
|
||
From the matter repository, run the following command in a terminal to launch | ||
the ZAP UI. This will open up the ZAP configuration for the EFR32 lighting | ||
application example. | ||
|
||
> `$ ./scripts/tools/zap/run_zaptool.sh examples/lighting-app/lighting-common/lighting-app.zap` | ||
On the left hand side of the application, there is a tab for Endpoint 0 and | ||
Endpoint 1. Endpoint 0 is known as the root node. This endpoint is akin to a | ||
"read me first" endpoint that describes itself and the other endpoints that make | ||
up the node. Endpoint 1 represents a lighting application device type. There are | ||
a number of required ZCL clusters enabled in Endpoint 1. Some clusters are | ||
common across most device types, such as identify and group clusters. Others, | ||
such as the On/Off, Level Control and Color Control clusters are required for a | ||
lighting application device type. | ||
|
||
Clicking on the blue settings icon on the right hand side of the application | ||
will bring you to the zap configuration settings for that cluster. Each cluster | ||
has some required attributes that may cause compile-time errors if they are not | ||
selected in the zap configuration. Other attributes are optional and are allowed | ||
to be disabled. Clusters also have a list of client-side commands, again some | ||
are mandatory and others are optional depending on the cluster. ZCL offers an | ||
extensive list of optional attributes and commands that allow you to customize | ||
your application to the full power of the Matter SDK. | ||
|
||
For example, if one was building a lighting application which only includes | ||
single color LEDs instead of RGB LEDs, it might make sense to disable the Color | ||
Control cluster in the ZAP configuration. Similarly, if one were to build a | ||
lighting application that doesn't take advantage of the Level Control cluster, | ||
which allows you to customize current flow to an LED, it might make sense to | ||
disable the Level Control cluster. | ||
|
||
Each time a modification is made to the ZAP UI, one must save (Electron→Save on | ||
a Mac toolbar) the current ZAP configuration and run the following command to | ||
generate ZAP code. | ||
|
||
> `$ ./scripts/tools/zap/generate.py examples/lighting-app/lighting-common/lighting-app.zap -o zzz_generated/lighting-app/zap-generated/` | ||
## Receiving Matter commands | ||
|
||
All Matter commands reach the application through the intermediate function | ||
MatterPostAttributeChangeCallback(). When a request is made by a Matter client, | ||
the information contained in the request is forwarded to a Matter application | ||
through this function. The command can then be dissected using conditional logic | ||
to call the proper application functions based on the most recent command | ||
received. | ||
|
||
## Adding a cluster to a ZAP configuration | ||
|
||
In the ZAP UI, navigate to the Level Control cluster. Make sure this cluster is | ||
enabled as a server in the drop down menu in the "Enable" column. Then click on | ||
the blue settings wheel in the "Configure" column. This cluster can be used to | ||
gather power source configuration settings from a Matter device. It contains a | ||
few required attributes, and a number of optional attributes. | ||
|
||
## Adding a new attribute | ||
|
||
In the Level Control cluster configurations, ensure the CurrentLevel attribute | ||
is set to enabled. Set the default value of this attribute as 1. | ||
|
||
## Adding a new command | ||
|
||
Navigate to the commands tab in zap and enable the MoveToLevel command. Now save | ||
the current zap configuration, and run the aforementioned generate.py script. | ||
|
||
## React to Level Control cluster commands in ZclCallbacks | ||
|
||
In the MatterPostAttributeCallback function in ZclCallbacks, add the following | ||
line of code or similar. This will give the application the ability to react to | ||
MoveToLevel commands. The developer can define platform specific behavior for a | ||
MoveToLevel action. | ||
|
||
else if (clusterId == LevelControl::Id) | ||
{ | ||
ChipLogProgress(Zcl, "Level Control attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", | ||
ChipLogValueMEI(attributeId), type, *value, size); | ||
|
||
if (attributeId == LevelControl::Attributes::CurrentLevel::Id) | ||
{ | ||
action_type = LightingManager::MOVE_TO_LEVEL; | ||
} | ||
|
||
LightMgr().InitiateActionLight(AppEvent::kEventType_Light, action_type, endpoint, *value); | ||
} | ||
|
||
## Send a MoveToLevel command and read the CurrentLevel attribute | ||
|
||
Rebuild the application and load the new executable on your EFR32 device. Send | ||
the following mattertool commands and verify that the current-level default | ||
attribute was updated as was configured. Replace {desired_level} with 10, and | ||
node_ID with the node ID assigned to the device upon commissioning | ||
|
||
> `$ mattertool levelcontrol read current-level 1 1 // Returns 1` | ||
> `$ mattertool levelcontrol move-to-level {desired_level} 0 1 1 {node_ID} 1` | ||
> `$ mattertool levelcontrol read current-level 1 1 // Returns 10` | ||
More Information Silicon Labs lighting example on a Thunderboard Sense 2 - | ||
[sl-newlight/efr32](../../../silabs_examples/sl-newLight/efr32/README.md) | ||
|
||
--- | ||
|
||
[Table of Contents](../README.md) | [Thread Demo](../thread/DEMO_OVERVIEW.md) | | ||
[Wi-Fi Demo](../wifi/DEMO_OVERVIEW.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Using Simplicity Studio's Energy Profiler with Matter | ||
|
||
Simplicity Studio's Energy Profiler allows the developer to see a graphical view | ||
of their devices energy usage over time. This can be very useful when developing | ||
an energy friendly device. | ||
|
||
Using Energy Profiler with Matter is the same as any other protocol except that | ||
you need to start the usage from within Energy Profiler rather than using an | ||
existing Simplicity Studio project since your Matter project will not have been | ||
created inside Simplicity Studio. | ||
|
||
Complete documentation on using the Simplicity Studio Energy Profiler is | ||
provided in the | ||
[Simplicity Studio 5 Energy Profiler User's Guide](https://docs.silabs.com/simplicity-studio-5-users-guide/1.0/using-the-tools/energy-profiler/) | ||
|
||
--- | ||
|
||
[Table of Contents](../README.md) | [Thread Demo](../thread/DEMO_OVERVIEW.md) | | ||
[Wi-Fi Demo](../wifi/DEMO_OVERVIEW.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.