Skip to content

Commit da4125c

Browse files
committed
refactor AdaCallback
remove BLEAdvertising stop_callback_t
1 parent 8a175aa commit da4125c

File tree

4 files changed

+2
-9
lines changed

4 files changed

+2
-9
lines changed

libraries/Bluefruit52Lib/src/BLEAdvertising.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ void BLEAdvertising::_eventHandler(ble_evt_t* evt)
393393
Bluefruit._stopConnLed(); // stop blinking
394394

395395
// invoke stop callback
396-
if (_stop_cb) ada_callback(NULL, _stop_cb);
396+
if (_stop_cb) ada_callback_defer(NULL, _stop_cb);
397397
}
398398
}
399399
}

libraries/Bluefruit52Lib/src/BLEScanner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ void BLEScanner::_eventHandler(ble_evt_t* evt)
365365
case BLE_GAP_EVT_TIMEOUT:
366366
if (evt->evt.gap_evt.params.timeout.src == BLE_GAP_TIMEOUT_SRC_SCAN)
367367
{
368-
if (_stop_cb) ada_callback(NULL, _stop_cb);
368+
if (_stop_cb) ada_callback_defer(NULL, _stop_cb);
369369
}
370370
break;
371371

libraries/Bluefruit52Lib/src/utility/AdaCallback.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,6 @@ void adafruit_callback_task(void* arg)
6565
((BLEGap::disconnect_callback_t) func) ( (uint16_t) args[0], (uint8_t) args[1] );
6666
break;
6767

68-
case BLEAdvertising_stop_callback_t:
69-
// case BLEScanner_stop_callback_t:
70-
((BLEAdvertising::stop_callback_t) func)();
71-
break;
72-
7368
case BLEScanner_rx_callback_t:
7469
((BLEScanner::rx_callback_t) func)( (ble_gap_evt_adv_report_t*) args[0] );
7570
break;

libraries/Bluefruit52Lib/src/utility/AdaCallback.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ typedef void (*adacb_worker_5arg_t) (uint32_t, uint32_t, uint32_t, uint32_t, uin
7373
/* BLEGap */ \
7474
XPAND(BLEGap , connect_callback_t ) \
7575
XPAND(BLEGap , disconnect_callback_t ) \
76-
XPAND(BLEAdvertising , stop_callback_t ) \
77-
/*BLEScanner::stop_callback_t is same as BLEAdvertising::stop_callback_t */\
7876
XPAND(BLEScanner , rx_callback_t ) \
7977
/* Bluefruit */ \
8078
/* Central */ \

0 commit comments

Comments
 (0)