esp-matter
esp-matter copied to clipboard
Simple way to generate TLV encode/decode logic (CON-1150)
I would like to be able to write a small XML file describing my custom clusters and then run a tool to generate the TLV encode/decode logic. zap can do that, but ... how can I run zap over a small amount of external XML without rebuilding all of CHIP?
@jonsmirl This is how you can add custom cluster.
- Write data model xml in required format.
- Add entry of the xml/s to the src/app/zap-templates/zcl/zcl-with-test-extensions.json, src/app/zap-templates/zcl/zcl.json and src/app/zap-templates/zcl/data-model/all.xml.
- Use script to regenerate zap. ./scripts/tools/zap_regen_all.py
There should be a simpler way to do this. Wouldn't you like to put the XML for the Rainmaker cluster into the build, and then when you build, the build process generates the Encode/Decode file?
In the short term... can you check an empty XML file into CHIP named custom.xml and edit src/app/zap-templates/zcl/zcl-with-test-extensions.json, src/app/zap-templates/zcl/zcl.json and src/app/zap-templates/zcl/data-model/all.xml to process it? Then all you have to do is replace custom.xml with your own XML. But that still leaves the manual process of digging the generated code out of the zzz directories.
As of now this is the way to add custom cluster.