diff options
author | Sven Gothel <[email protected]> | 2020-05-11 07:08:21 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-05-11 07:08:21 +0200 |
commit | ed4d9268b2a7ad560e116d3b17cd3f42fcbdd650 (patch) | |
tree | 9ae28b7e31fe30e984f4997a4310569e75b250ea /examples | |
parent | c542adbf2bb50b39e859a91d1515ee593ccc7671 (diff) |
Shape GATTServiceDecl + GATTCharacterisicsDecl into TinyB API conform data relationship
GATTServiceDecl: Add DBTDevice reference and 'isPrimary'
GATTCharacterisicsDecl: Add GATTServiceDecl reference
and remove now obsolete copies of service_uuid and service_handle_end.
+++
GattHandler only have ctor w/ DBTDevice reference hence
and pass the GATTServiceDeclRef by reference itself (efficiency).
+++
TODO: Add the JNI code and complete the GATT Java binding
to access native GATTServiceDecl + GATTCharacterisicsDecl mapping
and also support the read/write functionality via GATTHandler.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/java/ScannerTinyB01.java | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/examples/java/ScannerTinyB01.java b/examples/java/ScannerTinyB01.java index d9a3b3e9..97e5b311 100644 --- a/examples/java/ScannerTinyB01.java +++ b/examples/java/ScannerTinyB01.java @@ -244,7 +244,6 @@ public class ScannerTinyB01 { System.exit(-1); } - if( false ) { synchronized( servicesResolvedNotification ) { while( !servicesResolvedNotification.getValue() ) { final long tn = BluetoothUtils.getCurrentMilliseconds(); @@ -267,11 +266,10 @@ public class ScannerTinyB01 { //adapter.stopDiscovery(); final List<BluetoothGattService> allBluetoothServices = sensor.getServices(); - if (allBluetoothServices.isEmpty()) { + if ( null == allBluetoothServices || allBluetoothServices.isEmpty() ) { System.err.println("No BluetoothGattService found!"); - System.exit(1); - } - printAllServiceInfo(allBluetoothServices); + } else { + printAllServiceInfo(allBluetoothServices); } sensor.disconnect(); |