summaryrefslogtreecommitdiffstats
path: root/examples/java/ScannerTinyB10.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2020-09-22 11:20:18 +0200
committerSven Gothel <[email protected]>2020-09-22 11:20:18 +0200
commit21c1368b65e7724bee516f21a8186002020c5f3b (patch)
tree64d992f6ed8b02034ec5e19aed9bf55df1cb0bd5 /examples/java/ScannerTinyB10.java
parent8eb3ecb3033b28c5b6cc13807d0948f245ce9729 (diff)
Fix Java_direct_1bt_tinyb_DBTGattDescriptor_toStringImpl(..): Wrong arg list, oops. Added call to C++/Java example for validationv2.1.27
Diffstat (limited to 'examples/java/ScannerTinyB10.java')
-rw-r--r--examples/java/ScannerTinyB10.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/examples/java/ScannerTinyB10.java b/examples/java/ScannerTinyB10.java
index 1c38a45f..b57c992e 100644
--- a/examples/java/ScannerTinyB10.java
+++ b/examples/java/ScannerTinyB10.java
@@ -41,6 +41,7 @@ import org.tinyb.BTMode;
import org.tinyb.BluetoothException;
import org.tinyb.BluetoothFactory;
import org.tinyb.BluetoothGattCharacteristic;
+import org.tinyb.BluetoothGattDescriptor;
import org.tinyb.BluetoothGattService;
import org.tinyb.BluetoothManager;
import org.tinyb.BluetoothNotification;
@@ -353,18 +354,19 @@ public class ScannerTinyB10 {
}
try {
- int i=0, j=0;
+ int i=0;
for(final Iterator<BluetoothGattService> srvIter = primServices.iterator(); srvIter.hasNext(); i++) {
final BluetoothGattService primService = srvIter.next();
if( !SILENT_GATT ) {
printf(" [%02d] Service %s\n", i, primService.toString());
printf(" [%02d] Service Characteristics\n", i);
}
+ int j=0;
final List<BluetoothGattCharacteristic> serviceCharacteristics = primService.getCharacteristics();
for(final Iterator<BluetoothGattCharacteristic> charIter = serviceCharacteristics.iterator(); charIter.hasNext(); j++) {
final BluetoothGattCharacteristic serviceChar = charIter.next();
if( !SILENT_GATT ) {
- printf(" [%02d.%02d] CharDec: %s\n", i, j, serviceChar.toString());
+ printf(" [%02d.%02d] CharDef: %s\n", i, j, serviceChar.toString());
}
final List<String> properties = Arrays.asList(serviceChar.getFlags());
if( properties.contains("read") ) {
@@ -375,6 +377,14 @@ public class ScannerTinyB10 {
i, j, BluetoothUtils.bytesHexString(value, true, true), svalue);
}
}
+ int k=0;
+ final List<BluetoothGattDescriptor> charDescList = serviceChar.getDescriptors();
+ for(final Iterator<BluetoothGattDescriptor> descIter = charDescList.iterator(); descIter.hasNext(); k++) {
+ final BluetoothGattDescriptor charDesc = descIter.next();
+ if( !SILENT_GATT ) {
+ printf(" [%02d.%02d.%02d] Desc: %s\n", i, j, k, charDesc.toString());
+ }
+ }
}
}
} catch( final Exception ex) {