Skip to content

Commit

Permalink
update all sources to build lit icd app
Browse files Browse the repository at this point in the history
  • Loading branch information
mkardous-silabs committed Nov 29, 2023
1 parent 46f2ec2 commit 2551872
Show file tree
Hide file tree
Showing 16 changed files with 104 additions and 908 deletions.
29 changes: 0 additions & 29 deletions examples/lit-icd-app/silabs/.gn

This file was deleted.

10 changes: 4 additions & 6 deletions examples/lit-icd-app/silabs/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if (chip_enable_pw_rpc) {

assert(current_os == "freertos")

silabs_project_dir = "${chip_root}/examples/light-switch-app/silabs"
silabs_project_dir = "${chip_root}/examples/lit-icd-app/silabs"
examples_common_plat_dir = "${chip_root}/examples/platform/silabs"

if (wifi_soc) {
Expand Down Expand Up @@ -111,16 +111,14 @@ if (wifi_soc) {
}
}

silabs_executable("light_switch_app") {
output_name = "matter-silabs-light-switch-example.out"
silabs_executable("lit_icd_app") {
output_name = "matter-silabs-lit-icd-example.out"
include_dirs = [ "include" ]
defines = []

sources = [
"${examples_common_plat_dir}/main.cpp",
"src/AppTask.cpp",
"src/BindingHandler.cpp",
"src/LightSwitchMgr.cpp",
"src/ZclCallbacks.cpp",
]

Expand Down Expand Up @@ -206,7 +204,7 @@ silabs_executable("light_switch_app") {
}

group("silabs") {
deps = [ ":light_switch_app" ]
deps = [ ":lit_icd_app" ]
}

group("default") {
Expand Down
101 changes: 18 additions & 83 deletions examples/lit-icd-app/silabs/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Matter EFR32 Light Switch Example
# Matter EFR32 Lit ICD Example

An example showing the use of CHIP on the Silicon Labs EFR32 MG12 and MG24.

<hr>

- [Matter EFR32 Light Switch Example](#matter-efr32-light-switch-example)
- [Matter EFR32 LIT ICD Example](#matter-efr32-lit-icd-example)
- [Introduction](#introduction)
- [Building](#building)
- [Linux](#linux)
Expand Down Expand Up @@ -34,8 +34,8 @@ An example showing the use of CHIP on the Silicon Labs EFR32 MG12 and MG24.
## Introduction

The EFR32 light switch example provides a baseline demonstration of a on-off
light switch device, built using Matter and the Silicon Labs gecko SDK. It can
The EFR32 lit icd example provides a baseline demonstration of a on-off
lit icd device, built using Matter and the Silicon Labs gecko SDK. It can
be controlled by a Chip controller over an Openthread or Wifi network.

The EFR32 device can be commissioned over Bluetooth Low Energy where the device
Expand All @@ -47,7 +47,7 @@ If the LCD is enabled, the LCD on the Silabs WSTK shows a QR Code containing the
needed commissioning information for the BLE connection and starting the
Rendez-vous procedure.

The light switch example is intended to serve both as a means to explore the
The lit icd example is intended to serve both as a means to explore the
workings of Matter as well as a template for creating real products based on the
Silicon Labs platform.

Expand Down Expand Up @@ -106,7 +106,7 @@ Silicon Labs platform.
* Build the example application:

cd ~/connectedhomeip
./scripts/examples/gn_silabs_example.sh ./examples/light-switch-app/silabs/ ./out/light-switch-app BRD4187C
./scripts/examples/gn_silabs_example.sh ./examples/lit-icd-app/silabs/ ./out/lit-icd-app BRD4187C

- To delete generated executable, libraries and object files use:

Expand All @@ -115,7 +115,7 @@ Silicon Labs platform.

OR use GN/Ninja directly

$ cd ~/connectedhomeip/examples/light-switch-app/silabs
$ cd ~/connectedhomeip/examples/lit-icd-app/silabs
$ git submodule update --init
$ source third_party/connectedhomeip/scripts/activate.sh
$ export SILABS_BOARD=BRD4187C
Expand All @@ -124,28 +124,20 @@ Silicon Labs platform.

- To delete generated executable, libraries and object files use:

$ cd ~/connectedhomeip/examples/light-switch-app/silabs
$ cd ~/connectedhomeip/examples/lit-icd-app/silabs
$ rm -rf out/

* Build the example with Matter shell

./scripts/examples/gn_silabs_example.sh examples/light-switch-app/silabs/ out/light-switch-app BRD4187C chip_build_libshell=true

* Build the example as Intermittently Connected Device (ICD)

$ ./scripts/examples/gn_silabs_example.sh ./examples/light-switch-app/silabs/ ./out/light-switch-app_ICD BRD4187C --icd

or use gn as previously mentioned but adding the following arguments:

$ gn gen out/debug '--args=SILABS_BOARD="BRD4187C" enable_sleepy_device=true chip_openthread_ftd=false chip_build_libshell=true'
./scripts/examples/gn_silabs_example.sh examples/lit-icd-app/silabs/ out/lit-icd-app BRD4187C chip_build_libshell=true

* Build the example with pigweed RCP

$ ./scripts/examples/gn_silabs_example.sh examples/light-switch-app/silabs/ out/light-switch-app_rpc BRD4187C 'import("//with_pw_rpc.gni")'
$ ./scripts/examples/gn_silabs_example.sh examples/lit-icd-app/silabs/ out/lit-icd-app_rpc BRD4187C 'import("//with_pw_rpc.gni")'

or use GN/Ninja Directly

$ cd ~/connectedhomeip/examples/light-switch-app/silabs
$ cd ~/connectedhomeip/examples/lit-icd-app/silabs
$ git submodule update --init
$ source third_party/connectedhomeip/scripts/activate.sh
$ export SILABS_BOARD=BRD4187C
Expand All @@ -161,8 +153,8 @@ arguments

- On the command line:

$ cd ~/connectedhomeip/examples/light-switch-app/silabs
$ python3 out/debug/matter-silabs-light-switch-example.flash.py
$ cd ~/connectedhomeip/examples/lit-icd-app/silabs
$ python3 out/debug/matter-silabs-lit-icd-example.flash.py

- Or with the Ozone debugger, just load the .out file.

Expand Down Expand Up @@ -284,64 +276,7 @@ combination with JLinkRTTClient as follows:

**Push Button 1**

- Sends a Toggle command to bound light app

**Matter shell**

**_OnOff Cluster_**

- 'switch onoff on' : Sends unicast On command to bound device
- 'switch onoff off' : Sends unicast Off command to bound device
- 'switch onoff toggle' : Sends unicast Toggle command to bound device

- 'switch groups onoff on' : Sends On group command to bound group
- 'switch groups onoff off' : Sends On group command to bound group
- 'switch groups onoff toggle' : Sends On group command to bound group

**_Binding Cluster_**

- 'switch binding unicast <fabric index> <node id> <endpoint>' : Creates a unicast binding
- 'switch binding group <fabric index> <group id>' : Creates a group binding

* You can provision and control the Chip device using the python controller,
[CHIPTool](https://github.com/project-chip/connectedhomeip/blob/master/examples/chip-tool/README.md)
standalone, Android or iOS app

Here is an example with the CHIPTool for unicast commands only:

```
chip-tool pairing ble-thread 1 hex:<operationalDataset> 20202021 3840
chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [<chip-tool-node-id>], "targets": null },{"fabricIndex": 1, "privilege": 3, "authMode": 2, "subjects": [1], "targets": null }]' <lighting-node-id> 0
chip-tool binding write binding '[{"fabricIndex": 1, "node": <lighting-node-id>, "endpoint": 1, "cluster":6}]' 1 1
```
Here is an example with the CHIPTool for groups commands only:
```
chip-tool pairing ble-thread 1 hex:<operationalDataset> 20202021 3840
chip-tool tests TestGroupDemoConfig --nodeId 1
chip-tool tests TestGroupDemoConfig --nodeId <lighting-node-id>
chip-tool binding write binding '[{"fabricIndex": 1, "group": 257}]' 1 1
```
To run the example with unicast and groups commands, run the group
configuration commands and replace the last one with binding this command
```
chip-tool binding write binding '[{"fabricIndex": 1, "group": 257},{"fabricIndex": 1, "node": <lighting-node-id>, "endpoint": 1, "cluster":6} ]' 1 1
```
To acquire the chip-tool node id, read the acl table right after
commissioning
```
./connectedhomeip/out/chip-tool/chip-tool accesscontrol read acl <nodeid> 0
```
- Triggers a User action event to transition the ICD to Active mode.

### Notes

Expand Down Expand Up @@ -418,19 +353,19 @@ features can easily be toggled on or off. Here is a short list of options :

chip_progress_logging, chip_detail_logging, chip_automation_logging

$ ./scripts/examples/gn_silabs_example.sh ./examples/light-switch-app/silabs ./out/light-switch-app BRD4164A "chip_detail_logging=false chip_automation_logging=false chip_progress_logging=false"
$ ./scripts/examples/gn_silabs_example.sh ./examples/lit-icd-app/silabs ./out/lit-icd-app BRD4164A "chip_detail_logging=false chip_automation_logging=false chip_progress_logging=false"

### Debug build / release build

is_debug

$ ./scripts/examples/gn_silabs_example.sh ./examples/light-switch-app/silabs ./out/light-switch-app BRD4164A "is_debug=false"
$ ./scripts/examples/gn_silabs_example.sh ./examples/lit-icd-app/silabs ./out/lit-icd-app BRD4164A "is_debug=false"

### Disabling LCD

show_qr_code

$ ./scripts/examples/gn_silabs_example.sh ./examples/light-switch-app/silabs ./out/light-switch-app BRD4164A "show_qr_code=false"
$ ./scripts/examples/gn_silabs_example.sh ./examples/lit-icd-app/silabs ./out/lit-icd-app BRD4164A "show_qr_code=false"

### KVS maximum entry count

Expand All @@ -439,4 +374,4 @@ kvs_max_entries
Set the maximum Kvs entries that can be stored in NVM (Default 75)
Thresholds: 30 <= kvs_max_entries <= 255

$ ./scripts/examples/gn_silabs_example.sh ./examples/light-switch-app/silabs ./out/light-switch-app BRD4164A kvs_max_entries=50
$ ./scripts/examples/gn_silabs_example.sh ./examples/lit-icd-app/silabs ./out/lit-icd-app BRD4164A kvs_max_entries=50
Loading

0 comments on commit 2551872

Please sign in to comment.