matter-kit 0.3.0

Matter (CSA smart-home standard) protocol implementation in Rust: no_std, no-alloc, executor-agnostic
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
// Generated by `cargo xtask` from the CSA data model 1.6. Do not edit.
//
// Basic Information — cluster 0x0028.
//
// Regenerate with `cargo xtask clusters --dm <checkout>/data_model/1.6`; `cargo xtask check`
// is the CI gate that keeps this file honest. The XML itself is not vendored here — it
// carries the CSA's own copyright notice and is not redistributable.

//! Basic Information (cluster `0x0028`, revision 6).
//!
//! 28 identifiers, 0 feature bits, and the specification's own conformance for
//! every element. `CLUSTER` is the whole table.

#![allow(unused_imports)]

use crate::dm::conformance::{Clause, Condition, Conform, Conformance};
use crate::dm::meta::{EventPriority, Reporting};
use crate::dm::spec::{Attribute, Cluster, Command, Event, Feature};
use crate::dm::{Access, AccessQualities, AttributeQualities, Privilege};
use crate::error::Result;
use crate::im::{AttributeId, ClusterId, CommandId, EventId};
use crate::tlv::{
    ContainerKind, Element, FromTlv, Nullable, Tag, TlvList, TlvReader, TlvWriter, ToTlv, Value,
};

/// The cluster id.
pub const ID: ClusterId = 0x0028;

/// The highest revision the specification's history defines — what `ClusterRevision`
/// must report (Core §7.13.1).
pub const REVISION: u16 = 6;

/// The PICS code, which a certification declaration names the cluster by.
pub const PICS: &str = "BINFO";

/// This cluster defines no features, so its `FeatureMap` is always zero.
pub const FEATURES: &[Feature] = &[];

/// The attribute ids.
pub mod attribute {
    use crate::im::AttributeId;

    /// `DataModelRevision`.
    pub const DATA_MODEL_REVISION: AttributeId = 0x00;
    /// `VendorName`.
    pub const VENDOR_NAME: AttributeId = 0x01;
    /// `VendorID`.
    pub const VENDOR_ID: AttributeId = 0x02;
    /// `ProductName`.
    pub const PRODUCT_NAME: AttributeId = 0x03;
    /// `ProductID`.
    pub const PRODUCT_ID: AttributeId = 0x04;
    /// `NodeLabel`.
    pub const NODE_LABEL: AttributeId = 0x05;
    /// `Location`.
    pub const LOCATION: AttributeId = 0x06;
    /// `HardwareVersion`.
    pub const HARDWARE_VERSION: AttributeId = 0x07;
    /// `HardwareVersionString`.
    pub const HARDWARE_VERSION_STRING: AttributeId = 0x08;
    /// `SoftwareVersion`.
    pub const SOFTWARE_VERSION: AttributeId = 0x09;
    /// `SoftwareVersionString`.
    pub const SOFTWARE_VERSION_STRING: AttributeId = 0x0A;
    /// `ManufacturingDate`.
    pub const MANUFACTURING_DATE: AttributeId = 0x0B;
    /// `PartNumber`.
    pub const PART_NUMBER: AttributeId = 0x0C;
    /// `ProductURL`.
    pub const PRODUCT_URL: AttributeId = 0x0D;
    /// `ProductLabel`.
    pub const PRODUCT_LABEL: AttributeId = 0x0E;
    /// `SerialNumber`.
    pub const SERIAL_NUMBER: AttributeId = 0x0F;
    /// `LocalConfigDisabled`.
    pub const LOCAL_CONFIG_DISABLED: AttributeId = 0x10;
    /// `Reachable`.
    pub const REACHABLE: AttributeId = 0x11;
    /// `UniqueID`.
    pub const UNIQUE_ID: AttributeId = 0x12;
    /// `CapabilityMinima`.
    pub const CAPABILITY_MINIMA: AttributeId = 0x13;
    /// `ProductAppearance`.
    pub const PRODUCT_APPEARANCE: AttributeId = 0x14;
    /// `SpecificationVersion`.
    pub const SPECIFICATION_VERSION: AttributeId = 0x15;
    /// `MaxPathsPerInvoke`.
    pub const MAX_PATHS_PER_INVOKE: AttributeId = 0x16;
    /// `ConfigurationVersion`.
    pub const CONFIGURATION_VERSION: AttributeId = 0x18;
}

/// The event ids.
pub mod event {
    use crate::im::EventId;

    /// `StartUp`.
    pub const START_UP: EventId = 0x00;
    /// `ShutDown`.
    pub const SHUT_DOWN: EventId = 0x01;
    /// `Leave`.
    pub const LEAVE: EventId = 0x02;
    /// `ReachableChanged`.
    pub const REACHABLE_CHANGED: EventId = 0x03;
}

/// `ColorEnum`.
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(u8)]
pub enum ColorEnum {
    /// Approximately RGB #000000.
    Black = 0,
    /// Approximately RGB #000080.
    Navy = 1,
    /// Approximately RGB #008000.
    Green = 2,
    /// Approximately RGB #008080.
    Teal = 3,
    /// Approximately RGB #800000.
    Maroon = 4,
    /// Approximately RGB #800080.
    Purple = 5,
    /// Approximately RGB #808000.
    Olive = 6,
    /// Approximately RGB #808080.
    Gray = 7,
    /// Approximately RGB #0000FF.
    Blue = 8,
    /// Approximately RGB #00FF00.
    Lime = 9,
    /// Approximately RGB #00FFFF.
    Aqua = 10,
    /// Approximately RGB #FF0000.
    Red = 11,
    /// Approximately RGB #FF00FF.
    Fuchsia = 12,
    /// Approximately RGB #FFFF00.
    Yellow = 13,
    /// Approximately RGB #FFFFFF.
    White = 14,
    /// Typical hardware "Nickel" color.
    Nickel = 15,
    /// Typical hardware "Chrome" color.
    Chrome = 16,
    /// Typical hardware "Brass" color.
    Brass = 17,
    /// Typical hardware "Copper" color.
    Copper = 18,
    /// Typical hardware "Silver" color.
    Silver = 19,
    /// Typical hardware "Gold" color.
    Gold = 20,
}

impl ColorEnum {
    /// Reads a wire value, or `None` for one this revision does not define.
    #[must_use]
    pub const fn from_value(value: u8) -> Option<Self> {
        match value {
            0 => Some(Self::Black),
            1 => Some(Self::Navy),
            2 => Some(Self::Green),
            3 => Some(Self::Teal),
            4 => Some(Self::Maroon),
            5 => Some(Self::Purple),
            6 => Some(Self::Olive),
            7 => Some(Self::Gray),
            8 => Some(Self::Blue),
            9 => Some(Self::Lime),
            10 => Some(Self::Aqua),
            11 => Some(Self::Red),
            12 => Some(Self::Fuchsia),
            13 => Some(Self::Yellow),
            14 => Some(Self::White),
            15 => Some(Self::Nickel),
            16 => Some(Self::Chrome),
            17 => Some(Self::Brass),
            18 => Some(Self::Copper),
            19 => Some(Self::Silver),
            20 => Some(Self::Gold),
            _ => None,
        }
    }

    /// Its wire value.
    #[must_use]
    pub const fn value(self) -> u8 {
        self as u8
    }
}

impl ToTlv for ColorEnum {
    fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
        self.value().to_tlv(w, tag)
    }
}

impl<'a> FromTlv<'a> for ColorEnum {
    fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
        let value = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
        Self::from_value(value).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
    }
}

/// `ProductFinishEnum`.
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(u8)]
pub enum ProductFinishEnum {
    /// Product has some other finish not listed below.
    Other = 0,
    /// Product has a matte finish.
    Matte = 1,
    /// Product has a satin finish.
    Satin = 2,
    /// Product has a polished or shiny finish.
    Polished = 3,
    /// Product has a rugged finish.
    Rugged = 4,
    /// Product has a fabric finish.
    Fabric = 5,
}

impl ProductFinishEnum {
    /// Reads a wire value, or `None` for one this revision does not define.
    #[must_use]
    pub const fn from_value(value: u8) -> Option<Self> {
        match value {
            0 => Some(Self::Other),
            1 => Some(Self::Matte),
            2 => Some(Self::Satin),
            3 => Some(Self::Polished),
            4 => Some(Self::Rugged),
            5 => Some(Self::Fabric),
            _ => None,
        }
    }

    /// Its wire value.
    #[must_use]
    pub const fn value(self) -> u8 {
        self as u8
    }
}

impl ToTlv for ProductFinishEnum {
    fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
        self.value().to_tlv(w, tag)
    }
}

impl<'a> FromTlv<'a> for ProductFinishEnum {
    fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
        let value = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
        Self::from_value(value).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
    }
}

/// `CapabilityMinimaStruct`.
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct CapabilityMinimaStruct {
    /// `CaseSessionsPerFabric`, field 0.
    pub case_sessions_per_fabric: u16,
    /// `SubscriptionsPerFabric`, field 1.
    pub subscriptions_per_fabric: u16,
    /// `SimultaneousInvocationsSupported`, field 2.
    pub simultaneous_invocations_supported: Option<u16>,
    /// `SimultaneousWritesSupported`, field 3.
    pub simultaneous_writes_supported: Option<u16>,
    /// `ReadPathsSupported`, field 4.
    pub read_paths_supported: Option<u16>,
    /// `SubscribePathsSupported`, field 5.
    pub subscribe_paths_supported: Option<u16>,
}

impl ToTlv for CapabilityMinimaStruct {
    fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
        w.start_structure(tag)?;
        self.case_sessions_per_fabric.to_tlv(w, Tag::Context(0))?;
        self.subscriptions_per_fabric.to_tlv(w, Tag::Context(1))?;
        if let Some(value) = &self.simultaneous_invocations_supported {
            value.to_tlv(w, Tag::Context(2))?;
        }
        if let Some(value) = &self.simultaneous_writes_supported {
            value.to_tlv(w, Tag::Context(3))?;
        }
        if let Some(value) = &self.read_paths_supported {
            value.to_tlv(w, Tag::Context(4))?;
        }
        if let Some(value) = &self.subscribe_paths_supported {
            value.to_tlv(w, Tag::Context(5))?;
        }
        w.end_container()
    }
}

impl<'a> FromTlv<'a> for CapabilityMinimaStruct {
    fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
        if element.value.container() != Some(ContainerKind::Structure) {
            return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
        }
        let mut case_sessions_per_fabric = None;
        let mut subscriptions_per_fabric = None;
        let mut simultaneous_invocations_supported = None;
        let mut simultaneous_writes_supported = None;
        let mut read_paths_supported = None;
        let mut subscribe_paths_supported = None;
        loop {
            let Some(field) = reader.next_element()? else {
                return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
            };
            if field.value == Value::EndOfContainer {
                break;
            }
            match field.tag.context() {
                Some(0) => case_sessions_per_fabric = Some(<u16>::from_tlv(reader, &field)?),
                Some(1) => subscriptions_per_fabric = Some(<u16>::from_tlv(reader, &field)?),
                Some(2) => {
                    simultaneous_invocations_supported = Some(<u16>::from_tlv(reader, &field)?)
                }
                Some(3) => simultaneous_writes_supported = Some(<u16>::from_tlv(reader, &field)?),
                Some(4) => read_paths_supported = Some(<u16>::from_tlv(reader, &field)?),
                Some(5) => subscribe_paths_supported = Some(<u16>::from_tlv(reader, &field)?),
                // A field this revision does not define. §7.19.2: a receiver
                // ignores what it does not know rather than refusing the whole
                // structure, which is what lets a newer peer talk to an older one.
                _ => reader.skip_value(&field)?,
            }
        }
        Ok(Self {
            case_sessions_per_fabric: case_sessions_per_fabric
                .ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
            subscriptions_per_fabric: subscriptions_per_fabric
                .ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
            simultaneous_invocations_supported,
            simultaneous_writes_supported,
            read_paths_supported,
            subscribe_paths_supported,
        })
    }
}

/// `ProductAppearanceStruct`.
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct ProductAppearanceStruct {
    /// `Finish`, field 0.
    pub finish: ProductFinishEnum,
    /// `PrimaryColor`, field 1.
    pub primary_color: Nullable<ColorEnum>,
}

impl ToTlv for ProductAppearanceStruct {
    fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
        w.start_structure(tag)?;
        self.finish.to_tlv(w, Tag::Context(0))?;
        self.primary_color.to_tlv(w, Tag::Context(1))?;
        w.end_container()
    }
}

impl<'a> FromTlv<'a> for ProductAppearanceStruct {
    fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
        if element.value.container() != Some(ContainerKind::Structure) {
            return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
        }
        let mut finish = None;
        let mut primary_color = None;
        loop {
            let Some(field) = reader.next_element()? else {
                return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
            };
            if field.value == Value::EndOfContainer {
                break;
            }
            match field.tag.context() {
                Some(0) => finish = Some(<ProductFinishEnum>::from_tlv(reader, &field)?),
                Some(1) => primary_color = Some(<Nullable<ColorEnum>>::from_tlv(reader, &field)?),
                // A field this revision does not define. §7.19.2: a receiver
                // ignores what it does not know rather than refusing the whole
                // structure, which is what lets a newer peer talk to an older one.
                _ => reader.skip_value(&field)?,
            }
        }
        Ok(Self {
            finish: finish.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
            primary_color: primary_color.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
        })
    }
}

/// Every attribute the specification defines, with its conformance.
pub const ATTRIBUTES: &[Attribute] = &[
    Attribute {
        id: 0x0000,
        name: "DataModelRevision",
        kind: "uint16",
        access: Access::read_only(Privilege::View),
        qualities: AttributeQualities::FIXED,
        reporting: Reporting::OnChange,
        conform: Conform::MANDATORY,
    },
    Attribute {
        id: 0x0001,
        name: "VendorName",
        kind: "string",
        access: Access::read_only(Privilege::View),
        qualities: AttributeQualities::FIXED,
        reporting: Reporting::OnChange,
        conform: Conform::MANDATORY,
    },
    Attribute {
        id: 0x0002,
        name: "VendorID",
        kind: "vendor-id",
        access: Access::read_only(Privilege::View),
        qualities: AttributeQualities::FIXED,
        reporting: Reporting::OnChange,
        conform: Conform::MANDATORY,
    },
    Attribute {
        id: 0x0003,
        name: "ProductName",
        kind: "string",
        access: Access::read_only(Privilege::View),
        qualities: AttributeQualities::FIXED,
        reporting: Reporting::OnChange,
        conform: Conform::MANDATORY,
    },
    Attribute {
        id: 0x0004,
        name: "ProductID",
        kind: "uint16",
        access: Access::read_only(Privilege::View),
        qualities: AttributeQualities::FIXED,
        reporting: Reporting::OnChange,
        conform: Conform::MANDATORY,
    },
    Attribute {
        id: 0x0005,
        name: "NodeLabel",
        kind: "string",
        access: Access::read_write_with(Privilege::View, Privilege::Manage),
        qualities: AttributeQualities::NON_VOLATILE,
        reporting: Reporting::OnChange,
        conform: Conform::MANDATORY,
    },
    Attribute {
        id: 0x0006,
        name: "Location",
        kind: "string",
        access: Access::read_write_with(Privilege::View, Privilege::Administer),
        qualities: AttributeQualities::NON_VOLATILE,
        reporting: Reporting::OnChange,
        conform: Conform::MANDATORY,
    },
    Attribute {
        id: 0x0007,
        name: "HardwareVersion",
        kind: "uint16",
        access: Access::read_only(Privilege::View),
        qualities: AttributeQualities::FIXED,
        reporting: Reporting::OnChange,
        conform: Conform::MANDATORY,
    },
    Attribute {
        id: 0x0008,
        name: "HardwareVersionString",
        kind: "string",
        access: Access::read_only(Privilege::View),
        qualities: AttributeQualities::FIXED,
        reporting: Reporting::OnChange,
        conform: Conform::MANDATORY,
    },
    Attribute {
        id: 0x0009,
        name: "SoftwareVersion",
        kind: "uint32",
        access: Access::read_only(Privilege::View),
        qualities: AttributeQualities::FIXED,
        reporting: Reporting::OnChange,
        conform: Conform::MANDATORY,
    },
    Attribute {
        id: 0x000A,
        name: "SoftwareVersionString",
        kind: "string",
        access: Access::read_only(Privilege::View),
        qualities: AttributeQualities::FIXED,
        reporting: Reporting::OnChange,
        conform: Conform::MANDATORY,
    },
    Attribute {
        id: 0x000B,
        name: "ManufacturingDate",
        kind: "string",
        access: Access::read_only(Privilege::View),
        qualities: AttributeQualities::FIXED,
        reporting: Reporting::OnChange,
        conform: Conform::OPTIONAL,
    },
    Attribute {
        id: 0x000C,
        name: "PartNumber",
        kind: "string",
        access: Access::read_only(Privilege::View),
        qualities: AttributeQualities::FIXED,
        reporting: Reporting::OnChange,
        conform: Conform::OPTIONAL,
    },
    Attribute {
        id: 0x000D,
        name: "ProductURL",
        kind: "string",
        access: Access::read_only(Privilege::View),
        qualities: AttributeQualities::FIXED,
        reporting: Reporting::OnChange,
        conform: Conform::OPTIONAL,
    },
    Attribute {
        id: 0x000E,
        name: "ProductLabel",
        kind: "string",
        access: Access::read_only(Privilege::View),
        qualities: AttributeQualities::FIXED,
        reporting: Reporting::OnChange,
        conform: Conform::OPTIONAL,
    },
    Attribute {
        id: 0x000F,
        name: "SerialNumber",
        kind: "string",
        access: Access::read_only(Privilege::View),
        qualities: AttributeQualities::FIXED,
        reporting: Reporting::OnChange,
        conform: Conform::OPTIONAL,
    },
    Attribute {
        id: 0x0010,
        name: "LocalConfigDisabled",
        kind: "bool",
        access: Access::read_write_with(Privilege::View, Privilege::Manage),
        qualities: AttributeQualities::NON_VOLATILE,
        reporting: Reporting::OnChange,
        conform: Conform::OPTIONAL,
    },
    Attribute {
        id: 0x0011,
        name: "Reachable",
        kind: "bool",
        access: Access::read_only(Privilege::View),
        qualities: AttributeQualities::empty(),
        reporting: Reporting::OnChange,
        conform: Conform::OPTIONAL,
    },
    Attribute {
        id: 0x0012,
        name: "UniqueID",
        kind: "string",
        access: Access::read_only(Privilege::View),
        qualities: AttributeQualities::FIXED,
        reporting: Reporting::OnChange,
        conform: Conform {
            clauses: &[
                Clause {
                    verdict: Conformance::Described,
                    when: Condition::Named("comparison"),
                },
                Clause {
                    verdict: Conformance::Optional,
                    when: Condition::Always,
                },
            ],
        },
    },
    Attribute {
        id: 0x0013,
        name: "CapabilityMinima",
        kind: "CapabilityMinimaStruct",
        access: Access::read_only(Privilege::View),
        qualities: AttributeQualities::FIXED,
        reporting: Reporting::OnChange,
        conform: Conform::MANDATORY,
    },
    Attribute {
        id: 0x0014,
        name: "ProductAppearance",
        kind: "ProductAppearanceStruct",
        access: Access::read_only(Privilege::View),
        qualities: AttributeQualities::FIXED,
        reporting: Reporting::OnChange,
        conform: Conform {
            clauses: &[Clause {
                verdict: Conformance::Described,
                when: Condition::Named("comparison"),
            }],
        },
    },
    Attribute {
        id: 0x0015,
        name: "SpecificationVersion",
        kind: "uint32",
        access: Access::read_only(Privilege::View),
        qualities: AttributeQualities::FIXED,
        reporting: Reporting::OnChange,
        conform: Conform {
            clauses: &[Clause {
                verdict: Conformance::Described,
                when: Condition::Named("comparison"),
            }],
        },
    },
    Attribute {
        id: 0x0016,
        name: "MaxPathsPerInvoke",
        kind: "uint16",
        access: Access::read_only(Privilege::View),
        qualities: AttributeQualities::FIXED,
        reporting: Reporting::OnChange,
        conform: Conform {
            clauses: &[Clause {
                verdict: Conformance::Described,
                when: Condition::Named("comparison"),
            }],
        },
    },
    Attribute {
        id: 0x0018,
        name: "ConfigurationVersion",
        kind: "uint32",
        access: Access::read_only(Privilege::View),
        qualities: AttributeQualities::NON_VOLATILE,
        reporting: Reporting::OnChange,
        conform: Conform {
            clauses: &[Clause {
                verdict: Conformance::Described,
                when: Condition::Named("comparison"),
            }],
        },
    },
];

/// Every command, with its conformance.
pub const COMMANDS: &[Command] = &[];

/// Every event, with its conformance.
pub const EVENTS: &[Event] = &[
    Event {
        id: 0x00,
        name: "StartUp",
        priority: EventPriority::Critical,
        access: Access::read_only(Privilege::View),
        conform: Conform::MANDATORY,
    },
    Event {
        id: 0x01,
        name: "ShutDown",
        priority: EventPriority::Critical,
        access: Access::read_only(Privilege::View),
        conform: Conform::OPTIONAL,
    },
    Event {
        id: 0x02,
        name: "Leave",
        priority: EventPriority::Info,
        access: Access::read_only(Privilege::View),
        conform: Conform::OPTIONAL,
    },
    Event {
        id: 0x03,
        name: "ReachableChanged",
        priority: EventPriority::Info,
        access: Access::read_only(Privilege::View),
        conform: Conform {
            clauses: &[Clause {
                verdict: Conformance::Mandatory,
                when: Condition::Attribute(0x0011),
            }],
        },
    },
];

/// The whole cluster, as the specification defines it.
pub const CLUSTER: Cluster = Cluster {
    id: ID,
    name: "Basic Information",
    revision: REVISION,
    pics: "BINFO",
    derived_from: None,
    features: FEATURES,
    attributes: ATTRIBUTES,
    commands: COMMANDS,
    events: EVENTS,
};