Skip to content

Commit

Permalink
Sample Manufacturer Extension Cluster (#29162)
Browse files Browse the repository at this point in the history
* new: chef test custom cluster

* MEI sample cluster. Chef device sample

* renamed some symbols

* fix: sampleMei doesn't need zap-generated command callbacks

* chg: new implementation of cluster supports many endpoints

* chg: zap regen

* chg: removed unused variable captured in closure

* chg: changed %lu to %zu for size_t types

* commands made non-optional. Restyle

* removed reference for availability.yaml

* fix: controller-clusters.zap as a samplemei client cluster, not server

* fix: sample mei command handling on adding, availability.yaml

* chg: replaced %zu to type castings. Lint doesn't like %zu

* fix: removed event list from data model

* fix: event list removed from controller-clusters.zap

* chg: sample mei <code> tag doc

* fix: last bits of controller-clusters.zap got cut when rebased

* chg: zap regen after new zap version installed

* changed MEI to Mei in cluster name

* Restyled by whitespace

* Restyled by clang-format

* Update src/darwin/Framework/CHIP/templates/availability.yaml

Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>

* Update src/app/zap-templates/zcl/data-model/chip/sample-mei-cluster.xml

Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>

* Update src/app/clusters/sample-mei-server/sample-mei-server.cpp

Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>

* capitalized MEI

* chg: cluster added to ClustersWithShutdownFunctions

* chg: included app/util/config.h in sample-mei-server.h

* fix: shutdown calls UnregisterEndpoint

* fix: shutdown calls UnregisterEndpoint

* fix: name of cluster in config-data.yaml

* Restyled by clang-format

* chg: removed dead code

* chg: error codes for r/w

* Restyled by clang-format

* chg: issue number in config-data.yaml

---------

Co-authored-by: Restyled.io <commits@restyled.io>
Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
  • Loading branch information
3 people authored and pull[bot] committed Dec 1, 2023
1 parent d6a5288 commit b1b7370
Show file tree
Hide file tree
Showing 62 changed files with 18,833 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/.wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,7 @@ MDNS
MediaInput
MediaPlayback
MediaTek
MEI
mem
memdf
MemMonitoring
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ jobs:
src/app/zap-templates/zcl/data-model/draft/input-output-value-clusters.xml \
src/app/zap-templates/zcl/data-model/draft/onoff-switch-configuration-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/resource-monitoring-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/sample-mei-cluster.xml \
"
- name: Build Apps
run: |
Expand Down
27 changes: 27 additions & 0 deletions examples/chef/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,30 @@ To add new devices for chef:
`examples/chef/devices`.
- This is gated by the workflow in `.github/workflows/zap_templates.yaml`.
- All devices added to the repository are built in CD.

## Manufacturer Extensions / Custom Clusters

You may add vendor-defined features to chef. The
`rootnode_onofflight_meisample*` device showcases its usage by using the Sample
MEI cluster which is defined on
`src/app/zap-templates/zcl/data-model/chip/sample-mei-cluster.xml`

This cluster has

- One boolean attribute: `flip-flop`
- A `ping` command with no arguments
- A command/response pair `add-arguments`. The command takes two uint8
arguments and the response command returns their sum.

You may test the `Sample MEI` via chip-tool using the following commands:

```
# commissioning of on-network chef device
chip-tool pairing onnetwork 1 20202021
# tests command to sum arguments: returns 30
chip-tool samplemei add-arguments 1 1 10 20
# sets Flip-Flop to false
chip-tool samplemei write flip-flop 0 1 1
# reads Flip-Flop
chip-tool samplemei read flip-flop 1 1
```
Loading

0 comments on commit b1b7370

Please sign in to comment.