Broadcaster without advertising time out.

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

cross mob
Anonymous
Not applicable

Hi all,

   

I am trying to create a beacon type device that advertises some data once every few seconds.

   

How do I disable the advertisement timeout?

   

The General Discoverable Mode in the BLE_v1_10.pdf states:

   

General Discoverable Mode – In this mode, the device should be used by devices that need to be discoverable continuously or for no specific condition.

   

But one can't disable the advertisement timeout.

   

Maybe I'm missing something. Should I restart the advertisement from the CYBLE_EVT_TIMEOUT event?

   

Thank you,
Errol

0 Likes
1 Solution
Anonymous
Not applicable

 Errol,

   

 

   

You cannot disable advertisement timeout, but you can do following things:

   

1) Keep the timeout period huge. For start, this can be set to 65000 in BLE Component GUI ->Gap Settings Tab -> Advertisement Setting.

   

2) When Advertisement timeout happens, you get an event. In that event, restart advertisement:

   

 case CYBLE_EVT_GAPP_ADVERTISEMENT_START_STOP:

   

/* Restart Advertisement if the state is disconnected */

   

if(CyBle_GetState() == CYBLE_STATE_DISCONNECTED )

   

{

   

CyBle_GappStartAdvertisement(CYBLE_ADVERTISING_FAST);

   

}

   

        break;

   

 

   

-Rohit

View solution in original post

0 Likes
6 Replies
Anonymous
Not applicable

 Errol,

   

 

   

You cannot disable advertisement timeout, but you can do following things:

   

1) Keep the timeout period huge. For start, this can be set to 65000 in BLE Component GUI ->Gap Settings Tab -> Advertisement Setting.

   

2) When Advertisement timeout happens, you get an event. In that event, restart advertisement:

   

 case CYBLE_EVT_GAPP_ADVERTISEMENT_START_STOP:

   

/* Restart Advertisement if the state is disconnected */

   

if(CyBle_GetState() == CYBLE_STATE_DISCONNECTED )

   

{

   

CyBle_GappStartAdvertisement(CYBLE_ADVERTISING_FAST);

   

}

   

        break;

   

 

   

-Rohit

0 Likes
Anonymous
Not applicable

Thank you Rohit, that works great.

   

I disabled the slow advertising and set the fast advertising to every 5 seconds.

   

It took me a while to find where to change the advertising packet in code so that I can modify the manufacturer specific data, but I found it in cyBle_discoveryData

   

For some reason the Verify Answer button is missing...

   

Thank you,
Errol

0 Likes
Anonymous
Not applicable

FYI - I saw this project that shows how to update manufacturer specific data in an advertisement packet. https://github.com/cypresssemiconductorco/PSoC-4-BLE/tree/master/100_Projects_in_100_Days/Day009_Dyn... 

0 Likes
Anonymous
Not applicable

 All,

   

Advertisement without timeout is possible. You will need to pass 0 as advertisement timeout value.

   

Regards,

   

Ravinder 

   

Cypress

   

rave@cypress.com

0 Likes
Anonymous
Not applicable

Hi Ravinder,

   

Is this a new feature? Before I asked this question back then I tried using 0 as the timeout value but was given an error mesage that the minimum value was 1, if I recall correctly.

   

Thank you,
Errol

0 Likes
Anonymous
Not applicable

I had the same question and later found out that the internal API "CyBle_GappEnterDiscoveryMode" supports unlimited timeout when the timeout parmeter is set to zero, but the component API "CyBle_GappStartAdvertisement" doesn't support it today.

   

Cypress team, can you add this to your component?

0 Likes