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
// Generated by `cargo xtask` from the CSA data model 1.6. Do not edit.
//
// Joint Fabric Administrator โ€” cluster 0x0753.
//
// 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.

//! Joint Fabric Administrator (cluster `0x0753`, revision 1).
//!
//! 10 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 = 0x0753;

/// The highest revision the specification's history defines โ€” what `ClusterRevision`
/// must report (Core ยง7.13.1).
pub const REVISION: u16 = 1;

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

/// 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;

    /// `AdministratorFabricIndex`.
    pub const ADMINISTRATOR_FABRIC_INDEX: AttributeId = 0x00;
}

/// The command ids.
pub mod command {
    use crate::im::CommandId;

    /// `ICACCSRRequest`.
    pub const ICACCSR_REQUEST: CommandId = 0x00;
    /// `ICACCSRResponse`.
    pub const ICACCSR_RESPONSE: CommandId = 0x01;
    /// `AddICAC`.
    pub const ADD_ICAC: CommandId = 0x02;
    /// `ICACResponse`.
    pub const ICAC_RESPONSE: CommandId = 0x03;
    /// `OpenJointCommissioningWindow`.
    pub const OPEN_JOINT_COMMISSIONING_WINDOW: CommandId = 0x04;
    /// `TransferAnchorRequest`.
    pub const TRANSFER_ANCHOR_REQUEST: CommandId = 0x05;
    /// `TransferAnchorResponse`.
    pub const TRANSFER_ANCHOR_RESPONSE: CommandId = 0x06;
    /// `TransferAnchorComplete`.
    pub const TRANSFER_ANCHOR_COMPLETE: CommandId = 0x07;
    /// `AnnounceJointFabricAdministrator`.
    pub const ANNOUNCE_JOINT_FABRIC_ADMINISTRATOR: CommandId = 0x08;
}

/// `ICACCSRResponseStatusCodeEnum`.
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(u8)]
pub enum ICACCSRResponseStatusCodeEnum {
    /// No error
    OK = 0,
    /// Could not be completed because another commissioning is in progress
    Busy = 1,
    /// Provided PAKE parameters were incorrectly formatted or otherwise invalid
    PAKEParameterError = 2,
    /// The Joint Commissioning Method commissioning window is not currently open
    WindowNotOpen = 3,
    /// ICACCSRRequest command has been invoked by a peer against which Fabric Table VID Verification hasn't been executed
    VIDNotVerified = 4,
    /// OpenJointCommissioningWindow command has been invoked but the AdministratorFabricIndex field has the value of null
    InvalidAdministratorFabricIndex = 5,
}

impl ICACCSRResponseStatusCodeEnum {
    /// 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::OK),
            1 => Some(Self::Busy),
            2 => Some(Self::PAKEParameterError),
            3 => Some(Self::WindowNotOpen),
            4 => Some(Self::VIDNotVerified),
            5 => Some(Self::InvalidAdministratorFabricIndex),
            _ => None,
        }
    }

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

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

impl<'a> FromTlv<'a> for ICACCSRResponseStatusCodeEnum {
    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))
    }
}

/// `ICACResponseStatusEnum`.
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(u8)]
pub enum ICACResponseStatusEnum {
    /// No error
    OK = 0,
    /// Public Key in the ICAC is invalid
    InvalidPublicKey = 1,
    /// ICAC chain validation failed / ICAC DN Encoding rules verification failed
    InvalidICAC = 2,
}

impl ICACResponseStatusEnum {
    /// 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::OK),
            1 => Some(Self::InvalidPublicKey),
            2 => Some(Self::InvalidICAC),
            _ => None,
        }
    }

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

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

impl<'a> FromTlv<'a> for ICACResponseStatusEnum {
    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))
    }
}

/// `TransferAnchorResponseStatusEnum`.
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(u8)]
pub enum TransferAnchorResponseStatusEnum {
    /// No error
    OK = 0,
    /// Anchor Transfer was not started due to on-going Datastore operations
    TransferAnchorStatusDatastoreBusy = 1,
    /// User has not consented for Anchor Transfer
    TransferAnchorStatusNoUserConsent = 2,
}

impl TransferAnchorResponseStatusEnum {
    /// 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::OK),
            1 => Some(Self::TransferAnchorStatusDatastoreBusy),
            2 => Some(Self::TransferAnchorStatusNoUserConsent),
            _ => None,
        }
    }

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

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

impl<'a> FromTlv<'a> for TransferAnchorResponseStatusEnum {
    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))
    }
}

/// The fields of `ICACCSRResponse` (command `0x01`).
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct ICACCSRResponseFields<'a> {
    /// `StatusCode`, field 0.
    pub status_code: ICACCSRResponseStatusCodeEnum,
    /// `ICACCSR`, field 1.
    pub icaccsr: Option<&'a [u8]>,
}

impl<'a> ToTlv for ICACCSRResponseFields<'a> {
    fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
        w.start_structure(tag)?;
        self.status_code.to_tlv(w, Tag::Context(0))?;
        if let Some(value) = &self.icaccsr {
            value.to_tlv(w, Tag::Context(1))?;
        }
        w.end_container()
    }
}

impl<'a> FromTlv<'a> for ICACCSRResponseFields<'a> {
    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 status_code = None;
        let mut icaccsr = 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) => {
                    status_code = Some(<ICACCSRResponseStatusCodeEnum>::from_tlv(reader, &field)?)
                }
                Some(1) => icaccsr = Some(<&'a [u8]>::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 {
            status_code: status_code.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
            icaccsr,
        })
    }
}

/// The fields of `AddICAC` (command `0x02`).
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct AddICACFields<'a> {
    /// `ICACValue`, field 0.
    pub icac_value: &'a [u8],
}

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

impl<'a> FromTlv<'a> for AddICACFields<'a> {
    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 icac_value = 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) => icac_value = Some(<&'a [u8]>::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 {
            icac_value: icac_value.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
        })
    }
}

/// The fields of `ICACResponse` (command `0x03`).
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct ICACResponseFields {
    /// `StatusCode`, field 0.
    pub status_code: ICACResponseStatusEnum,
}

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

impl<'a> FromTlv<'a> for ICACResponseFields {
    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 status_code = 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) => status_code = Some(<ICACResponseStatusEnum>::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 {
            status_code: status_code.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
        })
    }
}

/// The fields of `OpenJointCommissioningWindow` (command `0x04`).
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct OpenJointCommissioningWindowFields<'a> {
    /// `CommissioningTimeout`, field 0.
    pub commissioning_timeout: u16,
    /// `PAKEPasscodeVerifier`, field 1.
    pub pake_passcode_verifier: &'a [u8],
    /// `Discriminator`, field 2.
    pub discriminator: u16,
    /// `Iterations`, field 3.
    pub iterations: u32,
    /// `Salt`, field 4.
    pub salt: &'a [u8],
}

impl<'a> ToTlv for OpenJointCommissioningWindowFields<'a> {
    fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
        w.start_structure(tag)?;
        self.commissioning_timeout.to_tlv(w, Tag::Context(0))?;
        self.pake_passcode_verifier.to_tlv(w, Tag::Context(1))?;
        self.discriminator.to_tlv(w, Tag::Context(2))?;
        self.iterations.to_tlv(w, Tag::Context(3))?;
        self.salt.to_tlv(w, Tag::Context(4))?;
        w.end_container()
    }
}

impl<'a> FromTlv<'a> for OpenJointCommissioningWindowFields<'a> {
    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 commissioning_timeout = None;
        let mut pake_passcode_verifier = None;
        let mut discriminator = None;
        let mut iterations = None;
        let mut salt = 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) => commissioning_timeout = Some(<u16>::from_tlv(reader, &field)?),
                Some(1) => pake_passcode_verifier = Some(<&'a [u8]>::from_tlv(reader, &field)?),
                Some(2) => discriminator = Some(<u16>::from_tlv(reader, &field)?),
                Some(3) => iterations = Some(<u32>::from_tlv(reader, &field)?),
                Some(4) => salt = Some(<&'a [u8]>::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 {
            commissioning_timeout: commissioning_timeout
                .ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
            pake_passcode_verifier: pake_passcode_verifier
                .ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
            discriminator: discriminator.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
            iterations: iterations.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
            salt: salt.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
        })
    }
}

/// The fields of `TransferAnchorResponse` (command `0x06`).
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct TransferAnchorResponseFields {
    /// `StatusCode`, field 0.
    pub status_code: TransferAnchorResponseStatusEnum,
}

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

impl<'a> FromTlv<'a> for TransferAnchorResponseFields {
    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 status_code = 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) => {
                    status_code = Some(<TransferAnchorResponseStatusEnum>::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 {
            status_code: status_code.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
        })
    }
}

/// The fields of `AnnounceJointFabricAdministrator` (command `0x08`).
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct AnnounceJointFabricAdministratorFields {
    /// `EndpointID`, field 0.
    pub endpoint_id: u16,
}

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

impl<'a> FromTlv<'a> for AnnounceJointFabricAdministratorFields {
    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 endpoint_id = 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) => endpoint_id = 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 {
            endpoint_id: endpoint_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
        })
    }
}

/// Every attribute the specification defines, with its conformance.
pub const ATTRIBUTES: &[Attribute] = &[Attribute {
    id: 0x0000,
    name: "AdministratorFabricIndex",
    kind: "fabric-idx",
    access: Access::read_only(Privilege::Administer),
    qualities: AttributeQualities::NULLABLE,
    reporting: Reporting::OnChange,
    conform: Conform::MANDATORY,
}];

/// Every command, with its conformance.
pub const COMMANDS: &[Command] = &[
    Command {
        id: 0x00,
        name: "ICACCSRRequest",
        to_server: true,
        response: Some(0x01),
        access: Access::invoke(Privilege::Administer),
        conform: Conform::MANDATORY,
    },
    Command {
        id: 0x01,
        name: "ICACCSRResponse",
        to_server: false,
        response: None,
        access: Access::invoke(Privilege::Operate),
        conform: Conform::MANDATORY,
    },
    Command {
        id: 0x02,
        name: "AddICAC",
        to_server: true,
        response: Some(0x03),
        access: Access::invoke(Privilege::Administer),
        conform: Conform::MANDATORY,
    },
    Command {
        id: 0x03,
        name: "ICACResponse",
        to_server: false,
        response: None,
        access: Access::invoke(Privilege::Operate),
        conform: Conform::MANDATORY,
    },
    Command {
        id: 0x04,
        name: "OpenJointCommissioningWindow",
        to_server: true,
        response: None,
        access: Access::invoke(Privilege::Administer),
        conform: Conform::MANDATORY,
    },
    Command {
        id: 0x05,
        name: "TransferAnchorRequest",
        to_server: true,
        response: Some(0x06),
        access: Access::invoke(Privilege::Administer),
        conform: Conform::MANDATORY,
    },
    Command {
        id: 0x06,
        name: "TransferAnchorResponse",
        to_server: false,
        response: None,
        access: Access::invoke(Privilege::Operate),
        conform: Conform::MANDATORY,
    },
    Command {
        id: 0x07,
        name: "TransferAnchorComplete",
        to_server: true,
        response: None,
        access: Access::invoke(Privilege::Administer),
        conform: Conform::MANDATORY,
    },
    Command {
        id: 0x08,
        name: "AnnounceJointFabricAdministrator",
        to_server: true,
        response: None,
        access: Access::invoke(Privilege::Administer),
        conform: Conform::MANDATORY,
    },
];

/// Every event, with its conformance.
pub const EVENTS: &[Event] = &[];

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