From c526104b0d57c36fbf4f353b810e6d9aceadfa6b Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 27 Oct 2021 14:23:11 +0200 Subject: Add BTAdapter::setSMPKeyBin(..): Allowing to upload keys for peripheral mode pre-connection FIXME: Pass keys to BTDevice instance after connection! --- api/direct_bt/BTAdapter.hpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'api') 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 @@ -624,6 +626,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. *

-- cgit v1.2.3