scientifichackers / flutter-rx-ble

A Flutter BLE plugin, based on RxAndroidBle and RxBluetoothKit.
GNU Lesser General Public License v3.0
35 stars 18 forks source link

I'm waiting for BleConnectionState.connected and still getting this Exception #21

Closed edsonboldrini closed 4 years ago

edsonboldrini commented 5 years ago

Connection to device has not been initialized yet. You must call "connect()" and wait for "BleConnectionState.connected" before doing any read/write operation. java.lang.IllegalArgumentException: Connection to device has not been initialized yet. You must call "connect()" and wait for "BleConnectionState.connected" before doing any read/write operation. image

devxpy commented 5 years ago

Do other operations work or is it just discoverChars() that fails?

edsonboldrini commented 5 years ago

Only this operation fails. To work around this, I put a delay from 2 seconds before discoverChars, but I don't think this is the best way to finish my code.

devxpy commented 5 years ago

FWIW, You don't need to call this method -- you can read/write chars anyway, using the correct UUID.

devxpy commented 5 years ago

Also, please provide a full stacktrace.

edsonboldrini commented 5 years ago

FWIW, You don't need to call this method -- you can read/write chars anyway, using the correct UUID.

Sounds nice, so I will remove my discoverChars call.

Also, please provide a full stacktrace.

ASAP I will provide my stacktrace with the error. Thanks for the help!

edsonboldrini commented 4 years ago

Too old, already solved