summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2020-12-09 11:32:57 +0100
committerSven Gothel <[email protected]>2020-12-09 11:32:57 +0100
commitba7ab284bb3b4bbbbef75b54dfbc87478079a72a (patch)
treed88065e65fca07492d2e14fc062853ae50f3d519 /api
parenta83392f65f8ce725de14d7bf5bd3cd336e4d5d17 (diff)
DBTDevice: Add get/set methods for SMPLongTermKeyInfo (tested); TODO: Java
Diffstat (limited to 'api')
-rw-r--r--api/direct_bt/DBTDevice.hpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/api/direct_bt/DBTDevice.hpp b/api/direct_bt/DBTDevice.hpp
index 296861ac..3239dc63 100644
--- a/api/direct_bt/DBTDevice.hpp
+++ b/api/direct_bt/DBTDevice.hpp
@@ -446,6 +446,23 @@ namespace direct_bt {
HCIStatusCode disconnect(const HCIStatusCode reason=HCIStatusCode::REMOTE_USER_TERMINATED_CONNECTION ) noexcept;
/**
+ * Returns a copy of the long term ket (LTK) info, valid after connection and SMP pairing has been completed.
+ * @param responder true will return the responder's LTK info (remote device, LL slave), otherwise the initiator's (the LL master).
+ * @return
+ * @see ::SMPPairingState::COMPLETED
+ * @see AdapterStatusListener::deviceReady()
+ */
+ SMPLongTermKeyInfo getLongTermKeyInfo(const bool responder) const noexcept;
+
+ /**
+ * Sets the long term ket (LTK) info of this device to reuse pre-paired encryption.
+ * @param ltk the pre-paired encryption
+ * @param responder true will set the responder's LTK info (remote device, LL slave), otherwise the initiator's (the LL master).
+ * @return ::HCIStatusCode::SUCCESS if successful, otherwise the appropriate error code.
+ */
+ HCIStatusCode setLongTermKeyInfo(const SMPLongTermKeyInfo& ltk, const bool responder) noexcept;
+
+ /**
* Unpairs this device from the adapter while staying connected.
* <p>
* All keys will be cleared within the adapter and host implementation.<br>