Store newest scan results

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
aaartis1
Level 1
Level 1
10 sign-ins 5 sign-ins First reply posted

Hello!

Part of application I'm developing needs to be able to store last n advertisement reports in array. How can I do it inside CY_BLE_EVT_GAPC_SCAN_PROGRESS_RESULT event?

0 Likes
1 Solution
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi @aaartis1 ,

The CY_BLE_EVT_GAPC_SCAN_PROGRESS_RESULT  will have an event parameter of type  cy_stc_ble_gapc_adv_report_param_t that will have all information about the adv packet. You can create a new object of this type or create a new structure with necessary data that you want to store from the adv packet  and store the adv report in that structure.

For example,

 cy_stc_ble_gapc_adv_report_param_t  adv_report[10]; //Can store 10 devices adv data

You can turn on Duplicate filtering to avoid the same device getting reported multiple times.

Regards,
Bragadeesh

View solution in original post

0 Likes
1 Reply
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi @aaartis1 ,

The CY_BLE_EVT_GAPC_SCAN_PROGRESS_RESULT  will have an event parameter of type  cy_stc_ble_gapc_adv_report_param_t that will have all information about the adv packet. You can create a new object of this type or create a new structure with necessary data that you want to store from the adv packet  and store the adv report in that structure.

For example,

 cy_stc_ble_gapc_adv_report_param_t  adv_report[10]; //Can store 10 devices adv data

You can turn on Duplicate filtering to avoid the same device getting reported multiple times.

Regards,
Bragadeesh
0 Likes