Part Number: CC2541
Hello,
I'm using SimpleBLEBroadcaster project. If I use the standalone project, all works fine, but if I ported it to OAD ImageB project, it stopped after one time sending advertising packet. The code is
HCI_EXT_AdvEventNoticeCmd(beacon_TaskID, SBP_ADV_CB_EVT);
....
uint16 SimpleBLEBroadcaster_ProcessEvent( uint8 task_id, uint16 events )
{
....
if ( events & SBP_ADV_CB_EVT )
{
advComplete = 1;
return ( events ^ SBP_ADV_CB_EVT );
}
if ( events & SBP_PERIODIC_EVT )
{
// Restart timer
if ( SBP_PERIODIC_EVT_PERIOD )
{
osal_start_timerEx( beacon_TaskID, SBP_PERIODIC_EVT, SBP_PERIODIC_EVT_PERIOD );
}
// Perform periodic application task
performPeriodicTask();
return (events ^ SBP_PERIODIC_EVT);
}
....
}
static void performPeriodicTask( void )
{
new_adv_enabled_status = TRUE;
//change the GAP advertisement status to enabled
GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED, sizeof( uint8 ), &new_adv_enabled_status);
....
if(advComplete) // <- this flag is 0 always
{
advComplete = 0;
....
}
}
So I have two problem:
1. After change the GAP advertisement status to enabled device send only one packet;
2. SBP_ADV_CB_EVT event is not appear.
Can anyone explain what is wrong?
Thanks,
Alex.