1#![allow(unused_imports)]
15
16use crate::dm::conformance::{Clause, Condition, Conform, Conformance};
17use crate::dm::meta::{EventPriority, Reporting};
18use crate::dm::spec::{Attribute, Cluster, Command, Event, Feature};
19use crate::dm::{Access, AccessQualities, AttributeQualities, Privilege};
20use crate::error::Result;
21use crate::im::{AttributeId, ClusterId, CommandId, EventId};
22use crate::tlv::{
23 ContainerKind, Element, FromTlv, Nullable, Tag, TlvList, TlvReader, TlvWriter, ToTlv, Value,
24};
25
26pub const ID: ClusterId = 0x0065;
28
29pub const REVISION: u16 = 1;
32
33pub const PICS: &str = "GC";
35
36pub mod feature {
41 pub const LISTENER: u32 = 1 << 0;
45 pub const SENDER: u32 = 1 << 1;
49 pub const PER_GROUP: u32 = 1 << 2;
53}
54
55pub const FEATURES: &[Feature] = &[
57 Feature {
58 bit: 0,
59 code: "LN",
60 name: "Listener",
61 conform: Conform {
62 clauses: &[
63 Clause {
64 verdict: Conformance::Provisional,
65 when: Condition::Always,
66 },
67 Clause {
68 verdict: Conformance::Optional,
69 when: Condition::Always,
70 },
71 ],
72 },
73 },
74 Feature {
75 bit: 1,
76 code: "SD",
77 name: "Sender",
78 conform: Conform {
79 clauses: &[
80 Clause {
81 verdict: Conformance::Provisional,
82 when: Condition::Always,
83 },
84 Clause {
85 verdict: Conformance::Optional,
86 when: Condition::Always,
87 },
88 ],
89 },
90 },
91 Feature {
92 bit: 2,
93 code: "PGA",
94 name: "PerGroup",
95 conform: Conform {
96 clauses: &[
97 Clause {
98 verdict: Conformance::Provisional,
99 when: Condition::Always,
100 },
101 Clause {
102 verdict: Conformance::Optional,
103 when: Condition::Always,
104 },
105 ],
106 },
107 },
108];
109
110pub mod attribute {
112 use crate::im::AttributeId;
113
114 pub const MEMBERSHIP: AttributeId = 0x00;
116 pub const MAX_MEMBERSHIP_COUNT: AttributeId = 0x01;
118 pub const MAX_MCAST_ADDR_COUNT: AttributeId = 0x02;
120 pub const USED_MCAST_ADDR_COUNT: AttributeId = 0x03;
122 pub const FABRIC_UNDER_TEST: AttributeId = 0x04;
124}
125
126pub mod command {
128 use crate::im::CommandId;
129
130 pub const JOIN_GROUP: CommandId = 0x00;
132 pub const LEAVE_GROUP: CommandId = 0x01;
134 pub const LEAVE_GROUP_RESPONSE: CommandId = 0x02;
136 pub const UPDATE_GROUP_KEY: CommandId = 0x03;
138 pub const CONFIGURE_AUXILIARY_ACL: CommandId = 0x04;
140 pub const GROUPCAST_TESTING: CommandId = 0x05;
142}
143
144pub mod event {
146 use crate::im::EventId;
147
148 pub const GROUPCAST_TESTING: EventId = 0x00;
150}
151
152#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
154#[repr(u8)]
155pub enum GroupcastTestResultEnum {
156 Success = 0,
158 GeneralError = 1,
160 MessageReplay = 2,
162 FailedAuth = 3,
164 NoAvailableKey = 4,
166 SendFailure = 5,
168}
169
170impl GroupcastTestResultEnum {
171 #[must_use]
173 pub const fn from_value(value: u8) -> Option<Self> {
174 match value {
175 0 => Some(Self::Success),
176 1 => Some(Self::GeneralError),
177 2 => Some(Self::MessageReplay),
178 3 => Some(Self::FailedAuth),
179 4 => Some(Self::NoAvailableKey),
180 5 => Some(Self::SendFailure),
181 _ => None,
182 }
183 }
184
185 #[must_use]
187 pub const fn value(self) -> u8 {
188 self as u8
189 }
190}
191
192impl ToTlv for GroupcastTestResultEnum {
193 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
194 self.value().to_tlv(w, tag)
195 }
196}
197
198impl<'a> FromTlv<'a> for GroupcastTestResultEnum {
199 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
200 let value = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
201 Self::from_value(value).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
202 }
203}
204
205#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
207#[repr(u8)]
208pub enum GroupcastTestingEnum {
209 DisableTesting = 0,
211 EnableListenerTesting = 1,
213 EnableSenderTesting = 2,
215}
216
217impl GroupcastTestingEnum {
218 #[must_use]
220 pub const fn from_value(value: u8) -> Option<Self> {
221 match value {
222 0 => Some(Self::DisableTesting),
223 1 => Some(Self::EnableListenerTesting),
224 2 => Some(Self::EnableSenderTesting),
225 _ => None,
226 }
227 }
228
229 #[must_use]
231 pub const fn value(self) -> u8 {
232 self as u8
233 }
234}
235
236impl ToTlv for GroupcastTestingEnum {
237 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
238 self.value().to_tlv(w, tag)
239 }
240}
241
242impl<'a> FromTlv<'a> for GroupcastTestingEnum {
243 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
244 let value = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
245 Self::from_value(value).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
246 }
247}
248
249#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
251#[repr(u8)]
252pub enum MulticastAddrPolicyEnum {
253 IanaAddr = 0,
255 PerGroup = 1,
257}
258
259impl MulticastAddrPolicyEnum {
260 #[must_use]
262 pub const fn from_value(value: u8) -> Option<Self> {
263 match value {
264 0 => Some(Self::IanaAddr),
265 1 => Some(Self::PerGroup),
266 _ => None,
267 }
268 }
269
270 #[must_use]
272 pub const fn value(self) -> u8 {
273 self as u8
274 }
275}
276
277impl ToTlv for MulticastAddrPolicyEnum {
278 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
279 self.value().to_tlv(w, tag)
280 }
281}
282
283impl<'a> FromTlv<'a> for MulticastAddrPolicyEnum {
284 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
285 let value = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
286 Self::from_value(value).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
287 }
288}
289
290#[derive(Debug, Clone, Copy, PartialEq)]
292pub struct MembershipStruct<'a> {
293 pub group_id: crate::msg::GroupId,
295 pub endpoints: Option<TlvList<'a, u16>>,
297 pub key_set_id: u16,
299 pub has_auxiliary_acl: Option<bool>,
301 pub mcast_addr_policy: MulticastAddrPolicyEnum,
303 pub fabric_index: crate::msg::FabricIndex,
305}
306
307impl<'a> ToTlv for MembershipStruct<'a> {
308 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
309 w.start_structure(tag)?;
310 self.group_id.to_tlv(w, Tag::Context(0))?;
311 if let Some(value) = &self.endpoints {
312 value.to_tlv(w, Tag::Context(1))?;
313 }
314 self.key_set_id.to_tlv(w, Tag::Context(2))?;
315 if let Some(value) = &self.has_auxiliary_acl {
316 value.to_tlv(w, Tag::Context(3))?;
317 }
318 self.mcast_addr_policy.to_tlv(w, Tag::Context(4))?;
319 self.fabric_index.to_tlv(w, Tag::Context(254))?;
320 w.end_container()
321 }
322}
323
324impl<'a> FromTlv<'a> for MembershipStruct<'a> {
325 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
326 if element.value.container() != Some(ContainerKind::Structure) {
327 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
328 }
329 let mut group_id = None;
330 let mut endpoints = None;
331 let mut key_set_id = None;
332 let mut has_auxiliary_acl = None;
333 let mut mcast_addr_policy = None;
334 let mut fabric_index = None;
335 loop {
336 let Some(field) = reader.next_element()? else {
337 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
338 };
339 if field.value == Value::EndOfContainer {
340 break;
341 }
342 match field.tag.context() {
343 Some(0) => group_id = Some(<crate::msg::GroupId>::from_tlv(reader, &field)?),
344 Some(1) => endpoints = Some(<TlvList<'a, u16>>::from_tlv(reader, &field)?),
345 Some(2) => key_set_id = Some(<u16>::from_tlv(reader, &field)?),
346 Some(3) => has_auxiliary_acl = Some(<bool>::from_tlv(reader, &field)?),
347 Some(4) => {
348 mcast_addr_policy = Some(<MulticastAddrPolicyEnum>::from_tlv(reader, &field)?)
349 }
350 Some(254) => {
351 fabric_index = Some(<crate::msg::FabricIndex>::from_tlv(reader, &field)?)
352 }
353 _ => reader.skip_value(&field)?,
357 }
358 }
359 Ok(Self {
360 group_id: group_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
361 endpoints,
362 key_set_id: key_set_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
363 has_auxiliary_acl,
364 mcast_addr_policy: mcast_addr_policy
365 .ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
366 fabric_index: fabric_index.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
367 })
368 }
369}
370
371#[derive(Debug, Clone, Copy, PartialEq)]
373pub struct JoinGroupFields<'a> {
374 pub group_id: crate::msg::GroupId,
376 pub endpoints: TlvList<'a, u16>,
378 pub key_set_id: u16,
380 pub key: Option<&'a [u8]>,
382 pub use_auxiliary_acl: Option<bool>,
384 pub replace_endpoints: Option<bool>,
386 pub mcast_addr_policy: Option<MulticastAddrPolicyEnum>,
388}
389
390impl<'a> ToTlv for JoinGroupFields<'a> {
391 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
392 w.start_structure(tag)?;
393 self.group_id.to_tlv(w, Tag::Context(0))?;
394 self.endpoints.to_tlv(w, Tag::Context(1))?;
395 self.key_set_id.to_tlv(w, Tag::Context(2))?;
396 if let Some(value) = &self.key {
397 value.to_tlv(w, Tag::Context(3))?;
398 }
399 if let Some(value) = &self.use_auxiliary_acl {
400 value.to_tlv(w, Tag::Context(4))?;
401 }
402 if let Some(value) = &self.replace_endpoints {
403 value.to_tlv(w, Tag::Context(5))?;
404 }
405 if let Some(value) = &self.mcast_addr_policy {
406 value.to_tlv(w, Tag::Context(6))?;
407 }
408 w.end_container()
409 }
410}
411
412impl<'a> FromTlv<'a> for JoinGroupFields<'a> {
413 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
414 if element.value.container() != Some(ContainerKind::Structure) {
415 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
416 }
417 let mut group_id = None;
418 let mut endpoints = None;
419 let mut key_set_id = None;
420 let mut key = None;
421 let mut use_auxiliary_acl = None;
422 let mut replace_endpoints = None;
423 let mut mcast_addr_policy = None;
424 loop {
425 let Some(field) = reader.next_element()? else {
426 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
427 };
428 if field.value == Value::EndOfContainer {
429 break;
430 }
431 match field.tag.context() {
432 Some(0) => group_id = Some(<crate::msg::GroupId>::from_tlv(reader, &field)?),
433 Some(1) => endpoints = Some(<TlvList<'a, u16>>::from_tlv(reader, &field)?),
434 Some(2) => key_set_id = Some(<u16>::from_tlv(reader, &field)?),
435 Some(3) => key = Some(<&'a [u8]>::from_tlv(reader, &field)?),
436 Some(4) => use_auxiliary_acl = Some(<bool>::from_tlv(reader, &field)?),
437 Some(5) => replace_endpoints = Some(<bool>::from_tlv(reader, &field)?),
438 Some(6) => {
439 mcast_addr_policy = Some(<MulticastAddrPolicyEnum>::from_tlv(reader, &field)?)
440 }
441 _ => reader.skip_value(&field)?,
445 }
446 }
447 Ok(Self {
448 group_id: group_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
449 endpoints: endpoints.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
450 key_set_id: key_set_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
451 key,
452 use_auxiliary_acl,
453 replace_endpoints,
454 mcast_addr_policy,
455 })
456 }
457}
458
459#[derive(Debug, Clone, Copy, PartialEq)]
461pub struct LeaveGroupFields<'a> {
462 pub group_id: crate::msg::GroupId,
464 pub endpoints: Option<TlvList<'a, u16>>,
466}
467
468impl<'a> ToTlv for LeaveGroupFields<'a> {
469 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
470 w.start_structure(tag)?;
471 self.group_id.to_tlv(w, Tag::Context(0))?;
472 if let Some(value) = &self.endpoints {
473 value.to_tlv(w, Tag::Context(1))?;
474 }
475 w.end_container()
476 }
477}
478
479impl<'a> FromTlv<'a> for LeaveGroupFields<'a> {
480 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
481 if element.value.container() != Some(ContainerKind::Structure) {
482 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
483 }
484 let mut group_id = None;
485 let mut endpoints = None;
486 loop {
487 let Some(field) = reader.next_element()? else {
488 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
489 };
490 if field.value == Value::EndOfContainer {
491 break;
492 }
493 match field.tag.context() {
494 Some(0) => group_id = Some(<crate::msg::GroupId>::from_tlv(reader, &field)?),
495 Some(1) => endpoints = Some(<TlvList<'a, u16>>::from_tlv(reader, &field)?),
496 _ => reader.skip_value(&field)?,
500 }
501 }
502 Ok(Self {
503 group_id: group_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
504 endpoints,
505 })
506 }
507}
508
509#[derive(Debug, Clone, Copy, PartialEq)]
511pub struct LeaveGroupResponseFields<'a> {
512 pub group_id: crate::msg::GroupId,
514 pub endpoints: TlvList<'a, u16>,
516}
517
518impl<'a> ToTlv for LeaveGroupResponseFields<'a> {
519 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
520 w.start_structure(tag)?;
521 self.group_id.to_tlv(w, Tag::Context(0))?;
522 self.endpoints.to_tlv(w, Tag::Context(1))?;
523 w.end_container()
524 }
525}
526
527impl<'a> FromTlv<'a> for LeaveGroupResponseFields<'a> {
528 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
529 if element.value.container() != Some(ContainerKind::Structure) {
530 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
531 }
532 let mut group_id = None;
533 let mut endpoints = None;
534 loop {
535 let Some(field) = reader.next_element()? else {
536 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
537 };
538 if field.value == Value::EndOfContainer {
539 break;
540 }
541 match field.tag.context() {
542 Some(0) => group_id = Some(<crate::msg::GroupId>::from_tlv(reader, &field)?),
543 Some(1) => endpoints = Some(<TlvList<'a, u16>>::from_tlv(reader, &field)?),
544 _ => reader.skip_value(&field)?,
548 }
549 }
550 Ok(Self {
551 group_id: group_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
552 endpoints: endpoints.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
553 })
554 }
555}
556
557#[derive(Debug, Clone, Copy, PartialEq)]
559pub struct UpdateGroupKeyFields<'a> {
560 pub group_id: crate::msg::GroupId,
562 pub key_set_id: u16,
564 pub key: Option<&'a [u8]>,
566}
567
568impl<'a> ToTlv for UpdateGroupKeyFields<'a> {
569 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
570 w.start_structure(tag)?;
571 self.group_id.to_tlv(w, Tag::Context(0))?;
572 self.key_set_id.to_tlv(w, Tag::Context(1))?;
573 if let Some(value) = &self.key {
574 value.to_tlv(w, Tag::Context(2))?;
575 }
576 w.end_container()
577 }
578}
579
580impl<'a> FromTlv<'a> for UpdateGroupKeyFields<'a> {
581 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
582 if element.value.container() != Some(ContainerKind::Structure) {
583 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
584 }
585 let mut group_id = None;
586 let mut key_set_id = None;
587 let mut key = None;
588 loop {
589 let Some(field) = reader.next_element()? else {
590 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
591 };
592 if field.value == Value::EndOfContainer {
593 break;
594 }
595 match field.tag.context() {
596 Some(0) => group_id = Some(<crate::msg::GroupId>::from_tlv(reader, &field)?),
597 Some(1) => key_set_id = Some(<u16>::from_tlv(reader, &field)?),
598 Some(2) => key = Some(<&'a [u8]>::from_tlv(reader, &field)?),
599 _ => reader.skip_value(&field)?,
603 }
604 }
605 Ok(Self {
606 group_id: group_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
607 key_set_id: key_set_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
608 key,
609 })
610 }
611}
612
613#[derive(Debug, Clone, Copy, PartialEq)]
615pub struct ConfigureAuxiliaryACLFields {
616 pub group_id: crate::msg::GroupId,
618 pub use_auxiliary_acl: bool,
620}
621
622impl ToTlv for ConfigureAuxiliaryACLFields {
623 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
624 w.start_structure(tag)?;
625 self.group_id.to_tlv(w, Tag::Context(0))?;
626 self.use_auxiliary_acl.to_tlv(w, Tag::Context(1))?;
627 w.end_container()
628 }
629}
630
631impl<'a> FromTlv<'a> for ConfigureAuxiliaryACLFields {
632 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
633 if element.value.container() != Some(ContainerKind::Structure) {
634 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
635 }
636 let mut group_id = None;
637 let mut use_auxiliary_acl = None;
638 loop {
639 let Some(field) = reader.next_element()? else {
640 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
641 };
642 if field.value == Value::EndOfContainer {
643 break;
644 }
645 match field.tag.context() {
646 Some(0) => group_id = Some(<crate::msg::GroupId>::from_tlv(reader, &field)?),
647 Some(1) => use_auxiliary_acl = Some(<bool>::from_tlv(reader, &field)?),
648 _ => reader.skip_value(&field)?,
652 }
653 }
654 Ok(Self {
655 group_id: group_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
656 use_auxiliary_acl: use_auxiliary_acl
657 .ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
658 })
659 }
660}
661
662#[derive(Debug, Clone, Copy, PartialEq)]
664pub struct GroupcastTestingFields {
665 pub test_operation: GroupcastTestingEnum,
667 pub duration_seconds: Option<u16>,
669}
670
671impl ToTlv for GroupcastTestingFields {
672 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
673 w.start_structure(tag)?;
674 self.test_operation.to_tlv(w, Tag::Context(0))?;
675 if let Some(value) = &self.duration_seconds {
676 value.to_tlv(w, Tag::Context(1))?;
677 }
678 w.end_container()
679 }
680}
681
682impl<'a> FromTlv<'a> for GroupcastTestingFields {
683 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
684 if element.value.container() != Some(ContainerKind::Structure) {
685 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
686 }
687 let mut test_operation = None;
688 let mut duration_seconds = None;
689 loop {
690 let Some(field) = reader.next_element()? else {
691 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
692 };
693 if field.value == Value::EndOfContainer {
694 break;
695 }
696 match field.tag.context() {
697 Some(0) => test_operation = Some(<GroupcastTestingEnum>::from_tlv(reader, &field)?),
698 Some(1) => duration_seconds = Some(<u16>::from_tlv(reader, &field)?),
699 _ => reader.skip_value(&field)?,
703 }
704 }
705 Ok(Self {
706 test_operation: test_operation
707 .ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
708 duration_seconds,
709 })
710 }
711}
712
713pub const ATTRIBUTES: &[Attribute] = &[
715 Attribute {
716 id: 0x0000,
717 name: "Membership",
718 kind: "list[MembershipStruct]",
719 access: Access::read_only(Privilege::View).with_qualities(AccessQualities::FABRIC_SCOPED),
720 qualities: AttributeQualities::NON_VOLATILE,
721 reporting: Reporting::OnChange,
722 conform: Conform {
723 clauses: &[
724 Clause {
725 verdict: Conformance::Provisional,
726 when: Condition::Always,
727 },
728 Clause {
729 verdict: Conformance::Mandatory,
730 when: Condition::Always,
731 },
732 ],
733 },
734 },
735 Attribute {
736 id: 0x0001,
737 name: "MaxMembershipCount",
738 kind: "uint16",
739 access: Access::read_only(Privilege::View),
740 qualities: AttributeQualities::FIXED,
741 reporting: Reporting::OnChange,
742 conform: Conform {
743 clauses: &[
744 Clause {
745 verdict: Conformance::Provisional,
746 when: Condition::Always,
747 },
748 Clause {
749 verdict: Conformance::Mandatory,
750 when: Condition::Always,
751 },
752 ],
753 },
754 },
755 Attribute {
756 id: 0x0002,
757 name: "MaxMcastAddrCount",
758 kind: "uint16",
759 access: Access::read_only(Privilege::View),
760 qualities: AttributeQualities::FIXED,
761 reporting: Reporting::OnChange,
762 conform: Conform {
763 clauses: &[
764 Clause {
765 verdict: Conformance::Provisional,
766 when: Condition::Always,
767 },
768 Clause {
769 verdict: Conformance::Mandatory,
770 when: Condition::Always,
771 },
772 ],
773 },
774 },
775 Attribute {
776 id: 0x0003,
777 name: "UsedMcastAddrCount",
778 kind: "uint16",
779 access: Access::read_only(Privilege::View),
780 qualities: AttributeQualities::FIXED,
781 reporting: Reporting::OnChange,
782 conform: Conform {
783 clauses: &[
784 Clause {
785 verdict: Conformance::Provisional,
786 when: Condition::Always,
787 },
788 Clause {
789 verdict: Conformance::Mandatory,
790 when: Condition::Always,
791 },
792 ],
793 },
794 },
795 Attribute {
796 id: 0x0004,
797 name: "FabricUnderTest",
798 kind: "fabric-idx",
799 access: Access::read_only(Privilege::View),
800 qualities: AttributeQualities::empty(),
801 reporting: Reporting::OnChange,
802 conform: Conform {
803 clauses: &[
804 Clause {
805 verdict: Conformance::Provisional,
806 when: Condition::Always,
807 },
808 Clause {
809 verdict: Conformance::Mandatory,
810 when: Condition::Always,
811 },
812 ],
813 },
814 },
815];
816
817pub const COMMANDS: &[Command] = &[
819 Command {
820 id: 0x00,
821 name: "JoinGroup",
822 to_server: true,
823 response: None,
824 access: Access::invoke(Privilege::Manage).with_qualities(AccessQualities::FABRIC_SCOPED),
825 conform: Conform {
826 clauses: &[
827 Clause {
828 verdict: Conformance::Provisional,
829 when: Condition::Always,
830 },
831 Clause {
832 verdict: Conformance::Mandatory,
833 when: Condition::Always,
834 },
835 ],
836 },
837 },
838 Command {
839 id: 0x01,
840 name: "LeaveGroup",
841 to_server: true,
842 response: Some(0x02),
843 access: Access::invoke(Privilege::Manage).with_qualities(AccessQualities::FABRIC_SCOPED),
844 conform: Conform {
845 clauses: &[
846 Clause {
847 verdict: Conformance::Provisional,
848 when: Condition::Always,
849 },
850 Clause {
851 verdict: Conformance::Mandatory,
852 when: Condition::Always,
853 },
854 ],
855 },
856 },
857 Command {
858 id: 0x02,
859 name: "LeaveGroupResponse",
860 to_server: false,
861 response: None,
862 access: Access::invoke(Privilege::Operate).with_qualities(AccessQualities::FABRIC_SCOPED),
863 conform: Conform {
864 clauses: &[
865 Clause {
866 verdict: Conformance::Provisional,
867 when: Condition::Always,
868 },
869 Clause {
870 verdict: Conformance::Mandatory,
871 when: Condition::Always,
872 },
873 ],
874 },
875 },
876 Command {
877 id: 0x03,
878 name: "UpdateGroupKey",
879 to_server: true,
880 response: None,
881 access: Access::invoke(Privilege::Manage).with_qualities(AccessQualities::FABRIC_SCOPED),
882 conform: Conform {
883 clauses: &[
884 Clause {
885 verdict: Conformance::Provisional,
886 when: Condition::Always,
887 },
888 Clause {
889 verdict: Conformance::Mandatory,
890 when: Condition::Always,
891 },
892 ],
893 },
894 },
895 Command {
896 id: 0x04,
897 name: "ConfigureAuxiliaryACL",
898 to_server: true,
899 response: None,
900 access: Access::invoke(Privilege::Administer)
901 .with_qualities(AccessQualities::FABRIC_SCOPED),
902 conform: Conform {
903 clauses: &[
904 Clause {
905 verdict: Conformance::Provisional,
906 when: Condition::Always,
907 },
908 Clause {
909 verdict: Conformance::Mandatory,
910 when: Condition::Feature(0),
911 },
912 ],
913 },
914 },
915 Command {
916 id: 0x05,
917 name: "GroupcastTesting",
918 to_server: true,
919 response: None,
920 access: Access::invoke(Privilege::Administer)
921 .with_qualities(AccessQualities::FABRIC_SCOPED),
922 conform: Conform {
923 clauses: &[
924 Clause {
925 verdict: Conformance::Provisional,
926 when: Condition::Always,
927 },
928 Clause {
929 verdict: Conformance::Mandatory,
930 when: Condition::Always,
931 },
932 ],
933 },
934 },
935];
936
937pub const EVENTS: &[Event] = &[Event {
939 id: 0x00,
940 name: "GroupcastTesting",
941 priority: EventPriority::Info,
942 access: Access::read_only(Privilege::Administer)
943 .with_qualities(AccessQualities::FABRIC_SENSITIVE),
944 conform: Conform {
945 clauses: &[
946 Clause {
947 verdict: Conformance::Provisional,
948 when: Condition::Always,
949 },
950 Clause {
951 verdict: Conformance::Mandatory,
952 when: Condition::Always,
953 },
954 ],
955 },
956}];
957
958pub const CLUSTER: Cluster = Cluster {
960 id: ID,
961 name: "Groupcast",
962 revision: REVISION,
963 pics: "GC",
964 derived_from: None,
965 features: FEATURES,
966 attributes: ATTRIBUTES,
967 commands: COMMANDS,
968 events: EVENTS,
969};