diff options
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(); |