refactor AdaCallback

remove BLEAdvertising stop_callback_t
This commit is contained in:
hathach committed 2017-09-15 02:15:59 +07:00
1 parent 8a175aa815
commit da4125c910
4 files changed
+2 -9

No files matched your search

@@ -393,7 +393,7 @@ void BLEAdvertising::_eventHandler(ble_evt_t* evt)
Bluefruit._stopConnLed(); // stop blinking
// invoke stop callback
if (_stop_cb) ada_callback(NULL, _stop_cb);
if (_stop_cb) ada_callback_defer(NULL, _stop_cb);
}
}
}
+1 -1
View File
@@ -365,7 +365,7 @@ void BLEScanner::_eventHandler(ble_evt_t* evt)
case BLE_GAP_EVT_TIMEOUT:
if (evt->evt.gap_evt.params.timeout.src == BLE_GAP_TIMEOUT_SRC_SCAN)
{
if (_stop_cb) ada_callback(NULL, _stop_cb);
if (_stop_cb) ada_callback_defer(NULL, _stop_cb);
}
break;
@@ -65,11 +65,6 @@ void adafruit_callback_task(void* arg)
((BLEGap::disconnect_callback_t) func) ( (uint16_t) args[0], (uint8_t) args[1] );
break;
case BLEAdvertising_stop_callback_t:
// case BLEScanner_stop_callback_t:
((BLEAdvertising::stop_callback_t) func)();
break;
case BLEScanner_rx_callback_t:
((BLEScanner::rx_callback_t) func)( (ble_gap_evt_adv_report_t*) args[0] );
break;
@@ -73,8 +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(BLEAdvertising , stop_callback_t ) \
/*BLEScanner::stop_callback_t is same as BLEAdvertising::stop_callback_t */\
XPAND(BLEScanner , rx_callback_t ) \
/* Bluefruit */ \
/* Central */ \