Closed RoberWare closed 5 years ago
Clarification: I'm using the BLE class from the example.
@RoberWare It will be more safe to initialize BLE class from the main thread, for example using the run_on_ui_thread
decorator, like it is done here:
https://github.com/b3b/drone-roll/blob/cce5c10cf358af4362fecbe5c3a46cc340de247a/main.py#L41
Does it works in your case?
Solved it, thanks. But now I get the same issue as #2 when start_scan is called. Any clue?
@RoberWare Something wrong with BLE initialization.
Probably, BluetoothDispatcher
was sublcassed and BluetoothDispatcher.__init__()
was not called from a new class, like:
from able import BluetoothDispatcher
class MyBLE(BluetoothDispatcher):
def __init__(self):
# Should call:
# super(MyBLE, self).__init__()
#...
Of course!. What a silly mistake! Sorry for the inconvenience. This solves #2 too.
I'm trying to discover near bluetooth LE services, and when I call the start_scan() method I get the following error:
I solved it following this, retrieve the org.jnius.NativeInvocationHandler manually in my main thread using:
But now, I get the following error:
It seems like java classes aren't being imported, any ideas?
Full log: