diff options
author | Sven Gothel <[email protected]> | 2021-10-27 14:23:11 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2021-10-27 14:23:11 +0200 |
commit | c526104b0d57c36fbf4f353b810e6d9aceadfa6b (patch) | |
tree | 951338d18d8e90c156bcdbaca5e4b0df6211b887 /api | |
parent | 434a8e042e1ec02879ab84fefd7e36787133b8e7 (diff) |
Add BTAdapter::setSMPKeyBin(..): Allowing to upload keys for peripheral mode pre-connection
FIXME: Pass keys to BTDevice instance after connection!
Diffstat (limited to 'api')
-rw-r--r-- | api/direct_bt/BTAdapter.hpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/api/direct_bt/BTAdapter.hpp b/api/direct_bt/BTAdapter.hpp index b01b7554..6b80fc92 100644 --- a/api/direct_bt/BTAdapter.hpp +++ b/api/direct_bt/BTAdapter.hpp @@ -45,6 +45,8 @@ #include "DBGattServer.hpp" +#include "SMPKeyBin.hpp" + namespace direct_bt { class BTAdapter; // forward @@ -625,6 +627,22 @@ namespace direct_bt { bool setSecureConnections(const bool enable) noexcept; /** + * Associate the given SMPKeyBin with the contained remote address, i.e. SMPKeyBin::getRemoteAddrAndType(). + * + * Further uploads the Long Term Key (LTK) and Link Key (LK) for a potential upcoming connection, + * if they are contained in the given SMPKeyBin file. + * + * This method is provided to support BTRole::Slave peripheral adapter mode, + * allowing user to inject all required keys before a connection occurs. + * + * FIXME: Pass keys to BTDevice instance after connection! + * + * @param keys SMPKeyBin file + * @return HCIStatusCode::SUCCESS or an error state on failure + */ + HCIStatusCode setSMPKeyBin(const SMPKeyBin& keys) noexcept; + + /** * Initialize the adapter with default values, including power-on. * <p> * Method shall be issued on the desired adapter found via ChangedAdapterSetFunc. |