mirror of https://github.com/ARMmbed/mbed-os.git
BLE: Bind address controller with Gap
parent
313676a089
commit
7e16ee448e
|
@ -201,7 +201,8 @@ ble::impl::Gap &BLEInstanceBase::getGapImpl()
|
|||
_event_queue,
|
||||
ble::impl::PalGap::get_gap(),
|
||||
cordio_gap_service,
|
||||
ble::impl::PalSecurityManager::get_security_manager()
|
||||
ble::impl::PalSecurityManager::get_security_manager(),
|
||||
getPrivateAddressRegistry()
|
||||
);
|
||||
return gap;
|
||||
}
|
||||
|
|
|
@ -319,11 +319,13 @@ Gap::Gap(
|
|||
ble::PalEventQueue &event_queue,
|
||||
ble::PalGap &pal_gap,
|
||||
ble::PalGenericAccessService &generic_access_service,
|
||||
ble::PalSecurityManager &pal_sm
|
||||
ble::PalSecurityManager &pal_sm,
|
||||
ble::PrivateAddressController &pal_addr_reg
|
||||
) : _event_queue(event_queue),
|
||||
_pal_gap(pal_gap),
|
||||
_gap_service(generic_access_service),
|
||||
_pal_sm(pal_sm),
|
||||
_address_registry(pal_addr_reg),
|
||||
_address_type(own_address_type_t::PUBLIC),
|
||||
_initiator_policy_mode(initiator_policy_t::NO_FILTER),
|
||||
_scanning_filter_policy(scanning_filter_policy_t::NO_FILTER),
|
||||
|
@ -348,6 +350,7 @@ Gap::Gap(
|
|||
_random_static_identity_address = _pal_gap.get_random_address();
|
||||
|
||||
_pal_gap.set_event_handler(this);
|
||||
_address_registry.set_event_handler(this);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2893,5 +2896,29 @@ void Gap::setEventHandler(Gap::EventHandler *handler)
|
|||
_event_handler = handler;
|
||||
}
|
||||
|
||||
|
||||
void Gap::on_resolvable_private_addresses_generated(const address_t &address)
|
||||
{
|
||||
}
|
||||
|
||||
void Gap::on_non_resolvable_private_addresses_generated(const address_t &address)
|
||||
{
|
||||
}
|
||||
|
||||
void Gap::on_private_address_generated(bool connectable)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Gap::on_address_resolution_completion(
|
||||
const address_t &peer_resolvable_address,
|
||||
bool resolved,
|
||||
target_peer_address_type_t identity_address_type,
|
||||
const address_t &identity_address
|
||||
)
|
||||
{
|
||||
// FIXME: Implement
|
||||
}
|
||||
}
|
||||
} // impl
|
||||
} // ble
|
||||
|
|
|
@ -38,6 +38,8 @@
|
|||
|
||||
#include "source/pal/PalGap.h"
|
||||
#include "source/pal/PalConnectionMonitor.h"
|
||||
#include "source/pal/PalEventQueue.h"
|
||||
#include "source/generic/PrivateAddressController.h"
|
||||
|
||||
#include "ble/Gap.h"
|
||||
|
||||
|
@ -57,7 +59,8 @@ class BLEInstanceBase;
|
|||
|
||||
class Gap :
|
||||
public ble::PalConnectionMonitor,
|
||||
public PalGapEventHandler {
|
||||
public PalGapEventHandler,
|
||||
public PrivateAddressController::EventHandler {
|
||||
friend PalConnectionMonitor;
|
||||
friend PalGapEventHandler;
|
||||
friend PalGap;
|
||||
|
@ -358,7 +361,8 @@ private:
|
|||
ble::PalEventQueue &event_queue,
|
||||
ble::PalGap &pal_gap,
|
||||
ble::PalGenericAccessService &generic_access_service,
|
||||
ble::PalSecurityManager &pal_sm
|
||||
ble::PalSecurityManager &pal_sm,
|
||||
ble::PrivateAddressController &pal_addr_reg
|
||||
);
|
||||
|
||||
~Gap();
|
||||
|
@ -533,6 +537,20 @@ private:
|
|||
|
||||
void process_legacy_scan_timeout();
|
||||
|
||||
/* Implement PrivateAddressController::EventHandler */
|
||||
private:
|
||||
void on_resolvable_private_addresses_generated(const address_t &address) final;
|
||||
|
||||
void on_non_resolvable_private_addresses_generated(const address_t &address) final;
|
||||
|
||||
void on_private_address_generated(bool connectable);
|
||||
|
||||
void on_address_resolution_completion(
|
||||
const address_t &peer_resolvable_address,
|
||||
bool resolved,
|
||||
target_peer_address_type_t identity_address_type,
|
||||
const address_t &identity_address
|
||||
) final;
|
||||
private:
|
||||
/**
|
||||
* Callchain containing all registered callback handlers for shutdown
|
||||
|
@ -549,6 +567,7 @@ private:
|
|||
PalGap &_pal_gap;
|
||||
PalGenericAccessService &_gap_service;
|
||||
PalSecurityManager &_pal_sm;
|
||||
PrivateAddressController &_address_registry;
|
||||
ble::own_address_type_t _address_type;
|
||||
ble::address_t _address;
|
||||
initiator_policy_t _initiator_policy_mode;
|
||||
|
|
Loading…
Reference in New Issue