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 = 0x0062;
28
29pub const REVISION: u16 = 1;
32
33pub const PICS: &str = "S";
35
36pub mod feature {
41 pub const SCENE_NAMES: u32 = 1 << 0;
45}
46
47pub const FEATURES: &[Feature] = &[Feature {
49 bit: 0,
50 code: "SN",
51 name: "SceneNames",
52 conform: Conform::OPTIONAL,
53}];
54
55pub mod attribute {
57 use crate::im::AttributeId;
58
59 pub const DO_NOT_USE: AttributeId = 0x00;
61 pub const SCENE_TABLE_SIZE: AttributeId = 0x01;
63 pub const FABRIC_SCENE_INFO: AttributeId = 0x02;
65}
66
67pub mod command {
69 use crate::im::CommandId;
70
71 pub const ADD_SCENE: CommandId = 0x00;
73 pub const ADD_SCENE_RESPONSE: CommandId = 0x00;
75 pub const VIEW_SCENE: CommandId = 0x01;
77 pub const VIEW_SCENE_RESPONSE: CommandId = 0x01;
79 pub const REMOVE_SCENE: CommandId = 0x02;
81 pub const REMOVE_SCENE_RESPONSE: CommandId = 0x02;
83 pub const REMOVE_ALL_SCENES: CommandId = 0x03;
85 pub const REMOVE_ALL_SCENES_RESPONSE: CommandId = 0x03;
87 pub const STORE_SCENE: CommandId = 0x04;
89 pub const STORE_SCENE_RESPONSE: CommandId = 0x04;
91 pub const RECALL_SCENE: CommandId = 0x05;
93 pub const GET_SCENE_MEMBERSHIP: CommandId = 0x06;
95 pub const GET_SCENE_MEMBERSHIP_RESPONSE: CommandId = 0x06;
97 pub const COPY_SCENE: CommandId = 0x40;
99 pub const COPY_SCENE_RESPONSE: CommandId = 0x40;
101}
102
103bitflags::bitflags! {
104 #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
106 pub struct CopyModeBitmap: u8 {
107 const COPY_ALL_SCENES = 1 << 0;
109 }
110}
111
112impl ToTlv for CopyModeBitmap {
113 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
114 self.bits().to_tlv(w, tag)
115 }
116}
117
118impl<'a> FromTlv<'a> for CopyModeBitmap {
119 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
120 let bits = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
121 Self::from_bits(bits).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
122 }
123}
124
125#[derive(Debug, Clone, Copy, PartialEq)]
127pub struct AttributeValuePairStruct {
128 pub attribute_id: u32,
130 pub value_unsigned8: Option<u8>,
132 pub value_signed8: Option<i8>,
134 pub value_unsigned16: Option<u16>,
136 pub value_signed16: Option<i16>,
138 pub value_unsigned32: Option<u32>,
140 pub value_signed32: Option<i32>,
142 pub value_unsigned64: Option<u64>,
144 pub value_signed64: Option<i64>,
146}
147
148impl ToTlv for AttributeValuePairStruct {
149 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
150 w.start_structure(tag)?;
151 self.attribute_id.to_tlv(w, Tag::Context(0))?;
152 if let Some(value) = &self.value_unsigned8 {
153 value.to_tlv(w, Tag::Context(1))?;
154 }
155 if let Some(value) = &self.value_signed8 {
156 value.to_tlv(w, Tag::Context(2))?;
157 }
158 if let Some(value) = &self.value_unsigned16 {
159 value.to_tlv(w, Tag::Context(3))?;
160 }
161 if let Some(value) = &self.value_signed16 {
162 value.to_tlv(w, Tag::Context(4))?;
163 }
164 if let Some(value) = &self.value_unsigned32 {
165 value.to_tlv(w, Tag::Context(5))?;
166 }
167 if let Some(value) = &self.value_signed32 {
168 value.to_tlv(w, Tag::Context(6))?;
169 }
170 if let Some(value) = &self.value_unsigned64 {
171 value.to_tlv(w, Tag::Context(7))?;
172 }
173 if let Some(value) = &self.value_signed64 {
174 value.to_tlv(w, Tag::Context(8))?;
175 }
176 w.end_container()
177 }
178}
179
180impl<'a> FromTlv<'a> for AttributeValuePairStruct {
181 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
182 if element.value.container() != Some(ContainerKind::Structure) {
183 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
184 }
185 let mut attribute_id = None;
186 let mut value_unsigned8 = None;
187 let mut value_signed8 = None;
188 let mut value_unsigned16 = None;
189 let mut value_signed16 = None;
190 let mut value_unsigned32 = None;
191 let mut value_signed32 = None;
192 let mut value_unsigned64 = None;
193 let mut value_signed64 = None;
194 loop {
195 let Some(field) = reader.next_element()? else {
196 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
197 };
198 if field.value == Value::EndOfContainer {
199 break;
200 }
201 match field.tag.context() {
202 Some(0) => attribute_id = Some(<u32>::from_tlv(reader, &field)?),
203 Some(1) => value_unsigned8 = Some(<u8>::from_tlv(reader, &field)?),
204 Some(2) => value_signed8 = Some(<i8>::from_tlv(reader, &field)?),
205 Some(3) => value_unsigned16 = Some(<u16>::from_tlv(reader, &field)?),
206 Some(4) => value_signed16 = Some(<i16>::from_tlv(reader, &field)?),
207 Some(5) => value_unsigned32 = Some(<u32>::from_tlv(reader, &field)?),
208 Some(6) => value_signed32 = Some(<i32>::from_tlv(reader, &field)?),
209 Some(7) => value_unsigned64 = Some(<u64>::from_tlv(reader, &field)?),
210 Some(8) => value_signed64 = Some(<i64>::from_tlv(reader, &field)?),
211 _ => reader.skip_value(&field)?,
215 }
216 }
217 Ok(Self {
218 attribute_id: attribute_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
219 value_unsigned8,
220 value_signed8,
221 value_unsigned16,
222 value_signed16,
223 value_unsigned32,
224 value_signed32,
225 value_unsigned64,
226 value_signed64,
227 })
228 }
229}
230
231#[derive(Debug, Clone, Copy, PartialEq)]
233pub struct ExtensionFieldSetStruct<'a> {
234 pub cluster_id: u32,
236 pub attribute_value_list: TlvList<'a, AttributeValuePairStruct>,
238}
239
240impl<'a> ToTlv for ExtensionFieldSetStruct<'a> {
241 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
242 w.start_structure(tag)?;
243 self.cluster_id.to_tlv(w, Tag::Context(0))?;
244 self.attribute_value_list.to_tlv(w, Tag::Context(1))?;
245 w.end_container()
246 }
247}
248
249impl<'a> FromTlv<'a> for ExtensionFieldSetStruct<'a> {
250 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
251 if element.value.container() != Some(ContainerKind::Structure) {
252 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
253 }
254 let mut cluster_id = None;
255 let mut attribute_value_list = None;
256 loop {
257 let Some(field) = reader.next_element()? else {
258 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
259 };
260 if field.value == Value::EndOfContainer {
261 break;
262 }
263 match field.tag.context() {
264 Some(0) => cluster_id = Some(<u32>::from_tlv(reader, &field)?),
265 Some(1) => {
266 attribute_value_list = Some(<TlvList<'a, AttributeValuePairStruct>>::from_tlv(
267 reader, &field,
268 )?)
269 }
270 _ => reader.skip_value(&field)?,
274 }
275 }
276 Ok(Self {
277 cluster_id: cluster_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
278 attribute_value_list: attribute_value_list
279 .ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
280 })
281 }
282}
283
284#[derive(Debug, Clone, Copy, PartialEq)]
286pub struct SceneInfoStruct {
287 pub scene_count: u8,
289 pub current_scene: u8,
291 pub current_group: crate::msg::GroupId,
293 pub scene_valid: bool,
295 pub remaining_capacity: u8,
297 pub fabric_index: crate::msg::FabricIndex,
299}
300
301impl ToTlv for SceneInfoStruct {
302 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
303 w.start_structure(tag)?;
304 self.scene_count.to_tlv(w, Tag::Context(0))?;
305 self.current_scene.to_tlv(w, Tag::Context(1))?;
306 self.current_group.to_tlv(w, Tag::Context(2))?;
307 self.scene_valid.to_tlv(w, Tag::Context(3))?;
308 self.remaining_capacity.to_tlv(w, Tag::Context(4))?;
309 self.fabric_index.to_tlv(w, Tag::Context(254))?;
310 w.end_container()
311 }
312}
313
314impl<'a> FromTlv<'a> for SceneInfoStruct {
315 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
316 if element.value.container() != Some(ContainerKind::Structure) {
317 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
318 }
319 let mut scene_count = None;
320 let mut current_scene = None;
321 let mut current_group = None;
322 let mut scene_valid = None;
323 let mut remaining_capacity = None;
324 let mut fabric_index = None;
325 loop {
326 let Some(field) = reader.next_element()? else {
327 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
328 };
329 if field.value == Value::EndOfContainer {
330 break;
331 }
332 match field.tag.context() {
333 Some(0) => scene_count = Some(<u8>::from_tlv(reader, &field)?),
334 Some(1) => current_scene = Some(<u8>::from_tlv(reader, &field)?),
335 Some(2) => current_group = Some(<crate::msg::GroupId>::from_tlv(reader, &field)?),
336 Some(3) => scene_valid = Some(<bool>::from_tlv(reader, &field)?),
337 Some(4) => remaining_capacity = Some(<u8>::from_tlv(reader, &field)?),
338 Some(254) => {
339 fabric_index = Some(<crate::msg::FabricIndex>::from_tlv(reader, &field)?)
340 }
341 _ => reader.skip_value(&field)?,
345 }
346 }
347 Ok(Self {
348 scene_count: scene_count.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
349 current_scene: current_scene.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
350 current_group: current_group.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
351 scene_valid: scene_valid.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
352 remaining_capacity: remaining_capacity
353 .ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
354 fabric_index: fabric_index.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
355 })
356 }
357}
358
359#[derive(Debug, Clone, Copy, PartialEq)]
361pub struct AddSceneFields<'a> {
362 pub group_id: crate::msg::GroupId,
364 pub scene_id: u8,
366 pub transition_time: u32,
368 pub scene_name: &'a str,
370 pub extension_field_set_structs: TlvList<'a, ExtensionFieldSetStruct<'a>>,
372}
373
374impl<'a> ToTlv for AddSceneFields<'a> {
375 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
376 w.start_structure(tag)?;
377 self.group_id.to_tlv(w, Tag::Context(0))?;
378 self.scene_id.to_tlv(w, Tag::Context(1))?;
379 self.transition_time.to_tlv(w, Tag::Context(2))?;
380 self.scene_name.to_tlv(w, Tag::Context(3))?;
381 self.extension_field_set_structs
382 .to_tlv(w, Tag::Context(4))?;
383 w.end_container()
384 }
385}
386
387impl<'a> FromTlv<'a> for AddSceneFields<'a> {
388 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
389 if element.value.container() != Some(ContainerKind::Structure) {
390 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
391 }
392 let mut group_id = None;
393 let mut scene_id = None;
394 let mut transition_time = None;
395 let mut scene_name = None;
396 let mut extension_field_set_structs = None;
397 loop {
398 let Some(field) = reader.next_element()? else {
399 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
400 };
401 if field.value == Value::EndOfContainer {
402 break;
403 }
404 match field.tag.context() {
405 Some(0) => group_id = Some(<crate::msg::GroupId>::from_tlv(reader, &field)?),
406 Some(1) => scene_id = Some(<u8>::from_tlv(reader, &field)?),
407 Some(2) => transition_time = Some(<u32>::from_tlv(reader, &field)?),
408 Some(3) => scene_name = Some(<&'a str>::from_tlv(reader, &field)?),
409 Some(4) => {
410 extension_field_set_structs = Some(
411 <TlvList<'a, ExtensionFieldSetStruct<'a>>>::from_tlv(reader, &field)?,
412 )
413 }
414 _ => reader.skip_value(&field)?,
418 }
419 }
420 Ok(Self {
421 group_id: group_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
422 scene_id: scene_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
423 transition_time: transition_time
424 .ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
425 scene_name: scene_name.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
426 extension_field_set_structs: extension_field_set_structs
427 .ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
428 })
429 }
430}
431
432#[derive(Debug, Clone, Copy, PartialEq)]
434pub struct AddSceneResponseFields {
435 pub status: u8,
437 pub group_id: crate::msg::GroupId,
439 pub scene_id: u8,
441}
442
443impl ToTlv for AddSceneResponseFields {
444 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
445 w.start_structure(tag)?;
446 self.status.to_tlv(w, Tag::Context(0))?;
447 self.group_id.to_tlv(w, Tag::Context(1))?;
448 self.scene_id.to_tlv(w, Tag::Context(2))?;
449 w.end_container()
450 }
451}
452
453impl<'a> FromTlv<'a> for AddSceneResponseFields {
454 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
455 if element.value.container() != Some(ContainerKind::Structure) {
456 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
457 }
458 let mut status = None;
459 let mut group_id = None;
460 let mut scene_id = None;
461 loop {
462 let Some(field) = reader.next_element()? else {
463 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
464 };
465 if field.value == Value::EndOfContainer {
466 break;
467 }
468 match field.tag.context() {
469 Some(0) => status = Some(<u8>::from_tlv(reader, &field)?),
470 Some(1) => group_id = Some(<crate::msg::GroupId>::from_tlv(reader, &field)?),
471 Some(2) => scene_id = Some(<u8>::from_tlv(reader, &field)?),
472 _ => reader.skip_value(&field)?,
476 }
477 }
478 Ok(Self {
479 status: status.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
480 group_id: group_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
481 scene_id: scene_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
482 })
483 }
484}
485
486#[derive(Debug, Clone, Copy, PartialEq)]
488pub struct ViewSceneFields {
489 pub group_id: crate::msg::GroupId,
491 pub scene_id: u8,
493}
494
495impl ToTlv for ViewSceneFields {
496 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
497 w.start_structure(tag)?;
498 self.group_id.to_tlv(w, Tag::Context(0))?;
499 self.scene_id.to_tlv(w, Tag::Context(1))?;
500 w.end_container()
501 }
502}
503
504impl<'a> FromTlv<'a> for ViewSceneFields {
505 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
506 if element.value.container() != Some(ContainerKind::Structure) {
507 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
508 }
509 let mut group_id = None;
510 let mut scene_id = None;
511 loop {
512 let Some(field) = reader.next_element()? else {
513 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
514 };
515 if field.value == Value::EndOfContainer {
516 break;
517 }
518 match field.tag.context() {
519 Some(0) => group_id = Some(<crate::msg::GroupId>::from_tlv(reader, &field)?),
520 Some(1) => scene_id = Some(<u8>::from_tlv(reader, &field)?),
521 _ => reader.skip_value(&field)?,
525 }
526 }
527 Ok(Self {
528 group_id: group_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
529 scene_id: scene_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
530 })
531 }
532}
533
534#[derive(Debug, Clone, Copy, PartialEq)]
536pub struct ViewSceneResponseFields<'a> {
537 pub status: u8,
539 pub group_id: crate::msg::GroupId,
541 pub scene_id: u8,
543 pub transition_time: Option<u32>,
545 pub scene_name: Option<&'a str>,
547 pub extension_field_set_structs: Option<TlvList<'a, ExtensionFieldSetStruct<'a>>>,
549}
550
551impl<'a> ToTlv for ViewSceneResponseFields<'a> {
552 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
553 w.start_structure(tag)?;
554 self.status.to_tlv(w, Tag::Context(0))?;
555 self.group_id.to_tlv(w, Tag::Context(1))?;
556 self.scene_id.to_tlv(w, Tag::Context(2))?;
557 if let Some(value) = &self.transition_time {
558 value.to_tlv(w, Tag::Context(3))?;
559 }
560 if let Some(value) = &self.scene_name {
561 value.to_tlv(w, Tag::Context(4))?;
562 }
563 if let Some(value) = &self.extension_field_set_structs {
564 value.to_tlv(w, Tag::Context(5))?;
565 }
566 w.end_container()
567 }
568}
569
570impl<'a> FromTlv<'a> for ViewSceneResponseFields<'a> {
571 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
572 if element.value.container() != Some(ContainerKind::Structure) {
573 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
574 }
575 let mut status = None;
576 let mut group_id = None;
577 let mut scene_id = None;
578 let mut transition_time = None;
579 let mut scene_name = None;
580 let mut extension_field_set_structs = None;
581 loop {
582 let Some(field) = reader.next_element()? else {
583 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
584 };
585 if field.value == Value::EndOfContainer {
586 break;
587 }
588 match field.tag.context() {
589 Some(0) => status = Some(<u8>::from_tlv(reader, &field)?),
590 Some(1) => group_id = Some(<crate::msg::GroupId>::from_tlv(reader, &field)?),
591 Some(2) => scene_id = Some(<u8>::from_tlv(reader, &field)?),
592 Some(3) => transition_time = Some(<u32>::from_tlv(reader, &field)?),
593 Some(4) => scene_name = Some(<&'a str>::from_tlv(reader, &field)?),
594 Some(5) => {
595 extension_field_set_structs = Some(
596 <TlvList<'a, ExtensionFieldSetStruct<'a>>>::from_tlv(reader, &field)?,
597 )
598 }
599 _ => reader.skip_value(&field)?,
603 }
604 }
605 Ok(Self {
606 status: status.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
607 group_id: group_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
608 scene_id: scene_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
609 transition_time,
610 scene_name,
611 extension_field_set_structs,
612 })
613 }
614}
615
616#[derive(Debug, Clone, Copy, PartialEq)]
618pub struct RemoveSceneFields {
619 pub group_id: crate::msg::GroupId,
621 pub scene_id: u8,
623}
624
625impl ToTlv for RemoveSceneFields {
626 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
627 w.start_structure(tag)?;
628 self.group_id.to_tlv(w, Tag::Context(0))?;
629 self.scene_id.to_tlv(w, Tag::Context(1))?;
630 w.end_container()
631 }
632}
633
634impl<'a> FromTlv<'a> for RemoveSceneFields {
635 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
636 if element.value.container() != Some(ContainerKind::Structure) {
637 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
638 }
639 let mut group_id = None;
640 let mut scene_id = None;
641 loop {
642 let Some(field) = reader.next_element()? else {
643 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
644 };
645 if field.value == Value::EndOfContainer {
646 break;
647 }
648 match field.tag.context() {
649 Some(0) => group_id = Some(<crate::msg::GroupId>::from_tlv(reader, &field)?),
650 Some(1) => scene_id = Some(<u8>::from_tlv(reader, &field)?),
651 _ => reader.skip_value(&field)?,
655 }
656 }
657 Ok(Self {
658 group_id: group_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
659 scene_id: scene_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
660 })
661 }
662}
663
664#[derive(Debug, Clone, Copy, PartialEq)]
666pub struct RemoveSceneResponseFields {
667 pub status: u8,
669 pub group_id: crate::msg::GroupId,
671 pub scene_id: u8,
673}
674
675impl ToTlv for RemoveSceneResponseFields {
676 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
677 w.start_structure(tag)?;
678 self.status.to_tlv(w, Tag::Context(0))?;
679 self.group_id.to_tlv(w, Tag::Context(1))?;
680 self.scene_id.to_tlv(w, Tag::Context(2))?;
681 w.end_container()
682 }
683}
684
685impl<'a> FromTlv<'a> for RemoveSceneResponseFields {
686 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
687 if element.value.container() != Some(ContainerKind::Structure) {
688 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
689 }
690 let mut status = None;
691 let mut group_id = None;
692 let mut scene_id = None;
693 loop {
694 let Some(field) = reader.next_element()? else {
695 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
696 };
697 if field.value == Value::EndOfContainer {
698 break;
699 }
700 match field.tag.context() {
701 Some(0) => status = Some(<u8>::from_tlv(reader, &field)?),
702 Some(1) => group_id = Some(<crate::msg::GroupId>::from_tlv(reader, &field)?),
703 Some(2) => scene_id = Some(<u8>::from_tlv(reader, &field)?),
704 _ => reader.skip_value(&field)?,
708 }
709 }
710 Ok(Self {
711 status: status.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
712 group_id: group_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
713 scene_id: scene_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
714 })
715 }
716}
717
718#[derive(Debug, Clone, Copy, PartialEq)]
720pub struct RemoveAllScenesFields {
721 pub group_id: crate::msg::GroupId,
723}
724
725impl ToTlv for RemoveAllScenesFields {
726 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
727 w.start_structure(tag)?;
728 self.group_id.to_tlv(w, Tag::Context(0))?;
729 w.end_container()
730 }
731}
732
733impl<'a> FromTlv<'a> for RemoveAllScenesFields {
734 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
735 if element.value.container() != Some(ContainerKind::Structure) {
736 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
737 }
738 let mut group_id = None;
739 loop {
740 let Some(field) = reader.next_element()? else {
741 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
742 };
743 if field.value == Value::EndOfContainer {
744 break;
745 }
746 match field.tag.context() {
747 Some(0) => group_id = Some(<crate::msg::GroupId>::from_tlv(reader, &field)?),
748 _ => reader.skip_value(&field)?,
752 }
753 }
754 Ok(Self {
755 group_id: group_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
756 })
757 }
758}
759
760#[derive(Debug, Clone, Copy, PartialEq)]
762pub struct RemoveAllScenesResponseFields {
763 pub status: u8,
765 pub group_id: crate::msg::GroupId,
767}
768
769impl ToTlv for RemoveAllScenesResponseFields {
770 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
771 w.start_structure(tag)?;
772 self.status.to_tlv(w, Tag::Context(0))?;
773 self.group_id.to_tlv(w, Tag::Context(1))?;
774 w.end_container()
775 }
776}
777
778impl<'a> FromTlv<'a> for RemoveAllScenesResponseFields {
779 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
780 if element.value.container() != Some(ContainerKind::Structure) {
781 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
782 }
783 let mut status = None;
784 let mut group_id = None;
785 loop {
786 let Some(field) = reader.next_element()? else {
787 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
788 };
789 if field.value == Value::EndOfContainer {
790 break;
791 }
792 match field.tag.context() {
793 Some(0) => status = Some(<u8>::from_tlv(reader, &field)?),
794 Some(1) => group_id = Some(<crate::msg::GroupId>::from_tlv(reader, &field)?),
795 _ => reader.skip_value(&field)?,
799 }
800 }
801 Ok(Self {
802 status: status.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
803 group_id: group_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
804 })
805 }
806}
807
808#[derive(Debug, Clone, Copy, PartialEq)]
810pub struct StoreSceneFields {
811 pub group_id: crate::msg::GroupId,
813 pub scene_id: u8,
815}
816
817impl ToTlv for StoreSceneFields {
818 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
819 w.start_structure(tag)?;
820 self.group_id.to_tlv(w, Tag::Context(0))?;
821 self.scene_id.to_tlv(w, Tag::Context(1))?;
822 w.end_container()
823 }
824}
825
826impl<'a> FromTlv<'a> for StoreSceneFields {
827 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
828 if element.value.container() != Some(ContainerKind::Structure) {
829 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
830 }
831 let mut group_id = None;
832 let mut scene_id = None;
833 loop {
834 let Some(field) = reader.next_element()? else {
835 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
836 };
837 if field.value == Value::EndOfContainer {
838 break;
839 }
840 match field.tag.context() {
841 Some(0) => group_id = Some(<crate::msg::GroupId>::from_tlv(reader, &field)?),
842 Some(1) => scene_id = Some(<u8>::from_tlv(reader, &field)?),
843 _ => reader.skip_value(&field)?,
847 }
848 }
849 Ok(Self {
850 group_id: group_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
851 scene_id: scene_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
852 })
853 }
854}
855
856#[derive(Debug, Clone, Copy, PartialEq)]
858pub struct StoreSceneResponseFields {
859 pub status: u8,
861 pub group_id: crate::msg::GroupId,
863 pub scene_id: u8,
865}
866
867impl ToTlv for StoreSceneResponseFields {
868 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
869 w.start_structure(tag)?;
870 self.status.to_tlv(w, Tag::Context(0))?;
871 self.group_id.to_tlv(w, Tag::Context(1))?;
872 self.scene_id.to_tlv(w, Tag::Context(2))?;
873 w.end_container()
874 }
875}
876
877impl<'a> FromTlv<'a> for StoreSceneResponseFields {
878 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
879 if element.value.container() != Some(ContainerKind::Structure) {
880 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
881 }
882 let mut status = None;
883 let mut group_id = None;
884 let mut scene_id = None;
885 loop {
886 let Some(field) = reader.next_element()? else {
887 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
888 };
889 if field.value == Value::EndOfContainer {
890 break;
891 }
892 match field.tag.context() {
893 Some(0) => status = Some(<u8>::from_tlv(reader, &field)?),
894 Some(1) => group_id = Some(<crate::msg::GroupId>::from_tlv(reader, &field)?),
895 Some(2) => scene_id = Some(<u8>::from_tlv(reader, &field)?),
896 _ => reader.skip_value(&field)?,
900 }
901 }
902 Ok(Self {
903 status: status.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
904 group_id: group_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
905 scene_id: scene_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
906 })
907 }
908}
909
910#[derive(Debug, Clone, Copy, PartialEq)]
912pub struct RecallSceneFields {
913 pub group_id: crate::msg::GroupId,
915 pub scene_id: u8,
917 pub transition_time: Option<Nullable<u32>>,
919}
920
921impl ToTlv for RecallSceneFields {
922 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
923 w.start_structure(tag)?;
924 self.group_id.to_tlv(w, Tag::Context(0))?;
925 self.scene_id.to_tlv(w, Tag::Context(1))?;
926 if let Some(value) = &self.transition_time {
927 value.to_tlv(w, Tag::Context(2))?;
928 }
929 w.end_container()
930 }
931}
932
933impl<'a> FromTlv<'a> for RecallSceneFields {
934 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
935 if element.value.container() != Some(ContainerKind::Structure) {
936 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
937 }
938 let mut group_id = None;
939 let mut scene_id = None;
940 let mut transition_time = None;
941 loop {
942 let Some(field) = reader.next_element()? else {
943 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
944 };
945 if field.value == Value::EndOfContainer {
946 break;
947 }
948 match field.tag.context() {
949 Some(0) => group_id = Some(<crate::msg::GroupId>::from_tlv(reader, &field)?),
950 Some(1) => scene_id = Some(<u8>::from_tlv(reader, &field)?),
951 Some(2) => transition_time = Some(<Nullable<u32>>::from_tlv(reader, &field)?),
952 _ => reader.skip_value(&field)?,
956 }
957 }
958 Ok(Self {
959 group_id: group_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
960 scene_id: scene_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
961 transition_time,
962 })
963 }
964}
965
966#[derive(Debug, Clone, Copy, PartialEq)]
968pub struct GetSceneMembershipFields {
969 pub group_id: crate::msg::GroupId,
971}
972
973impl ToTlv for GetSceneMembershipFields {
974 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
975 w.start_structure(tag)?;
976 self.group_id.to_tlv(w, Tag::Context(0))?;
977 w.end_container()
978 }
979}
980
981impl<'a> FromTlv<'a> for GetSceneMembershipFields {
982 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
983 if element.value.container() != Some(ContainerKind::Structure) {
984 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
985 }
986 let mut group_id = None;
987 loop {
988 let Some(field) = reader.next_element()? else {
989 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
990 };
991 if field.value == Value::EndOfContainer {
992 break;
993 }
994 match field.tag.context() {
995 Some(0) => group_id = Some(<crate::msg::GroupId>::from_tlv(reader, &field)?),
996 _ => reader.skip_value(&field)?,
1000 }
1001 }
1002 Ok(Self {
1003 group_id: group_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
1004 })
1005 }
1006}
1007
1008#[derive(Debug, Clone, Copy, PartialEq)]
1010pub struct GetSceneMembershipResponseFields<'a> {
1011 pub status: u8,
1013 pub capacity: Nullable<u8>,
1015 pub group_id: crate::msg::GroupId,
1017 pub scene_list: Option<TlvList<'a, u8>>,
1019}
1020
1021impl<'a> ToTlv for GetSceneMembershipResponseFields<'a> {
1022 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
1023 w.start_structure(tag)?;
1024 self.status.to_tlv(w, Tag::Context(0))?;
1025 self.capacity.to_tlv(w, Tag::Context(1))?;
1026 self.group_id.to_tlv(w, Tag::Context(2))?;
1027 if let Some(value) = &self.scene_list {
1028 value.to_tlv(w, Tag::Context(3))?;
1029 }
1030 w.end_container()
1031 }
1032}
1033
1034impl<'a> FromTlv<'a> for GetSceneMembershipResponseFields<'a> {
1035 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
1036 if element.value.container() != Some(ContainerKind::Structure) {
1037 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
1038 }
1039 let mut status = None;
1040 let mut capacity = None;
1041 let mut group_id = None;
1042 let mut scene_list = None;
1043 loop {
1044 let Some(field) = reader.next_element()? else {
1045 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
1046 };
1047 if field.value == Value::EndOfContainer {
1048 break;
1049 }
1050 match field.tag.context() {
1051 Some(0) => status = Some(<u8>::from_tlv(reader, &field)?),
1052 Some(1) => capacity = Some(<Nullable<u8>>::from_tlv(reader, &field)?),
1053 Some(2) => group_id = Some(<crate::msg::GroupId>::from_tlv(reader, &field)?),
1054 Some(3) => scene_list = Some(<TlvList<'a, u8>>::from_tlv(reader, &field)?),
1055 _ => reader.skip_value(&field)?,
1059 }
1060 }
1061 Ok(Self {
1062 status: status.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
1063 capacity: capacity.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
1064 group_id: group_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
1065 scene_list,
1066 })
1067 }
1068}
1069
1070#[derive(Debug, Clone, Copy, PartialEq)]
1072pub struct CopySceneFields {
1073 pub mode: CopyModeBitmap,
1075 pub group_identifier_from: crate::msg::GroupId,
1077 pub scene_identifier_from: u8,
1079 pub group_identifier_to: crate::msg::GroupId,
1081 pub scene_identifier_to: u8,
1083}
1084
1085impl ToTlv for CopySceneFields {
1086 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
1087 w.start_structure(tag)?;
1088 self.mode.to_tlv(w, Tag::Context(0))?;
1089 self.group_identifier_from.to_tlv(w, Tag::Context(1))?;
1090 self.scene_identifier_from.to_tlv(w, Tag::Context(2))?;
1091 self.group_identifier_to.to_tlv(w, Tag::Context(3))?;
1092 self.scene_identifier_to.to_tlv(w, Tag::Context(4))?;
1093 w.end_container()
1094 }
1095}
1096
1097impl<'a> FromTlv<'a> for CopySceneFields {
1098 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
1099 if element.value.container() != Some(ContainerKind::Structure) {
1100 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
1101 }
1102 let mut mode = None;
1103 let mut group_identifier_from = None;
1104 let mut scene_identifier_from = None;
1105 let mut group_identifier_to = None;
1106 let mut scene_identifier_to = None;
1107 loop {
1108 let Some(field) = reader.next_element()? else {
1109 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
1110 };
1111 if field.value == Value::EndOfContainer {
1112 break;
1113 }
1114 match field.tag.context() {
1115 Some(0) => mode = Some(<CopyModeBitmap>::from_tlv(reader, &field)?),
1116 Some(1) => {
1117 group_identifier_from = Some(<crate::msg::GroupId>::from_tlv(reader, &field)?)
1118 }
1119 Some(2) => scene_identifier_from = Some(<u8>::from_tlv(reader, &field)?),
1120 Some(3) => {
1121 group_identifier_to = Some(<crate::msg::GroupId>::from_tlv(reader, &field)?)
1122 }
1123 Some(4) => scene_identifier_to = Some(<u8>::from_tlv(reader, &field)?),
1124 _ => reader.skip_value(&field)?,
1128 }
1129 }
1130 Ok(Self {
1131 mode: mode.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
1132 group_identifier_from: group_identifier_from
1133 .ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
1134 scene_identifier_from: scene_identifier_from
1135 .ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
1136 group_identifier_to: group_identifier_to
1137 .ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
1138 scene_identifier_to: scene_identifier_to
1139 .ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
1140 })
1141 }
1142}
1143
1144#[derive(Debug, Clone, Copy, PartialEq)]
1146pub struct CopySceneResponseFields {
1147 pub status: u8,
1149 pub group_identifier_from: crate::msg::GroupId,
1151 pub scene_identifier_from: u8,
1153}
1154
1155impl ToTlv for CopySceneResponseFields {
1156 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
1157 w.start_structure(tag)?;
1158 self.status.to_tlv(w, Tag::Context(0))?;
1159 self.group_identifier_from.to_tlv(w, Tag::Context(1))?;
1160 self.scene_identifier_from.to_tlv(w, Tag::Context(2))?;
1161 w.end_container()
1162 }
1163}
1164
1165impl<'a> FromTlv<'a> for CopySceneResponseFields {
1166 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
1167 if element.value.container() != Some(ContainerKind::Structure) {
1168 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
1169 }
1170 let mut status = None;
1171 let mut group_identifier_from = None;
1172 let mut scene_identifier_from = None;
1173 loop {
1174 let Some(field) = reader.next_element()? else {
1175 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
1176 };
1177 if field.value == Value::EndOfContainer {
1178 break;
1179 }
1180 match field.tag.context() {
1181 Some(0) => status = Some(<u8>::from_tlv(reader, &field)?),
1182 Some(1) => {
1183 group_identifier_from = Some(<crate::msg::GroupId>::from_tlv(reader, &field)?)
1184 }
1185 Some(2) => scene_identifier_from = Some(<u8>::from_tlv(reader, &field)?),
1186 _ => reader.skip_value(&field)?,
1190 }
1191 }
1192 Ok(Self {
1193 status: status.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
1194 group_identifier_from: group_identifier_from
1195 .ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
1196 scene_identifier_from: scene_identifier_from
1197 .ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
1198 })
1199 }
1200}
1201
1202pub const ATTRIBUTES: &[Attribute] = &[
1204 Attribute {
1205 id: 0x0000,
1206 name: "DoNotUse",
1207 kind: "",
1208 access: Access::read_only(Privilege::View),
1209 qualities: AttributeQualities::empty(),
1210 reporting: Reporting::OnChange,
1211 conform: Conform::DISALLOWED,
1212 },
1213 Attribute {
1214 id: 0x0001,
1215 name: "SceneTableSize",
1216 kind: "uint16",
1217 access: Access::read_only(Privilege::View),
1218 qualities: AttributeQualities::FIXED,
1219 reporting: Reporting::OnChange,
1220 conform: Conform::MANDATORY,
1221 },
1222 Attribute {
1223 id: 0x0002,
1224 name: "FabricSceneInfo",
1225 kind: "list[SceneInfoStruct]",
1226 access: Access::read_only(Privilege::View).with_qualities(AccessQualities::FABRIC_SCOPED),
1227 qualities: AttributeQualities::empty(),
1228 reporting: Reporting::OnChange,
1229 conform: Conform::MANDATORY,
1230 },
1231];
1232
1233pub const COMMANDS: &[Command] = &[
1235 Command {
1236 id: 0x00,
1237 name: "AddScene",
1238 to_server: true,
1239 response: Some(0x00),
1240 access: Access::invoke(Privilege::Manage).with_qualities(AccessQualities::FABRIC_SCOPED),
1241 conform: Conform::MANDATORY,
1242 },
1243 Command {
1244 id: 0x00,
1245 name: "AddSceneResponse",
1246 to_server: false,
1247 response: None,
1248 access: Access::invoke(Privilege::Operate),
1249 conform: Conform::MANDATORY,
1250 },
1251 Command {
1252 id: 0x01,
1253 name: "ViewScene",
1254 to_server: true,
1255 response: Some(0x01),
1256 access: Access::invoke(Privilege::Operate).with_qualities(AccessQualities::FABRIC_SCOPED),
1257 conform: Conform::MANDATORY,
1258 },
1259 Command {
1260 id: 0x01,
1261 name: "ViewSceneResponse",
1262 to_server: false,
1263 response: None,
1264 access: Access::invoke(Privilege::Operate),
1265 conform: Conform::MANDATORY,
1266 },
1267 Command {
1268 id: 0x02,
1269 name: "RemoveScene",
1270 to_server: true,
1271 response: Some(0x02),
1272 access: Access::invoke(Privilege::Manage).with_qualities(AccessQualities::FABRIC_SCOPED),
1273 conform: Conform::MANDATORY,
1274 },
1275 Command {
1276 id: 0x02,
1277 name: "RemoveSceneResponse",
1278 to_server: false,
1279 response: None,
1280 access: Access::invoke(Privilege::Operate),
1281 conform: Conform::MANDATORY,
1282 },
1283 Command {
1284 id: 0x03,
1285 name: "RemoveAllScenes",
1286 to_server: true,
1287 response: Some(0x03),
1288 access: Access::invoke(Privilege::Manage).with_qualities(AccessQualities::FABRIC_SCOPED),
1289 conform: Conform::MANDATORY,
1290 },
1291 Command {
1292 id: 0x03,
1293 name: "RemoveAllScenesResponse",
1294 to_server: false,
1295 response: None,
1296 access: Access::invoke(Privilege::Operate),
1297 conform: Conform::MANDATORY,
1298 },
1299 Command {
1300 id: 0x04,
1301 name: "StoreScene",
1302 to_server: true,
1303 response: Some(0x04),
1304 access: Access::invoke(Privilege::Manage).with_qualities(AccessQualities::FABRIC_SCOPED),
1305 conform: Conform::MANDATORY,
1306 },
1307 Command {
1308 id: 0x04,
1309 name: "StoreSceneResponse",
1310 to_server: false,
1311 response: None,
1312 access: Access::invoke(Privilege::Operate),
1313 conform: Conform::MANDATORY,
1314 },
1315 Command {
1316 id: 0x05,
1317 name: "RecallScene",
1318 to_server: true,
1319 response: None,
1320 access: Access::invoke(Privilege::Operate).with_qualities(AccessQualities::FABRIC_SCOPED),
1321 conform: Conform::MANDATORY,
1322 },
1323 Command {
1324 id: 0x06,
1325 name: "GetSceneMembership",
1326 to_server: true,
1327 response: Some(0x06),
1328 access: Access::invoke(Privilege::Operate).with_qualities(AccessQualities::FABRIC_SCOPED),
1329 conform: Conform::MANDATORY,
1330 },
1331 Command {
1332 id: 0x06,
1333 name: "GetSceneMembershipResponse",
1334 to_server: false,
1335 response: None,
1336 access: Access::invoke(Privilege::Operate),
1337 conform: Conform::MANDATORY,
1338 },
1339 Command {
1340 id: 0x40,
1341 name: "CopyScene",
1342 to_server: true,
1343 response: Some(0x40),
1344 access: Access::invoke(Privilege::Manage).with_qualities(AccessQualities::FABRIC_SCOPED),
1345 conform: Conform::OPTIONAL,
1346 },
1347 Command {
1348 id: 0x40,
1349 name: "CopySceneResponse",
1350 to_server: false,
1351 response: None,
1352 access: Access::invoke(Privilege::Operate),
1353 conform: Conform {
1354 clauses: &[Clause {
1355 verdict: Conformance::Mandatory,
1356 when: Condition::Command(0x40),
1357 }],
1358 },
1359 },
1360];
1361
1362pub const EVENTS: &[Event] = &[];
1364
1365pub const CLUSTER: Cluster = Cluster {
1367 id: ID,
1368 name: "Scenes Management",
1369 revision: REVISION,
1370 pics: "S",
1371 derived_from: None,
1372 features: FEATURES,
1373 attributes: ATTRIBUTES,
1374 commands: COMMANDS,
1375 events: EVENTS,
1376};