Skip to content

Commit

Permalink
Pull request project-chip#164: Cherry-Pick V0.4.0 doc update
Browse files Browse the repository at this point in the history
Merge in WMN_TOOLS/matter from cherry-pick/documentation_update to silabs_1.0

Squashed commit of the following:

commit c4da7f93ab80339e39ccab65414d4209f2066ec2
Author: Ezra Hale <ezra.hale@silabs.com>
Date:   Tue Oct 4 15:52:04 2022 +0000

    Pull request #125: V0.4.0 doc update

    Merge in WMN_TOOLS/matter from v0.4.0_doc_update to silabs

    Squashed commit of the following:

    commit 86ee80df8f4fd45e1b651da721e8ed41306e22f4
    Author: Ezra Hale <ezra.hale@silabs.com>
    Date:   Tue Oct 4 11:42:39 2022 -0400

        closing out the rest of Catherine's comments

    commit 07e8b9c42662d3251da667ae95df74678f8098d7
    Author: Ezra Hale <ezra.hale@silabs.com>
    Date:   Tue Oct 4 09:58:02 2022 -0400

        Chip-Tool -> chip-tool

    commit ce0b943a13143873572e67afe16c01150d883f9d
    Author: Ezra Hale <ezra.hale@silabs.com>
    Date:   Tue Sep 27 12:18:33 2022 -0400

        updated to address Mathieu's issues in the PR

    ... and 12 more commits
  • Loading branch information
mkardous-silabs authored and jmartinez-silabs committed Oct 26, 2022
1 parent 264b607 commit 6e8f8ba
Show file tree
Hide file tree
Showing 24 changed files with 506 additions and 326 deletions.
55 changes: 55 additions & 0 deletions docs/silabs/DOC_STANDARD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Silicon Labs Documentation Standards Using Markdown

## Titles
# This Is a Title
Notice how the main words are capitalized

## Subsections Look Like This
This is a `##` subsection under a `#` title header. Notice how the words are also capitalized.

## Lists

- This is a bulleted list
- Second item in a bulleted list

1. This is a numbered list
2. Second item in a numbered list

## Commands

```shell
$ this is a highlighted command
```

```shell
$ if there is a second line it has it's own entry
```
```shell
$ notice how commands all start with the dollar sign, $, this is to indicate that they are to be used on a command line
```
## Code
```cpp
This is a code block() {
Not to be confused with a highlighted command as above ^^^
This should only be used for preformatted code, not for commands.
}
```
## Notes
> **Note:** This is a note that we want to draw attention to, it is similar to a highlighted command except that it does not generally use `preformatted text`.
## Tables
| col 1 | col 2 | col 3 |
| ----- | ----- | ----- |
| don't do | large tables | they don't |
| format well | or look good | and are |
| difficult | to | maintain |
If you need to do a large table, find some other way to represent the information in .md. You could use HTML but this is also frowned upon for the reason listed below...
## HTML
Try to avoid <br> Using HTML <br> Since it doesn't <br> get picked up <br> by .md translators
2 changes: 1 addition & 1 deletion docs/silabs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
2. [Loading the Raspberry Pi image onto the Matter Hub](thread/RASPI_IMG.md)
3. [Setting up the RCP](thread/RCP.md)
4. [Creating a Thread Matter End Device](thread/BUILD_FLASH_MAD.md)
5. [Using the Chip-Tool](thread/CHIP_TOOL.md)<BR> <BR>
5. [Using the chip-tool](thread/CHIP_TOOL.md)<BR> <BR>

4. Matter over Wi-Fi

Expand Down
32 changes: 23 additions & 9 deletions docs/silabs/dev/vscode/SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,30 @@
On macOS, you must install Xcode from the Mac App Store. The remaining
dependencies can be installed and satisfied using [Brew](https://brew.sh/):

> `$ brew install openssl pkg-config`
```shell
$ brew install openssl pkg-config
```

However, that does not expose the package to `pkg-config`. To fix that, run
something like the following:

Intel:

> `$ cd /usr/local/lib/pkgconfig ln -s ../../Cellar/openssl@1.1/1.1.1g/lib/pkgconfig/* .`
```shell
$ cd /usr/local/lib/pkgconfig ln -s ../../Cellar/openssl@1.1/1.1.1g/lib/pkgconfig/* .
```

where `openssl@1.1/1.1.1g` may need to be replaced with the actual version of
OpenSSL installed by Brew.

Apple Silicon:

> `$ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:"/opt/homebrew/opt/openssl@3/lib/pkgconfig"`
```shell
$ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:"/opt/homebrew/opt/openssl@3/lib/pkgconfig"
```

Note: If using MacPorts, `port install openssl` is sufficient to satisfy this
dependency.

> **Note:** If using MacPorts, `port install openssl` is sufficient to satisfy this dependency.
### Mac OS (Apple Silicon) Users

Expand All @@ -56,21 +62,29 @@ those mentioned above. <br>
1. Add ARM GCC toolchain to the search path within `bootstrap.sh` by adding this
line of code:

> `$ export PATH="/Applications/ARM/bin:$PATH"`
```shell
$ export PATH="/Applications/ARM/bin:$PATH"
```

2. Users may also have to specify which `pkg-config`/`openssl` to use by adding
these lines of code as well:

> `$ export PATH="/opt/homebrew/opt/openssl@3/bin:$PATH"`
```shell
$ export PATH="/opt/homebrew/opt/openssl@3/bin:$PATH"
```

> `$ export PKG_CONFIG_PATH="/opt/homebrew/opt/openssl@3/lib/pkgconfig"`
```shell
$ export PKG_CONFIG_PATH="/opt/homebrew/opt/openssl@3/lib/pkgconfig"
```

### Installing prerequisites on Linux

On Debian-based Linux distributions such as Ubuntu, these dependencies can be
satisfied with the following:

> ` $ sudo apt-get install git gcc g++ pkg-config libssl-dev libdbus-1-dev libglib2.0-dev libavahi-client-dev ninja-build python3-venv python3-dev python3-pip unzip libgirepository1.0-dev libcairo2-dev libreadline-dev`
```shell
$ sudo apt-get install git gcc g++ pkg-config libssl-dev libdbus-1-dev libglib2.0-dev libavahi-client-dev ninja-build python3-venv python3-dev python3-pip unzip libgirepository1.0-dev libcairo2-dev libreadline-dev
```

## Bootstrapping your source tree (one time)

Expand Down
22 changes: 18 additions & 4 deletions docs/silabs/general/ARTIFACTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ used to set up the Matter Demo for the Thread and Wi-Fi use cases.

The Matter Hub image is intended to be flashed onto an SD card for a Raspberry
Pi. The Matter Hub Image provides both an Open Thread Border Router and the
Matter chiptool. Note the image is ~10GB in size so depending on your internet
Matter chip-tool. Note the image is ~10GB in size so depending on your internet
connection this download may take some time. Start the Matter Hub Raspberry Pi
image download here:

Expand All @@ -24,7 +24,7 @@ used with a Raspberry Pi to allow the Raspberry Pi's Open Thread Border Router
to access the Thread network. Radio Co-Processor (RCP) images are available in
the Assets section of this page:

https://github.com/SiliconLabs/matter/releases/tag/v0.3.0
https://github.com/SiliconLabs/matter/releases/tag/v0.4.0

<br>

Expand All @@ -34,7 +34,13 @@ The Matter Accessory Device Images are used to turn an EFR into a Matter device.
These are pre-built binary images for the Matter Demo. Matter Accessory Device
Images are located in the Assets section of this page:

https://github.com/SiliconLabs/matter/releases/tag/v0.3.0
https://github.com/SiliconLabs/matter/releases/tag/v0.4.0

For Matter over Thread, 3 different types of images are provided:

1. **Standard**: Includes all code including enabling the LCD for a QR Code that can be used for commissioning.
2. **Release**: A smaller image size with reduced functionality, including removal of the LCD support, thus no QR Code.
3. **Sleepy**: A sleepy device image for improved energy efficiency and running on battery power.

<br>

Expand All @@ -45,7 +51,7 @@ EFR32MG2x device, you will need to flash a bootloader binary on your device alon
with the application image. Bootloader binaries for all of the Matter supported
devices are available here:

https://github.com/SiliconLabs/matter/releases/tag/v0.3.0
https://github.com/SiliconLabs/matter/releases/tag/v0.4.0

<br>

Expand All @@ -57,6 +63,14 @@ directory, `./third_party/silabs/wiseconnect-wifi-bt-sdk/firmware`

<br>

## SiWx917 Firmware

The SiWx917 firmware is used to update the SiWx917 - it can be found in the
repository you have cloned, at the following relative path from the `/matter`
directory, `./third_party/silabs/wiseconnect-wifi-bt-sdk/firmware`

<br>

---

[Table of Contents](../README.md) | [Thread Demo](../thread/DEMO_OVERVIEW.md) |
Expand Down
2 changes: 1 addition & 1 deletion docs/silabs/general/COMMIT_HASHES.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ in this release of the Silicon Labs Matter Out of Box Experience
| --------------------------------------- | ------ | ---------------------------------------- |
| https://github.com/SiliconLabs/ot-efr32 | main | 7a567da02a078546eb34136c1c44170c8832dd55 |

## Matter ChipTool
## Matter chip-tool

| Repo | Branch | Commit Hash |
| ----------------------------------------------- | ------ | ---------------------------------------- |
Expand Down
37 changes: 24 additions & 13 deletions docs/silabs/general/CUSTOM_MATTER_DEVICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ 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
## ZAP Configuration

From the matter repository, run the following command in a terminal to launch
the ZAP user interface (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`
```shell
$ ./scripts/tools/zap/run_zaptool.sh examples/lighting-app/lighting-common/lighting-app.zap
```

On the left 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
Expand Down Expand Up @@ -59,9 +61,11 @@ Each time a modification is made to the ZAP UI, 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/`
```shell
$ ./scripts/tools/zap/generate.py examples/lighting-app/lighting-common/lighting-app.zap -o zzz_generated/lighting-app/zap-generated/
```

## Receiving Matter commands
## Receiving Matter Commands

All Matter commands reach the application through the intermediate function
MatterPostAttributeChangeCallback(). When a request is made by a Matter client,
Expand All @@ -70,31 +74,32 @@ 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
## 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
## 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
## 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 generate.py script above.

## React to Level Control cluster commands in ZclCallbacks
## React to Level Control Cluster Commands in ZclCallbacks

In the MatterPostAttributeCallback function in ZclCallbacks, add the following
line of code or a similar line. This will give the application the ability to react to
MoveToLevel commands. You can define platform-specific behavior for a
MoveToLevel action.

```cpp
else if (clusterId == LevelControl::Id)
{
ChipLogProgress(Zcl, "Level Control attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u",
Expand All @@ -107,19 +112,25 @@ MoveToLevel action.

LightMgr().InitiateActionLight(AppEvent::kEventType_Light, action_type, endpoint, *value);
}

## Send a MoveToLevel command and read the CurrentLevel attribute
```
## 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`
```shell
$ mattertool levelcontrol read current-level 1 1 // Returns 1
```

> `$ mattertool levelcontrol move-to-level {desired_level} 0 1 1 {node_ID} 1`
```shell
$ mattertool levelcontrol move-to-level {desired_level} 0 1 1 {node_ID} 1
```

> `$ mattertool levelcontrol read current-level 1 1 // Returns 10`
```shell
$ mattertool levelcontrol read current-level 1 1 // Returns 10
```

For more information on running a Silicon Labs lighting example on a Thunderboard Sense 2 see
[sl-newlight/efr32](../../../silabs_examples/sl-newLight/efr32/README.md).
Expand Down
Loading

0 comments on commit 6e8f8ba

Please sign in to comment.