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 = 0x0150;
28
29pub const REVISION: u16 = 2;
32
33pub const PICS: &str = "SEAR";
35
36pub mod feature {
41 pub const SELECT_WHILE_RUNNING: u32 = 1 << 0;
45 pub const PROGRESS_REPORTING: u32 = 1 << 1;
49 pub const MAPS: u32 = 1 << 2;
53}
54
55pub const FEATURES: &[Feature] = &[
57 Feature {
58 bit: 0,
59 code: "SELRUN",
60 name: "SelectWhileRunning",
61 conform: Conform::OPTIONAL,
62 },
63 Feature {
64 bit: 1,
65 code: "PROG",
66 name: "ProgressReporting",
67 conform: Conform::OPTIONAL,
68 },
69 Feature {
70 bit: 2,
71 code: "MAPS",
72 name: "Maps",
73 conform: Conform::OPTIONAL,
74 },
75];
76
77pub mod attribute {
79 use crate::im::AttributeId;
80
81 pub const SUPPORTED_AREAS: AttributeId = 0x00;
83 pub const SUPPORTED_MAPS: AttributeId = 0x01;
85 pub const SELECTED_AREAS: AttributeId = 0x02;
87 pub const CURRENT_AREA: AttributeId = 0x03;
89 pub const ESTIMATED_END_TIME: AttributeId = 0x04;
91 pub const PROGRESS: AttributeId = 0x05;
93}
94
95pub mod command {
97 use crate::im::CommandId;
98
99 pub const SELECT_AREAS: CommandId = 0x00;
101 pub const SELECT_AREAS_RESPONSE: CommandId = 0x01;
103 pub const SKIP_AREA: CommandId = 0x02;
105 pub const SKIP_AREA_RESPONSE: CommandId = 0x03;
107}
108
109#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
111#[repr(u8)]
112pub enum OperationalStatusEnum {
113 Pending = 0,
115 Operating = 1,
117 Skipped = 2,
119 Completed = 3,
121}
122
123impl OperationalStatusEnum {
124 #[must_use]
126 pub const fn from_value(value: u8) -> Option<Self> {
127 match value {
128 0 => Some(Self::Pending),
129 1 => Some(Self::Operating),
130 2 => Some(Self::Skipped),
131 3 => Some(Self::Completed),
132 _ => None,
133 }
134 }
135
136 #[must_use]
138 pub const fn value(self) -> u8 {
139 self as u8
140 }
141}
142
143impl ToTlv for OperationalStatusEnum {
144 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
145 self.value().to_tlv(w, tag)
146 }
147}
148
149impl<'a> FromTlv<'a> for OperationalStatusEnum {
150 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
151 let value = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
152 Self::from_value(value).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
153 }
154}
155
156#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
158#[repr(u8)]
159pub enum SelectAreasStatus {
160 Success = 0,
162 UnsupportedArea = 1,
164 InvalidInMode = 2,
166 InvalidSet = 3,
168}
169
170impl SelectAreasStatus {
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::UnsupportedArea),
177 2 => Some(Self::InvalidInMode),
178 3 => Some(Self::InvalidSet),
179 _ => None,
180 }
181 }
182
183 #[must_use]
185 pub const fn value(self) -> u8 {
186 self as u8
187 }
188}
189
190impl ToTlv for SelectAreasStatus {
191 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
192 self.value().to_tlv(w, tag)
193 }
194}
195
196impl<'a> FromTlv<'a> for SelectAreasStatus {
197 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
198 let value = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
199 Self::from_value(value).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
200 }
201}
202
203#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
205#[repr(u8)]
206pub enum SkipAreaStatus {
207 Success = 0,
209 InvalidAreaList = 1,
211 InvalidInMode = 2,
213 InvalidSkippedArea = 3,
215}
216
217impl SkipAreaStatus {
218 #[must_use]
220 pub const fn from_value(value: u8) -> Option<Self> {
221 match value {
222 0 => Some(Self::Success),
223 1 => Some(Self::InvalidAreaList),
224 2 => Some(Self::InvalidInMode),
225 3 => Some(Self::InvalidSkippedArea),
226 _ => None,
227 }
228 }
229
230 #[must_use]
232 pub const fn value(self) -> u8 {
233 self as u8
234 }
235}
236
237impl ToTlv for SkipAreaStatus {
238 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
239 self.value().to_tlv(w, tag)
240 }
241}
242
243impl<'a> FromTlv<'a> for SkipAreaStatus {
244 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
245 let value = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
246 Self::from_value(value).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
247 }
248}
249
250#[derive(Debug, Clone, Copy, PartialEq)]
252pub struct AreaInfoStruct<'a> {
253 pub location_info: Nullable<crate::clusters::generated::globals::LocationDescriptorStruct<'a>>,
255 pub landmark_info: Nullable<LandmarkInfoStruct>,
257}
258
259impl<'a> ToTlv for AreaInfoStruct<'a> {
260 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
261 w.start_structure(tag)?;
262 self.location_info.to_tlv(w, Tag::Context(0))?;
263 self.landmark_info.to_tlv(w, Tag::Context(1))?;
264 w.end_container()
265 }
266}
267
268impl<'a> FromTlv<'a> for AreaInfoStruct<'a> {
269 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
270 if element.value.container() != Some(ContainerKind::Structure) {
271 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
272 }
273 let mut location_info = None;
274 let mut landmark_info = None;
275 loop {
276 let Some(field) = reader.next_element()? else {
277 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
278 };
279 if field.value == Value::EndOfContainer {
280 break;
281 }
282 match field.tag.context() {
283 Some(0) => {
284 location_info = Some(<Nullable<
285 crate::clusters::generated::globals::LocationDescriptorStruct<'a>,
286 >>::from_tlv(reader, &field)?)
287 }
288 Some(1) => {
289 landmark_info = Some(<Nullable<LandmarkInfoStruct>>::from_tlv(reader, &field)?)
290 }
291 _ => reader.skip_value(&field)?,
295 }
296 }
297 Ok(Self {
298 location_info: location_info.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
299 landmark_info: landmark_info.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
300 })
301 }
302}
303
304#[derive(Debug, Clone, Copy, PartialEq)]
306pub struct AreaStruct<'a> {
307 pub area_id: u32,
309 pub map_id: Nullable<u32>,
311 pub area_info: AreaInfoStruct<'a>,
313}
314
315impl<'a> ToTlv for AreaStruct<'a> {
316 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
317 w.start_structure(tag)?;
318 self.area_id.to_tlv(w, Tag::Context(0))?;
319 self.map_id.to_tlv(w, Tag::Context(1))?;
320 self.area_info.to_tlv(w, Tag::Context(2))?;
321 w.end_container()
322 }
323}
324
325impl<'a> FromTlv<'a> for AreaStruct<'a> {
326 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
327 if element.value.container() != Some(ContainerKind::Structure) {
328 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
329 }
330 let mut area_id = None;
331 let mut map_id = None;
332 let mut area_info = None;
333 loop {
334 let Some(field) = reader.next_element()? else {
335 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
336 };
337 if field.value == Value::EndOfContainer {
338 break;
339 }
340 match field.tag.context() {
341 Some(0) => area_id = Some(<u32>::from_tlv(reader, &field)?),
342 Some(1) => map_id = Some(<Nullable<u32>>::from_tlv(reader, &field)?),
343 Some(2) => area_info = Some(<AreaInfoStruct<'a>>::from_tlv(reader, &field)?),
344 _ => reader.skip_value(&field)?,
348 }
349 }
350 Ok(Self {
351 area_id: area_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
352 map_id: map_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
353 area_info: area_info.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
354 })
355 }
356}
357
358#[derive(Debug, Clone, Copy, PartialEq)]
360pub struct LandmarkInfoStruct {
361 pub landmark_tag: u8,
363 pub relative_position_tag: Nullable<u8>,
365}
366
367impl ToTlv for LandmarkInfoStruct {
368 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
369 w.start_structure(tag)?;
370 self.landmark_tag.to_tlv(w, Tag::Context(0))?;
371 self.relative_position_tag.to_tlv(w, Tag::Context(1))?;
372 w.end_container()
373 }
374}
375
376impl<'a> FromTlv<'a> for LandmarkInfoStruct {
377 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
378 if element.value.container() != Some(ContainerKind::Structure) {
379 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
380 }
381 let mut landmark_tag = None;
382 let mut relative_position_tag = None;
383 loop {
384 let Some(field) = reader.next_element()? else {
385 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
386 };
387 if field.value == Value::EndOfContainer {
388 break;
389 }
390 match field.tag.context() {
391 Some(0) => landmark_tag = Some(<u8>::from_tlv(reader, &field)?),
392 Some(1) => relative_position_tag = Some(<Nullable<u8>>::from_tlv(reader, &field)?),
393 _ => reader.skip_value(&field)?,
397 }
398 }
399 Ok(Self {
400 landmark_tag: landmark_tag.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
401 relative_position_tag: relative_position_tag
402 .ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
403 })
404 }
405}
406
407#[derive(Debug, Clone, Copy, PartialEq)]
409pub struct MapStruct<'a> {
410 pub map_id: u32,
412 pub name: &'a str,
414}
415
416impl<'a> ToTlv for MapStruct<'a> {
417 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
418 w.start_structure(tag)?;
419 self.map_id.to_tlv(w, Tag::Context(0))?;
420 self.name.to_tlv(w, Tag::Context(1))?;
421 w.end_container()
422 }
423}
424
425impl<'a> FromTlv<'a> for MapStruct<'a> {
426 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
427 if element.value.container() != Some(ContainerKind::Structure) {
428 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
429 }
430 let mut map_id = None;
431 let mut name = None;
432 loop {
433 let Some(field) = reader.next_element()? else {
434 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
435 };
436 if field.value == Value::EndOfContainer {
437 break;
438 }
439 match field.tag.context() {
440 Some(0) => map_id = Some(<u32>::from_tlv(reader, &field)?),
441 Some(1) => name = Some(<&'a str>::from_tlv(reader, &field)?),
442 _ => reader.skip_value(&field)?,
446 }
447 }
448 Ok(Self {
449 map_id: map_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
450 name: name.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
451 })
452 }
453}
454
455#[derive(Debug, Clone, Copy, PartialEq)]
457pub struct ProgressStruct {
458 pub area_id: u32,
460 pub status: OperationalStatusEnum,
462 pub total_operational_time: Option<Nullable<u32>>,
464 pub estimated_time: Option<Nullable<u32>>,
466}
467
468impl ToTlv for ProgressStruct {
469 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
470 w.start_structure(tag)?;
471 self.area_id.to_tlv(w, Tag::Context(0))?;
472 self.status.to_tlv(w, Tag::Context(1))?;
473 if let Some(value) = &self.total_operational_time {
474 value.to_tlv(w, Tag::Context(2))?;
475 }
476 if let Some(value) = &self.estimated_time {
477 value.to_tlv(w, Tag::Context(3))?;
478 }
479 w.end_container()
480 }
481}
482
483impl<'a> FromTlv<'a> for ProgressStruct {
484 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
485 if element.value.container() != Some(ContainerKind::Structure) {
486 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
487 }
488 let mut area_id = None;
489 let mut status = None;
490 let mut total_operational_time = None;
491 let mut estimated_time = None;
492 loop {
493 let Some(field) = reader.next_element()? else {
494 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
495 };
496 if field.value == Value::EndOfContainer {
497 break;
498 }
499 match field.tag.context() {
500 Some(0) => area_id = Some(<u32>::from_tlv(reader, &field)?),
501 Some(1) => status = Some(<OperationalStatusEnum>::from_tlv(reader, &field)?),
502 Some(2) => {
503 total_operational_time = Some(<Nullable<u32>>::from_tlv(reader, &field)?)
504 }
505 Some(3) => estimated_time = Some(<Nullable<u32>>::from_tlv(reader, &field)?),
506 _ => reader.skip_value(&field)?,
510 }
511 }
512 Ok(Self {
513 area_id: area_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
514 status: status.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
515 total_operational_time,
516 estimated_time,
517 })
518 }
519}
520
521#[derive(Debug, Clone, Copy, PartialEq)]
523pub struct SelectAreasFields<'a> {
524 pub new_areas: TlvList<'a, u32>,
526}
527
528impl<'a> ToTlv for SelectAreasFields<'a> {
529 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
530 w.start_structure(tag)?;
531 self.new_areas.to_tlv(w, Tag::Context(0))?;
532 w.end_container()
533 }
534}
535
536impl<'a> FromTlv<'a> for SelectAreasFields<'a> {
537 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
538 if element.value.container() != Some(ContainerKind::Structure) {
539 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
540 }
541 let mut new_areas = None;
542 loop {
543 let Some(field) = reader.next_element()? else {
544 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
545 };
546 if field.value == Value::EndOfContainer {
547 break;
548 }
549 match field.tag.context() {
550 Some(0) => new_areas = Some(<TlvList<'a, u32>>::from_tlv(reader, &field)?),
551 _ => reader.skip_value(&field)?,
555 }
556 }
557 Ok(Self {
558 new_areas: new_areas.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
559 })
560 }
561}
562
563#[derive(Debug, Clone, Copy, PartialEq)]
565pub struct SelectAreasResponseFields<'a> {
566 pub status: SelectAreasStatus,
568 pub status_text: &'a str,
570}
571
572impl<'a> ToTlv for SelectAreasResponseFields<'a> {
573 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
574 w.start_structure(tag)?;
575 self.status.to_tlv(w, Tag::Context(0))?;
576 self.status_text.to_tlv(w, Tag::Context(1))?;
577 w.end_container()
578 }
579}
580
581impl<'a> FromTlv<'a> for SelectAreasResponseFields<'a> {
582 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
583 if element.value.container() != Some(ContainerKind::Structure) {
584 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
585 }
586 let mut status = None;
587 let mut status_text = 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) => status = Some(<SelectAreasStatus>::from_tlv(reader, &field)?),
597 Some(1) => status_text = Some(<&'a str>::from_tlv(reader, &field)?),
598 _ => reader.skip_value(&field)?,
602 }
603 }
604 Ok(Self {
605 status: status.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
606 status_text: status_text.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
607 })
608 }
609}
610
611#[derive(Debug, Clone, Copy, PartialEq)]
613pub struct SkipAreaFields {
614 pub skipped_area: u32,
616}
617
618impl ToTlv for SkipAreaFields {
619 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
620 w.start_structure(tag)?;
621 self.skipped_area.to_tlv(w, Tag::Context(0))?;
622 w.end_container()
623 }
624}
625
626impl<'a> FromTlv<'a> for SkipAreaFields {
627 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
628 if element.value.container() != Some(ContainerKind::Structure) {
629 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
630 }
631 let mut skipped_area = None;
632 loop {
633 let Some(field) = reader.next_element()? else {
634 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
635 };
636 if field.value == Value::EndOfContainer {
637 break;
638 }
639 match field.tag.context() {
640 Some(0) => skipped_area = Some(<u32>::from_tlv(reader, &field)?),
641 _ => reader.skip_value(&field)?,
645 }
646 }
647 Ok(Self {
648 skipped_area: skipped_area.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
649 })
650 }
651}
652
653#[derive(Debug, Clone, Copy, PartialEq)]
655pub struct SkipAreaResponseFields<'a> {
656 pub status: SkipAreaStatus,
658 pub status_text: &'a str,
660}
661
662impl<'a> ToTlv for SkipAreaResponseFields<'a> {
663 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
664 w.start_structure(tag)?;
665 self.status.to_tlv(w, Tag::Context(0))?;
666 self.status_text.to_tlv(w, Tag::Context(1))?;
667 w.end_container()
668 }
669}
670
671impl<'a> FromTlv<'a> for SkipAreaResponseFields<'a> {
672 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
673 if element.value.container() != Some(ContainerKind::Structure) {
674 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
675 }
676 let mut status = None;
677 let mut status_text = None;
678 loop {
679 let Some(field) = reader.next_element()? else {
680 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
681 };
682 if field.value == Value::EndOfContainer {
683 break;
684 }
685 match field.tag.context() {
686 Some(0) => status = Some(<SkipAreaStatus>::from_tlv(reader, &field)?),
687 Some(1) => status_text = Some(<&'a str>::from_tlv(reader, &field)?),
688 _ => reader.skip_value(&field)?,
692 }
693 }
694 Ok(Self {
695 status: status.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
696 status_text: status_text.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
697 })
698 }
699}
700
701pub const ATTRIBUTES: &[Attribute] = &[
703 Attribute {
704 id: 0x0000,
705 name: "SupportedAreas",
706 kind: "list[AreaStruct]",
707 access: Access::read_only(Privilege::View),
708 qualities: AttributeQualities::empty(),
709 reporting: Reporting::OnChange,
710 conform: Conform::MANDATORY,
711 },
712 Attribute {
713 id: 0x0001,
714 name: "SupportedMaps",
715 kind: "list[MapStruct]",
716 access: Access::read_only(Privilege::View),
717 qualities: AttributeQualities::empty(),
718 reporting: Reporting::OnChange,
719 conform: Conform {
720 clauses: &[Clause {
721 verdict: Conformance::Mandatory,
722 when: Condition::Feature(2),
723 }],
724 },
725 },
726 Attribute {
727 id: 0x0002,
728 name: "SelectedAreas",
729 kind: "list[uint32]",
730 access: Access::read_only(Privilege::View),
731 qualities: AttributeQualities::empty(),
732 reporting: Reporting::OnChange,
733 conform: Conform::MANDATORY,
734 },
735 Attribute {
736 id: 0x0003,
737 name: "CurrentArea",
738 kind: "uint32",
739 access: Access::read_only(Privilege::View),
740 qualities: AttributeQualities::NULLABLE,
741 reporting: Reporting::OnChange,
742 conform: Conform::DESCRIBED,
743 },
744 Attribute {
745 id: 0x0004,
746 name: "EstimatedEndTime",
747 kind: "epoch-s",
748 access: Access::read_only(Privilege::View),
749 qualities: AttributeQualities::NULLABLE,
750 reporting: Reporting::Quieter,
751 conform: Conform {
752 clauses: &[Clause {
753 verdict: Conformance::Optional,
754 when: Condition::Attribute(0x0003),
755 }],
756 },
757 },
758 Attribute {
759 id: 0x0005,
760 name: "Progress",
761 kind: "list[ProgressStruct]",
762 access: Access::read_only(Privilege::View),
763 qualities: AttributeQualities::empty(),
764 reporting: Reporting::OnChange,
765 conform: Conform {
766 clauses: &[Clause {
767 verdict: Conformance::Mandatory,
768 when: Condition::Feature(1),
769 }],
770 },
771 },
772];
773
774pub const COMMANDS: &[Command] = &[
776 Command {
777 id: 0x00,
778 name: "SelectAreas",
779 to_server: true,
780 response: Some(0x01),
781 access: Access::invoke(Privilege::Operate),
782 conform: Conform::MANDATORY,
783 },
784 Command {
785 id: 0x01,
786 name: "SelectAreasResponse",
787 to_server: false,
788 response: None,
789 access: Access::invoke(Privilege::Operate),
790 conform: Conform::MANDATORY,
791 },
792 Command {
793 id: 0x02,
794 name: "SkipArea",
795 to_server: true,
796 response: Some(0x03),
797 access: Access::invoke(Privilege::Operate),
798 conform: Conform {
799 clauses: &[Clause {
800 verdict: Conformance::Optional,
801 when: Condition::Any(&[Condition::Attribute(0x0003), Condition::Attribute(0x0005)]),
802 }],
803 },
804 },
805 Command {
806 id: 0x03,
807 name: "SkipAreaResponse",
808 to_server: false,
809 response: None,
810 access: Access::invoke(Privilege::Operate),
811 conform: Conform {
812 clauses: &[Clause {
813 verdict: Conformance::Mandatory,
814 when: Condition::Command(0x02),
815 }],
816 },
817 },
818];
819
820pub const EVENTS: &[Event] = &[];
822
823pub const CLUSTER: Cluster = Cluster {
825 id: ID,
826 name: "Service Area",
827 revision: REVISION,
828 pics: "SEAR",
829 derived_from: None,
830 features: FEATURES,
831 attributes: ATTRIBUTES,
832 commands: COMMANDS,
833 events: EVENTS,
834};