BLE scan raw data (p_data) gives incomplete data.

I am trying to display the p_data received data using below inside NRF_BLE_SCAN_EVT_NOT_FOUND case but I am receiving the below data.

2|1|6|1a|ff|4c|0|2|15|ff|ff|0|0|ff|ff|0|0|ff|ff|0|0|ff|ff|0|0|ff|11|2|a5|bf|6a|0|2c|39|0|20|1f|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|

instead of receiving

2|1|6|1a|ff|4c|0|2|15|ff|ff|0|0|ff|ff|0|0|ff|ff|0|0|ff|ff|0|0|ff|11|2|a5|bf|2|a|4|a|16|0|ff|55|ff|11|2|a5|41|88|9|9|54|43|5a|30|30|31|37|36

Note: above payload, HEX data is separated by '|' symbol.

In the above payload data type Type: a and Type: 16 is not getting displayed on the received data. But on the contrary, note even though we can't see it on raw data but we can fetch the data by using ble_advdata_parse() function. why this is happening ? why so?

I have even tried to increase NRF_BLE_SCAN_BUFFER value but no luck

Thanks and regards,

Neeraj Dhekale

Parents Reply Children
  • Hello  

    it's likely the raw data is split into two packets here.

    I think you are right. I have tried to display only GAP_AD_TYPE during BLE scan and it seems that it is getting called 2 times in the same milliseconds. In below image you may see {1}  {ff} received first and the {a} {16} {9} received right after 1st data received. That means ble_evt_handler() function is getting called twice everytime.

    Is there any option to get all in once. I have already set scan_params.active=1; or somewhere by setting in sdk_config.h file?

    So due to this I need to save it somewhere all these GAP_AD_TYPE and then I need to pass it to ble_advdata_parse() function to get all raw data like show in the above nRF connect screenshot (1st main question of this thread)..

    Thanks and regards,

    Neeraj Dhekale

  • You are on the right track here, so you need to buffer that packets somehow if you need to parse both the advertisment and scan response to check for data.

    Kenneth

Related