Skip to content

Commit

Permalink
[Group] Configure Chip-tool's GroupDataProvider (#16232)
Browse files Browse the repository at this point in the history
* Configure Chip-tool's GroupDataProvider
  • Loading branch information
jepenven-silabs authored and pull[bot] committed Nov 15, 2023
1 parent 3e00a29 commit 90dd8fe
Show file tree
Hide file tree
Showing 6 changed files with 430 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .github/.wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ cxx
CY
CYW
DAC
dadbdcdddedf
DAP
DAPLINK
DataFrame
Expand Down Expand Up @@ -358,6 +359,7 @@ DevKitC
DevKitM
devtype
df
dfe
dfu
DgDxsfHx
dhclient
Expand Down Expand Up @@ -542,6 +544,7 @@ Gradle
gradlew
GroupId
GroupKeyManagement
groupsettings
gtk
GUA
Gv
Expand Down Expand Up @@ -646,6 +649,7 @@ kBusy
kCase
Kconfig
KeypadInput
keyset
kGroup
kInvalidCommandId
KitProg
Expand Down Expand Up @@ -1184,6 +1188,7 @@ TestEmptyString
TestGenExample
TestGroupDemoConfig
TestMultiRead
TestName
TESTPASSWD
TestPICS
TESTSSID
Expand Down Expand Up @@ -1326,6 +1331,7 @@ WS
WSL
WSTK
xa
xAAAA
xab
xaver
xb
Expand Down Expand Up @@ -1358,6 +1364,8 @@ xfffff
xFFFFFFFD
xffffffffe
xfffffffff
xffffffffffff
xffffffffffffXXXX
xtensa
xwayland
XXXX
Expand Down
39 changes: 39 additions & 0 deletions examples/chip-tool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,45 @@ The endpoint id must be between 1 and 240.

The client will send a single command packet and then exit.

## Configuring the client for Group Commands

Prior to sending a Group command, both the end device and the Client (Chip-tool)
must be configured appropriately.

To configure the client please use the groupsettings option

$ chip-tool groupsettings

A group with a valid encryption key needs to be set. The groupid and the
encryption key must match the one configured on the end device.

To add a group

$ chip-tool groupsettings add-group TestName 0x1010

To add a keyset

$ chip-tool groupsettings add-keyset 0xAAAA 0 0x000000000021dfe0 hex:d0d1d2d3d4d5d6d7d8d9dadbdcdddedf

Take note that the epoch key must be in hex form with the 'hex:' prefix

Finally to bind the keyset to the group

$ chip-tool groupsettings bind-keyset 0x1010 0xAAAA

## Using the Client to Send Group (Multicast) Matter Commands

To use the Client to send Matter commands, run the built executable and pass it
the target cluster name, the target command name, the Group Id in Node Id form
(0xffffffffffffXXXX) and an unused endpoint Id. Take note that Only commands and
attributes write can be send with Group Id.

E.G. sending to group Id 0x0025

$ chip-tool onoff on 0xffffffffffff0025 1

The client will send a single multicast command packet and then exit.

### How to get the list of supported clusters

To get the list of supported clusters, run the built executable without any
Expand Down
2 changes: 1 addition & 1 deletion examples/chip-tool/commands/common/CHIPCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ CHIP_ERROR CHIPCommand::Run()
ReturnLogErrorOnFailure(InitializeCommissioner(kIdentityGamma, kIdentityGammaFabricId, trustStore));

// Initialize Group Data
ReturnLogErrorOnFailure(chip::GroupTesting::InitProvider());
ReturnLogErrorOnFailure(chip::GroupTesting::InitProvider(mDefaultStorage));
for (auto it = mCommissioners.begin(); it != mCommissioners.end(); it++)
{
chip::FabricInfo * fabric = it->second->GetFabricInfo();
Expand Down
Loading

0 comments on commit 90dd8fe

Please sign in to comment.