diff options
author | Sven Gothel <[email protected]> | 2020-07-03 18:40:37 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-07-03 18:40:37 +0200 |
commit | 1b623173885bee4223efc44253bbcdb9fe7c5bf7 (patch) | |
tree | ef25ed111b4123191b47700a2330d1774dcbfe0c | |
parent | 0a58adf310f9ae29f0e753c9594e6879e0e2c0c7 (diff) |
DBTAdapter::printDevices() -> printSharedPtrListOfDevices() + API doc remark: .. debug facility
-rw-r--r-- | api/direct_bt/DBTAdapter.hpp | 6 | ||||
-rw-r--r-- | examples/direct_bt_scanner10/dbt_scanner10.cpp | 6 | ||||
-rw-r--r-- | src/direct_bt/DBTAdapter.cpp | 2 |
3 files changed, 9 insertions, 5 deletions
diff --git a/api/direct_bt/DBTAdapter.hpp b/api/direct_bt/DBTAdapter.hpp index f450c4ba..2df0a867 100644 --- a/api/direct_bt/DBTAdapter.hpp +++ b/api/direct_bt/DBTAdapter.hpp @@ -456,7 +456,11 @@ namespace direct_bt { std::string toString() const override; - void printDevices(); + /** + * This is a debug facility only, to observe consistency + * of the internally maintained lists of shared_ptr<DBTDevice>. + */ + void printSharedPtrListOfDevices(); }; } // namespace direct_bt diff --git a/examples/direct_bt_scanner10/dbt_scanner10.cpp b/examples/direct_bt_scanner10/dbt_scanner10.cpp index 8c8736ab..8a1f7087 100644 --- a/examples/direct_bt_scanner10/dbt_scanner10.cpp +++ b/examples/direct_bt_scanner10/dbt_scanner10.cpp @@ -252,7 +252,7 @@ static void processConnectedDevice(std::shared_ptr<DBTDevice> device) { // GATT Service Processing // fprintf(stderr, "****** Processing Device: GATT start: %s\n", device->getAddressString().c_str()); - device->getAdapter().printDevices(); + device->getAdapter().printSharedPtrListOfDevices(); try { std::vector<GATTServiceRef> primServices = device->getGATTServices(); // implicit GATT connect... if( 0 == primServices.size() ) { @@ -337,7 +337,7 @@ exit: fprintf(stderr, "****** Processing Device: removing: %s\n", device->getAddressString().c_str()); device->remove(); } - device->getAdapter().printDevices(); + device->getAdapter().printSharedPtrListOfDevices(); removeFromDevicesProcessing(device->getAddress()); if( 0 < MULTI_MEASUREMENTS ) { @@ -400,7 +400,7 @@ void test(int dev_id) { } } fprintf(stderr, "****** EOL Adapter's Devices\n"); - adapter.printDevices(); + adapter.printSharedPtrListOfDevices(); } int main(int argc, char *argv[]) diff --git a/src/direct_bt/DBTAdapter.cpp b/src/direct_bt/DBTAdapter.cpp index 102c8791..56e15422 100644 --- a/src/direct_bt/DBTAdapter.cpp +++ b/src/direct_bt/DBTAdapter.cpp @@ -187,7 +187,7 @@ DBTAdapter::~DBTAdapter() { DBG_PRINT("DBTAdapter::dtor: XXX"); } -void DBTAdapter::printDevices() { +void DBTAdapter::printSharedPtrListOfDevices() { const std::lock_guard<std::recursive_mutex> lock0(mtx_connectedDevices); const std::lock_guard<std::recursive_mutex> lock1(mtx_discoveredDevices); const std::lock_guard<std::recursive_mutex> lock2(mtx_sharedDevices); |