Skip to content

Commit

Permalink
Merge pull request #80 from embassy-rs/fix-l2cap-disconnect
Browse files Browse the repository at this point in the history
Ensure notifying l2cap channel of disconnection
  • Loading branch information
lulf authored Aug 19, 2024
2 parents 97db1a6 + 1323a4b commit f52cd9e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion host/src/channel_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -446,9 +446,11 @@ impl<'d, const RXQ: usize> ChannelManager<'d, RXQ> {

fn handle_disconnect_request(&self, cid: u16) -> Result<(), Error> {
let mut state = self.state.borrow_mut();
for storage in state.channels.iter_mut() {
for (idx, storage) in state.channels.iter_mut().enumerate() {
if cid == storage.cid {
storage.state = ChannelState::PeerDisconnecting;
let _ = self.inbound[idx as usize].close();
state.disconnect_waker.wake();
break;
}
}
Expand Down

0 comments on commit f52cd9e

Please sign in to comment.