广播
1.开启广播
uint8 initial_advertising_enable = TRUE;
GAPRole_SetParameter( GAPROLE_ADVERT_ENABLED, sizeof( uint8 ), &initial_advertising_enable );
然后我们进入到GAPRole_SetParameter中发现,每次进到这个函数里,就会把gapRole_AdvEnabled的值保存到oldAdvEnabled,再把新的状态写到gapRole_AdvEnabled。
uint8 oldAdvEnabled = gapRole_AdvEnabled;
gapRole_AdvEnabled = *((uint8*)pValue);
然后在这个函数中打开广播的情况是
else if ( (oldAdvEnabled == FALSE) && (gapRole_AdvEnabled) )
{
// Turn on Advertising
if ( (gapRole_state == GAPROLE_STARTED)
|| (gapRole_state ==