net-esp-hosted: put link down on wifi disconnect.

This commit is contained in:
Dario Nieuwenhuis 2023-08-17 00:53:25 +02:00
parent 065b0f34af
commit ef7523e5b7

View File

@ -128,6 +128,7 @@ where
let mut runner = Runner {
ch: ch_runner,
state_ch,
shared: &state.shared,
next_seq: 1,
handshake,
@ -142,6 +143,7 @@ where
pub struct Runner<'a, SPI, IN, OUT> {
ch: ch::Runner<'a, MTU>,
state_ch: ch::StateRunner<'a>,
shared: &'a Shared,
next_seq: u16,
@ -322,6 +324,10 @@ where
match payload {
CtrlMsgPayload::EventEspInit(_) => self.shared.init_done(),
CtrlMsgPayload::EventStationDisconnectFromAp(e) => {
info!("disconnected, code {}", e.resp);
self.state_ch.set_link_state(LinkState::Down);
}
_ => {}
}
}