refactor ada callback

remove BLEScanner::rx_callback_t to adacb_worker_1arg_t
This commit is contained in:
hathach committed 2017-09-15 02:23:44 +07:00
1 parent da4125c910
commit c036808000
3 files changed
+1 -12

No files matched your search

+1 -1
View File
@@ -325,7 +325,7 @@ void BLEScanner::_eventHandler(ble_evt_t* evt)
ble_gap_evt_adv_report_t* adv_report = (ble_gap_evt_adv_report_t*) rtos_malloc( sizeof(ble_gap_evt_adv_report_t) );
(*adv_report) = (*evt_report);
if (_rx_cb) ada_callback(adv_report, _rx_cb, adv_report);
if (_rx_cb) ada_callback_defer(adv_report, _rx_cb, adv_report);
}
break;
@@ -65,14 +65,6 @@ void adafruit_callback_task(void* arg)
((BLEGap::disconnect_callback_t) func) ( (uint16_t) args[0], (uint8_t) args[1] );
break;
case BLEScanner_rx_callback_t:
((BLEScanner::rx_callback_t) func)( (ble_gap_evt_adv_report_t*) args[0] );
break;
/*------------- Bluefruit -------------*/
/*------------- Central -------------*/
/*------------- Client Service & Chars -------------*/
case BLEClientCharacteristic_notify_cb_t:
((BLEClientCharacteristic::notify_cb_t) func) ( *((BLEClientCharacteristic*) args[0]), (uint8_t*) args[1], (uint16_t) args[2] );
@@ -73,9 +73,6 @@ typedef void (*adacb_worker_5arg_t) (uint32_t, uint32_t, uint32_t, uint32_t, uin
/* BLEGap */ \
XPAND(BLEGap , connect_callback_t ) \
XPAND(BLEGap , disconnect_callback_t ) \
XPAND(BLEScanner , rx_callback_t ) \
/* Bluefruit */ \
/* Central */ \
/* Client Characteristic */ \
XPAND(BLEClientCharacteristic , notify_cb_t ) \
/*XPAND(BLEClientCharacteristic , indicate_cb_t)*/ \