Change the BLE advertising rate

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

cross mob
Anonymous
Not applicable

Hi,

   

My project is based on the "AltBeacon" example, and it use broadcasting mode for the BLE component. 

   

However, I the data broadcasting rate is about 100ms. I want to slow it down to, like 1s. 

   

I tried a few things:

   

1. I tried to add a Cydelay() in the main while loop, but it does not help.

   

2. In the "BLE interface.c" file, I modified the  CyBle_GappStartAdvertisement(CYBLE_ADVERTISING_FAST) to  CyBle_GappStartAdvertisement(CYBLE_ADVERTISING_SLOW), and I can not change the data rate either.

   

Is there anyone know that if is there a method to slow down the advertising rate for broadcasting mode?

   

Or, do we have to use the general profile that we can go to the deepsleep mode to save the energy?

   

Thanks!

   

 

   

Song

0 Likes
1 Solution
Anonymous
Not applicable

cyBle_discoveryModeInfo.advParam->advIntvMin =
    /* your advertise interval m, minimal. seconds are m * 0.000625 s */;
cyBle_discoveryModeInfo.advParam->advIntvMax =

    /* your advertise interval m, maximal. seconds are m * 0.000625 s */;
cyBle_discoveryModeInfo.discMode = CYBLE_GAPP_GEN_DISC_MODE;

   

// you can set a lot of other parameters, like advertising data,
// advertising timeout, etc. see API documentation for
// CYBLE_GAPP_DISC_MODE_INFO_T

   

CYBLE_API_RESULT_T res = CyBle_GappEnterDiscoveryMode( &cyBle_discoveryModeInfo );

   

 

   

Your call to CyBle_GappStartAdvertisement() should instead be replaced with the code above.

View solution in original post

0 Likes
1 Reply
Anonymous
Not applicable

cyBle_discoveryModeInfo.advParam->advIntvMin =
    /* your advertise interval m, minimal. seconds are m * 0.000625 s */;
cyBle_discoveryModeInfo.advParam->advIntvMax =

    /* your advertise interval m, maximal. seconds are m * 0.000625 s */;
cyBle_discoveryModeInfo.discMode = CYBLE_GAPP_GEN_DISC_MODE;

   

// you can set a lot of other parameters, like advertising data,
// advertising timeout, etc. see API documentation for
// CYBLE_GAPP_DISC_MODE_INFO_T

   

CYBLE_API_RESULT_T res = CyBle_GappEnterDiscoveryMode( &cyBle_discoveryModeInfo );

   

 

   

Your call to CyBle_GappStartAdvertisement() should instead be replaced with the code above.

0 Likes