reset advertising sets on reset

pull/8738/head
paul-szczepanek-arm 2018-11-26 16:25:33 +00:00
parent 2b94b66fd2
commit f4a560dace
2 changed files with 14 additions and 0 deletions

View File

@ -755,6 +755,13 @@ private:
data[p.byte_index] &= ~(0x01 << p.bit_index);
}
void clear()
{
for (size_t i = 0; i < (bit_size / 8 + 1); ++i) {
data[i] = 0;
}
}
private:
struct position {
position(size_t bit_number) :

View File

@ -1345,8 +1345,15 @@ ble_error_t GenericGap::startAdvertising(const GapAdvertisingParams &params)
ble_error_t GenericGap::reset(void)
{
::Gap::reset();
_advertising_timeout.detach();
_scan_timeout.detach();
_existing_sets.clear();
_active_sets.clear();
_active_periodic_sets.clear();
_active_sets.set(LEGACY_ADVERTISING_HANDLE);
_pal_gap.clear_advertising_sets();
return BLE_ERROR_NONE;