summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/direct_bt_scanner10/dbt_scanner10.cpp9
-rw-r--r--examples/java/ScannerTinyB10.java14
2 files changed, 16 insertions, 7 deletions
diff --git a/examples/direct_bt_scanner10/dbt_scanner10.cpp b/examples/direct_bt_scanner10/dbt_scanner10.cpp
index f1490d23..49e519f9 100644
--- a/examples/direct_bt_scanner10/dbt_scanner10.cpp
+++ b/examples/direct_bt_scanner10/dbt_scanner10.cpp
@@ -324,6 +324,11 @@ static void processConnectedDevice(std::shared_ptr<DBTDevice> device) {
}
exit:
+ removeFromDevicesProcessing(device->getAddress());
+ if( !USE_WHITELIST && 0 == devicesInProcessing.size() ) {
+ device->getAdapter().startDiscovery( true );
+ }
+
if( KEEP_CONNECTED ) {
while( device->pingGATT() ) {
fprintf(stderr, "****** Processing Device: pingGATT OK: %s\n", device->getAddressString().c_str());
@@ -343,16 +348,12 @@ exit:
}
device->getAdapter().printSharedPtrListOfDevices();
- removeFromDevicesProcessing(device->getAddress());
if( 0 < MULTI_MEASUREMENTS ) {
MULTI_MEASUREMENTS--;
fprintf(stderr, "****** Processing Device: MULTI_MEASUREMENTS left %d: %s\n", MULTI_MEASUREMENTS, device->getAddressString().c_str());
}
fprintf(stderr, "****** Processing Device: End: Success %d on %s; devInProc %zd\n",
success, device->toString().c_str(), devicesInProcessing.size());
- if( !USE_WHITELIST && 0 == devicesInProcessing.size() ) {
- device->getAdapter().startDiscovery( true );
- }
if( success ) {
addToDevicesProcessed(device->getAddress());
}
diff --git a/examples/java/ScannerTinyB10.java b/examples/java/ScannerTinyB10.java
index a56ce9ab..1815bf50 100644
--- a/examples/java/ScannerTinyB10.java
+++ b/examples/java/ScannerTinyB10.java
@@ -183,7 +183,10 @@ public class ScannerTinyB10 {
private void connectDiscoveredDevice(final BluetoothDevice device) {
println("****** Connecting Device: Start " + device.toString());
- device.getAdapter().stopDiscovery();
+ {
+ final boolean r = device.getAdapter().stopDiscovery();
+ println("****** Connecting Device: stopDiscovery result "+r);
+ }
HCIStatusCode res;
if( !USE_WHITELIST ) {
res = device.connect();
@@ -192,7 +195,8 @@ public class ScannerTinyB10 {
}
println("****** Connecting Device Command, res "+res+": End result "+res+" of " + device.toString());
if( !USE_WHITELIST && 0 == devicesInProcessing.size() && HCIStatusCode.SUCCESS != res ) {
- device.getAdapter().startDiscovery( true );
+ final boolean r = device.getAdapter().startDiscovery( true );
+ println("****** Connecting Device: startDiscovery result "+r);
}
}
@@ -231,7 +235,11 @@ public class ScannerTinyB10 {
private void processConnectedDevice(final BluetoothDevice device) {
println("****** Processing Device: Start " + device.toString());
- device.getAdapter().stopDiscovery(); // make sure for pending connections on failed connect*(..) command
+ {
+ // make sure for pending connections on failed connect*(..) command
+ final boolean r = device.getAdapter().stopDiscovery();
+ println("****** Processing Device: stopDiscovery result "+r);
+ }
final long t1 = BluetoothUtils.getCurrentMilliseconds();
boolean success = false;