summaryrefslogtreecommitdiffstats
path: root/java/direct_bt/tinyb
diff options
context:
space:
mode:
Diffstat (limited to 'java/direct_bt/tinyb')
-rw-r--r--java/direct_bt/tinyb/DBTAdapter.java15
-rw-r--r--java/direct_bt/tinyb/DBTManager.java2
2 files changed, 11 insertions, 6 deletions
diff --git a/java/direct_bt/tinyb/DBTAdapter.java b/java/direct_bt/tinyb/DBTAdapter.java
index 2bc028b2..a8b99fbd 100644
--- a/java/direct_bt/tinyb/DBTAdapter.java
+++ b/java/direct_bt/tinyb/DBTAdapter.java
@@ -38,6 +38,7 @@ import org.tinyb.BluetoothException;
import org.tinyb.BluetoothManager;
import org.tinyb.BluetoothNotification;
import org.tinyb.BluetoothType;
+import org.tinyb.EIRDataType;
import org.tinyb.BluetoothDeviceStatusListener;
import org.tinyb.TransportType;
@@ -209,7 +210,9 @@ public class DBTAdapter extends DBTObject implements BluetoothAdapter
final boolean res = startDiscoveryImpl();
isDiscovering = res;
synchronized( stateLock ) {
- discoveringNotificationCB.run(res);
+ if( null != discoveringNotificationCB ) {
+ discoveringNotificationCB.run(res);
+ }
stateLock.notifyAll();
}
return res;
@@ -222,7 +225,9 @@ public class DBTAdapter extends DBTObject implements BluetoothAdapter
isDiscovering = false;
final boolean res = stopDiscoveryImpl();
synchronized( stateLock ) {
- discoveringNotificationCB.run(false);
+ if( null != discoveringNotificationCB ) {
+ discoveringNotificationCB.run(false);
+ }
stateLock.notifyAll();
}
return res;
@@ -316,10 +321,10 @@ public class DBTAdapter extends DBTObject implements BluetoothAdapter
}
@Override
- public void deviceUpdated(final BluetoothAdapter a, final BluetoothDevice device, final long timestamp) {
- System.err.println("DBTAdapter.DeviceStatusListener.updated: "+device+" on "+a);
+ public void deviceUpdated(final BluetoothAdapter a, final BluetoothDevice device, final long timestamp, final EIRDataType updateMask) {
+ System.err.println("DBTAdapter.DeviceStatusListener.updated: "+updateMask+" of "+device+" on "+a);
// nop on discoveredDevices
- userDeviceStatusListener.deviceUpdated(a, device, timestamp);
+ userDeviceStatusListener.deviceUpdated(a, device, timestamp, updateMask);
}
@Override
diff --git a/java/direct_bt/tinyb/DBTManager.java b/java/direct_bt/tinyb/DBTManager.java
index 4b200da3..4438c66f 100644
--- a/java/direct_bt/tinyb/DBTManager.java
+++ b/java/direct_bt/tinyb/DBTManager.java
@@ -122,7 +122,7 @@ public class DBTManager implements BluetoothManager
{
initImpl();
try {
- adapters.add(getDefaultAdapterImpl());
+ adapters.addAll(getAdapterListImpl());
} catch (final BluetoothException be) {
be.printStackTrace();
}