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 = 0x0105;
28
29pub const REVISION: u16 = 1;
32
33pub const PICS: &str = "CLDIM";
35
36pub mod feature {
41 pub const POSITIONING: u32 = 1 << 0;
45 pub const MOTION_LATCHING: u32 = 1 << 1;
49 pub const UNIT: u32 = 1 << 2;
53 pub const LIMITATION: u32 = 1 << 3;
57 pub const SPEED: u32 = 1 << 4;
61 pub const TRANSLATION: u32 = 1 << 5;
65 pub const ROTATION: u32 = 1 << 6;
69 pub const MODULATION: u32 = 1 << 7;
73}
74
75pub const FEATURES: &[Feature] = &[
77 Feature {
78 bit: 0,
79 code: "PS",
80 name: "Positioning",
81 conform: Conform::OPTIONAL,
82 },
83 Feature {
84 bit: 1,
85 code: "LT",
86 name: "MotionLatching",
87 conform: Conform::OPTIONAL,
88 },
89 Feature {
90 bit: 2,
91 code: "UT",
92 name: "Unit",
93 conform: Conform {
94 clauses: &[Clause {
95 verdict: Conformance::Optional,
96 when: Condition::Feature(0),
97 }],
98 },
99 },
100 Feature {
101 bit: 3,
102 code: "LM",
103 name: "Limitation",
104 conform: Conform {
105 clauses: &[Clause {
106 verdict: Conformance::Optional,
107 when: Condition::Feature(0),
108 }],
109 },
110 },
111 Feature {
112 bit: 4,
113 code: "SP",
114 name: "Speed",
115 conform: Conform {
116 clauses: &[Clause {
117 verdict: Conformance::Optional,
118 when: Condition::Feature(0),
119 }],
120 },
121 },
122 Feature {
123 bit: 5,
124 code: "TR",
125 name: "Translation",
126 conform: Conform {
127 clauses: &[Clause {
128 verdict: Conformance::Optional,
129 when: Condition::Feature(0),
130 }],
131 },
132 },
133 Feature {
134 bit: 6,
135 code: "RO",
136 name: "Rotation",
137 conform: Conform {
138 clauses: &[Clause {
139 verdict: Conformance::Optional,
140 when: Condition::Feature(0),
141 }],
142 },
143 },
144 Feature {
145 bit: 7,
146 code: "MD",
147 name: "Modulation",
148 conform: Conform {
149 clauses: &[Clause {
150 verdict: Conformance::Optional,
151 when: Condition::Feature(0),
152 }],
153 },
154 },
155];
156
157pub mod attribute {
159 use crate::im::AttributeId;
160
161 pub const CURRENT_STATE: AttributeId = 0x00;
163 pub const TARGET_STATE: AttributeId = 0x01;
165 pub const RESOLUTION: AttributeId = 0x02;
167 pub const STEP_VALUE: AttributeId = 0x03;
169 pub const UNIT: AttributeId = 0x04;
171 pub const UNIT_RANGE: AttributeId = 0x05;
173 pub const LIMIT_RANGE: AttributeId = 0x06;
175 pub const TRANSLATION_DIRECTION: AttributeId = 0x07;
177 pub const ROTATION_AXIS: AttributeId = 0x08;
179 pub const OVERFLOW: AttributeId = 0x09;
181 pub const MODULATION_TYPE: AttributeId = 0x0A;
183 pub const LATCH_CONTROL_MODES: AttributeId = 0x0B;
185}
186
187pub mod command {
189 use crate::im::CommandId;
190
191 pub const SET_TARGET: CommandId = 0x00;
193 pub const STEP: CommandId = 0x01;
195}
196
197#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
199#[repr(u8)]
200pub enum ClosureUnitEnum {
201 Millimeter = 0,
203 Degree = 1,
205}
206
207impl ClosureUnitEnum {
208 #[must_use]
210 pub const fn from_value(value: u8) -> Option<Self> {
211 match value {
212 0 => Some(Self::Millimeter),
213 1 => Some(Self::Degree),
214 _ => None,
215 }
216 }
217
218 #[must_use]
220 pub const fn value(self) -> u8 {
221 self as u8
222 }
223}
224
225impl ToTlv for ClosureUnitEnum {
226 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
227 self.value().to_tlv(w, tag)
228 }
229}
230
231impl<'a> FromTlv<'a> for ClosureUnitEnum {
232 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
233 let value = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
234 Self::from_value(value).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
235 }
236}
237
238#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
240#[repr(u8)]
241pub enum ModulationTypeEnum {
242 SlatsOrientation = 0,
244 SlatsOpenwork = 1,
246 StripesAlignment = 2,
248 Opacity = 3,
250 Ventilation = 4,
252}
253
254impl ModulationTypeEnum {
255 #[must_use]
257 pub const fn from_value(value: u8) -> Option<Self> {
258 match value {
259 0 => Some(Self::SlatsOrientation),
260 1 => Some(Self::SlatsOpenwork),
261 2 => Some(Self::StripesAlignment),
262 3 => Some(Self::Opacity),
263 4 => Some(Self::Ventilation),
264 _ => None,
265 }
266 }
267
268 #[must_use]
270 pub const fn value(self) -> u8 {
271 self as u8
272 }
273}
274
275impl ToTlv for ModulationTypeEnum {
276 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
277 self.value().to_tlv(w, tag)
278 }
279}
280
281impl<'a> FromTlv<'a> for ModulationTypeEnum {
282 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
283 let value = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
284 Self::from_value(value).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
285 }
286}
287
288#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
290#[repr(u8)]
291pub enum OverflowEnum {
292 NoOverflow = 0,
294 Inside = 1,
296 Outside = 2,
298 TopInside = 3,
300 TopOutside = 4,
302 BottomInside = 5,
304 BottomOutside = 6,
306 LeftInside = 7,
308 LeftOutside = 8,
310 RightInside = 9,
312 RightOutside = 10,
314}
315
316impl OverflowEnum {
317 #[must_use]
319 pub const fn from_value(value: u8) -> Option<Self> {
320 match value {
321 0 => Some(Self::NoOverflow),
322 1 => Some(Self::Inside),
323 2 => Some(Self::Outside),
324 3 => Some(Self::TopInside),
325 4 => Some(Self::TopOutside),
326 5 => Some(Self::BottomInside),
327 6 => Some(Self::BottomOutside),
328 7 => Some(Self::LeftInside),
329 8 => Some(Self::LeftOutside),
330 9 => Some(Self::RightInside),
331 10 => Some(Self::RightOutside),
332 _ => None,
333 }
334 }
335
336 #[must_use]
338 pub const fn value(self) -> u8 {
339 self as u8
340 }
341}
342
343impl ToTlv for OverflowEnum {
344 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
345 self.value().to_tlv(w, tag)
346 }
347}
348
349impl<'a> FromTlv<'a> for OverflowEnum {
350 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
351 let value = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
352 Self::from_value(value).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
353 }
354}
355
356#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
358#[repr(u8)]
359pub enum RotationAxisEnum {
360 Left = 0,
362 CenteredVertical = 1,
364 LeftAndRight = 2,
366 Right = 3,
368 Top = 4,
370 CenteredHorizontal = 5,
372 TopAndBottom = 6,
374 Bottom = 7,
376 LeftBarrier = 8,
378 LeftAndRightBarriers = 9,
380 RightBarrier = 10,
382}
383
384impl RotationAxisEnum {
385 #[must_use]
387 pub const fn from_value(value: u8) -> Option<Self> {
388 match value {
389 0 => Some(Self::Left),
390 1 => Some(Self::CenteredVertical),
391 2 => Some(Self::LeftAndRight),
392 3 => Some(Self::Right),
393 4 => Some(Self::Top),
394 5 => Some(Self::CenteredHorizontal),
395 6 => Some(Self::TopAndBottom),
396 7 => Some(Self::Bottom),
397 8 => Some(Self::LeftBarrier),
398 9 => Some(Self::LeftAndRightBarriers),
399 10 => Some(Self::RightBarrier),
400 _ => None,
401 }
402 }
403
404 #[must_use]
406 pub const fn value(self) -> u8 {
407 self as u8
408 }
409}
410
411impl ToTlv for RotationAxisEnum {
412 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
413 self.value().to_tlv(w, tag)
414 }
415}
416
417impl<'a> FromTlv<'a> for RotationAxisEnum {
418 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
419 let value = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
420 Self::from_value(value).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
421 }
422}
423
424#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
426#[repr(u8)]
427pub enum StepDirectionEnum {
428 Decrease = 0,
430 Increase = 1,
432}
433
434impl StepDirectionEnum {
435 #[must_use]
437 pub const fn from_value(value: u8) -> Option<Self> {
438 match value {
439 0 => Some(Self::Decrease),
440 1 => Some(Self::Increase),
441 _ => None,
442 }
443 }
444
445 #[must_use]
447 pub const fn value(self) -> u8 {
448 self as u8
449 }
450}
451
452impl ToTlv for StepDirectionEnum {
453 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
454 self.value().to_tlv(w, tag)
455 }
456}
457
458impl<'a> FromTlv<'a> for StepDirectionEnum {
459 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
460 let value = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
461 Self::from_value(value).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
462 }
463}
464
465#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
467#[repr(u8)]
468pub enum TranslationDirectionEnum {
469 Downward = 0,
471 Upward = 1,
473 VerticalMask = 2,
475 VerticalSymmetry = 3,
477 Leftward = 4,
479 Rightward = 5,
481 HorizontalMask = 6,
483 HorizontalSymmetry = 7,
485 Forward = 8,
487 Backward = 9,
489 DepthMask = 10,
491 DepthSymmetry = 11,
493}
494
495impl TranslationDirectionEnum {
496 #[must_use]
498 pub const fn from_value(value: u8) -> Option<Self> {
499 match value {
500 0 => Some(Self::Downward),
501 1 => Some(Self::Upward),
502 2 => Some(Self::VerticalMask),
503 3 => Some(Self::VerticalSymmetry),
504 4 => Some(Self::Leftward),
505 5 => Some(Self::Rightward),
506 6 => Some(Self::HorizontalMask),
507 7 => Some(Self::HorizontalSymmetry),
508 8 => Some(Self::Forward),
509 9 => Some(Self::Backward),
510 10 => Some(Self::DepthMask),
511 11 => Some(Self::DepthSymmetry),
512 _ => None,
513 }
514 }
515
516 #[must_use]
518 pub const fn value(self) -> u8 {
519 self as u8
520 }
521}
522
523impl ToTlv for TranslationDirectionEnum {
524 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
525 self.value().to_tlv(w, tag)
526 }
527}
528
529impl<'a> FromTlv<'a> for TranslationDirectionEnum {
530 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
531 let value = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
532 Self::from_value(value).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
533 }
534}
535
536bitflags::bitflags! {
537 #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
539 pub struct LatchControlModesBitmap: u8 {
540 const REMOTE_LATCHING = 1 << 0;
542 const REMOTE_UNLATCHING = 1 << 1;
544 }
545}
546
547impl ToTlv for LatchControlModesBitmap {
548 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
549 self.bits().to_tlv(w, tag)
550 }
551}
552
553impl<'a> FromTlv<'a> for LatchControlModesBitmap {
554 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
555 let bits = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
556 Self::from_bits(bits).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
557 }
558}
559
560#[derive(Debug, Clone, Copy, PartialEq)]
562pub struct DimensionStateStruct {
563 pub position: Option<Nullable<u16>>,
565 pub latch: Option<Nullable<bool>>,
567 pub speed: Option<crate::clusters::generated::globals::ThreeLevelAutoEnum>,
569}
570
571impl ToTlv for DimensionStateStruct {
572 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
573 w.start_structure(tag)?;
574 if let Some(value) = &self.position {
575 value.to_tlv(w, Tag::Context(0))?;
576 }
577 if let Some(value) = &self.latch {
578 value.to_tlv(w, Tag::Context(1))?;
579 }
580 if let Some(value) = &self.speed {
581 value.to_tlv(w, Tag::Context(2))?;
582 }
583 w.end_container()
584 }
585}
586
587impl<'a> FromTlv<'a> for DimensionStateStruct {
588 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
589 if element.value.container() != Some(ContainerKind::Structure) {
590 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
591 }
592 let mut position = None;
593 let mut latch = None;
594 let mut speed = None;
595 loop {
596 let Some(field) = reader.next_element()? else {
597 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
598 };
599 if field.value == Value::EndOfContainer {
600 break;
601 }
602 match field.tag.context() {
603 Some(0) => position = Some(<Nullable<u16>>::from_tlv(reader, &field)?),
604 Some(1) => latch = Some(<Nullable<bool>>::from_tlv(reader, &field)?),
605 Some(2) => {
606 speed = Some(
607 <crate::clusters::generated::globals::ThreeLevelAutoEnum>::from_tlv(
608 reader, &field,
609 )?,
610 )
611 }
612 _ => reader.skip_value(&field)?,
616 }
617 }
618 Ok(Self {
619 position,
620 latch,
621 speed,
622 })
623 }
624}
625
626#[derive(Debug, Clone, Copy, PartialEq)]
628pub struct RangePercent100ThsStruct {
629 pub min: u16,
631 pub max: u16,
633}
634
635impl ToTlv for RangePercent100ThsStruct {
636 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
637 w.start_structure(tag)?;
638 self.min.to_tlv(w, Tag::Context(0))?;
639 self.max.to_tlv(w, Tag::Context(1))?;
640 w.end_container()
641 }
642}
643
644impl<'a> FromTlv<'a> for RangePercent100ThsStruct {
645 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
646 if element.value.container() != Some(ContainerKind::Structure) {
647 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
648 }
649 let mut min = None;
650 let mut max = None;
651 loop {
652 let Some(field) = reader.next_element()? else {
653 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
654 };
655 if field.value == Value::EndOfContainer {
656 break;
657 }
658 match field.tag.context() {
659 Some(0) => min = Some(<u16>::from_tlv(reader, &field)?),
660 Some(1) => max = Some(<u16>::from_tlv(reader, &field)?),
661 _ => reader.skip_value(&field)?,
665 }
666 }
667 Ok(Self {
668 min: min.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
669 max: max.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
670 })
671 }
672}
673
674#[derive(Debug, Clone, Copy, PartialEq)]
676pub struct UnitRangeStruct {
677 pub min: i16,
679 pub max: i16,
681}
682
683impl ToTlv for UnitRangeStruct {
684 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
685 w.start_structure(tag)?;
686 self.min.to_tlv(w, Tag::Context(0))?;
687 self.max.to_tlv(w, Tag::Context(1))?;
688 w.end_container()
689 }
690}
691
692impl<'a> FromTlv<'a> for UnitRangeStruct {
693 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
694 if element.value.container() != Some(ContainerKind::Structure) {
695 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
696 }
697 let mut min = None;
698 let mut max = None;
699 loop {
700 let Some(field) = reader.next_element()? else {
701 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
702 };
703 if field.value == Value::EndOfContainer {
704 break;
705 }
706 match field.tag.context() {
707 Some(0) => min = Some(<i16>::from_tlv(reader, &field)?),
708 Some(1) => max = Some(<i16>::from_tlv(reader, &field)?),
709 _ => reader.skip_value(&field)?,
713 }
714 }
715 Ok(Self {
716 min: min.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
717 max: max.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
718 })
719 }
720}
721
722#[derive(Debug, Clone, Copy, PartialEq)]
724pub struct SetTargetFields {
725 pub position: Option<u16>,
727 pub latch: Option<bool>,
729 pub speed: Option<crate::clusters::generated::globals::ThreeLevelAutoEnum>,
731}
732
733impl ToTlv for SetTargetFields {
734 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
735 w.start_structure(tag)?;
736 if let Some(value) = &self.position {
737 value.to_tlv(w, Tag::Context(0))?;
738 }
739 if let Some(value) = &self.latch {
740 value.to_tlv(w, Tag::Context(1))?;
741 }
742 if let Some(value) = &self.speed {
743 value.to_tlv(w, Tag::Context(2))?;
744 }
745 w.end_container()
746 }
747}
748
749impl<'a> FromTlv<'a> for SetTargetFields {
750 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
751 if element.value.container() != Some(ContainerKind::Structure) {
752 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
753 }
754 let mut position = None;
755 let mut latch = None;
756 let mut speed = None;
757 loop {
758 let Some(field) = reader.next_element()? else {
759 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
760 };
761 if field.value == Value::EndOfContainer {
762 break;
763 }
764 match field.tag.context() {
765 Some(0) => position = Some(<u16>::from_tlv(reader, &field)?),
766 Some(1) => latch = Some(<bool>::from_tlv(reader, &field)?),
767 Some(2) => {
768 speed = Some(
769 <crate::clusters::generated::globals::ThreeLevelAutoEnum>::from_tlv(
770 reader, &field,
771 )?,
772 )
773 }
774 _ => reader.skip_value(&field)?,
778 }
779 }
780 Ok(Self {
781 position,
782 latch,
783 speed,
784 })
785 }
786}
787
788#[derive(Debug, Clone, Copy, PartialEq)]
790pub struct StepFields {
791 pub direction: StepDirectionEnum,
793 pub number_of_steps: u16,
795 pub speed: Option<crate::clusters::generated::globals::ThreeLevelAutoEnum>,
797}
798
799impl ToTlv for StepFields {
800 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
801 w.start_structure(tag)?;
802 self.direction.to_tlv(w, Tag::Context(0))?;
803 self.number_of_steps.to_tlv(w, Tag::Context(1))?;
804 if let Some(value) = &self.speed {
805 value.to_tlv(w, Tag::Context(2))?;
806 }
807 w.end_container()
808 }
809}
810
811impl<'a> FromTlv<'a> for StepFields {
812 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
813 if element.value.container() != Some(ContainerKind::Structure) {
814 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
815 }
816 let mut direction = None;
817 let mut number_of_steps = None;
818 let mut speed = None;
819 loop {
820 let Some(field) = reader.next_element()? else {
821 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
822 };
823 if field.value == Value::EndOfContainer {
824 break;
825 }
826 match field.tag.context() {
827 Some(0) => direction = Some(<StepDirectionEnum>::from_tlv(reader, &field)?),
828 Some(1) => number_of_steps = Some(<u16>::from_tlv(reader, &field)?),
829 Some(2) => {
830 speed = Some(
831 <crate::clusters::generated::globals::ThreeLevelAutoEnum>::from_tlv(
832 reader, &field,
833 )?,
834 )
835 }
836 _ => reader.skip_value(&field)?,
840 }
841 }
842 Ok(Self {
843 direction: direction.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
844 number_of_steps: number_of_steps
845 .ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
846 speed,
847 })
848 }
849}
850
851pub const ATTRIBUTES: &[Attribute] = &[
853 Attribute {
854 id: 0x0000,
855 name: "CurrentState",
856 kind: "DimensionStateStruct",
857 access: Access::read_only(Privilege::View),
858 qualities: AttributeQualities::NULLABLE,
859 reporting: Reporting::Quieter,
860 conform: Conform::MANDATORY,
861 },
862 Attribute {
863 id: 0x0001,
864 name: "TargetState",
865 kind: "DimensionStateStruct",
866 access: Access::read_only(Privilege::View),
867 qualities: AttributeQualities::NULLABLE,
868 reporting: Reporting::OnChange,
869 conform: Conform::MANDATORY,
870 },
871 Attribute {
872 id: 0x0002,
873 name: "Resolution",
874 kind: "percent100ths",
875 access: Access::read_only(Privilege::View),
876 qualities: AttributeQualities::FIXED,
877 reporting: Reporting::OnChange,
878 conform: Conform {
879 clauses: &[Clause {
880 verdict: Conformance::Mandatory,
881 when: Condition::Feature(0),
882 }],
883 },
884 },
885 Attribute {
886 id: 0x0003,
887 name: "StepValue",
888 kind: "percent100ths",
889 access: Access::read_only(Privilege::View),
890 qualities: AttributeQualities::FIXED,
891 reporting: Reporting::OnChange,
892 conform: Conform {
893 clauses: &[Clause {
894 verdict: Conformance::Mandatory,
895 when: Condition::Feature(0),
896 }],
897 },
898 },
899 Attribute {
900 id: 0x0004,
901 name: "Unit",
902 kind: "ClosureUnitEnum",
903 access: Access::read_only(Privilege::View),
904 qualities: AttributeQualities::FIXED,
905 reporting: Reporting::OnChange,
906 conform: Conform {
907 clauses: &[Clause {
908 verdict: Conformance::Mandatory,
909 when: Condition::Feature(2),
910 }],
911 },
912 },
913 Attribute {
914 id: 0x0005,
915 name: "UnitRange",
916 kind: "UnitRangeStruct",
917 access: Access::read_only(Privilege::View),
918 qualities: AttributeQualities::NULLABLE,
919 reporting: Reporting::OnChange,
920 conform: Conform {
921 clauses: &[Clause {
922 verdict: Conformance::Mandatory,
923 when: Condition::Feature(2),
924 }],
925 },
926 },
927 Attribute {
928 id: 0x0006,
929 name: "LimitRange",
930 kind: "RangePercent100thsStruct",
931 access: Access::read_only(Privilege::View),
932 qualities: AttributeQualities::empty(),
933 reporting: Reporting::OnChange,
934 conform: Conform {
935 clauses: &[Clause {
936 verdict: Conformance::Mandatory,
937 when: Condition::Feature(3),
938 }],
939 },
940 },
941 Attribute {
942 id: 0x0007,
943 name: "TranslationDirection",
944 kind: "TranslationDirectionEnum",
945 access: Access::read_only(Privilege::View),
946 qualities: AttributeQualities::FIXED,
947 reporting: Reporting::OnChange,
948 conform: Conform {
949 clauses: &[Clause {
950 verdict: Conformance::Mandatory,
951 when: Condition::Feature(5),
952 }],
953 },
954 },
955 Attribute {
956 id: 0x0008,
957 name: "RotationAxis",
958 kind: "RotationAxisEnum",
959 access: Access::read_only(Privilege::View),
960 qualities: AttributeQualities::FIXED,
961 reporting: Reporting::OnChange,
962 conform: Conform {
963 clauses: &[Clause {
964 verdict: Conformance::Mandatory,
965 when: Condition::Feature(6),
966 }],
967 },
968 },
969 Attribute {
970 id: 0x0009,
971 name: "Overflow",
972 kind: "OverflowEnum",
973 access: Access::read_only(Privilege::View),
974 qualities: AttributeQualities::FIXED,
975 reporting: Reporting::OnChange,
976 conform: Conform {
977 clauses: &[Clause {
978 verdict: Conformance::Mandatory,
979 when: Condition::Feature(6),
980 }],
981 },
982 },
983 Attribute {
984 id: 0x000A,
985 name: "ModulationType",
986 kind: "ModulationTypeEnum",
987 access: Access::read_only(Privilege::View),
988 qualities: AttributeQualities::FIXED,
989 reporting: Reporting::OnChange,
990 conform: Conform {
991 clauses: &[Clause {
992 verdict: Conformance::Mandatory,
993 when: Condition::Feature(7),
994 }],
995 },
996 },
997 Attribute {
998 id: 0x000B,
999 name: "LatchControlModes",
1000 kind: "LatchControlModesBitmap",
1001 access: Access::read_only(Privilege::View),
1002 qualities: AttributeQualities::FIXED,
1003 reporting: Reporting::OnChange,
1004 conform: Conform {
1005 clauses: &[Clause {
1006 verdict: Conformance::Mandatory,
1007 when: Condition::Feature(1),
1008 }],
1009 },
1010 },
1011];
1012
1013pub const COMMANDS: &[Command] = &[
1015 Command {
1016 id: 0x00,
1017 name: "SetTarget",
1018 to_server: true,
1019 response: None,
1020 access: Access::invoke(Privilege::Operate).with_qualities(AccessQualities::TIMED),
1021 conform: Conform::MANDATORY,
1022 },
1023 Command {
1024 id: 0x01,
1025 name: "Step",
1026 to_server: true,
1027 response: None,
1028 access: Access::invoke(Privilege::Operate).with_qualities(AccessQualities::TIMED),
1029 conform: Conform {
1030 clauses: &[Clause {
1031 verdict: Conformance::Mandatory,
1032 when: Condition::Feature(0),
1033 }],
1034 },
1035 },
1036];
1037
1038pub const EVENTS: &[Event] = &[];
1040
1041pub const CLUSTER: Cluster = Cluster {
1043 id: ID,
1044 name: "Closure Dimension",
1045 revision: REVISION,
1046 pics: "CLDIM",
1047 derived_from: None,
1048 features: FEATURES,
1049 attributes: ATTRIBUTES,
1050 commands: COMMANDS,
1051 events: EVENTS,
1052};