summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2020-09-20 23:43:12 +0200
committerSven Gothel <[email protected]>2020-09-20 23:43:12 +0200
commitc765a62fcce39b7f8048bed15a7ec53dc52f0ca7 (patch)
tree17701ff9eca5d965c58270afcca9033e8dc0634a /examples
parent346d92d0a6ff088188fbe99cff5a01d133113757 (diff)
GATT*::toString(): Encapsulate resulting string with '[]'; Examples: Use clear type names: CharDef and CharVal
Diffstat (limited to 'examples')
-rw-r--r--examples/direct_bt_scanner10/dbt_scanner10.cpp8
-rw-r--r--examples/java/ScannerTinyB10.java8
2 files changed, 8 insertions, 8 deletions
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<DBTDevice> device) {
for(size_t j=0; j<serviceCharacteristics.size(); j++) {
GATTCharacteristic & serviceChar = *serviceCharacteristics.at(j);
if( !SILENT_GATT ) {
- fprintf(stderr, " [%2.2d.%2.2d] Decla: %s\n", (int)i, (int)j, serviceChar.toString().c_str());
+ fprintf(stderr, " [%2.2d.%2.2d] CharDef: %s\n", (int)i, (int)j, serviceChar.toString().c_str());
}
if( serviceChar.hasProperties(GATTCharacteristic::PropertyBitVal::Read) ) {
POctets value(GATTHandler::number(GATTHandler::Defaults::MAX_ATT_MTU), 0);
if( serviceChar.readValue(value) ) {
std::string sval = dfa_utf8_decode(value.get_ptr(), value.getSize());
if( !SILENT_GATT ) {
- fprintf(stderr, " [%2.2d.%2.2d] Value: %s ('%s')\n", (int)i, (int)j, value.toString().c_str(), sval.c_str());
+ fprintf(stderr, " [%2.2d.%2.2d] CharVal: %s ('%s')\n", (int)i, (int)j, value.toString().c_str(), sval.c_str());
}
}
}
@@ -501,8 +501,8 @@ int main(int argc, char *argv[])
fprintf(stderr, "Run with '[-dev_id <adapter-index>] [-btmode LE|BREDR|DUAL] "
"[-disconnect] [-count <number>] [-single] [-show_update_events] [-silent_gatt] "
"(-mac <device_address>)* (-wl <device_address>)* "
- "[-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<BluetoothGattCharacteristic> 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<String> 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 <number>] [-single] (-char <uuid>)* [-show_update_events] [-silent_gatt]"+
"(-mac <device_address>)* (-wl <device_address>)* "+
"[-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,... "+