-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MTU handshake results in default size #232
Comments
Looking through the code base, it appears that neither the info!("[adv] advertising");
let conn = advertiser.accept().await?;
conn.set_att_mtu(ATT_MTU as u16); // <-- Add here.
info!("[adv] connection established");
Ok(conn) If I add the following log to pub(crate) fn exchange_att_mtu(&self, conn: ConnHandle, mtu: u16) -> u16 {
let mut state = self.state.borrow_mut();
for storage in state.connections.iter_mut() {
match storage.state {
ConnectionState::Connected if storage.handle.unwrap() == conn => {
info!("storage.att_mtu = {:?}, mtu = {:?}", storage.att_mtu, mtu); // <-- Added log
storage.att_mtu = storage.att_mtu.min(mtu);
return storage.att_mtu;
}
_ => {}
}
}
mtu
} I get:
Note: I seem to always get the above warning about unsupported l2cap channel id. Curious if anyone else has noticed this. |
Rather than setting default att mtu to the smallest value, set it to the max possible based on l2cap mtu - 4. Issue #232
I think #237 should fix using the l2cap - 4 as the default rather than 23. Wrt. set_att_mtu, it was used earlier when att mtu was explicitly set from the no longer existing gatt server. We could remove the method, or expose it. In either case, if the other end chooses a lower value, it will pick the lowest (it looks like in your case the other end has a max of 185?) |
Rather than setting default att mtu to the smallest value, set it to the max possible based on l2cap mtu - 4. Issue #232
Rather than setting default att mtu to the smallest value, set it to the max possible based on l2cap mtu - 4. Issue #232
I would be in favor of removing the It's interesting because when I run the |
Rather than setting default att mtu to the smallest value, set it to the max possible based on l2cap mtu - 4. Issue #232
When running the ble_bas_peripheral example on the Microbit, the agreed upon MTU results in the BLE default of 23 bytes, instead of the requested 247 that is specified
L2CAP_MTU - 4
. When running a similar application withnrf-softdevice
(with the same devices for gatt server/client), the MTU handshake results in the upper limit being selected, i.e. whateverATT_MTU
sets.The text was updated successfully, but these errors were encountered: