Start and Stop BLE Scanning

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

cross mob
Anonymous
Not applicable

Hi All

   

As part of my application I need to start and stop BLE Scanning.

   

To start scanning I use the function CyBle_GapcStartScan(CYBLE_SCANNING_FAST).

   

To stop scanning I use the function CyBle_GapcStopScan().

   

The start scanning always works and generates a CYBLE_EVT_GAPC_SCAN_START_STOP event.

   

The stop scanning only works intermittently.

   

When it works it generates a CYBLE_EVT_GAPC_SCAN_START_STOP event.

   

When it doesn't work, no event is generated and the BLE remains in scanning mode.

   

Are there other conditions I need to set to stop the BLE from scanning.

   

The device is a CYBL10563-56LQXI

   

​Thanks

   

John

0 Likes
2 Replies
AnjanaM_61
Moderator
Moderator
Moderator
10 questions asked 5 comments on KBA First comment on KBA

Hi John,

   

I am not sure how you are using the CyBle_GapcStopScan() API. Are you calling CyBleprocessevents() after CyBle_GapcStopScan() API? Can you please make sure of that?

   

Please let us know your further queries.

   

Thanks & Regards,
Anjana

0 Likes
Anonymous
Not applicable

Hi Anjana

   

Thanks for the reply regarding my scan stop start issue.

   

Not calling CyBleprocessevents was the cause of my issue.

   

I had not called it directly after the stop scan command so once I did the stop scan worked perfectly.

   

I actually fixed the issue the day after I posted query so my apologies for not updating my post.

   

Thanks again,

   

John

0 Likes