Greetings,
I am running the SimpleBLEBroadcaster project. I have made changes to advertise for 5 seconds and do nothing for 60 seconds and then repeat - using a timer event.
This works very well, however when I add extra data into advertisement packets the device only advertises for 2 minutes and then stops.
My event code and two examples of working / not-working advertisement packets are below.
Any suggestions? Thanks.
// -----------------Timer Event Code------------------------------------------------------------
if (events & START_ADV_TX)
{
uint8 current_adv_status;
GAPRole_GetParameter( GAPROLE_ADVERT_ENABLED, ¤t_adv_status);
if (current_adv_status == FALSE) {
uint8 adv_status = TRUE;
GAPRole_SetParameter( GAPROLE_ADVERT_ENABLED, sizeof( uint8 ), &adv_status );
osal_start_timerEx( simpleBLEBroadcaster_TaskID, START_ADV_TX, 5000);
} else {
uint8 adv_status = FALSE;
GAPRole_SetParameter( GAPROLE_ADVERT_ENABLED, sizeof( uint8 ), &adv_status );
}
....
if ( events & SBP_START_DEVICE_EVT )
{
// Start the Device
VOID GAPRole_StartDevice( &simpleBLEBroadcaster_BroadcasterCBs );
osal_start_timerEx( simpleBLEBroadcaster_TaskID, START_ADV_TX, 60000);
return ( events ^ SBP_START_DEVICE_EVT );
}
// -----------------Advertisement Packet Code------------------------------------------------------------
// Advertises For Two Minutes and and Stops :(
static uint8 advertData[] =
{
0x02, // length of this data
GAP_ADTYPE_FLAGS,
GAP_ADTYPE_FLAGS_GENERAL | GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED
// GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED,
// three-byte broadcast of the data "1 2 3"
0x04, // length of this data including the data type byte
GAP_ADTYPE_MANUFACTURER_SPECIFIC, // manufacturer specific advertisement data type
0x11,
0x12,
0x13
};
// Advertises indefinitely. :)
static uint8 advertData[] =
{
0x02, // length of this data
GAP_ADTYPE_FLAGS,
GAP_ADTYPE_FLAGS_GENERAL | GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED
};