wlan_sme/ap/
event.rs
1use ieee80211::MacAddr;
6use wlan_common::timer::TimeoutDuration;
7
8pub const START_TIMEOUT_SECONDS: i64 = 10;
12pub const STOP_TIMEOUT_SECONDS: i64 = 10;
13
14#[derive(Debug, Clone)]
15pub enum Event {
16 Sme { event: SmeEvent },
17 Client { addr: MacAddr, event: ClientEvent },
18}
19
20impl TimeoutDuration for Event {
21 fn timeout_duration(&self) -> zx::MonotonicDuration {
22 match self {
23 Event::Sme { event } => event.timeout_duration(),
24 Event::Client { event, .. } => event.timeout_duration(),
25 }
26 }
27}
28
29#[derive(Debug, Clone)]
30pub enum SmeEvent {
31 StartTimeout,
32 StopTimeout,
33}
34
35impl SmeEvent {
36 pub fn timeout_duration(&self) -> zx::MonotonicDuration {
37 match self {
38 SmeEvent::StartTimeout => zx::MonotonicDuration::from_seconds(START_TIMEOUT_SECONDS),
39 SmeEvent::StopTimeout => zx::MonotonicDuration::from_seconds(STOP_TIMEOUT_SECONDS),
40 }
41 }
42}
43
44#[derive(Debug, Clone)]
45pub enum RsnaTimeout {
46 Request,
47 Negotiation,
48}
49
50#[derive(Debug, Clone)]
51pub enum ClientEvent {
52 AssociationTimeout,
53 RsnaTimeout(RsnaTimeout),
54}
55
56impl ClientEvent {
57 pub fn timeout_duration(&self) -> zx::MonotonicDuration {
58 match self {
59 ClientEvent::AssociationTimeout => zx::MonotonicDuration::from_seconds(0),
62 ClientEvent::RsnaTimeout { .. } => zx::MonotonicDuration::from_seconds(0),
63 }
64 }
65}