dotintent / FlutterBleLib

Bluetooth Low Energy library for Flutter with support for simulating peripherals
Apache License 2.0
535 stars 197 forks source link

requestMtu Back to Default #493

Closed arizki29 closed 3 years ago

arizki29 commented 4 years ago

i have tried set mtu but value always back to default mtu(23).

flutter_ble_lib: ^2.2.5

this my code:

await peripheral.connect(requestMtu: 0); await peripheral.discoverAllServicesAndCharacteristics(); int mtu = await peripheral.requestMtu(512);

result : D/com.polidea.flutter_ble_lib.FlutterBleLibPlugin( 7491): on native side observed method: characteristicsForService D/com.polidea.flutter_ble_lib.FlutterBleLibPlugin( 7491): on native side observed method: requestMtu D/com.polidea.flutter_ble_lib.delegate.MtuDelegate( 7491): Request MTU 512 D/BluetoothGatt( 7491): configureMTU() - device: 4C:24:98:77:6F:B1 mtu: 512 D/BluetoothGatt( 7491): onConfigureMTU() - Device=4C:24:98:77:6F:B1 mtu=23 status=0

mikolak commented 4 years ago

I'd guess your peripheral doesn't support higher MTU.

arizki29 commented 4 years ago

I'd guess your peripheral doesn't support higher MTU.

sory for bad my english. I tried Samsung J7 Prime with Android 8.0, Samsung Galaxy A01 with Android 10. and Xiaomi Redmi 3. and to ensure that I try to install the application "Serial Bluetooth Terminal (support BlE)" on the PlayStore and the result is that data can be received completely. I do not know what I missed in this example FlutterBleLib. thx

mikolak commented 3 years ago

I don't know what might be wrong, your code looks ok. Perhaps it's some kind of weird firmware issue?

Closing because of lack of follow ups.