chipweinberger / flutter_blue_plus

Flutter plugin for connecting and communicationg with Bluetooth Low Energy devices, on Android, iOS, macOS
Other
791 stars 479 forks source link

[Help]: c.write not response on verison 1.28.8+, but ok on version 1.26.4 #679

Closed nuxwork closed 1 year ago

nuxwork commented 1 year ago

Requirements

Have you checked this problem on the example app?

Yes

FlutterBluePlus Version

1.28.8+

Flutter Version

3.13.1

What OS?

Android

OS Version

android Q

Bluetooth Module

Nordic/nrf52810/1.6

What is your problem?

c.write not response on verison 1.28.8+, but ok on version 1.26.4

Logs

v1.28.8+
I/flutter (27600): CAM8Z6_NoName_G_E8 connectionState BluetoothConnectionState.connected
D/[FBP-Android](27600): [FBP] onMethodCall: requestMtu
D/BluetoothGatt(27600): configureMTU() - device: ED:61:21:A9:C2:09 mtu: 512
D/[FBP-Android](27600): [FBP] onMethodCall: getAdapterState
D/BluetoothGatt(27600): onConnectionUpdated() - Device=ED:61:21:A9:C2:09 interval=6 latency=0 timeout=500 status=0
D/BluetoothGatt(27600): onConfigureMTU() - Device=ED:61:21:A9:C2:09 mtu=247 status=0
D/[FBP-Android](27600): [FBP] onMtuChanged: mtu: 247 status: 0
I/flutter (27600): === writeBle
D/[FBP-Android](27600): [FBP] onMethodCall: requestMtu
D/BluetoothGatt(27600): configureMTU() - device: ED:61:21:A9:C2:09 mtu: 512
D/[FBP-Android](27600): [FBP] onMethodCall: getAdapterState
D/BluetoothGatt(27600): onConnectionUpdated() - Device=ED:61:21:A9:C2:09 interval=39 latency=0 timeout=500 status=0
D/BluetoothGatt(27600): onConfigureMTU() - Device=ED:61:21:A9:C2:09 mtu=247 status=4
D/[FBP-Android](27600): [FBP] onMtuChanged: mtu: 247 status: 4
D/[FBP-Android](27600): [FBP] onMethodCall: discoverServices
D/BluetoothGatt(27600): discoverServices() - device: ED:61:21:A9:C2:09
D/[FBP-Android](27600): [FBP] onMethodCall: getAdapterState
D/BluetoothGatt(27600): onSearchComplete() = Device=ED:61:21:A9:C2:09 Status=0
D/[FBP-Android](27600): [FBP] onServicesDiscovered: count: 3 status: 0
I/flutter (27600): devices.length = 2
I/flutter (27600): ======== 0000ffb0-0000-1000-8000-00805f9b34fb
I/flutter (27600): ======= write...............
D/BluetoothGatt(27600): onConnectionUpdated() - Device=ED:61:21:A9:C2:09 interval=60 latency=0 timeout=400 status=0

v1.26.4
I/flutter (27946): CAM8Z6_NoName_G_E8 connectionState BluetoothConnectionState.connected
D/[FBP-Android](27946): [FBP] onMethodCall: requestMtu
D/BluetoothGatt(27946): configureMTU() - device: ED:61:21:A9:C2:09 mtu: 512
D/[FBP-Android](27946): [FBP] onMethodCall: getAdapterState
D/BluetoothGatt(27946): onConnectionUpdated() - Device=ED:61:21:A9:C2:09 interval=6 latency=0 timeout=500 status=0
D/BluetoothGatt(27946): onConfigureMTU() - Device=ED:61:21:A9:C2:09 mtu=247 status=0
D/[FBP-Android](27946): [FBP] onMtuChanged: mtu: 247 status: 0
I/flutter (27946): === writeBle
D/[FBP-Android](27946): [FBP] onMethodCall: requestMtu
D/BluetoothGatt(27946): configureMTU() - device: ED:61:21:A9:C2:09 mtu: 512
D/[FBP-Android](27946): [FBP] onMethodCall: getAdapterState
D/BluetoothGatt(27946): onConnectionUpdated() - Device=ED:61:21:A9:C2:09 interval=39 latency=0 timeout=500 status=0
D/BluetoothGatt(27946): onConfigureMTU() - Device=ED:61:21:A9:C2:09 mtu=247 status=4
D/[FBP-Android](27946): [FBP] onMtuChanged: mtu: 247 status: 4
D/[FBP-Android](27946): [FBP] onMethodCall: discoverServices
D/BluetoothGatt(27946): discoverServices() - device: ED:61:21:A9:C2:09
D/[FBP-Android](27946): [FBP] onMethodCall: getAdapterState
D/BluetoothGatt(27946): onSearchComplete() = Device=ED:61:21:A9:C2:09 Status=0
D/[FBP-Android](27946): [FBP] onServicesDiscovered: count: 3 status: 0
I/flutter (27946): devices.length = 2
I/flutter (27946): ======== 0000ffb0-0000-1000-8000-00805f9b34fb
I/flutter (27946): ======= write...............
D/[FBP-Android](27946): [FBP] onMethodCall: writeCharacteristic
D/[FBP-Android](27946): [FBP] onMethodCall: getAdapterState
D/[FBP-Android](27946): [FBP] onCharacteristicWrite: uuid: 0000ffb1-0000-1000-8000-00805f9b34fb status: 0
I/flutter (27946): write end
chipweinberger commented 1 year ago

I dont see "D/FBP-Android: [FBP] onMethodCall: writeCharacteristic" in your new logs.

It appears you are not writing anything.

in recent versions we now return short UUID. this is your problem.

see https://github.com/boskokg/flutter_blue_plus/issues/677#issuecomment-1807445635