weliem / blessed-android

BLESSED, a Bluetooth Low Energy (BLE) library for Android
MIT License
557 stars 119 forks source link

Requested MTU is not configured. #121

Closed kartic-techindustan closed 3 years ago

kartic-techindustan commented 3 years ago

I am requesting highest possilbe MTU = peripheral.requestMtu(BluetoothPeripheral.MAX_MTU); still its configured to 23.

Logs --

2021-09-16 14:19:41.519 25504-25504/com.bluetoothtest I/BluetoothPeripheral: connect to '2012000230' (30:1B:97:45:DC:F7) using transport LE 2021-09-16 14:19:41.526 25504-25504/com.bluetoothtest I/BluetoothPeripheral: peripheral '30:1B:97:45:DC:F7' is connecting 2021-09-16 14:19:41.527 25504-25504/com.bluetoothtest D/BluetoothGatt: connect() - device: 30:1B:97:45:DC:F7, auto: false 2021-09-16 14:19:41.527 25504-25504/com.bluetoothtest D/BluetoothGatt: registerApp() 2021-09-16 14:19:41.528 25504-25504/com.bluetoothtest D/BluetoothGatt: registerApp() - UUID=8df36484-b68f-488f-a5f6-88e9963c87a4 2021-09-16 14:19:41.530 25504-25523/com.bluetoothtest D/BluetoothGatt: onClientRegistered() - status=0 clientIf=9 2021-09-16 14:19:41.844 25504-25523/com.bluetoothtest D/BluetoothGatt: onClientConnectionState() - status=0 clientIf=9 device=30:1B:97:45:DC:F7 2021-09-16 14:19:41.850 25504-25523/com.bluetoothtest I/BluetoothPeripheral: connected to '2012000230' (BONDED) in 0.3s 2021-09-16 14:19:41.856 25504-25504/com.bluetoothtest D/BluetoothPeripheral: discovering services of '2012000230' with delay of 0 ms 2021-09-16 14:19:41.856 25504-25504/com.bluetoothtest D/BluetoothGatt: discoverServices() - device: 30:1B:97:45:DC:F7 2021-09-16 14:19:41.860 25504-25523/com.bluetoothtest D/BluetoothGatt: onSearchComplete() = Device=30:1B:97:45:DC:F7 Status=0 2021-09-16 14:19:41.862 25504-25523/com.bluetoothtest I/BluetoothPeripheral: discovered 6 services for '2012000230' 2021-09-16 14:19:41.864 25504-25504/com.bluetoothtest I/BluetoothHandler: connected to '2012000230' 2021-09-16 14:19:41.868 25504-25504/com.bluetoothtest D/BluetoothGatt: configureMTU() - device: 30:1B:97:45:DC:F7 mtu: 517 2021-09-16 14:19:41.869 25504-25504/com.bluetoothtest I/BluetoothPeripheral: requesting MTU of 517 2021-09-16 14:19:42.197 25504-25523/com.bluetoothtest D/BluetoothGatt: onConfigureMTU() - Device=30:1B:97:45:DC:F7 mtu=23 status=0 2021-09-16 14:19:42.198 25504-25504/com.bluetoothtest I/BluetoothHandler: new MTU set: 23 2021-09-16 14:19:42.198 25504-25504/com.bluetoothtest D/BluetoothGatt: requestConnectionPriority() - params: 1 2021-09-16 14:19:42.199 25504-25504/com.bluetoothtest D/BluetoothPeripheral: requesting connection priority HIGH 2021-09-16 14:19:42.651 25504-25523/com.bluetoothtest D/BluetoothGatt: onConnectionUpdated() - Device=30:1B:97:45:DC:F7 interval=12 latency=0 timeout=500 status=0 2021-09-16 14:19:42.665 25504-25523/com.bluetoothtest D/BluetoothPeripheral: connection parameters: interval=15.0ms latency=0 timeout=5s 2021-09-16 14:19:43.006 25504-25523/com.bluetoothtest D/BluetoothGatt: onConnectionUpdated() - Device=30:1B:97:45:DC:F7 interval=312 latency=4 timeout=600 status=0 2021-09-16 14:19:43.007 25504-25523/com.bluetoothtest D/BluetoothPeripheral: connection parameters: interval=390.0ms latency=4 timeout=6s

weliem commented 3 years ago

As mentioned in the readme, you can request what ever you want, but the peripheral will return the value it can do. So apparently your peripheral doesn't support a higher MTU

kartic-techindustan commented 3 years ago

thanks.