diff options
author | Sven Gothel <[email protected]> | 2021-09-24 09:13:23 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2021-09-24 09:13:23 +0200 |
commit | e73bfa6898ad1fdd813f024990a70e81bc2d70ba (patch) | |
tree | 93388ea6a3aa0670741b1b5be0fdb950de39a155 /api | |
parent | afd62e2ee8dddabc32658c4a0eb967ec7a876e01 (diff) |
Added HCIHandler::check_open_connection(..): Reuse same state and param checking, reduce code
Diffstat (limited to 'api')
-rw-r--r-- | api/direct_bt/HCIHandler.hpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/api/direct_bt/HCIHandler.hpp b/api/direct_bt/HCIHandler.hpp index 46891696..dcaec292 100644 --- a/api/direct_bt/HCIHandler.hpp +++ b/api/direct_bt/HCIHandler.hpp @@ -477,6 +477,24 @@ namespace direct_bt { */ LE_Features le_get_local_features() noexcept { return le_ll_feats; } + private: + + /** + * Return HCIStatusCode::SUCCESS if isOpen() and the conn_handle is tracked + * and matching the give peerAddressAndType + * + * @param caller caller method base-name for DBG_ or ERR_PRINT. + * @param conn_handle + * @param peerAddressAndType + * @param addUntrackedConn true adds connection if not tracked, + * otherwise return HCIStatusCode::INVALID_HCI_COMMAND_PARAMETERS (default) + * @return + */ + HCIStatusCode check_open_connection(const std::string& caller, + const uint16_t conn_handle, const BDAddressAndType& peerAddressAndType, + const bool addUntrackedConn = false); + + public: /** * Request supported LE_Features from remote device. * <pre> |