Skip to content

Commit 4442906

Browse files
rochaferrazrestyled-commitsbzbarsky-apple
authored
Sample Manufacturer Extension Cluster (#29162)
* 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>
1 parent 041ba33 commit 4442906

File tree

62 files changed

+18833
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+18833
-6
lines changed

.github/.wordlist.txt

+1
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,7 @@ MDNS
849849
MediaInput
850850
MediaPlayback
851851
MediaTek
852+
MEI
852853
mem
853854
memdf
854855
MemMonitoring

.github/workflows/tests.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ jobs:
180180
src/app/zap-templates/zcl/data-model/draft/input-output-value-clusters.xml \
181181
src/app/zap-templates/zcl/data-model/draft/onoff-switch-configuration-cluster.xml \
182182
src/app/zap-templates/zcl/data-model/chip/resource-monitoring-cluster.xml \
183+
src/app/zap-templates/zcl/data-model/chip/sample-mei-cluster.xml \
183184
"
184185
- name: Build Apps
185186
run: |

examples/chef/README.md

+27
Original file line numberDiff line numberDiff line change
@@ -210,3 +210,30 @@ To add new devices for chef:
210210
`examples/chef/devices`.
211211
- This is gated by the workflow in `.github/workflows/zap_templates.yaml`.
212212
- All devices added to the repository are built in CD.
213+
214+
## Manufacturer Extensions / Custom Clusters
215+
216+
You may add vendor-defined features to chef. The
217+
`rootnode_onofflight_meisample*` device showcases its usage by using the Sample
218+
MEI cluster which is defined on
219+
`src/app/zap-templates/zcl/data-model/chip/sample-mei-cluster.xml`
220+
221+
This cluster has
222+
223+
- One boolean attribute: `flip-flop`
224+
- A `ping` command with no arguments
225+
- A command/response pair `add-arguments`. The command takes two uint8
226+
arguments and the response command returns their sum.
227+
228+
You may test the `Sample MEI` via chip-tool using the following commands:
229+
230+
```
231+
# commissioning of on-network chef device
232+
chip-tool pairing onnetwork 1 20202021
233+
# tests command to sum arguments: returns 30
234+
chip-tool samplemei add-arguments 1 1 10 20
235+
# sets Flip-Flop to false
236+
chip-tool samplemei write flip-flop 0 1 1
237+
# reads Flip-Flop
238+
chip-tool samplemei read flip-flop 1 1
239+
```

0 commit comments

Comments
 (0)