From 8fd5e62090df664f2519293b21ccc99b7e495af8 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 15 Jun 2021 14:58:05 +0200 Subject: [D]BTAdapter.printDeviceList[s](..): Also print device name in debug output. --- java/jau/direct_bt/DBTAdapter.java | 3 ++- src/direct_bt/BTAdapter.cpp | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/java/jau/direct_bt/DBTAdapter.java b/java/jau/direct_bt/DBTAdapter.java index 09aec7e1..8d8ae441 100644 --- a/java/jau/direct_bt/DBTAdapter.java +++ b/java/jau/direct_bt/DBTAdapter.java @@ -548,7 +548,8 @@ public class DBTAdapter extends DBTObject implements BTAdapter if( null == d ) { BTUtils.fprintf_td(System.err, " - %d / %d: nil%s", (idx+1), sz, System.lineSeparator()); } else { - BTUtils.fprintf_td(System.err, " - %d / %d: %s%s", (idx+1), sz, d.getAddressAndType().toString(), System.lineSeparator()); + BTUtils.fprintf_td(System.err, " - %d / %d: %s, name '%s'%s", (idx+1), sz, + d.getAddressAndType().toString(), d.getName(), System.lineSeparator()); } } } diff --git a/src/direct_bt/BTAdapter.cpp b/src/direct_bt/BTAdapter.cpp index 01a11724..82c6c7c1 100644 --- a/src/direct_bt/BTAdapter.cpp +++ b/src/direct_bt/BTAdapter.cpp @@ -296,7 +296,9 @@ void BTAdapter::printDeviceList(const std::string& prefix, const BTAdapter::devi jau::PLAIN_PRINT(true, "- BTAdapter::%s: %zu elements", prefix.c_str(), sz); int idx = 0; for (auto it = list.begin(); it != list.end(); ++idx, ++it) { - jau::PLAIN_PRINT(true, " - %d / %zu: %s", (idx+1), sz, (*it)->getAddressAndType().toString().c_str()); + jau::PLAIN_PRINT(true, " - %d / %zu: %s, name '%s'", (idx+1), sz, + (*it)->getAddressAndType().toString().c_str(), + (*it)->getName().c_str() ); } } void BTAdapter::printDeviceLists() noexcept { -- cgit v1.2.3