use std::time::Duration;
use dvb_ci::resource::ResourceId;
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum Event<'a> {
Readable(&'a [u8]),
Tick {
elapsed: Duration,
},
Host(HostRequest<'a>),
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum HostRequest<'a> {
Init,
SendCaPmt(&'a [u8]),
Shutdown,
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum Action {
Write(Vec<u8>),
Reset,
QuerySlot,
SetTimer {
after: Duration,
},
Notify(Notification),
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum Notification {
CamReady,
ApplicationInfo {
application_type: u8,
manufacturer: u16,
code: u16,
menu: String,
},
CaInfo {
ca_system_ids: Vec<u16>,
},
CaPmtReply {
program_number: u16,
descrambling_ok: bool,
},
Mmi(MmiEvent),
SessionOpened {
resource: ResourceId,
},
SessionClosed {
session_nb: u16,
},
Error {
detail: String,
},
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum MmiEvent {
Menu {
title: String,
items: Vec<String>,
},
Enquiry {
prompt: String,
blind: bool,
answer_len: u8,
},
Close,
}