mirror of https://github.com/ARMmbed/mbed-os.git
reset advertising sets on reset
parent
2b94b66fd2
commit
f4a560dace
|
|
@ -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) :
|
||||
|
|
|
|||
|
|
@ -1345,8 +1345,15 @@ ble_error_t GenericGap::startAdvertising(const GapAdvertisingParams ¶ms)
|
|||
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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue