Skip to content

Commit c036808

Browse files
committed
refactor ada callback
remove BLEScanner::rx_callback_t to adacb_worker_1arg_t
1 parent da4125c commit c036808

File tree

3 files changed

+1
-12
lines changed

3 files changed

+1
-12
lines changed

libraries/Bluefruit52Lib/src/BLEScanner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ void BLEScanner::_eventHandler(ble_evt_t* evt)
325325

326326
ble_gap_evt_adv_report_t* adv_report = (ble_gap_evt_adv_report_t*) rtos_malloc( sizeof(ble_gap_evt_adv_report_t) );
327327
(*adv_report) = (*evt_report);
328-
if (_rx_cb) ada_callback(adv_report, _rx_cb, adv_report);
328+
if (_rx_cb) ada_callback_defer(adv_report, _rx_cb, adv_report);
329329
}
330330
break;
331331

libraries/Bluefruit52Lib/src/utility/AdaCallback.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +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 BLEScanner_rx_callback_t:
69-
((BLEScanner::rx_callback_t) func)( (ble_gap_evt_adv_report_t*) args[0] );
70-
break;
71-
72-
/*------------- Bluefruit -------------*/
73-
74-
/*------------- Central -------------*/
75-
7668
/*------------- Client Service & Chars -------------*/
7769
case BLEClientCharacteristic_notify_cb_t:
7870
((BLEClientCharacteristic::notify_cb_t) func) ( *((BLEClientCharacteristic*) args[0]), (uint8_t*) args[1], (uint16_t) args[2] );

libraries/Bluefruit52Lib/src/utility/AdaCallback.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +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(BLEScanner , rx_callback_t ) \
77-
/* Bluefruit */ \
78-
/* Central */ \
7976
/* Client Characteristic */ \
8077
XPAND(BLEClientCharacteristic , notify_cb_t ) \
8178
/*XPAND(BLEClientCharacteristic , indicate_cb_t)*/ \

0 commit comments

Comments
 (0)