From 770b1e801c0a06ba51a4eb9b9f5a393726f32f33 Mon Sep 17 00:00:00 2001 From: Stephen Roe Date: Sun, 12 Jan 2025 13:07:30 +0000 Subject: [PATCH] Increase mtu for ble_bas_peripheral for esp examples (#235) * Increase mtu for ble_bas_peripheral for esp examples --- examples/apps/src/ble_bas_peripheral.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/apps/src/ble_bas_peripheral.rs b/examples/apps/src/ble_bas_peripheral.rs index f2b4110..0eb5ef1 100644 --- a/examples/apps/src/ble_bas_peripheral.rs +++ b/examples/apps/src/ble_bas_peripheral.rs @@ -2,8 +2,12 @@ use embassy_futures::{join::join, select::select}; use embassy_time::Timer; use trouble_host::prelude::*; -/// Size of L2CAP packets (ATT MTU is this - 4) -const L2CAP_MTU: usize = 251; +/// Size of L2CAP packets +#[cfg(not(feature = "esp"))] +pub const L2CAP_MTU: usize = 251; +#[cfg(feature = "esp")] +// Some esp chips only accept an MTU >= 1017 +pub const L2CAP_MTU: usize = 1017; /// Max number of connections const CONNECTIONS_MAX: usize = 1;