Using the scanner module, I set up a scan filter to scan for UUID with no auto connect. In the scan_evt_handler, I have a switch case for the NRF_BLE_SCAN_EVT_FILTER_MATCH.
I see that the filter match has p_adv_report attached to the event structure. I am trying to get the full device name from it, but am not having any luck.
case NRF_BLE_SCAN_EVT_FILTER_MATCH:
{
volatile nrf_ble_scan_evt_filter_match_t const* filterMatch = &p_scan_evt->params.filter_match;
volatile uint8_t *data = ble_advdata_parse(filterMatch->p_adv_report->data.p_data, filterMatch->p_adv_report->data.len, BLE_GAP_AD_TYPE_COMPLETE_LOCAL_NAME);
NRF_LOG_INFO("Filter Match.");
}
The data pointer returned from ble_advdata_parse is always 0x00000000. The advertising device is just the base ble_app_uart example app and it is set up to advertise the full device name. I see the name in nrf_connect phone app when scanned.
What am I missing?