cancel
Showing results for 
Search instead for 
Did you mean: 

How to receive call to either hci_le_scan_request_received_event or aci_hal_scan_req_report_event

ttveldhuis
Associate
I am trying to receive calls when a device receives scan requests but I can not get the events to work;

Meaning I want the hci_le_scan_request_received_event and/or aci_hal_scan_req_report_event calls to be called whenever there is a scan request. Or alternatively receive it via the UserEvtRx parameter given to hci_init.

It looks like by default this is disabled, now I have tried setting the hci mask to events only but without result:

 

uint8_t scan_reports_only[8] = { 0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00 };

ret = hci_le_set_event_mask(scan_reports_only);
if (ret != BLE_STATUS_SUCCESS)
{
  APP_DBG_MSG("  Fail   : hci_le_set_event_mask command, result: 0x%x \n", ret);
}
else
{
  APP_DBG_MSG("  Success: hci_le_set_event_mask command\n");
}

 

 

The call succeeds but makes no difference.

 

Now I read it might be needed to call aci_hal_set_event_mask, but that call fails wherever I put it.

 

ret = aci_hal_set_event_mask(0x00000001 /*ACI_HAL_SCAN_REQ_REPORT_EVENT*/);
if (ret != BLE_STATUS_SUCCESS)
{
  APP_DBG_MSG("  Fail   : aci_hal_set_event_mask command - ACI_HAL_SCAN_REQ_REPORT_EVENT, result: 0x%x \n", ret);
}
else
{
  APP_DBG_MSG("  Success: aci_hal_set_event_mask command - ACI_HAL_SCAN_REQ_REPORT_EVENT\n");
}
​



 

Is there someone who can point me in the right direction to get these events going?



Kind regards,
 
0 REPLIES 0