@@ -2403,8 +2403,8 @@ ble_error_t Gap::startAdvertising(
24032403 }
24042404
24052405 _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 ();
24082408 });
24092409
24102410 } else
@@ -2448,7 +2448,7 @@ ble_error_t Gap::startAdvertising(
24482448#endif
24492449
24502450#if BLE_FEATURE_EXTENDED_ADVERTISING
2451- void Gap::start_advertising_enable (
2451+ void Gap::queue_advertising_start (
24522452 advertising_handle_t handle,
24532453 adv_duration_t maxDuration,
24542454 uint8_t maxEvents
@@ -2470,7 +2470,7 @@ void Gap::start_advertising_enable(
24702470 }
24712471 next = &(*next)->next ;
24722472 }
2473- *next = new AdvertisingEnableStackNode_t ();
2473+ *next = new (std::nothrow) AdvertisingEnableStackNode_t ();
24742474 if (!*next) {
24752475 tr_error (" Out of memory creating pending advertising enable node for handle %d" , handle);
24762476 return ;
@@ -2482,7 +2482,7 @@ void Gap::start_advertising_enable(
24822482 }
24832483}
24842484
2485- void Gap::evaluate_advertising_enable_queue ()
2485+ void Gap::process_enable_queue ()
24862486{
24872487 tr_info (" Evaluating pending advertising sets to be started" );
24882488 if (_advertising_enable_pending) {
@@ -2575,7 +2575,7 @@ ble_error_t Gap::stopAdvertising(advertising_handle_t handle)
25752575 }
25762576 _pending_stop_sets.set (handle);
25772577 if (!delay) {
2578- evaluate_advertising_stop ();
2578+ process_stop ();
25792579 }
25802580 });
25812581
@@ -2604,7 +2604,7 @@ ble_error_t Gap::stopAdvertising(advertising_handle_t handle)
26042604}
26052605
26062606#if BLE_FEATURE_EXTENDED_ADVERTISING
2607- void Gap::evaluate_advertising_stop ()
2607+ void Gap::process_stop ()
26082608{
26092609 // refresh for address for all connectable advertising sets
26102610 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)
34613461
34623462 _event_queue.post ([this ] {
34633463 _advertising_enable_pending = false ;
3464- evaluate_advertising_enable_queue ();
3464+ process_enable_queue ();
34653465 });
34663466
34673467 for (const auto &handle : handles) {
@@ -3506,7 +3506,7 @@ void Gap::on_advertising_set_terminated(
35063506
35073507 _event_queue.post ([this , advertising_handle] {
35083508 _pending_stop_sets.clear (advertising_handle);
3509- evaluate_advertising_stop ();
3509+ process_stop ();
35103510 });
35113511
35123512 if (!_event_handler) {
0 commit comments