- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Solved! Go to Solution.
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
All,
Advertisement without timeout is possible. You will need to pass 0 as advertisement timeout value.
Regards,
Ravinder
Cypress
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?