diff options
author | Sven Gothel <[email protected]> | 2022-04-08 02:22:16 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2022-04-08 02:22:16 +0200 |
commit | 19cf3e54bc1a81459efda7c74cd6e3544efd11ba (patch) | |
tree | 429a2bbdb0954f3471b6033011f305f77f8f296d /src | |
parent | e82e6e1b2f9d7707908436c890b00d551334c49f (diff) |
DBG_PRINT: Show BTManager::readDefaultSysParam() @ pre/post BTManager::initializeAdapter() and BTAdapter::startAdvertising()
Diffstat (limited to 'src')
-rw-r--r-- | src/direct_bt/BTAdapter.cpp | 8 | ||||
-rw-r--r-- | src/direct_bt/BTManager.cpp | 14 |
2 files changed, 21 insertions, 1 deletions
diff --git a/src/direct_bt/BTAdapter.cpp b/src/direct_bt/BTAdapter.cpp index b3fd105d..51504a02 100644 --- a/src/direct_bt/BTAdapter.cpp +++ b/src/direct_bt/BTAdapter.cpp @@ -1410,7 +1410,13 @@ HCIStatusCode BTAdapter::startAdvertising(DBGattServerRef gattServerData_, WARN_PRINT("Not allowed (%d connections open/pending): %s", connCount, toString(true).c_str()); return HCIStatusCode::COMMAND_DISALLOWED; } - // FIXME?? std::this_thread::sleep_for(std::chrono::milliseconds(100)); // wait a little (FIXME: Fast restart of advertising error) + if( jau::environment::get().debug ) { + std::vector<MgmtDefaultParam> params = mgmt.readDefaultSysParam(dev_id); + DBG_PRINT("BTAdapter::startAdvertising[%d]: SysParam: %zd", dev_id, params.size()); + for(size_t i=0; i<params.size(); ++i) { + jau::PLAIN_PRINT(true, "[%2.2zd]: %s", i, params[i].toString().c_str()); + } + } l2cap_service.start(); diff --git a/src/direct_bt/BTManager.cpp b/src/direct_bt/BTManager.cpp index f28f1ea4..ab91c886 100644 --- a/src/direct_bt/BTManager.cpp +++ b/src/direct_bt/BTManager.cpp @@ -308,7 +308,21 @@ HCIStatusCode BTManager::initializeAdapter(AdapterInfo& adapterInfo, const uint1 removeDeviceFromWhitelist(dev_id, BDAddressAndType::ANY_BREDR_DEVICE); // flush whitelist! + if( jau::environment::get().debug ) { + std::vector<MgmtDefaultParam> params = readDefaultSysParam(dev_id); + DBG_PRINT("BTManager::initializeAdapter[%d]: SysParam-Pre: %zd", dev_id, params.size()); + for(size_t i=0; i<params.size(); ++i) { + jau::PLAIN_PRINT(true, "[%2.2zd]: %s", i, params[i].toString().c_str()); + } + } setDefaultConnParam(dev_id); // using our defaults, exceeding BlueZ/Linux on the lower-end a bit + if( jau::environment::get().debug ) { + std::vector<MgmtDefaultParam> params = readDefaultSysParam(dev_id); + DBG_PRINT("BTManager::initializeAdapter[%d]: SysParam-Post: %zd", dev_id, params.size()); + for(size_t i=0; i<params.size(); ++i) { + jau::PLAIN_PRINT(true, "[%2.2zd]: %s", i, params[i].toString().c_str()); + } + } setMode(dev_id, MgmtCommand::Opcode::SET_POWERED, 1, current_settings); |