mirror of https://github.com/ARMmbed/mbed-os.git
connection complete event
parent
519f75587a
commit
62b38cfbc8
|
@ -1285,6 +1285,32 @@ public:
|
||||||
(void)rxPhy;
|
(void)rxPhy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void onEnhancedConnectionComplete(
|
||||||
|
bool success,
|
||||||
|
Handle_t connectionHandle,
|
||||||
|
Role_t ownRole,
|
||||||
|
PeerAddressType_t peerAddressType,
|
||||||
|
const ble::address_t &peerAddress,
|
||||||
|
const ble::address_t &localResolvablePrivateAddress,
|
||||||
|
const ble::address_t &peerResolvablePrivateAddress,
|
||||||
|
uint16_t connectionInterval_us,
|
||||||
|
uint16_t connectionLatency,
|
||||||
|
uint16_t supervisionTimeout_ms,
|
||||||
|
uint16_t masterClockAccuracy_ppm
|
||||||
|
) {
|
||||||
|
(void)success;
|
||||||
|
(void)connectionHandle;
|
||||||
|
(void)ownRole;
|
||||||
|
(void)peerAddressType;
|
||||||
|
(void)peerAddress;
|
||||||
|
(void)localResolvablePrivateAddress;
|
||||||
|
(void)peerResolvablePrivateAddress;
|
||||||
|
(void)connectionInterval_us;
|
||||||
|
(void)connectionLatency;
|
||||||
|
(void)supervisionTimeout_ms;
|
||||||
|
(void)masterClockAccuracy_ppm;
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
* Prevent polymorphic deletion and avoid uncessery virtual destructor
|
* Prevent polymorphic deletion and avoid uncessery virtual destructor
|
||||||
|
|
|
@ -610,6 +610,7 @@ ble_error_t GenericGap::connect(
|
||||||
if (!connectionParams.getNumberOfEnabledPhys()) {
|
if (!connectionParams.getNumberOfEnabledPhys()) {
|
||||||
return BLE_ERROR_INVALID_PARAM;
|
return BLE_ERROR_INVALID_PARAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
return _pal_gap.extended_create_connection(
|
return _pal_gap.extended_create_connection(
|
||||||
(ble::pal::initiator_policy_t::type)connectionParams.getFilterPolicy(),
|
(ble::pal::initiator_policy_t::type)connectionParams.getFilterPolicy(),
|
||||||
(ble::pal::own_address_type_t::type)connectionParams.getOwnAddressType().value(),
|
(ble::pal::own_address_type_t::type)connectionParams.getOwnAddressType().value(),
|
||||||
|
@ -2129,9 +2130,22 @@ void GenericGap::on_enhanced_connection_complete(
|
||||||
uint16_t connection_latency,
|
uint16_t connection_latency,
|
||||||
uint16_t supervision_timeout,
|
uint16_t supervision_timeout,
|
||||||
pal::clock_accuracy_t master_clock_accuracy
|
pal::clock_accuracy_t master_clock_accuracy
|
||||||
)
|
) {
|
||||||
{
|
if (_eventHandler) {
|
||||||
|
_eventHandler->onEnhancedConnectionComplete(
|
||||||
|
(status==pal::hci_error_code_t::SUCCESS),
|
||||||
|
(ble::connection_handle_t)connection_handle,
|
||||||
|
(Gap::Role_t)own_role.value(),
|
||||||
|
(ble::peer_address_type_t::type)peer_address_type.value(),
|
||||||
|
peer_address,
|
||||||
|
local_resolvable_private_address,
|
||||||
|
peer_resolvable_private_address,
|
||||||
|
connection_interval * 1250,
|
||||||
|
connection_latency,
|
||||||
|
supervision_timeout * 10,
|
||||||
|
master_clock_accuracy.getPPM()
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GenericGap::on_extended_advertising_report(
|
void GenericGap::on_extended_advertising_report(
|
||||||
|
|
Loading…
Reference in New Issue