notification lenght #87
-
Hi, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi Luca, My guess is nRF Connect does the MTU negotiation automatically whereas in blatann it's a manual function call. Typically it looks something like this: device = BleDevice(params)
# This sets the maximum MTU size supported by the dongle. Without this call the max is set to the default 23. BLE spec is 512 bytes.
# if configure() is called without any parameters, the max is set to 247 which is optimized for DLE/throughput
device.configure(att_mtu_max_size=x)
peer = device.connect(...).wait()
print(f"Initial MTU size: {peer.mtu_size}")
peer.preferred_mtu_size = desired_mtu_size # Set the preferred MTU size for this peer
peer.exchange_mtu().wait() # Perform MTU exchange. Both devices send their preferred MTU size and the smaller of the two is set
print(f"New MTU size: {peer.mtu_size}")
peer.update_data_length().wait() # Sets the DLE to be optimal for the new MTU, helps throughput
# perform service discovery and everything else Hope this helps! |
Beta Was this translation helpful? Give feedback.
Hi Luca,
The notification length is determined by the connection's MTU. The default MTU size is 23 bytes, where notifications require 3 bytes overhead thus 20 bytes are notified. The MTU size is typically negotiated at the start of a connection and set to a larger size if desired.
My guess is nRF Connect does the MTU negotiation automatically whereas in blatann it's a manual function call. Typically it looks something like this: