From 21c1368b65e7724bee516f21a8186002020c5f3b Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 22 Sep 2020 11:20:18 +0200 Subject: Fix Java_direct_1bt_tinyb_DBTGattDescriptor_toStringImpl(..): Wrong arg list, oops. Added call to C++/Java example for validation --- examples/java/ScannerTinyB10.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'examples/java/ScannerTinyB10.java') 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 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 serviceCharacteristics = primService.getCharacteristics(); for(final Iterator 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 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 charDescList = serviceChar.getDescriptors(); + for(final Iterator 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) { -- cgit v1.2.3