Skip to content

Commit

Permalink
Cherry-pick chef tool (#17653)
Browse files Browse the repository at this point in the history
* chef sample app (#16731)

* new: chef app is a configurable application that processes zap files during the build process

Change-Id: Ia6aeba2d5587e09074defcd34dc5028288d74a90

* fix: esp32 functional on master on 28/mar/2021

Change-Id: I33f572f313dc7be91e208b074fe6ba6c7ab9da31

* chg: removed old zap files that need to be updated

Change-Id: Ibbe26ad39ba69d251fd4ef956632eb1aac9dfdf8

* Restyled by whitespace

* Restyled by clang-format

* Restyled by gn

* Restyled by prettier-markdown

* Restyled by autopep8

* fix: init server on scheduled task

Change-Id: If7c287ea7e9632fb8b4a49e8e4c82af4002cf4e4

* fix: excluded unsued context from task call

Change-Id: I8a353828804b2a203d336e47edbe58ce7d62163a

* chg: fixes to paths in README file

Change-Id: I252594388ec759c84525ea9090c153bdd7f80d3f

* fix: update to zap regen script to ignore chef sample app

Change-Id: Ia17baae1a7cca206fd1854928f1b56ca05c0b9e7

* Update wordlist: add new work (flags gzbf) and sort|unique the word list

Co-authored-by: Restyled.io <[email protected]>
Co-authored-by: Andrei Litvin <[email protected]>

* Chef Sample App - yaml configuration file (#17330)

* chg: removed config file, SDK path needs to be set as environment variable

Change-Id: Ied6a186f5d7370818461f921e76309a0508aaaf5

* chg: config file is now a YAML file

Change-Id: Ia34b45c1e54245b94da06dca626170a78581b7b9

* chg: zap-generated files in independent folders by device type

Change-Id: If86a393576166a03f1aa801947b36233308e6df4

* fix: fixes CMakeLists files for ESP32 and nrfconnect to build on current tot

Change-Id: Ia6f94dfc6a186036f41af1c567b4b8416ff2ef22

* chg: applied restyle

Change-Id: I38f52568e0a7f967b35ad42ca7ade1373235c3fe

* fix: added a words to .wordslist

Change-Id: I84a7cb6ea7830146711450d0d713b9da2fd895b4

* Update .wordlist.txt

* Update README.md

* Update README.md

* Update .wordlist.txt

* fix: reverted unwanted change to submodule hash reference

Change-Id: I15fee54e792d8aa06d83051b803c9e27093d29d3

* Restyled by autopep8

Co-authored-by: Douglas Rocha Ferraz <[email protected]>
Co-authored-by: Restyled.io <[email protected]>
Co-authored-by: Andrei Litvin <[email protected]>
  • Loading branch information
4 people authored Apr 22, 2022
1 parent b3c47ab commit 8171632
Show file tree
Hide file tree
Showing 38 changed files with 8,978 additions and 31 deletions.
54 changes: 23 additions & 31 deletions .github/.wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ APIs
apk
AppConfig
AppImpl
appliable
ApplianceControl
applianceeventsandalert
ApplianceIdentification
Expand All @@ -69,6 +70,7 @@ ApplyUpdateRequest
ApplyUpdateResponse
approver
appspot
appwrite
aps
arg
argc
Expand Down Expand Up @@ -142,6 +144,7 @@ BooleanState
bootable
Bootloader
BorderRouterAP
bouffalolab
BRD
breakpoint
bredr
Expand Down Expand Up @@ -231,6 +234,7 @@ clusterAttrs
clusterId
clusterList
clusterListName
ClusterObjectTests
ClusterRevision
ClusterTestGeneration
cmake
Expand All @@ -250,11 +254,13 @@ Comcast
Commandline
Commissionable
commissionables
commissionee
CommissioningFlow
commondatastorage
CONF
CONFIG
ConfigDescription
configs
configTOTAL
ConfigurationManager
ConfigurationManagerImpl
Expand Down Expand Up @@ -291,6 +297,7 @@ CQM
crypto
cryptographic
CSA
csg
csrrequest
csu
csv
Expand All @@ -310,6 +317,7 @@ dadbdcdddedf
DAP
DAPLINK
DataFrame
datamodel
DataModelRevision
dataset
datasets
Expand Down Expand Up @@ -402,6 +410,7 @@ Dockerfile
Dockerfiles
Don'ts
DoorLock
doru
DOTBR
DOVERLAY
downcasting
Expand Down Expand Up @@ -562,6 +571,7 @@ gtk
GUA
Gv
gz
gzbf
HaloaceticAcidsConcentrationMeasurement
hardcoded
hardknott
Expand Down Expand Up @@ -645,6 +655,7 @@ isLowerCase
isUpperCase
itemName
iterable
itsfoss
JDK
jinja
JLink
Expand Down Expand Up @@ -828,7 +839,6 @@ mydir
MyPASSWORD
MySSID
NAMESERVER
nameserver
namespacing
nano
natively
Expand Down Expand Up @@ -903,6 +913,7 @@ otaImageList
OTAImageProcessorDriver
OTAImageProcessorImpl
OTAImageProcessorInterface
otaissues
OTAProvider
OTAProviderIpAddress
OTAProviderNodeId
Expand All @@ -913,6 +924,7 @@ OTARequestorDriver
OTARequestorSerialPort
OtaSoftwareUpdateProvider
otasoftwareupdaterequestor
otatesting
otaURL
OTBR
otcli
Expand Down Expand Up @@ -940,6 +952,7 @@ PCA
pcaps
PDFs
PDK
PDM
peerAddrStr
peerNodeId
peerSessionId
Expand Down Expand Up @@ -989,6 +1002,7 @@ ProxyValid
ProxyView
PRs
PSCAN
PSECT
PSK
PSoC
PTR
Expand Down Expand Up @@ -1019,6 +1033,7 @@ QSPI
QueryImage
QueryImageResponse
queryImageStatus
Quickstart
qvCHIP
RADVD
raspberryPi
Expand Down Expand Up @@ -1068,6 +1083,7 @@ rootfs
RPC
RPCs
RPi
RPis
rsn
RSSI
rsync
Expand Down Expand Up @@ -1151,6 +1167,7 @@ spinel
src
SRP
SRV
SSBL
SSID
startoffset
StartScan
Expand Down Expand Up @@ -1220,6 +1237,7 @@ TESTSSID
TestString
TestStruct
TestThreadStackMgr
TestTimedRequestTimeout
TestUint
TestUpdateValue
testws
Expand Down Expand Up @@ -1256,10 +1274,11 @@ totalTests
TotalTrihalomethanesConcentrationMeasurement
trackAlloc
trackFree
transitionTime
TransferSession
transitionTime
TransportMgrBase
TrustedRootCertificates
tsan
TSG
tsv
TTL
Expand Down Expand Up @@ -1338,6 +1357,7 @@ WaitNewInputEvent
WakeOnLan
WantedBy
webpage
wg
wget
whde
whitespace
Expand All @@ -1363,8 +1383,8 @@ xAAAA
xab
xaver
xb
xbef
xBEEF
xbef
xc
xcd
Xcode
Expand Down Expand Up @@ -1423,31 +1443,3 @@ zephyrproject
Zigbee
zigbeealliance
zigbeethread
libshell
TestGroupDemoConfig
ACLs
AddNOC
CHIPConfig
CHIPProjectAppConfig
CaseAdminNode
DataVersion
ProxyView
ReadAttribute
WriteAttribute
kAdminister
kManage
kOperate
kView
xFFFFFFFD
ClusterObjectTests
TestTimedRequestTimeout
datamodel
appliable
commissionee
configs
NAMESERVER
UTF
localedef
nameserver
nmcli
tsan
4 changes: 4 additions & 0 deletions examples/chef/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
config.yaml
project_include.cmake
linux/args.gni
linux/sample.gni
60 changes: 60 additions & 0 deletions examples/chef/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# MATTER CHEF APP

The purpose of the chef app is to to increase the coverage of device types in
Matter.

It uses the shell app a starting point, adding the processing of ZAP files and
the support of a few targets under a unified build script: `chef.py`.

As it incorporates the processing of ZAP files as part of the build process, it
does not use `zzz_generated`, but rather places the auto-generated zap artifacts
under its `zap-generated` temporary folder.

All device types available (DM/IM .zap files) are found inside the `devices`
folder.

## Building a Sample Application

Run `chef.py -h` to see the available commands

## Building your first sample

1. Make sure you have the toolchain installed for your desired target
2. Run `chef.py` the first time to create a `config.yaml` configuration file. If
you already have SDK environment variables such as IDF_PATH (esp32) and
ZEPHYR_BASE (nrfconnect) it will use those values as default.
3. Update your the SDK paths on `config.yaml`. TTY is the path used by the
platform to enumerate its device as a serial port. Typical values are:

```
# ESP32 macOS
TTY: /dev/tty.usbmodemXXXXXXX
# ESP32 Linux
TTY: /dev/ttyACM0
# NRFCONNECT macOS
TTY: /dev/tty.usbserial-XXXXX
# NRFCONNECT Linux
TTY: /dev/ttyUSB0
```

4. Run `$ chef.py -u` to update zap and the toolchain (on selected platforms)
5. Run `$ chef.py -gzbf -t <platform> -d lighting`. This command will run the
ZAP GUI opening the `devices/lighting.zap` file and will allow editing. It
will then generate the zap artifacts, place them on the `zap-generated`
folder, run a build and flash the binary in your target

## Creating a new device type in your device library

1. Run `$ chef.py -g -d <device>` to open in the ZAP GUI a device to be used as
a starting point.
2. Edit your cluster configurations
3. Click on `Save As` and save the file with the name of your new device type
into the `devices` folder. This device is now available for the script. See
`chef.py -h` for a list of devices available.
1 change: 1 addition & 0 deletions examples/chef/README_DEVICE.md
1 change: 1 addition & 0 deletions examples/chef/README_OTCLI.md
1 change: 1 addition & 0 deletions examples/chef/README_SHELL.md
Loading

0 comments on commit 8171632

Please sign in to comment.