Skip to content

Commit

Permalink
set host buffer sizes even without flow control
Browse files Browse the repository at this point in the history
  • Loading branch information
lulf committed Aug 13, 2024
1 parent 27975d8 commit 97db1a6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion host/src/channel_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
29 changes: 15 additions & 14 deletions host/src/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?;
Expand Down

0 comments on commit 97db1a6

Please sign in to comment.