use ada_callback for scanner callback

also increase ada callback queue depth to 20
This commit is contained in:
hathach committed 2017-07-13 17:44:02 +07:00
1 parent 98bae8d1cb
commit e42063bd82
3 files changed
+7 -6

No files matched your search

+3 -2
View File
@@ -232,8 +232,9 @@ void BLEScanner::_eventHandler(ble_evt_t* evt)
case BLE_GAP_EVT_ADV_REPORT:
{
// evt_conn_hdl is equal to BLE_CONN_HANDLE_INVALID
ble_gap_evt_adv_report_t* adv_report = &evt->evt.gap_evt.params.adv_report;
if (_rx_cb) _rx_cb(adv_report); // TODO ada_callback
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->evt.gap_evt.params.adv_report;
if (_rx_cb) ada_callback(adv_report, _rx_cb, adv_report);
}
break;
@@ -71,9 +71,9 @@ void adafruit_callback_task(void* arg)
((BLEAdvertising::stop_callback_t) func)();
break;
// case BLEScanner_rx_callback_t:
// ((BLEScanner::BLEScanner_rx_callback_t) func)();
// break;
case BLEScanner_rx_callback_t:
((BLEScanner::rx_callback_t) func)( (ble_gap_evt_adv_report_t*) args[0] );
break;
/*------------- Bluefruit -------------*/
@@ -40,7 +40,7 @@
#include "bluefruit.h"
#define CFG_CALLBACK_TASK_STACKSIZE (512*2)
#define CFG_CALLBACK_QUEUE_LENGTH 10
#define CFG_CALLBACK_QUEUE_LENGTH 20
typedef struct
{