mirror of https://github.com/ARMmbed/mbed-os.git
check feature support before calling extended functnions
parent
bed7677c81
commit
bf535af159
|
@ -1349,6 +1349,7 @@ ble_error_t GenericGap::reset(void)
|
||||||
_advertising_timeout.detach();
|
_advertising_timeout.detach();
|
||||||
_scan_timeout.detach();
|
_scan_timeout.detach();
|
||||||
|
|
||||||
|
if (is_extended_advertising_available()) {
|
||||||
/* stop all advertising sets */
|
/* stop all advertising sets */
|
||||||
for (size_t i = 0; i < MAX_ADVERTISING_SETS; ++i) {
|
for (size_t i = 0; i < MAX_ADVERTISING_SETS; ++i) {
|
||||||
if (_active_sets.get(i)) {
|
if (_active_sets.get(i)) {
|
||||||
|
@ -1370,13 +1371,20 @@ ble_error_t GenericGap::reset(void)
|
||||||
|
|
||||||
/* clear state of all advertising sets */
|
/* clear state of all advertising sets */
|
||||||
_existing_sets.clear();
|
_existing_sets.clear();
|
||||||
_existing_sets.set(LEGACY_ADVERTISING_HANDLE);
|
|
||||||
_active_sets.clear();
|
_active_sets.clear();
|
||||||
_active_periodic_sets.clear();
|
_active_periodic_sets.clear();
|
||||||
|
|
||||||
/* clear advertising set data on the controller */
|
/* clear advertising set data on the controller */
|
||||||
_pal_gap.clear_advertising_sets();
|
_pal_gap.clear_advertising_sets();
|
||||||
|
|
||||||
|
_existing_sets.set(LEGACY_ADVERTISING_HANDLE);
|
||||||
|
|
||||||
|
setExtendedAdvertisingParameters(
|
||||||
|
LEGACY_ADVERTISING_HANDLE,
|
||||||
|
AdvertisingParameters()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return BLE_ERROR_NONE;
|
return BLE_ERROR_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue