cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

DeAl_292241
New Contributor II

Hi,

   

How to know if the BLE device is scanning in FAST mode or SLOW mode? In fact, for my particular case, I would like to know when exactly the device is advertising to blink a LED at the same rate.

   

Thanks,

   

Denis Alain, Eng.

0 Likes
Reply
1 Solution
Anonymous
Not applicable

Hi 

   

 

   

No direct procedure to find whether central is scanning in fast mode or slow mode. When scanning mode changes from fast to slow, at the end of fast mode ,event CYBLE_EVT_TIMEOUT will trigger. you can monitor that one.

   

 

   

In addition to that you can read the register "BLE_BLELL_SCAN_INTERVAL" and "BLE_BLELL_SCAN_WINDOW" and see if the value matches with fast or slow modes.

   

 

   

When device is advertising CYB:LE_GetState() returns CYBLE_STATE_ADVERTISING. So you can tunr oN LED based on the return value of CYBLE_GetState(). If you want blink at the same rate of advertising then implement low power

   

and toggle the LED when API CYBLE_GetBLESSState() returns CYBLE_BLESS_STATE_EVENT_CLOSE

   

 

   

refer app note AN92584 for more details on low power modes

   

http://www.cypress.com/documentation/application-notes/an92584-designing-low-power-and-estimating-ba...

   

 

   

Regards

   

Vikas.

View solution in original post

0 Likes
Reply
2 Replies
Anonymous
Not applicable

Hi 

   

 

   

No direct procedure to find whether central is scanning in fast mode or slow mode. When scanning mode changes from fast to slow, at the end of fast mode ,event CYBLE_EVT_TIMEOUT will trigger. you can monitor that one.

   

 

   

In addition to that you can read the register "BLE_BLELL_SCAN_INTERVAL" and "BLE_BLELL_SCAN_WINDOW" and see if the value matches with fast or slow modes.

   

 

   

When device is advertising CYB:LE_GetState() returns CYBLE_STATE_ADVERTISING. So you can tunr oN LED based on the return value of CYBLE_GetState(). If you want blink at the same rate of advertising then implement low power

   

and toggle the LED when API CYBLE_GetBLESSState() returns CYBLE_BLESS_STATE_EVENT_CLOSE

   

 

   

refer app note AN92584 for more details on low power modes

   

http://www.cypress.com/documentation/application-notes/an92584-designing-low-power-and-estimating-ba...

   

 

   

Regards

   

Vikas.

View solution in original post

0 Likes
Reply
DeAl_292241
New Contributor II

Hi Vikas,

   

Thanks for your post! I will try it soon.
Best Regards, 

   

Denis

0 Likes
Reply