Skip to main content

matter_kit/clusters/generated/
mod.rs

1// Generated by `cargo xtask` from the CSA data model 1.6. Do not edit.
2//
3// Every cluster the specification defines.
4//
5// Regenerate with `cargo xtask clusters --dm <checkout>/data_model/1.6`; `cargo xtask check`
6// is the CI gate that keeps this file honest. The XML itself is not vendored here — it
7// carries the CSA's own copyright notice and is not redistributable.
8
9//! The Matter cluster library, generated from the CSA data model.
10//!
11//! One module per cluster. Each holds the cluster's identifiers, its feature bits,
12//! its enumerations and bitmaps as Rust types, and a [`Cluster`](crate::dm::spec::Cluster)
13//! carrying every element the specification defines with its conformance, access and
14//! qualities.
15//!
16//! These are the specification's tables, not a device's configuration. What a device
17//! serves is a [`ClusterDescriptor`](crate::dm::ClusterDescriptor), and
18//! [`Cluster::validate`](crate::dm::spec::Cluster::validate) is what checks one
19//! against the other — the drift that certification finds, found at home instead.
20
21/// Access Control — cluster `0x001F`.
22pub mod access_control;
23/// Account Login — cluster `0x050E`.
24pub mod account_login;
25/// Actions — cluster `0x0025`.
26pub mod actions;
27/// Activated Carbon Filter Monitoring — cluster `0x0072`.
28pub mod activated_carbon_filter_monitoring;
29/// Administrator Commissioning — cluster `0x003C`.
30pub mod administrator_commissioning;
31/// Air Quality — cluster `0x005B`.
32pub mod air_quality;
33/// Alarm Base — an abstract base: the types the clusters derived from it share,
34/// with no cluster id of its own.
35pub mod alarm_base;
36/// Ambient Context Sensing — cluster `0x0431`.
37pub mod ambient_context_sensing;
38/// Application Basic — cluster `0x050D`.
39pub mod application_basic;
40/// Application Launcher — cluster `0x050C`.
41pub mod application_launcher;
42/// Audio Output — cluster `0x050B`.
43pub mod audio_output;
44/// Basic Information — cluster `0x0028`.
45pub mod basic_information;
46/// Binding — cluster `0x001E`.
47pub mod binding;
48/// Boolean State — cluster `0x0045`.
49pub mod boolean_state;
50/// Boolean State Configuration — cluster `0x0080`.
51pub mod boolean_state_configuration;
52/// Bridged Device Basic Information — cluster `0x0039`.
53pub mod bridged_device_basic_information;
54/// Camera AV Settings User Level Management — cluster `0x0552`.
55pub mod camera_av_settings_user_level_management;
56/// Camera AV Stream Management — cluster `0x0551`.
57pub mod camera_av_stream_management;
58/// Carbon Dioxide Concentration Measurement — cluster `0x040D`.
59pub mod carbon_dioxide_concentration_measurement;
60/// Carbon Monoxide Concentration Measurement — cluster `0x040C`.
61pub mod carbon_monoxide_concentration_measurement;
62/// Channel — cluster `0x0504`.
63pub mod channel;
64/// Chime — cluster `0x0556`.
65pub mod chime;
66/// Closure Control — cluster `0x0104`.
67pub mod closure_control;
68/// Closure Dimension — cluster `0x0105`.
69pub mod closure_dimension;
70/// Color Control — cluster `0x0300`.
71pub mod color_control;
72/// Commissioner Control — cluster `0x0751`.
73pub mod commissioner_control;
74/// Commodity Metering — cluster `0x0B07`.
75pub mod commodity_metering;
76/// Commodity Price — cluster `0x0095`.
77pub mod commodity_price;
78/// Commodity Tariff — cluster `0x0700`.
79pub mod commodity_tariff;
80/// Content App Observer — cluster `0x0510`.
81pub mod content_app_observer;
82/// Content Control — cluster `0x050F`.
83pub mod content_control;
84/// Content Launcher — cluster `0x050A`.
85pub mod content_launcher;
86/// Descriptor — cluster `0x001D`.
87pub mod descriptor;
88/// Device Energy Management — cluster `0x0098`.
89pub mod device_energy_management;
90/// Device Energy Management Mode — cluster `0x009F`.
91pub mod device_energy_management_mode;
92/// Diagnostic Logs — cluster `0x0032`.
93pub mod diagnostic_logs;
94/// Dishwasher Alarm — cluster `0x005D`.
95pub mod dishwasher_alarm;
96/// Dishwasher Mode — cluster `0x0059`.
97pub mod dishwasher_mode;
98/// Door Lock — cluster `0x0101`.
99pub mod door_lock;
100/// Ecosystem Information — cluster `0x0750`.
101pub mod ecosystem_information;
102/// Electrical Energy Measurement — cluster `0x0091`.
103pub mod electrical_energy_measurement;
104/// Electrical Grid Conditions — cluster `0x00A0`.
105pub mod electrical_grid_conditions;
106/// Electrical Power Measurement — cluster `0x0090`.
107pub mod electrical_power_measurement;
108/// Energy EVSE — cluster `0x0099`.
109pub mod energy_evse;
110/// Energy EVSE Mode — cluster `0x009D`.
111pub mod energy_evse_mode;
112/// Energy Preference — cluster `0x009B`.
113pub mod energy_preference;
114/// Ethernet Network Diagnostics — cluster `0x0037`.
115pub mod ethernet_network_diagnostics;
116/// Fan Control — cluster `0x0202`.
117pub mod fan_control;
118/// Fixed Label — cluster `0x0040`.
119pub mod fixed_label;
120/// Flow Measurement — cluster `0x0404`.
121pub mod flow_measurement;
122/// Formaldehyde Concentration Measurement — cluster `0x042B`.
123pub mod formaldehyde_concentration_measurement;
124/// General Commissioning — cluster `0x0030`.
125pub mod general_commissioning;
126/// General Diagnostics — cluster `0x0033`.
127pub mod general_diagnostics;
128/// Globals — an abstract base: the types the clusters derived from it share,
129/// with no cluster id of its own.
130pub mod globals;
131/// Group Key Management — cluster `0x003F`.
132pub mod group_key_management;
133/// Groupcast — cluster `0x0065`.
134pub mod groupcast;
135/// Groups — cluster `0x0004`.
136pub mod groups;
137/// HEPA Filter Monitoring — cluster `0x0071`.
138pub mod hepa_filter_monitoring;
139/// ICD Management — cluster `0x0046`.
140pub mod icd_management;
141/// Identify — cluster `0x0003`.
142pub mod identify;
143/// Illuminance Measurement — cluster `0x0400`.
144pub mod illuminance_measurement;
145/// Joint Fabric Administrator — cluster `0x0753`.
146pub mod joint_fabric_administrator;
147/// Joint Fabric Datastore — cluster `0x0752`.
148pub mod joint_fabric_datastore;
149/// Keypad Input — cluster `0x0509`.
150pub mod keypad_input;
151/// Label — an abstract base: the types the clusters derived from it share,
152/// with no cluster id of its own.
153pub mod label;
154/// Laundry Dryer Controls — cluster `0x004A`.
155pub mod laundry_dryer_controls;
156/// Laundry Washer Controls — cluster `0x0053`.
157pub mod laundry_washer_controls;
158/// Laundry Washer Mode — cluster `0x0051`.
159pub mod laundry_washer_mode;
160/// Level Control — cluster `0x0008`.
161pub mod level_control;
162/// Localization Configuration — cluster `0x002B`.
163pub mod localization_configuration;
164/// Low Power — cluster `0x0508`.
165pub mod low_power;
166/// Media Input — cluster `0x0507`.
167pub mod media_input;
168/// Media Playback — cluster `0x0506`.
169pub mod media_playback;
170/// Messages — cluster `0x0097`.
171pub mod messages;
172/// Meter Identification — cluster `0x0B06`.
173pub mod meter_identification;
174/// Microwave Oven Control — cluster `0x005F`.
175pub mod microwave_oven_control;
176/// Microwave Oven Mode — cluster `0x005E`.
177pub mod microwave_oven_mode;
178/// Mode Base — an abstract base: the types the clusters derived from it share,
179/// with no cluster id of its own.
180pub mod mode_base;
181/// Mode Select — cluster `0x0050`.
182pub mod mode_select;
183/// Network Commissioning — cluster `0x0031`.
184pub mod network_commissioning;
185/// Nitrogen Dioxide Concentration Measurement — cluster `0x0413`.
186pub mod nitrogen_dioxide_concentration_measurement;
187/// Occupancy Sensing — cluster `0x0406`.
188pub mod occupancy_sensing;
189/// On/Off — cluster `0x0006`.
190pub mod on_off;
191/// Operational Credentials — cluster `0x003E`.
192pub mod operational_credentials;
193/// Operational State — cluster `0x0060`.
194pub mod operational_state;
195/// OTA Software Update Provider — cluster `0x0029`.
196pub mod ota_software_update_provider;
197/// OTA Software Update Requestor — cluster `0x002A`.
198pub mod ota_software_update_requestor;
199/// Oven Cavity Operational State — cluster `0x0048`.
200pub mod oven_cavity_operational_state;
201/// Oven Mode — cluster `0x0049`.
202pub mod oven_mode;
203/// Ozone Concentration Measurement — cluster `0x0415`.
204pub mod ozone_concentration_measurement;
205/// PM10 Concentration Measurement — cluster `0x042D`.
206pub mod pm10_concentration_measurement;
207/// PM1 Concentration Measurement — cluster `0x042C`.
208pub mod pm1_concentration_measurement;
209/// PM2.5 Concentration Measurement — cluster `0x042A`.
210pub mod pm2_5_concentration_measurement;
211/// Power Source — cluster `0x002F`.
212pub mod power_source;
213/// Power Source Configuration — cluster `0x002E`.
214pub mod power_source_configuration;
215/// Power Topology — cluster `0x009C`.
216pub mod power_topology;
217/// Pressure Measurement — cluster `0x0403`.
218pub mod pressure_measurement;
219/// Pump Configuration and Control — cluster `0x0200`.
220pub mod pump_configuration_and_control;
221/// Push AV Stream Transport — cluster `0x0555`.
222pub mod push_av_stream_transport;
223/// Radon Concentration Measurement — cluster `0x042F`.
224pub mod radon_concentration_measurement;
225/// Refrigerator Alarm — cluster `0x0057`.
226pub mod refrigerator_alarm;
227/// Refrigerator And Temperature Controlled Cabinet Mode — cluster `0x0052`.
228pub mod refrigerator_and_temperature_controlled_cabinet_mode;
229/// Relative Humidity Measurement — cluster `0x0405`.
230pub mod relative_humidity_measurement;
231/// RVC Clean Mode — cluster `0x0055`.
232pub mod rvc_clean_mode;
233/// RVC Operational State — cluster `0x0061`.
234pub mod rvc_operational_state;
235/// RVC Run Mode — cluster `0x0054`.
236pub mod rvc_run_mode;
237/// Scenes Management — cluster `0x0062`.
238pub mod scenes_management;
239/// Service Area — cluster `0x0150`.
240pub mod service_area;
241/// Smoke CO Alarm — cluster `0x005C`.
242pub mod smoke_co_alarm;
243/// Software Diagnostics — cluster `0x0034`.
244pub mod software_diagnostics;
245/// Soil Measurement — cluster `0x0430`.
246pub mod soil_measurement;
247/// Switch — cluster `0x003B`.
248pub mod switch;
249/// Target Navigator — cluster `0x0505`.
250pub mod target_navigator;
251/// Temperature Alarm — cluster `0x0064`.
252pub mod temperature_alarm;
253/// Temperature Control — cluster `0x0056`.
254pub mod temperature_control;
255/// Temperature Measurement — cluster `0x0402`.
256pub mod temperature_measurement;
257/// Thermostat — cluster `0x0201`.
258pub mod thermostat;
259/// Thermostat User Interface Configuration — cluster `0x0204`.
260pub mod thermostat_user_interface_configuration;
261/// Thread Border Router Management — cluster `0x0452`.
262pub mod thread_border_router_management;
263/// Thread Network Diagnostics — cluster `0x0035`.
264pub mod thread_network_diagnostics;
265/// Thread Network Directory — cluster `0x0453`.
266pub mod thread_network_directory;
267/// Time Format Localization — cluster `0x002C`.
268pub mod time_format_localization;
269/// Time Synchronization — cluster `0x0038`.
270pub mod time_synchronization;
271/// TLS Certificate Management — cluster `0x0801`.
272pub mod tls_certificate_management;
273/// TLS Client Management — cluster `0x0802`.
274pub mod tls_client_management;
275/// Total Volatile Organic Compounds Concentration Measurement — cluster `0x042E`.
276pub mod total_volatile_organic_compounds_concentration_measurement;
277/// Unit Localization — cluster `0x002D`.
278pub mod unit_localization;
279/// User Label — cluster `0x0041`.
280pub mod user_label;
281/// Valve Configuration and Control — cluster `0x0081`.
282pub mod valve_configuration_and_control;
283/// Wake On LAN — cluster `0x0503`.
284pub mod wake_on_lan;
285/// Water Heater Management — cluster `0x0094`.
286pub mod water_heater_management;
287/// Water Heater Mode — cluster `0x009E`.
288pub mod water_heater_mode;
289/// Water Tank Level Monitoring — cluster `0x0079`.
290pub mod water_tank_level_monitoring;
291/// WebRTC Transport Provider — cluster `0x0553`.
292pub mod web_rtc_transport_provider;
293/// WebRTC Transport Requestor — cluster `0x0554`.
294pub mod web_rtc_transport_requestor;
295/// Wi-Fi Network Diagnostics — cluster `0x0036`.
296pub mod wi_fi_network_diagnostics;
297/// Wi-Fi Network Management — cluster `0x0451`.
298pub mod wi_fi_network_management;
299/// Window Covering — cluster `0x0102`.
300pub mod window_covering;
301/// Zone Management — cluster `0x0550`.
302pub mod zone_management;
303
304pub mod device_types;
305
306/// Every cluster in the library, sorted by id.
307///
308/// **Referencing this links all of them.** Each table on its own is `const` data the
309/// linker drops when nothing names it — one cluster costs about 8 KB of read-only
310/// data, the whole library about 131 KB, measured on a release build. So a
311/// controller or a conformance tool uses `ALL` and pays for it happily, and a device
312/// names the handful of clusters it serves and pays for those.
313///
314/// [`crate::clusters::validate_endpoint`] reaches `ALL` through [`find`], which is
315/// why it belongs in a device's *tests* rather than its start-up path.
316pub const ALL: &[&crate::dm::spec::Cluster] = &[
317    &identify::CLUSTER,
318    &groups::CLUSTER,
319    &on_off::CLUSTER,
320    &level_control::CLUSTER,
321    &descriptor::CLUSTER,
322    &binding::CLUSTER,
323    &access_control::CLUSTER,
324    &actions::CLUSTER,
325    &basic_information::CLUSTER,
326    &ota_software_update_provider::CLUSTER,
327    &ota_software_update_requestor::CLUSTER,
328    &localization_configuration::CLUSTER,
329    &time_format_localization::CLUSTER,
330    &unit_localization::CLUSTER,
331    &power_source_configuration::CLUSTER,
332    &power_source::CLUSTER,
333    &general_commissioning::CLUSTER,
334    &network_commissioning::CLUSTER,
335    &diagnostic_logs::CLUSTER,
336    &general_diagnostics::CLUSTER,
337    &software_diagnostics::CLUSTER,
338    &thread_network_diagnostics::CLUSTER,
339    &wi_fi_network_diagnostics::CLUSTER,
340    &ethernet_network_diagnostics::CLUSTER,
341    &time_synchronization::CLUSTER,
342    &bridged_device_basic_information::CLUSTER,
343    &switch::CLUSTER,
344    &administrator_commissioning::CLUSTER,
345    &operational_credentials::CLUSTER,
346    &group_key_management::CLUSTER,
347    &fixed_label::CLUSTER,
348    &user_label::CLUSTER,
349    &boolean_state::CLUSTER,
350    &icd_management::CLUSTER,
351    &oven_cavity_operational_state::CLUSTER,
352    &oven_mode::CLUSTER,
353    &laundry_dryer_controls::CLUSTER,
354    &mode_select::CLUSTER,
355    &laundry_washer_mode::CLUSTER,
356    &refrigerator_and_temperature_controlled_cabinet_mode::CLUSTER,
357    &laundry_washer_controls::CLUSTER,
358    &rvc_run_mode::CLUSTER,
359    &rvc_clean_mode::CLUSTER,
360    &temperature_control::CLUSTER,
361    &refrigerator_alarm::CLUSTER,
362    &dishwasher_mode::CLUSTER,
363    &air_quality::CLUSTER,
364    &smoke_co_alarm::CLUSTER,
365    &dishwasher_alarm::CLUSTER,
366    &microwave_oven_mode::CLUSTER,
367    &microwave_oven_control::CLUSTER,
368    &operational_state::CLUSTER,
369    &rvc_operational_state::CLUSTER,
370    &scenes_management::CLUSTER,
371    &temperature_alarm::CLUSTER,
372    &groupcast::CLUSTER,
373    &hepa_filter_monitoring::CLUSTER,
374    &activated_carbon_filter_monitoring::CLUSTER,
375    &water_tank_level_monitoring::CLUSTER,
376    &boolean_state_configuration::CLUSTER,
377    &valve_configuration_and_control::CLUSTER,
378    &electrical_power_measurement::CLUSTER,
379    &electrical_energy_measurement::CLUSTER,
380    &water_heater_management::CLUSTER,
381    &commodity_price::CLUSTER,
382    &messages::CLUSTER,
383    &device_energy_management::CLUSTER,
384    &energy_evse::CLUSTER,
385    &energy_preference::CLUSTER,
386    &power_topology::CLUSTER,
387    &energy_evse_mode::CLUSTER,
388    &water_heater_mode::CLUSTER,
389    &device_energy_management_mode::CLUSTER,
390    &electrical_grid_conditions::CLUSTER,
391    &door_lock::CLUSTER,
392    &window_covering::CLUSTER,
393    &closure_control::CLUSTER,
394    &closure_dimension::CLUSTER,
395    &service_area::CLUSTER,
396    &pump_configuration_and_control::CLUSTER,
397    &thermostat::CLUSTER,
398    &fan_control::CLUSTER,
399    &thermostat_user_interface_configuration::CLUSTER,
400    &color_control::CLUSTER,
401    &illuminance_measurement::CLUSTER,
402    &temperature_measurement::CLUSTER,
403    &pressure_measurement::CLUSTER,
404    &flow_measurement::CLUSTER,
405    &relative_humidity_measurement::CLUSTER,
406    &occupancy_sensing::CLUSTER,
407    &carbon_monoxide_concentration_measurement::CLUSTER,
408    &carbon_dioxide_concentration_measurement::CLUSTER,
409    &nitrogen_dioxide_concentration_measurement::CLUSTER,
410    &ozone_concentration_measurement::CLUSTER,
411    &pm2_5_concentration_measurement::CLUSTER,
412    &formaldehyde_concentration_measurement::CLUSTER,
413    &pm1_concentration_measurement::CLUSTER,
414    &pm10_concentration_measurement::CLUSTER,
415    &total_volatile_organic_compounds_concentration_measurement::CLUSTER,
416    &radon_concentration_measurement::CLUSTER,
417    &soil_measurement::CLUSTER,
418    &ambient_context_sensing::CLUSTER,
419    &wi_fi_network_management::CLUSTER,
420    &thread_border_router_management::CLUSTER,
421    &thread_network_directory::CLUSTER,
422    &wake_on_lan::CLUSTER,
423    &channel::CLUSTER,
424    &target_navigator::CLUSTER,
425    &media_playback::CLUSTER,
426    &media_input::CLUSTER,
427    &low_power::CLUSTER,
428    &keypad_input::CLUSTER,
429    &content_launcher::CLUSTER,
430    &audio_output::CLUSTER,
431    &application_launcher::CLUSTER,
432    &application_basic::CLUSTER,
433    &account_login::CLUSTER,
434    &content_control::CLUSTER,
435    &content_app_observer::CLUSTER,
436    &zone_management::CLUSTER,
437    &camera_av_stream_management::CLUSTER,
438    &camera_av_settings_user_level_management::CLUSTER,
439    &web_rtc_transport_provider::CLUSTER,
440    &web_rtc_transport_requestor::CLUSTER,
441    &push_av_stream_transport::CLUSTER,
442    &chime::CLUSTER,
443    &commodity_tariff::CLUSTER,
444    &ecosystem_information::CLUSTER,
445    &commissioner_control::CLUSTER,
446    &joint_fabric_datastore::CLUSTER,
447    &joint_fabric_administrator::CLUSTER,
448    &tls_certificate_management::CLUSTER,
449    &tls_client_management::CLUSTER,
450    &meter_identification::CLUSTER,
451    &commodity_metering::CLUSTER,
452];
453
454/// The specification's definition of a cluster, by id.
455///
456/// Linear over 135 entries, which is nothing next to what a caller does with
457/// the answer — and a sorted binary search would be one `unsafe`-free `expect` away
458/// from a table that is sorted by construction anyway.
459#[must_use]
460pub fn find(id: crate::im::ClusterId) -> Option<&'static crate::dm::spec::Cluster> {
461    ALL.iter().copied().find(|cluster| cluster.id == id)
462}