Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Camera clusters XML #35773

Draft
wants to merge 21 commits into
base: master
Choose a base branch
from
Draft

Add Camera clusters XML #35773

wants to merge 21 commits into from

Conversation

gmarcosb
Copy link
Contributor

Add camera clusters from https://github.com/CHIP-Specifications/connectedhomeip-spec/pull/10004

Generated with (with some hand-edits to work with ZAP compile):

for camera_cluster in 'WebRTC_Requestor.adoc' 'WebRTC_Provider.adoc' 'Chime.adoc' 'PushAVStreamTransport.adoc' 'CameraAVStreamManagement.adoc' 'CameraAVSettingsUserLevelManagement.adoc'
do
 ./alchemy zap --attribute="in-progress"  --sdkRoot=[] --specRoot=[] camera_cluster
done
 ./scripts/tools/zap_regen_all.py

Note to reviewer: if you prefer, I'm happy to split this into 1-pull-per-cluster, I just thought it may be easier to review them together as they share structures & concepts

Note that this pull also includes some necessary dependent changes (which, I'm also happy to split out to separate pull if preferred)

  1. Addition of ThreeLevelAutoEnum, which [although defined in the spec] did not seem to have a type spec
  2. Add missing schema definitions to zcl.xsd

Copy link

semanticdiff-com bot commented Sep 25, 2024

Review changes with SemanticDiff.

Analyzed 12 of 152 files.

Overall, the semantic diff is 2% smaller than the GitHub diff.

File Information
Filename Status
zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h Unsupported file format
zzz_generated/chip-tool/zap-generated/cluster/Commands.h Unsupported file format
zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp Unsupported file format
zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h Unsupported file format
zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp Unsupported file format
zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h Unsupported file format
zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp Unsupported file format
zzz_generated/app-common/app-common/zap-generated/callback.h Unsupported file format
zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h Unsupported file format
zzz_generated/app-common/app-common/zap-generated/cluster-enums.h Unsupported file format
zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp Unsupported file format
zzz_generated/app-common/app-common/zap-generated/cluster-objects.h Unsupported file format
zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h Unsupported file format
zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h Unsupported file format
zzz_generated/app-common/app-common/zap-generated/ids/Commands.h Unsupported file format
zzz_generated/app-common/app-common/zap-generated/ids/Events.h Unsupported file format
zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp Unsupported file format
zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h Unsupported file format
src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm Unsupported file format
src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm Unsupported file format
src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h Unsupported file format
src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm Unsupported file format
src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h Unsupported file format
src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm Unsupported file format
src/darwin/Framework/CHIP/zap-generated/MTRClusters.h Unsupported file format
src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm Unsupported file format
src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h Unsupported file format
src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm Unsupported file format
src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h Unsupported file format
src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm Unsupported file format
src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm Unsupported file format
src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h Unsupported file format
src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm Unsupported file format
✔️ src/controller/python/chip/clusters/CHIPClusters.py Analyzed
✔️ src/controller/python/chip/clusters/Objects.py Analyzed
src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp Unsupported file format
src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp Unsupported file format
src/controller/java/generated/java/matter/controller/cluster/files.gni Unsupported file format
✔️ src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java Analyzed
✔️ src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java Analyzed
✔️ src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java Analyzed
✔️ src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java Analyzed
✔️ src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java Analyzed
✔️ src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java Analyzed
✔️ src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java Analyzed
src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni Unsupported file format
src/controller/data_model/controller-clusters.matter Unsupported file format
✔️ src/app/zap_cluster_list.json 14.29% smaller
✔️ src/app/zap-templates/zcl/zcl-with-test-extensions.json 57.07% smaller
✔️ src/app/zap-templates/zcl/zcl.json 57.07% smaller
src/app/zap-templates/zcl/zcl.xsd Unsupported file format
src/app/zap-templates/zcl/data-model/draft/camera-av-settings-user-level-management-cluster.xml Unsupported file format
src/app/zap-templates/zcl/data-model/draft/camera-av-stream-management-cluster.xml Unsupported file format
src/app/zap-templates/zcl/data-model/draft/chime-cluster.xml Unsupported file format
src/app/zap-templates/zcl/data-model/draft/push-av-stream-transport-cluster.xml Unsupported file format
src/app/zap-templates/zcl/data-model/draft/web-rtc-provider-cluster.xml Unsupported file format
src/app/zap-templates/zcl/data-model/draft/web-rtc-requestor-cluster.xml Unsupported file format
src/app/zap-templates/zcl/data-model/chip/global-bitmaps.xml Unsupported file format
src/app/zap-templates/zcl/data-model/chip/global-enums.xml Unsupported file format
src/app/zap-templates/zcl/data-model/chip/global-structs.xml Unsupported file format
scripts/rules.matterlint Unsupported file format
examples/window-app/common/window-app.matter Unsupported file format
examples/virtual-device-app/virtual-device-common/virtual-device-app.matter Unsupported file format
examples/tv-casting-app/tv-casting-common/tv-casting-app.matter Unsupported file format
examples/tv-app/tv-common/tv-app.matter Unsupported file format
examples/thread-br-app/thread-br-common/thread-br-app.matter Unsupported file format
examples/thermostat/thermostat-common/thermostat.matter Unsupported file format
examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter Unsupported file format
examples/thermostat/nxp/zap/thermostat_matter_thread.matter Unsupported file format
examples/thermostat/nxp/zap/thermostat_matter_wifi.matter Unsupported file format
examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter Unsupported file format
examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter Unsupported file format
examples/rvc-app/rvc-common/rvc-app.matter Unsupported file format
examples/refrigerator-app/refrigerator-common/refrigerator-app.matter Unsupported file format
examples/pump-controller-app/pump-controller-common/pump-controller-app.matter Unsupported file format
examples/pump-app/silabs/data_model/pump-thread-app.matter Unsupported file format
examples/pump-app/silabs/data_model/pump-wifi-app.matter Unsupported file format
examples/pump-app/pump-common/pump-app.matter Unsupported file format
examples/placeholder/linux/apps/app2/config.matter Unsupported file format
examples/placeholder/linux/apps/app1/config.matter Unsupported file format
examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter Unsupported file format
examples/ota-provider-app/ota-provider-common/ota-provider-app.matter Unsupported file format
examples/network-manager-app/network-manager-common/network-manager-app.matter Unsupported file format
examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter Unsupported file format
examples/log-source-app/log-source-common/log-source-app.matter Unsupported file format
examples/lock-app/qpg/zap/lock.matter Unsupported file format
examples/lock-app/nxp/zap/lock-app.matter Unsupported file format
examples/lock-app/lock-common/lock-app.matter Unsupported file format
examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter Unsupported file format
examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.matter Unsupported file format
examples/lighting-app/silabs/data_model/lighting-thread-app.matter Unsupported file format
examples/lighting-app/silabs/data_model/lighting-wifi-app.matter Unsupported file format
examples/lighting-app/qpg/zap/light.matter Unsupported file format
examples/lighting-app/nxp/zap/lighting-on-off.matter Unsupported file format
examples/lighting-app/lighting-common/lighting-app.matter Unsupported file format
examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter Unsupported file format
examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter Unsupported file format
examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter Unsupported file format
examples/light-switch-app/qpg/zap/switch.matter Unsupported file format
examples/light-switch-app/light-switch-common/light-switch-app.matter Unsupported file format
examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter Unsupported file format
examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.matter Unsupported file format
examples/energy-management-app/energy-management-common/energy-management-app.matter Unsupported file format
examples/dishwasher-app/dishwasher-common/dishwasher-app.matter Unsupported file format
examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.matter Unsupported file format
examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter Unsupported file format
examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter Unsupported file format
examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter Unsupported file format
examples/chef/devices/rootnode_airpurifier_73a6fe2651.matter Unsupported file format
examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter Unsupported file format
examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter Unsupported file format
examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter Unsupported file format
examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter Unsupported file format
examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter Unsupported file format
examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter Unsupported file format
examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter Unsupported file format
examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter Unsupported file format
examples/chef/devices/rootnode_dishwasher_cc105034fe.matter Unsupported file format
examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter Unsupported file format
examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter Unsupported file format
examples/chef/devices/rootnode_fan_7N2TobIlOX.matter Unsupported file format
examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter Unsupported file format
examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter Unsupported file format
examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter Unsupported file format
examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter Unsupported file format
examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter Unsupported file format
examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter Unsupported file format
examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter Unsupported file format
examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter Unsupported file format
examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter Unsupported file format
examples/chef/devices/rootnode_onofflight_samplemei.matter Unsupported file format
examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter Unsupported file format
examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter Unsupported file format
examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter Unsupported file format
examples/chef/devices/rootnode_pump_5f904818cc.matter Unsupported file format
examples/chef/devices/rootnode_pump_a811bb33a0.matter Unsupported file format
examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter Unsupported file format
examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter Unsupported file format
examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter Unsupported file format
examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter Unsupported file format
examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter Unsupported file format
examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter Unsupported file format
examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter Unsupported file format
examples/chef/devices/rootnode_waterleakdetector_0b067acfa3.matter Unsupported file format
examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter Unsupported file format
examples/bridge-app/bridge-common/bridge-app.matter Unsupported file format
examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter Unsupported file format
examples/all-clusters-app/all-clusters-common/all-clusters-app.matter Unsupported file format
examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter Unsupported file format
examples/air-purifier-app/air-purifier-common/air-purifier-app.matter Unsupported file format
docs/zap_clusters.md Unsupported file format
.github/workflows/tests.yaml Unsupported file format

@gmarcosb
Copy link
Contributor Author

@aronrosenberg FYI as this is the zap generation for the spec pull you have

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do split these out. Finding several small chunks of time to review separate PRs is much easier than finding a big chunk of time to review a single large PR. Splitting things out also allows the review work to be parallelized across more people, in general...

Note that there are merge issues here with ZLL_COMMISSIONING_CLUSTER being incorrectly re-introduced and whatnot. Those would be easier to catch in a smaller PR.

In terms of shared concepts... those are not really relevant to reviewing whether the spec was correctly translated into the XML.

By the way, whatever hand-edits you had to make should probably be turned into alchemy issues, if they were edits to alchemy output?

Copy link
Contributor Author

@gmarcosb gmarcosb Sep 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, will split it out!

Had some general questions here though before doing that:

  1. I put these in /draft - is that correct, or should I just put them in /chip?
  2. Hand edits: the camera spec is dependent on ~typedefs, e.g. VideoStreamID: This data type is derived from uint16 - but there doesn't seem to be a way to specify that in the zap xml schema, so I think it'd actually need zap generation changes
  3. structs used across clusters: should I put these in global-structs.xml as I have here, have them defined in one of the clusters, or something else altogether?
  4. If I don't add a <cluster code="0x0551"/> to those shared structures, zap generation ends up generating it in every single .matter file (even non-camera ones); if I add that restriction, though, it seems it causes duplicate definition (see build errors: multiple definition of ‘enum class chip::app::Clusters::detail::StreamTypeEnum’) - what's the right way of dealing with these shared structures?

Thanks Boris!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Good question. I think the "draft" bits got removed in Remove all un-specified draft clusters from SDK #35583 so putting them in draft likely does not do the right thing.
  2. Ah, yes, I discussed this with @andyg-apple just yesterday. Please talk to @hasty about Alchemy handling this by desugaring the typedefs for now?
  3. global-structs should be for actually global structs, which are not tied to any cluster or list of clusters at all. There are some open questions about which, if any, of the camera structs will end up that way. For now, I'd put them in one of the clusters, or a new camera-structs.xml or something.
  4. For global things (not associated with any clusters), listing them in all .matter files is correct. Things that are associated with clusters should work; please drop me a link on Slack to a branch or SHA that has the duplicate definition error for you, and I will take a look.

Copy link
Contributor Author

@gmarcosb gmarcosb Sep 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. As far as I can tell, as long as the /draft path is specified in xmlRoot of zcl.json, it seems to work & generate the files - but if we're moving away from the /draft path (which maybe seems to be the case?) then I'll just put these in /chip (let me know otherwise)
  2. Sounds good, I'll make the changes to alchemy, shouldn't be a problem (the files it will generate should look like my hand-edited ones, but I'll make the changes & verify in parallel)
  3. Will do 👍
  4. Will do 👍 (UPDATED: welp I can't get it to repro so I must be missing something, ignore this one)

Copy link
Contributor Author

@gmarcosb gmarcosb Sep 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First smaller PR with prereqs: #35775
WebRTC provider cluster: #35779
Chime cluster: #35806

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Right, but it's not specified there anymore, right? I figure putting these in chip makes sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alchemy support for "typedefs" so that we automatically get the ID types to be output as their raw simple types @ project-chip/alchemy#5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

2 participants