CC2640 SimpleBLEPeripheralObserver
cc2640 SimpleBLEPeripheralObserver工程中
在event中(如SBP_PERIODIC_EVT)调用
uint8_t initialAdvertEnable = TRUE; //实测peripheralobserver工程中,在event中开关广播,程序跑死。
GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED, sizeof(uint8_t),&initialAdvertEnable);
程序跑死?再也进不了该event?
论坛有类似讨论,解答请看这边: https://e2e.ti.com/support/wireless_connectivity/bluetooth_low_energy/f/538/p/499008/1806987#pi239031350=1
貌似问题并没有解决啊。。。?我现在代码如下: 切换一次后就再也进不了这个event了。 把GAPRole_GetParameter(GAPROLE_ADVERT_ENABLED, &adv_status);注释掉后又恢复正常。
if (events & SBP_PERIODIC_EVT)
{
..............
uint8_t adv_status;
GAPRole_GetParameter(GAPROLE_ADVERT_ENABLED, &adv_status);
if(adv_status)
{
adv_status = FALSE;
GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED, sizeof(uint8_t), &adv_status);
}
else
{
adv_status = TRUE;
GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED, sizeof(uint8_t), &adv_status);
}
...............
}