From c765a62fcce39b7f8048bed15a7ec53dc52f0ca7 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 20 Sep 2020 23:43:12 +0200 Subject: GATT*::toString(): Encapsulate resulting string with '[]'; Examples: Use clear type names: CharDef and CharVal --- examples/direct_bt_scanner10/dbt_scanner10.cpp | 8 ++++---- examples/java/ScannerTinyB10.java | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'examples') diff --git a/examples/direct_bt_scanner10/dbt_scanner10.cpp b/examples/direct_bt_scanner10/dbt_scanner10.cpp index 03cc7296..0c08dc25 100644 --- a/examples/direct_bt_scanner10/dbt_scanner10.cpp +++ b/examples/direct_bt_scanner10/dbt_scanner10.cpp @@ -327,14 +327,14 @@ static void processConnectedDevice(std::shared_ptr device) { for(size_t j=0; j] [-btmode LE|BREDR|DUAL] " "[-disconnect] [-count ] [-single] [-show_update_events] [-silent_gatt] " "(-mac )* (-wl )* " - "[-dbt_verbose [true|false]] " - "[-dbt_debug [true|false|adapter.event,gatt.data,hci.event,mgmt.event]] " + "[-dbt_verbose true|false] " + "[-dbt_debug true|false|adapter.event,gatt.data,hci.event,mgmt.event] " "[-dbt_mgmt cmd.timeout=3000,ringsize=64,... " "[-dbt_hci cmd.complete.timeout=10000,cmd.status.timeout=3000,ringsize=64,... " "[-dbt_gatt cmd.read.timeout=500,cmd.write.timeout=500,cmd.init.timeout=2500,ringsize=128,... " diff --git a/examples/java/ScannerTinyB10.java b/examples/java/ScannerTinyB10.java index 8c5f8ac7..4ef7c055 100644 --- a/examples/java/ScannerTinyB10.java +++ b/examples/java/ScannerTinyB10.java @@ -337,14 +337,14 @@ public class ScannerTinyB10 { for(final Iterator charIter = serviceCharacteristics.iterator(); charIter.hasNext(); j++) { final BluetoothGattCharacteristic serviceChar = charIter.next(); if( !SILENT_GATT ) { - printf(" [%02d.%02d] Decla: %s\n", i, j, serviceChar.toString()); + printf(" [%02d.%02d] CharDec: %s\n", i, j, serviceChar.toString()); } final List properties = Arrays.asList(serviceChar.getFlags()); if( properties.contains("read") ) { final byte[] value = serviceChar.readValue(); final String svalue = BluetoothUtils.decodeUTF8String(value, 0, value.length); if( !SILENT_GATT ) { - printf(" [%02d.%02d] Value: %s ('%s')\n", + printf(" [%02d.%02d] CharVal: %s ('%s')\n", i, j, BluetoothUtils.bytesHexString(value, true, true), svalue); } } @@ -577,8 +577,8 @@ public class ScannerTinyB10 { "[-disconnect] [-count ] [-single] (-char )* [-show_update_events] [-silent_gatt]"+ "(-mac )* (-wl )* "+ "[-verbose] [-debug] "+ - "[-dbt_verbose [true|false]] "+ - "[-dbt_debug [true|false|adapter.event,gatt.data,hci.event,mgmt.event]] "+ + "[-dbt_verbose true|false] "+ + "[-dbt_debug true|false|adapter.event,gatt.data,hci.event,mgmt.event] "+ "[-dbt_mgmt cmd.timeout=3000,ringsize=64,... "+ "[-dbt_hci cmd.complete.timeout=10000,cmd.status.timeout=3000,ringsize=64,... "+ "[-dbt_gatt cmd.read.timeout=500,cmd.write.timeout=500,cmd.init.timeout=2500,ringsize=128,... "+ -- cgit v1.2.3