diff options
author | Sven Gothel <[email protected]> | 2020-05-24 00:14:11 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-05-24 00:14:11 +0200 |
commit | c14827e615c53f1c091cc0f04f4bf0550dcdb4d2 (patch) | |
tree | 0b84c1c4ed3120109ee09d31672a0af0dc8fcc5f /java/direct_bt/tinyb | |
parent | 6291468795a915d5fc7e2ec896711c849cded452 (diff) |
C++ multithreading fixes and example
DBTAdapter:
- Add HCI mutex
- openHCI() returns already open HCIComm
- Notify device on disconnected
DBTDevice:
- Add data mutex, covering race-condition on data update(..) and data usage
- notifyDisconnected(): Clear hciConnHandle
- getServices() -> getGATTServices() to differenciate from scan-result
+++
Java/JNI DBTAdapter:
- Remove open/openImpl() in favor of implicit openHCI() @ connect call.
+++
Added multithreading example dbt_scanner10.cpp
Diffstat (limited to 'java/direct_bt/tinyb')
-rw-r--r-- | java/direct_bt/tinyb/DBTAdapter.java | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/java/direct_bt/tinyb/DBTAdapter.java b/java/direct_bt/tinyb/DBTAdapter.java index 6c9e9f03..9b60d27b 100644 --- a/java/direct_bt/tinyb/DBTAdapter.java +++ b/java/direct_bt/tinyb/DBTAdapter.java @@ -233,13 +233,6 @@ public class DBTAdapter extends DBTObject implements BluetoothAdapter /* internal */ - private synchronized void open() { - if( !isOpen ) { - isOpen = openImpl(); - } - } - private native boolean openImpl(); - @Override protected native void deleteImpl(); @@ -247,7 +240,6 @@ public class DBTAdapter extends DBTObject implements BluetoothAdapter @Override public synchronized boolean startDiscovery() throws BluetoothException { - open(); removeDevices(); final boolean res = startDiscoveryImpl(); isDiscovering = res; @@ -278,7 +270,6 @@ public class DBTAdapter extends DBTObject implements BluetoothAdapter @Override public int removeDevices() throws BluetoothException { - open(); final int cj = removeDiscoveredDevices(); final int cn = removeDevicesImpl(); if( cj != cn ) { |