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 = 0x0504;
28
29pub const REVISION: u16 = 2;
32
33pub const PICS: &str = "CHANNEL";
35
36pub mod feature {
41 pub const CHANNEL_LIST: u32 = 1 << 0;
45 pub const LINEUP_INFO: u32 = 1 << 1;
49 pub const ELECTRONIC_GUIDE: u32 = 1 << 2;
53 pub const RECORD_PROGRAM: u32 = 1 << 3;
57}
58
59pub const FEATURES: &[Feature] = &[
61 Feature {
62 bit: 0,
63 code: "CL",
64 name: "ChannelList",
65 conform: Conform::OPTIONAL,
66 },
67 Feature {
68 bit: 1,
69 code: "LI",
70 name: "LineupInfo",
71 conform: Conform::OPTIONAL,
72 },
73 Feature {
74 bit: 2,
75 code: "EG",
76 name: "ElectronicGuide",
77 conform: Conform::OPTIONAL,
78 },
79 Feature {
80 bit: 3,
81 code: "RP",
82 name: "RecordProgram",
83 conform: Conform::OPTIONAL,
84 },
85];
86
87pub mod attribute {
89 use crate::im::AttributeId;
90
91 pub const CHANNEL_LIST: AttributeId = 0x00;
93 pub const LINEUP: AttributeId = 0x01;
95 pub const CURRENT_CHANNEL: AttributeId = 0x02;
97}
98
99pub mod command {
101 use crate::im::CommandId;
102
103 pub const CHANGE_CHANNEL: CommandId = 0x00;
105 pub const CHANGE_CHANNEL_RESPONSE: CommandId = 0x01;
107 pub const CHANGE_CHANNEL_BY_NUMBER: CommandId = 0x02;
109 pub const SKIP_CHANNEL: CommandId = 0x03;
111 pub const GET_PROGRAM_GUIDE: CommandId = 0x04;
113 pub const PROGRAM_GUIDE_RESPONSE: CommandId = 0x05;
115 pub const RECORD_PROGRAM: CommandId = 0x06;
117 pub const CANCEL_RECORD_PROGRAM: CommandId = 0x07;
119}
120
121#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
123#[repr(u8)]
124pub enum ChannelTypeEnum {
125 Satellite = 0,
127 Cable = 1,
129 Terrestrial = 2,
131 OTT = 3,
133}
134
135impl ChannelTypeEnum {
136 #[must_use]
138 pub const fn from_value(value: u8) -> Option<Self> {
139 match value {
140 0 => Some(Self::Satellite),
141 1 => Some(Self::Cable),
142 2 => Some(Self::Terrestrial),
143 3 => Some(Self::OTT),
144 _ => None,
145 }
146 }
147
148 #[must_use]
150 pub const fn value(self) -> u8 {
151 self as u8
152 }
153}
154
155impl ToTlv for ChannelTypeEnum {
156 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
157 self.value().to_tlv(w, tag)
158 }
159}
160
161impl<'a> FromTlv<'a> for ChannelTypeEnum {
162 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
163 let value = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
164 Self::from_value(value).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
165 }
166}
167
168#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
170#[repr(u8)]
171pub enum LineupInfoTypeEnum {
172 MSO = 0,
174}
175
176impl LineupInfoTypeEnum {
177 #[must_use]
179 pub const fn from_value(value: u8) -> Option<Self> {
180 match value {
181 0 => Some(Self::MSO),
182 _ => None,
183 }
184 }
185
186 #[must_use]
188 pub const fn value(self) -> u8 {
189 self as u8
190 }
191}
192
193impl ToTlv for LineupInfoTypeEnum {
194 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
195 self.value().to_tlv(w, tag)
196 }
197}
198
199impl<'a> FromTlv<'a> for LineupInfoTypeEnum {
200 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
201 let value = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
202 Self::from_value(value).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
203 }
204}
205
206#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
208#[repr(u8)]
209pub enum StatusEnum {
210 Success = 0,
212 MultipleMatches = 1,
214 NoMatches = 2,
216}
217
218impl StatusEnum {
219 #[must_use]
221 pub const fn from_value(value: u8) -> Option<Self> {
222 match value {
223 0 => Some(Self::Success),
224 1 => Some(Self::MultipleMatches),
225 2 => Some(Self::NoMatches),
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 StatusEnum {
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 StatusEnum {
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
250bitflags::bitflags! {
251 #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
253 pub struct RecordingFlagBitmap: u8 {
254 const SCHEDULED = 1 << 0;
256 const RECORD_SERIES = 1 << 1;
258 const RECORDED = 1 << 2;
260 }
261}
262
263impl ToTlv for RecordingFlagBitmap {
264 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
265 self.bits().to_tlv(w, tag)
266 }
267}
268
269impl<'a> FromTlv<'a> for RecordingFlagBitmap {
270 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
271 let bits = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
272 Self::from_bits(bits).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
273 }
274}
275
276#[derive(Debug, Clone, Copy, PartialEq)]
278pub struct ChannelInfoStruct<'a> {
279 pub major_number: u16,
281 pub minor_number: u16,
283 pub name: Option<&'a str>,
285 pub call_sign: Option<&'a str>,
287 pub affiliate_call_sign: Option<&'a str>,
289 pub identifier: Option<&'a str>,
291 pub type_: Option<ChannelTypeEnum>,
293}
294
295impl<'a> ToTlv for ChannelInfoStruct<'a> {
296 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
297 w.start_structure(tag)?;
298 self.major_number.to_tlv(w, Tag::Context(0))?;
299 self.minor_number.to_tlv(w, Tag::Context(1))?;
300 if let Some(value) = &self.name {
301 value.to_tlv(w, Tag::Context(2))?;
302 }
303 if let Some(value) = &self.call_sign {
304 value.to_tlv(w, Tag::Context(3))?;
305 }
306 if let Some(value) = &self.affiliate_call_sign {
307 value.to_tlv(w, Tag::Context(4))?;
308 }
309 if let Some(value) = &self.identifier {
310 value.to_tlv(w, Tag::Context(5))?;
311 }
312 if let Some(value) = &self.type_ {
313 value.to_tlv(w, Tag::Context(6))?;
314 }
315 w.end_container()
316 }
317}
318
319impl<'a> FromTlv<'a> for ChannelInfoStruct<'a> {
320 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
321 if element.value.container() != Some(ContainerKind::Structure) {
322 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
323 }
324 let mut major_number = None;
325 let mut minor_number = None;
326 let mut name = None;
327 let mut call_sign = None;
328 let mut affiliate_call_sign = None;
329 let mut identifier = None;
330 let mut type_ = None;
331 loop {
332 let Some(field) = reader.next_element()? else {
333 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
334 };
335 if field.value == Value::EndOfContainer {
336 break;
337 }
338 match field.tag.context() {
339 Some(0) => major_number = Some(<u16>::from_tlv(reader, &field)?),
340 Some(1) => minor_number = Some(<u16>::from_tlv(reader, &field)?),
341 Some(2) => name = Some(<&'a str>::from_tlv(reader, &field)?),
342 Some(3) => call_sign = Some(<&'a str>::from_tlv(reader, &field)?),
343 Some(4) => affiliate_call_sign = Some(<&'a str>::from_tlv(reader, &field)?),
344 Some(5) => identifier = Some(<&'a str>::from_tlv(reader, &field)?),
345 Some(6) => type_ = Some(<ChannelTypeEnum>::from_tlv(reader, &field)?),
346 _ => reader.skip_value(&field)?,
350 }
351 }
352 Ok(Self {
353 major_number: major_number.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
354 minor_number: minor_number.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
355 name,
356 call_sign,
357 affiliate_call_sign,
358 identifier,
359 type_,
360 })
361 }
362}
363
364#[derive(Debug, Clone, Copy, PartialEq)]
366pub struct ChannelPagingStruct<'a> {
367 pub previous_token: Option<Nullable<PageTokenStruct<'a>>>,
369 pub next_token: Option<Nullable<PageTokenStruct<'a>>>,
371}
372
373impl<'a> ToTlv for ChannelPagingStruct<'a> {
374 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
375 w.start_structure(tag)?;
376 if let Some(value) = &self.previous_token {
377 value.to_tlv(w, Tag::Context(0))?;
378 }
379 if let Some(value) = &self.next_token {
380 value.to_tlv(w, Tag::Context(1))?;
381 }
382 w.end_container()
383 }
384}
385
386impl<'a> FromTlv<'a> for ChannelPagingStruct<'a> {
387 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
388 if element.value.container() != Some(ContainerKind::Structure) {
389 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
390 }
391 let mut previous_token = None;
392 let mut next_token = None;
393 loop {
394 let Some(field) = reader.next_element()? else {
395 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
396 };
397 if field.value == Value::EndOfContainer {
398 break;
399 }
400 match field.tag.context() {
401 Some(0) => {
402 previous_token =
403 Some(<Nullable<PageTokenStruct<'a>>>::from_tlv(reader, &field)?)
404 }
405 Some(1) => {
406 next_token = Some(<Nullable<PageTokenStruct<'a>>>::from_tlv(reader, &field)?)
407 }
408 _ => reader.skip_value(&field)?,
412 }
413 }
414 Ok(Self {
415 previous_token,
416 next_token,
417 })
418 }
419}
420
421#[derive(Debug, Clone, Copy, PartialEq)]
423pub struct LineupInfoStruct<'a> {
424 pub operator_name: &'a str,
426 pub lineup_name: Option<&'a str>,
428 pub postal_code: Option<&'a str>,
430 pub lineup_info_type: LineupInfoTypeEnum,
432}
433
434impl<'a> ToTlv for LineupInfoStruct<'a> {
435 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
436 w.start_structure(tag)?;
437 self.operator_name.to_tlv(w, Tag::Context(0))?;
438 if let Some(value) = &self.lineup_name {
439 value.to_tlv(w, Tag::Context(1))?;
440 }
441 if let Some(value) = &self.postal_code {
442 value.to_tlv(w, Tag::Context(2))?;
443 }
444 self.lineup_info_type.to_tlv(w, Tag::Context(3))?;
445 w.end_container()
446 }
447}
448
449impl<'a> FromTlv<'a> for LineupInfoStruct<'a> {
450 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
451 if element.value.container() != Some(ContainerKind::Structure) {
452 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
453 }
454 let mut operator_name = None;
455 let mut lineup_name = None;
456 let mut postal_code = None;
457 let mut lineup_info_type = None;
458 loop {
459 let Some(field) = reader.next_element()? else {
460 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
461 };
462 if field.value == Value::EndOfContainer {
463 break;
464 }
465 match field.tag.context() {
466 Some(0) => operator_name = Some(<&'a str>::from_tlv(reader, &field)?),
467 Some(1) => lineup_name = Some(<&'a str>::from_tlv(reader, &field)?),
468 Some(2) => postal_code = Some(<&'a str>::from_tlv(reader, &field)?),
469 Some(3) => lineup_info_type = Some(<LineupInfoTypeEnum>::from_tlv(reader, &field)?),
470 _ => reader.skip_value(&field)?,
474 }
475 }
476 Ok(Self {
477 operator_name: operator_name.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
478 lineup_name,
479 postal_code,
480 lineup_info_type: lineup_info_type
481 .ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
482 })
483 }
484}
485
486#[derive(Debug, Clone, Copy, PartialEq)]
488pub struct PageTokenStruct<'a> {
489 pub limit: Option<u16>,
491 pub after: Option<&'a str>,
493 pub before: Option<&'a str>,
495}
496
497impl<'a> ToTlv for PageTokenStruct<'a> {
498 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
499 w.start_structure(tag)?;
500 if let Some(value) = &self.limit {
501 value.to_tlv(w, Tag::Context(0))?;
502 }
503 if let Some(value) = &self.after {
504 value.to_tlv(w, Tag::Context(1))?;
505 }
506 if let Some(value) = &self.before {
507 value.to_tlv(w, Tag::Context(2))?;
508 }
509 w.end_container()
510 }
511}
512
513impl<'a> FromTlv<'a> for PageTokenStruct<'a> {
514 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
515 if element.value.container() != Some(ContainerKind::Structure) {
516 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
517 }
518 let mut limit = None;
519 let mut after = None;
520 let mut before = None;
521 loop {
522 let Some(field) = reader.next_element()? else {
523 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
524 };
525 if field.value == Value::EndOfContainer {
526 break;
527 }
528 match field.tag.context() {
529 Some(0) => limit = Some(<u16>::from_tlv(reader, &field)?),
530 Some(1) => after = Some(<&'a str>::from_tlv(reader, &field)?),
531 Some(2) => before = Some(<&'a str>::from_tlv(reader, &field)?),
532 _ => reader.skip_value(&field)?,
536 }
537 }
538 Ok(Self {
539 limit,
540 after,
541 before,
542 })
543 }
544}
545
546#[derive(Debug, Clone, Copy, PartialEq)]
548pub struct ProgramCastStruct<'a> {
549 pub name: &'a str,
551 pub role: &'a str,
553}
554
555impl<'a> ToTlv for ProgramCastStruct<'a> {
556 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
557 w.start_structure(tag)?;
558 self.name.to_tlv(w, Tag::Context(0))?;
559 self.role.to_tlv(w, Tag::Context(1))?;
560 w.end_container()
561 }
562}
563
564impl<'a> FromTlv<'a> for ProgramCastStruct<'a> {
565 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
566 if element.value.container() != Some(ContainerKind::Structure) {
567 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
568 }
569 let mut name = None;
570 let mut role = None;
571 loop {
572 let Some(field) = reader.next_element()? else {
573 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
574 };
575 if field.value == Value::EndOfContainer {
576 break;
577 }
578 match field.tag.context() {
579 Some(0) => name = Some(<&'a str>::from_tlv(reader, &field)?),
580 Some(1) => role = Some(<&'a str>::from_tlv(reader, &field)?),
581 _ => reader.skip_value(&field)?,
585 }
586 }
587 Ok(Self {
588 name: name.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
589 role: role.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
590 })
591 }
592}
593
594#[derive(Debug, Clone, Copy, PartialEq)]
596pub struct ProgramCategoryStruct<'a> {
597 pub category: &'a str,
599 pub sub_category: Option<&'a str>,
601}
602
603impl<'a> ToTlv for ProgramCategoryStruct<'a> {
604 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
605 w.start_structure(tag)?;
606 self.category.to_tlv(w, Tag::Context(0))?;
607 if let Some(value) = &self.sub_category {
608 value.to_tlv(w, Tag::Context(1))?;
609 }
610 w.end_container()
611 }
612}
613
614impl<'a> FromTlv<'a> for ProgramCategoryStruct<'a> {
615 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
616 if element.value.container() != Some(ContainerKind::Structure) {
617 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
618 }
619 let mut category = None;
620 let mut sub_category = None;
621 loop {
622 let Some(field) = reader.next_element()? else {
623 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
624 };
625 if field.value == Value::EndOfContainer {
626 break;
627 }
628 match field.tag.context() {
629 Some(0) => category = Some(<&'a str>::from_tlv(reader, &field)?),
630 Some(1) => sub_category = Some(<&'a str>::from_tlv(reader, &field)?),
631 _ => reader.skip_value(&field)?,
635 }
636 }
637 Ok(Self {
638 category: category.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
639 sub_category,
640 })
641 }
642}
643
644#[derive(Debug, Clone, Copy, PartialEq)]
646pub struct ProgramStruct<'a> {
647 pub identifier: &'a str,
649 pub channel: ChannelInfoStruct<'a>,
651 pub start_time: u32,
653 pub end_time: u32,
655 pub title: &'a str,
657 pub subtitle: Option<&'a str>,
659 pub description: Option<&'a str>,
661 pub audio_languages: Option<TlvList<'a, &'a str>>,
663 pub ratings: Option<TlvList<'a, &'a str>>,
665 pub thumbnail_url: Option<&'a str>,
667 pub poster_art_url: Option<&'a str>,
669 pub dvbi_url: Option<&'a str>,
671 pub release_date: Option<&'a str>,
673 pub parental_guidance_text: Option<&'a str>,
675 pub recording_flag: Option<RecordingFlagBitmap>,
677 pub series_info: Option<Nullable<SeriesInfoStruct<'a>>>,
679 pub category_list: Option<TlvList<'a, ProgramCategoryStruct<'a>>>,
681 pub cast_list: Option<TlvList<'a, ProgramCastStruct<'a>>>,
683 pub external_id_list:
685 Option<TlvList<'a, crate::clusters::generated::content_launcher::AdditionalInfoStruct<'a>>>,
686}
687
688impl<'a> ToTlv for ProgramStruct<'a> {
689 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
690 w.start_structure(tag)?;
691 self.identifier.to_tlv(w, Tag::Context(0))?;
692 self.channel.to_tlv(w, Tag::Context(1))?;
693 self.start_time.to_tlv(w, Tag::Context(2))?;
694 self.end_time.to_tlv(w, Tag::Context(3))?;
695 self.title.to_tlv(w, Tag::Context(4))?;
696 if let Some(value) = &self.subtitle {
697 value.to_tlv(w, Tag::Context(5))?;
698 }
699 if let Some(value) = &self.description {
700 value.to_tlv(w, Tag::Context(6))?;
701 }
702 if let Some(value) = &self.audio_languages {
703 value.to_tlv(w, Tag::Context(7))?;
704 }
705 if let Some(value) = &self.ratings {
706 value.to_tlv(w, Tag::Context(8))?;
707 }
708 if let Some(value) = &self.thumbnail_url {
709 value.to_tlv(w, Tag::Context(9))?;
710 }
711 if let Some(value) = &self.poster_art_url {
712 value.to_tlv(w, Tag::Context(10))?;
713 }
714 if let Some(value) = &self.dvbi_url {
715 value.to_tlv(w, Tag::Context(11))?;
716 }
717 if let Some(value) = &self.release_date {
718 value.to_tlv(w, Tag::Context(12))?;
719 }
720 if let Some(value) = &self.parental_guidance_text {
721 value.to_tlv(w, Tag::Context(13))?;
722 }
723 if let Some(value) = &self.recording_flag {
724 value.to_tlv(w, Tag::Context(14))?;
725 }
726 if let Some(value) = &self.series_info {
727 value.to_tlv(w, Tag::Context(15))?;
728 }
729 if let Some(value) = &self.category_list {
730 value.to_tlv(w, Tag::Context(16))?;
731 }
732 if let Some(value) = &self.cast_list {
733 value.to_tlv(w, Tag::Context(17))?;
734 }
735 if let Some(value) = &self.external_id_list {
736 value.to_tlv(w, Tag::Context(18))?;
737 }
738 w.end_container()
739 }
740}
741
742impl<'a> FromTlv<'a> for ProgramStruct<'a> {
743 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
744 if element.value.container() != Some(ContainerKind::Structure) {
745 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
746 }
747 let mut identifier = None;
748 let mut channel = None;
749 let mut start_time = None;
750 let mut end_time = None;
751 let mut title = None;
752 let mut subtitle = None;
753 let mut description = None;
754 let mut audio_languages = None;
755 let mut ratings = None;
756 let mut thumbnail_url = None;
757 let mut poster_art_url = None;
758 let mut dvbi_url = None;
759 let mut release_date = None;
760 let mut parental_guidance_text = None;
761 let mut recording_flag = None;
762 let mut series_info = None;
763 let mut category_list = None;
764 let mut cast_list = None;
765 let mut external_id_list = None;
766 loop {
767 let Some(field) = reader.next_element()? else {
768 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
769 };
770 if field.value == Value::EndOfContainer {
771 break;
772 }
773 match field.tag.context() {
774 Some(0) => identifier = Some(<&'a str>::from_tlv(reader, &field)?),
775 Some(1) => channel = Some(<ChannelInfoStruct<'a>>::from_tlv(reader, &field)?),
776 Some(2) => start_time = Some(<u32>::from_tlv(reader, &field)?),
777 Some(3) => end_time = Some(<u32>::from_tlv(reader, &field)?),
778 Some(4) => title = Some(<&'a str>::from_tlv(reader, &field)?),
779 Some(5) => subtitle = Some(<&'a str>::from_tlv(reader, &field)?),
780 Some(6) => description = Some(<&'a str>::from_tlv(reader, &field)?),
781 Some(7) => {
782 audio_languages = Some(<TlvList<'a, &'a str>>::from_tlv(reader, &field)?)
783 }
784 Some(8) => ratings = Some(<TlvList<'a, &'a str>>::from_tlv(reader, &field)?),
785 Some(9) => thumbnail_url = Some(<&'a str>::from_tlv(reader, &field)?),
786 Some(10) => poster_art_url = Some(<&'a str>::from_tlv(reader, &field)?),
787 Some(11) => dvbi_url = Some(<&'a str>::from_tlv(reader, &field)?),
788 Some(12) => release_date = Some(<&'a str>::from_tlv(reader, &field)?),
789 Some(13) => parental_guidance_text = Some(<&'a str>::from_tlv(reader, &field)?),
790 Some(14) => recording_flag = Some(<RecordingFlagBitmap>::from_tlv(reader, &field)?),
791 Some(15) => {
792 series_info = Some(<Nullable<SeriesInfoStruct<'a>>>::from_tlv(reader, &field)?)
793 }
794 Some(16) => {
795 category_list = Some(<TlvList<'a, ProgramCategoryStruct<'a>>>::from_tlv(
796 reader, &field,
797 )?)
798 }
799 Some(17) => {
800 cast_list = Some(<TlvList<'a, ProgramCastStruct<'a>>>::from_tlv(
801 reader, &field,
802 )?)
803 }
804 Some(18) => {
805 external_id_list = Some(<TlvList<
806 'a,
807 crate::clusters::generated::content_launcher::AdditionalInfoStruct<'a>,
808 >>::from_tlv(reader, &field)?)
809 }
810 _ => reader.skip_value(&field)?,
814 }
815 }
816 Ok(Self {
817 identifier: identifier.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
818 channel: channel.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
819 start_time: start_time.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
820 end_time: end_time.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
821 title: title.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
822 subtitle,
823 description,
824 audio_languages,
825 ratings,
826 thumbnail_url,
827 poster_art_url,
828 dvbi_url,
829 release_date,
830 parental_guidance_text,
831 recording_flag,
832 series_info,
833 category_list,
834 cast_list,
835 external_id_list,
836 })
837 }
838}
839
840#[derive(Debug, Clone, Copy, PartialEq)]
842pub struct SeriesInfoStruct<'a> {
843 pub season: &'a str,
845 pub episode: &'a str,
847}
848
849impl<'a> ToTlv for SeriesInfoStruct<'a> {
850 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
851 w.start_structure(tag)?;
852 self.season.to_tlv(w, Tag::Context(0))?;
853 self.episode.to_tlv(w, Tag::Context(1))?;
854 w.end_container()
855 }
856}
857
858impl<'a> FromTlv<'a> for SeriesInfoStruct<'a> {
859 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
860 if element.value.container() != Some(ContainerKind::Structure) {
861 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
862 }
863 let mut season = None;
864 let mut episode = None;
865 loop {
866 let Some(field) = reader.next_element()? else {
867 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
868 };
869 if field.value == Value::EndOfContainer {
870 break;
871 }
872 match field.tag.context() {
873 Some(0) => season = Some(<&'a str>::from_tlv(reader, &field)?),
874 Some(1) => episode = Some(<&'a str>::from_tlv(reader, &field)?),
875 _ => reader.skip_value(&field)?,
879 }
880 }
881 Ok(Self {
882 season: season.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
883 episode: episode.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
884 })
885 }
886}
887
888#[derive(Debug, Clone, Copy, PartialEq)]
890pub struct ChangeChannelFields<'a> {
891 pub match_: &'a str,
893}
894
895impl<'a> ToTlv for ChangeChannelFields<'a> {
896 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
897 w.start_structure(tag)?;
898 self.match_.to_tlv(w, Tag::Context(0))?;
899 w.end_container()
900 }
901}
902
903impl<'a> FromTlv<'a> for ChangeChannelFields<'a> {
904 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
905 if element.value.container() != Some(ContainerKind::Structure) {
906 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
907 }
908 let mut match_ = None;
909 loop {
910 let Some(field) = reader.next_element()? else {
911 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
912 };
913 if field.value == Value::EndOfContainer {
914 break;
915 }
916 match field.tag.context() {
917 Some(0) => match_ = Some(<&'a str>::from_tlv(reader, &field)?),
918 _ => reader.skip_value(&field)?,
922 }
923 }
924 Ok(Self {
925 match_: match_.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
926 })
927 }
928}
929
930#[derive(Debug, Clone, Copy, PartialEq)]
932pub struct ChangeChannelResponseFields<'a> {
933 pub status: StatusEnum,
935 pub data: Option<&'a str>,
937}
938
939impl<'a> ToTlv for ChangeChannelResponseFields<'a> {
940 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
941 w.start_structure(tag)?;
942 self.status.to_tlv(w, Tag::Context(0))?;
943 if let Some(value) = &self.data {
944 value.to_tlv(w, Tag::Context(1))?;
945 }
946 w.end_container()
947 }
948}
949
950impl<'a> FromTlv<'a> for ChangeChannelResponseFields<'a> {
951 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
952 if element.value.container() != Some(ContainerKind::Structure) {
953 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
954 }
955 let mut status = None;
956 let mut data = None;
957 loop {
958 let Some(field) = reader.next_element()? else {
959 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
960 };
961 if field.value == Value::EndOfContainer {
962 break;
963 }
964 match field.tag.context() {
965 Some(0) => status = Some(<StatusEnum>::from_tlv(reader, &field)?),
966 Some(1) => data = Some(<&'a str>::from_tlv(reader, &field)?),
967 _ => reader.skip_value(&field)?,
971 }
972 }
973 Ok(Self {
974 status: status.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
975 data,
976 })
977 }
978}
979
980#[derive(Debug, Clone, Copy, PartialEq)]
982pub struct ChangeChannelByNumberFields {
983 pub major_number: u16,
985 pub minor_number: u16,
987}
988
989impl ToTlv for ChangeChannelByNumberFields {
990 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
991 w.start_structure(tag)?;
992 self.major_number.to_tlv(w, Tag::Context(0))?;
993 self.minor_number.to_tlv(w, Tag::Context(1))?;
994 w.end_container()
995 }
996}
997
998impl<'a> FromTlv<'a> for ChangeChannelByNumberFields {
999 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
1000 if element.value.container() != Some(ContainerKind::Structure) {
1001 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
1002 }
1003 let mut major_number = None;
1004 let mut minor_number = None;
1005 loop {
1006 let Some(field) = reader.next_element()? else {
1007 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
1008 };
1009 if field.value == Value::EndOfContainer {
1010 break;
1011 }
1012 match field.tag.context() {
1013 Some(0) => major_number = Some(<u16>::from_tlv(reader, &field)?),
1014 Some(1) => minor_number = Some(<u16>::from_tlv(reader, &field)?),
1015 _ => reader.skip_value(&field)?,
1019 }
1020 }
1021 Ok(Self {
1022 major_number: major_number.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
1023 minor_number: minor_number.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
1024 })
1025 }
1026}
1027
1028#[derive(Debug, Clone, Copy, PartialEq)]
1030pub struct SkipChannelFields {
1031 pub count: i16,
1033}
1034
1035impl ToTlv for SkipChannelFields {
1036 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
1037 w.start_structure(tag)?;
1038 self.count.to_tlv(w, Tag::Context(0))?;
1039 w.end_container()
1040 }
1041}
1042
1043impl<'a> FromTlv<'a> for SkipChannelFields {
1044 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
1045 if element.value.container() != Some(ContainerKind::Structure) {
1046 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
1047 }
1048 let mut count = None;
1049 loop {
1050 let Some(field) = reader.next_element()? else {
1051 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
1052 };
1053 if field.value == Value::EndOfContainer {
1054 break;
1055 }
1056 match field.tag.context() {
1057 Some(0) => count = Some(<i16>::from_tlv(reader, &field)?),
1058 _ => reader.skip_value(&field)?,
1062 }
1063 }
1064 Ok(Self {
1065 count: count.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
1066 })
1067 }
1068}
1069
1070#[derive(Debug, Clone, Copy, PartialEq)]
1072pub struct GetProgramGuideFields<'a> {
1073 pub start_time: u32,
1075 pub end_time: u32,
1077 pub channel_list: Option<TlvList<'a, ChannelInfoStruct<'a>>>,
1079 pub page_token: Option<Nullable<PageTokenStruct<'a>>>,
1081 pub recording_flag: Option<Nullable<RecordingFlagBitmap>>,
1083 pub external_id_list:
1085 Option<TlvList<'a, crate::clusters::generated::content_launcher::AdditionalInfoStruct<'a>>>,
1086 pub data: Option<&'a [u8]>,
1088}
1089
1090impl<'a> ToTlv for GetProgramGuideFields<'a> {
1091 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
1092 w.start_structure(tag)?;
1093 self.start_time.to_tlv(w, Tag::Context(0))?;
1094 self.end_time.to_tlv(w, Tag::Context(1))?;
1095 if let Some(value) = &self.channel_list {
1096 value.to_tlv(w, Tag::Context(2))?;
1097 }
1098 if let Some(value) = &self.page_token {
1099 value.to_tlv(w, Tag::Context(3))?;
1100 }
1101 if let Some(value) = &self.recording_flag {
1102 value.to_tlv(w, Tag::Context(5))?;
1103 }
1104 if let Some(value) = &self.external_id_list {
1105 value.to_tlv(w, Tag::Context(6))?;
1106 }
1107 if let Some(value) = &self.data {
1108 value.to_tlv(w, Tag::Context(7))?;
1109 }
1110 w.end_container()
1111 }
1112}
1113
1114impl<'a> FromTlv<'a> for GetProgramGuideFields<'a> {
1115 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
1116 if element.value.container() != Some(ContainerKind::Structure) {
1117 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
1118 }
1119 let mut start_time = None;
1120 let mut end_time = None;
1121 let mut channel_list = None;
1122 let mut page_token = None;
1123 let mut recording_flag = None;
1124 let mut external_id_list = None;
1125 let mut data = None;
1126 loop {
1127 let Some(field) = reader.next_element()? else {
1128 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
1129 };
1130 if field.value == Value::EndOfContainer {
1131 break;
1132 }
1133 match field.tag.context() {
1134 Some(0) => start_time = Some(<u32>::from_tlv(reader, &field)?),
1135 Some(1) => end_time = Some(<u32>::from_tlv(reader, &field)?),
1136 Some(2) => {
1137 channel_list = Some(<TlvList<'a, ChannelInfoStruct<'a>>>::from_tlv(
1138 reader, &field,
1139 )?)
1140 }
1141 Some(3) => {
1142 page_token = Some(<Nullable<PageTokenStruct<'a>>>::from_tlv(reader, &field)?)
1143 }
1144 Some(5) => {
1145 recording_flag =
1146 Some(<Nullable<RecordingFlagBitmap>>::from_tlv(reader, &field)?)
1147 }
1148 Some(6) => {
1149 external_id_list = Some(<TlvList<
1150 'a,
1151 crate::clusters::generated::content_launcher::AdditionalInfoStruct<'a>,
1152 >>::from_tlv(reader, &field)?)
1153 }
1154 Some(7) => data = Some(<&'a [u8]>::from_tlv(reader, &field)?),
1155 _ => reader.skip_value(&field)?,
1159 }
1160 }
1161 Ok(Self {
1162 start_time: start_time.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
1163 end_time: end_time.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
1164 channel_list,
1165 page_token,
1166 recording_flag,
1167 external_id_list,
1168 data,
1169 })
1170 }
1171}
1172
1173#[derive(Debug, Clone, Copy, PartialEq)]
1175pub struct ProgramGuideResponseFields<'a> {
1176 pub paging: ChannelPagingStruct<'a>,
1178 pub program_list: TlvList<'a, ProgramStruct<'a>>,
1180}
1181
1182impl<'a> ToTlv for ProgramGuideResponseFields<'a> {
1183 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
1184 w.start_structure(tag)?;
1185 self.paging.to_tlv(w, Tag::Context(0))?;
1186 self.program_list.to_tlv(w, Tag::Context(1))?;
1187 w.end_container()
1188 }
1189}
1190
1191impl<'a> FromTlv<'a> for ProgramGuideResponseFields<'a> {
1192 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
1193 if element.value.container() != Some(ContainerKind::Structure) {
1194 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
1195 }
1196 let mut paging = None;
1197 let mut program_list = None;
1198 loop {
1199 let Some(field) = reader.next_element()? else {
1200 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
1201 };
1202 if field.value == Value::EndOfContainer {
1203 break;
1204 }
1205 match field.tag.context() {
1206 Some(0) => paging = Some(<ChannelPagingStruct<'a>>::from_tlv(reader, &field)?),
1207 Some(1) => {
1208 program_list = Some(<TlvList<'a, ProgramStruct<'a>>>::from_tlv(reader, &field)?)
1209 }
1210 _ => reader.skip_value(&field)?,
1214 }
1215 }
1216 Ok(Self {
1217 paging: paging.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
1218 program_list: program_list.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
1219 })
1220 }
1221}
1222
1223#[derive(Debug, Clone, Copy, PartialEq)]
1225pub struct RecordProgramFields<'a> {
1226 pub program_identifier: &'a str,
1228 pub should_record_series: bool,
1230 pub external_id_list:
1232 Option<TlvList<'a, crate::clusters::generated::content_launcher::AdditionalInfoStruct<'a>>>,
1233 pub data: Option<&'a [u8]>,
1235}
1236
1237impl<'a> ToTlv for RecordProgramFields<'a> {
1238 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
1239 w.start_structure(tag)?;
1240 self.program_identifier.to_tlv(w, Tag::Context(0))?;
1241 self.should_record_series.to_tlv(w, Tag::Context(1))?;
1242 if let Some(value) = &self.external_id_list {
1243 value.to_tlv(w, Tag::Context(2))?;
1244 }
1245 if let Some(value) = &self.data {
1246 value.to_tlv(w, Tag::Context(3))?;
1247 }
1248 w.end_container()
1249 }
1250}
1251
1252impl<'a> FromTlv<'a> for RecordProgramFields<'a> {
1253 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
1254 if element.value.container() != Some(ContainerKind::Structure) {
1255 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
1256 }
1257 let mut program_identifier = None;
1258 let mut should_record_series = None;
1259 let mut external_id_list = None;
1260 let mut data = None;
1261 loop {
1262 let Some(field) = reader.next_element()? else {
1263 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
1264 };
1265 if field.value == Value::EndOfContainer {
1266 break;
1267 }
1268 match field.tag.context() {
1269 Some(0) => program_identifier = Some(<&'a str>::from_tlv(reader, &field)?),
1270 Some(1) => should_record_series = Some(<bool>::from_tlv(reader, &field)?),
1271 Some(2) => {
1272 external_id_list = Some(<TlvList<
1273 'a,
1274 crate::clusters::generated::content_launcher::AdditionalInfoStruct<'a>,
1275 >>::from_tlv(reader, &field)?)
1276 }
1277 Some(3) => data = Some(<&'a [u8]>::from_tlv(reader, &field)?),
1278 _ => reader.skip_value(&field)?,
1282 }
1283 }
1284 Ok(Self {
1285 program_identifier: program_identifier
1286 .ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
1287 should_record_series: should_record_series
1288 .ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
1289 external_id_list,
1290 data,
1291 })
1292 }
1293}
1294
1295#[derive(Debug, Clone, Copy, PartialEq)]
1297pub struct CancelRecordProgramFields<'a> {
1298 pub program_identifier: &'a str,
1300 pub should_record_series: bool,
1302 pub external_id_list:
1304 Option<TlvList<'a, crate::clusters::generated::content_launcher::AdditionalInfoStruct<'a>>>,
1305 pub data: Option<&'a [u8]>,
1307}
1308
1309impl<'a> ToTlv for CancelRecordProgramFields<'a> {
1310 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
1311 w.start_structure(tag)?;
1312 self.program_identifier.to_tlv(w, Tag::Context(0))?;
1313 self.should_record_series.to_tlv(w, Tag::Context(1))?;
1314 if let Some(value) = &self.external_id_list {
1315 value.to_tlv(w, Tag::Context(2))?;
1316 }
1317 if let Some(value) = &self.data {
1318 value.to_tlv(w, Tag::Context(3))?;
1319 }
1320 w.end_container()
1321 }
1322}
1323
1324impl<'a> FromTlv<'a> for CancelRecordProgramFields<'a> {
1325 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
1326 if element.value.container() != Some(ContainerKind::Structure) {
1327 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
1328 }
1329 let mut program_identifier = None;
1330 let mut should_record_series = None;
1331 let mut external_id_list = None;
1332 let mut data = None;
1333 loop {
1334 let Some(field) = reader.next_element()? else {
1335 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
1336 };
1337 if field.value == Value::EndOfContainer {
1338 break;
1339 }
1340 match field.tag.context() {
1341 Some(0) => program_identifier = Some(<&'a str>::from_tlv(reader, &field)?),
1342 Some(1) => should_record_series = Some(<bool>::from_tlv(reader, &field)?),
1343 Some(2) => {
1344 external_id_list = Some(<TlvList<
1345 'a,
1346 crate::clusters::generated::content_launcher::AdditionalInfoStruct<'a>,
1347 >>::from_tlv(reader, &field)?)
1348 }
1349 Some(3) => data = Some(<&'a [u8]>::from_tlv(reader, &field)?),
1350 _ => reader.skip_value(&field)?,
1354 }
1355 }
1356 Ok(Self {
1357 program_identifier: program_identifier
1358 .ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
1359 should_record_series: should_record_series
1360 .ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
1361 external_id_list,
1362 data,
1363 })
1364 }
1365}
1366
1367pub const ATTRIBUTES: &[Attribute] = &[
1369 Attribute {
1370 id: 0x0000,
1371 name: "ChannelList",
1372 kind: "list[ChannelInfoStruct]",
1373 access: Access::read_only(Privilege::View),
1374 qualities: AttributeQualities::empty(),
1375 reporting: Reporting::OnChange,
1376 conform: Conform {
1377 clauses: &[Clause {
1378 verdict: Conformance::Mandatory,
1379 when: Condition::Feature(0),
1380 }],
1381 },
1382 },
1383 Attribute {
1384 id: 0x0001,
1385 name: "Lineup",
1386 kind: "LineupInfoStruct",
1387 access: Access::read_only(Privilege::View),
1388 qualities: AttributeQualities::NULLABLE,
1389 reporting: Reporting::OnChange,
1390 conform: Conform {
1391 clauses: &[Clause {
1392 verdict: Conformance::Mandatory,
1393 when: Condition::Feature(1),
1394 }],
1395 },
1396 },
1397 Attribute {
1398 id: 0x0002,
1399 name: "CurrentChannel",
1400 kind: "ChannelInfoStruct",
1401 access: Access::read_only(Privilege::View),
1402 qualities: AttributeQualities::NULLABLE,
1403 reporting: Reporting::OnChange,
1404 conform: Conform::OPTIONAL,
1405 },
1406];
1407
1408pub const COMMANDS: &[Command] = &[
1410 Command {
1411 id: 0x00,
1412 name: "ChangeChannel",
1413 to_server: true,
1414 response: Some(0x01),
1415 access: Access::invoke(Privilege::Operate),
1416 conform: Conform {
1417 clauses: &[Clause {
1418 verdict: Conformance::Mandatory,
1419 when: Condition::Any(&[Condition::Feature(0), Condition::Feature(1)]),
1420 }],
1421 },
1422 },
1423 Command {
1424 id: 0x01,
1425 name: "ChangeChannelResponse",
1426 to_server: false,
1427 response: None,
1428 access: Access::invoke(Privilege::Operate),
1429 conform: Conform {
1430 clauses: &[Clause {
1431 verdict: Conformance::Mandatory,
1432 when: Condition::Any(&[Condition::Feature(0), Condition::Feature(1)]),
1433 }],
1434 },
1435 },
1436 Command {
1437 id: 0x02,
1438 name: "ChangeChannelByNumber",
1439 to_server: true,
1440 response: None,
1441 access: Access::invoke(Privilege::Operate),
1442 conform: Conform::MANDATORY,
1443 },
1444 Command {
1445 id: 0x03,
1446 name: "SkipChannel",
1447 to_server: true,
1448 response: None,
1449 access: Access::invoke(Privilege::Operate),
1450 conform: Conform::MANDATORY,
1451 },
1452 Command {
1453 id: 0x04,
1454 name: "GetProgramGuide",
1455 to_server: true,
1456 response: Some(0x05),
1457 access: Access::invoke(Privilege::Operate),
1458 conform: Conform {
1459 clauses: &[Clause {
1460 verdict: Conformance::Mandatory,
1461 when: Condition::Feature(2),
1462 }],
1463 },
1464 },
1465 Command {
1466 id: 0x05,
1467 name: "ProgramGuideResponse",
1468 to_server: false,
1469 response: None,
1470 access: Access::invoke(Privilege::Operate),
1471 conform: Conform {
1472 clauses: &[Clause {
1473 verdict: Conformance::Mandatory,
1474 when: Condition::Feature(2),
1475 }],
1476 },
1477 },
1478 Command {
1479 id: 0x06,
1480 name: "RecordProgram",
1481 to_server: true,
1482 response: None,
1483 access: Access::invoke(Privilege::Operate),
1484 conform: Conform {
1485 clauses: &[Clause {
1486 verdict: Conformance::Mandatory,
1487 when: Condition::All(&[Condition::Feature(3), Condition::Feature(2)]),
1488 }],
1489 },
1490 },
1491 Command {
1492 id: 0x07,
1493 name: "CancelRecordProgram",
1494 to_server: true,
1495 response: None,
1496 access: Access::invoke(Privilege::Operate),
1497 conform: Conform {
1498 clauses: &[Clause {
1499 verdict: Conformance::Mandatory,
1500 when: Condition::All(&[Condition::Feature(3), Condition::Feature(2)]),
1501 }],
1502 },
1503 },
1504];
1505
1506pub const EVENTS: &[Event] = &[];
1508
1509pub const CLUSTER: Cluster = Cluster {
1511 id: ID,
1512 name: "Channel",
1513 revision: REVISION,
1514 pics: "CHANNEL",
1515 derived_from: None,
1516 features: FEATURES,
1517 attributes: ATTRIBUTES,
1518 commands: COMMANDS,
1519 events: EVENTS,
1520};