@@ -2403,8 +2403,8 @@ ble_error_t Gap::startAdvertising(
2403
2403
}
2404
2404
2405
2405
_event_queue.post ([this , handle, maxDuration, maxEvents] {
2406
- start_advertising_enable (handle, maxDuration, maxEvents);
2407
- evaluate_advertising_enable_queue ();
2406
+ queue_advertising_start (handle, maxDuration, maxEvents);
2407
+ process_enable_queue ();
2408
2408
});
2409
2409
2410
2410
} else
@@ -2448,7 +2448,7 @@ ble_error_t Gap::startAdvertising(
2448
2448
#endif
2449
2449
2450
2450
#if BLE_FEATURE_EXTENDED_ADVERTISING
2451
- void Gap::start_advertising_enable (
2451
+ void Gap::queue_advertising_start (
2452
2452
advertising_handle_t handle,
2453
2453
adv_duration_t maxDuration,
2454
2454
uint8_t maxEvents
@@ -2470,7 +2470,7 @@ void Gap::start_advertising_enable(
2470
2470
}
2471
2471
next = &(*next)->next ;
2472
2472
}
2473
- *next = new AdvertisingEnableStackNode_t ();
2473
+ *next = new (std::nothrow) AdvertisingEnableStackNode_t ();
2474
2474
if (!*next) {
2475
2475
tr_error (" Out of memory creating pending advertising enable node for handle %d" , handle);
2476
2476
return ;
@@ -2482,7 +2482,7 @@ void Gap::start_advertising_enable(
2482
2482
}
2483
2483
}
2484
2484
2485
- void Gap::evaluate_advertising_enable_queue ()
2485
+ void Gap::process_enable_queue ()
2486
2486
{
2487
2487
tr_info (" Evaluating pending advertising sets to be started" );
2488
2488
if (_advertising_enable_pending) {
@@ -2575,7 +2575,7 @@ ble_error_t Gap::stopAdvertising(advertising_handle_t handle)
2575
2575
}
2576
2576
_pending_stop_sets.set (handle);
2577
2577
if (!delay) {
2578
- evaluate_advertising_stop ();
2578
+ process_stop ();
2579
2579
}
2580
2580
});
2581
2581
@@ -2604,7 +2604,7 @@ ble_error_t Gap::stopAdvertising(advertising_handle_t handle)
2604
2604
}
2605
2605
2606
2606
#if BLE_FEATURE_EXTENDED_ADVERTISING
2607
- void Gap::evaluate_advertising_stop ()
2607
+ void Gap::process_stop ()
2608
2608
{
2609
2609
// refresh for address for all connectable advertising sets
2610
2610
for (size_t i = 0 ; i < BLE_GAP_MAX_ADVERTISING_SETS; ++i) {
@@ -3461,7 +3461,7 @@ void Gap::on_advertising_set_started(const mbed::Span<const uint8_t>& handles)
3461
3461
3462
3462
_event_queue.post ([this ] {
3463
3463
_advertising_enable_pending = false ;
3464
- evaluate_advertising_enable_queue ();
3464
+ process_enable_queue ();
3465
3465
});
3466
3466
3467
3467
for (const auto &handle : handles) {
@@ -3506,7 +3506,7 @@ void Gap::on_advertising_set_terminated(
3506
3506
3507
3507
_event_queue.post ([this , advertising_handle] {
3508
3508
_pending_stop_sets.clear (advertising_handle);
3509
- evaluate_advertising_stop ();
3509
+ process_stop ();
3510
3510
});
3511
3511
3512
3512
if (!_event_handler) {
0 commit comments