}
}
+void SecurityManagerImpl::CreateBondOutOfBand(
+ hci::AddressWithType device, pairing::OobData remote_p192_oob_data, pairing::OobData remote_p256_oob_data) {
+ // TODO(optedoblivion): Implement when ClassicPairingHandler is ready.
+}
+
void SecurityManagerImpl::CreateBondLe(hci::AddressWithType address) {
auto record = security_database_.FindOrCreate(address);
if (record->IsPaired()) {
#include "security/channel/security_manager_channel.h"
#include "security/initial_informations.h"
#include "security/pairing/classic_pairing_handler.h"
+#include "security/pairing/oob_data.h"
#include "security/pairing_handler_le.h"
#include "security/record/security_record.h"
#include "security/record/security_record_database.h"
void CreateBond(hci::AddressWithType address);
/**
+ * Initiates bond over Classic transport with device, if not bonded yet.
+ *
+ * Allows for OobData to be passed in for use while pairing
+ *
+ * @param address device address we want to bond with
+ * @param remote_p192_oob_data P192 data given to the stack
+ * @param remote_p256_oob_data P256 data given to the stack
+ */
+ void CreateBondOutOfBand(
+ hci::AddressWithType address, pairing::OobData remote_p192_oob_data, pairing::OobData remote_p256_oob_data);
+
+ /**
* Initiates bond over Low Energy transport with device, if not bonded yet.
*
* @param address device address we want to bond with
std::forward<hci::AddressWithType>(device)));
}
+void SecurityManager::CreateBondOutOfBand(
+ hci::AddressWithType device, pairing::OobData remote_p192_oob_data, pairing::OobData remote_p256_oob_data) {
+ security_handler_->Post(common::BindOnce(
+ &internal::SecurityManagerImpl::CreateBondOutOfBand,
+ common::Unretained(security_manager_impl_),
+ std::forward<hci::AddressWithType>(device),
+ remote_p192_oob_data,
+ remote_p256_oob_data));
+}
+
void SecurityManager::CreateBondLe(hci::AddressWithType device) {
security_handler_->Post(common::BindOnce(&internal::SecurityManagerImpl::CreateBondLe,
common::Unretained(security_manager_impl_),
#include "hci/address_with_type.h"
#include "hci/le_address_manager.h"
#include "security/internal/security_manager_impl.h"
+#include "security/pairing/oob_data.h"
#include "security/security_manager_listener.h"
namespace bluetooth {
/**
* Initiates bond over Classic transport with device, if not bonded yet.
*
+ * This will initiate the Numeric Comparison bonding method
+ *
* @param address device address we want to bond with
*/
void CreateBond(hci::AddressWithType address);
/**
+ * Initiates bond over Classic transport with device, if not bonded yet.
+ *
+ * This will initiate the Out of Band bonding method
+ *
+ * @param address device address we want to bond with
+ * @param remote_p192_oob_data comparison and random for p192
+ * @param remote_p256_oob_data comparison and random for p256
+ */
+ void CreateBondOutOfBand(
+ hci::AddressWithType address, pairing::OobData remote_p192_oob_data, pairing::OobData remote_p256_oob_data);
+
+ /**
* Initiates bond over Low Energy transport with device, if not bonded yet.
*
* @param address device address we want to bond with