From 97db1a6c052ef0729a562f6975631a46114b3452 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Tue, 13 Aug 2024 14:56:41 +0200 Subject: [PATCH] set host buffer sizes even without flow control --- host/src/channel_manager.rs | 2 +- host/src/host.rs | 29 +++++++++++++++-------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/host/src/channel_manager.rs b/host/src/channel_manager.rs index 6fbfa0d..b699ed2 100644 --- a/host/src/channel_manager.rs +++ b/host/src/channel_manager.rs @@ -3,7 +3,7 @@ use core::future::poll_fn; use core::task::{Context, Poll}; use bt_hci::controller::{blocking, Controller}; -use bt_hci::param::{ConnHandle, Duration}; +use bt_hci::param::ConnHandle; use bt_hci::FromHciBytes; use embassy_sync::blocking_mutex::raw::NoopRawMutex; use embassy_sync::channel::Channel; diff --git a/host/src/host.rs b/host/src/host.rs index efc2794..3302001 100644 --- a/host/src/host.rs +++ b/host/src/host.rs @@ -1000,22 +1000,23 @@ where self.connections .set_link_credits(ret.total_num_le_acl_data_packets as usize); + info!( + "[host] configuring host buffers ({} packets of size {})", + config::L2CAP_RX_PACKET_POOL_SIZE, + self.rx_pool.mtu() + ); + HostBufferSize::new( + self.rx_pool.mtu() as u16, + 0, + config::L2CAP_RX_PACKET_POOL_SIZE as u16, + 0, + ) + .exec(&self.controller) + .await?; + #[cfg(feature = "controller-host-flow-control")] { - info!( - "[host] enabling flow control ({} packets of size {})", - config::L2CAP_RX_PACKET_POOL_SIZE, - self.rx_pool.mtu() - ); - HostBufferSize::new( - self.rx_pool.mtu() as u16, - 0, - config::L2CAP_RX_PACKET_POOL_SIZE as u16, - 0, - ) - .exec(&self.controller) - .await?; - + info!("[host] enabling flow control"); SetControllerToHostFlowControl::new(ControllerToHostFlowControl::AclOnSyncOff) .exec(&self.controller) .await?;