在keyfobdemo例程中peripheral在广播状态的时候,灯会不停的闪。当与btool处于establish的时候,灯就会灭掉;当从establish状态到terminate时peripheral又会处于广播状态,灯又会开始闪。
在keyfobdemo例程中peripheral在广播状态的时候,灯会不停的闪。当与btool处于establish的时候,灯就会灭掉;当从establish状态到terminate时peripheral又会处于广播状态,灯又会开始闪。
这个灯闪烁的代码又在那里,被封装了吗。。。
看 peripheralStateNotificationCB函数中的GAPROLE_ADVERTISING和GAPROLE_CONNECTED事件中有Led的处理。
case GAPROLE_ADVERTISING:
{
// Visual feedback that we are advertising.
HalLedSet( HAL_LED_2, HAL_LED_MODE_ON );
}
break;
//if the state changed to connected, initially assume that keyfob is in range
case GAPROLE_CONNECTED:
{
// set the proximity state to either path loss alert or in range depending
// on the value of keyfobProxIMAlertLevel (which was set by proximity monitor)
if( keyfobProxIMAlertLevel != PP_ALERT_LEVEL_NO )
{
keyfobProximityState = KEYFOB_PROXSTATE_PATH_LOSS;
// perform alert
keyfobapp_PerformAlert();
buzzer_beep_count = 0;
}
else // if keyfobProxIMAlertLevel == PP_ALERT_LEVEL_NO
{
keyfobProximityState = KEYFOB_PROXSTATE_CONNECTED_IN_RANGE;
keyfobapp_StopAlert();
}
GAPRole_GetParameter( GAPROLE_CONNHANDLE, &connHandle );
#if defined ( PLUS_BROADCASTER )
osal_start_timerEx( keyfobapp_TaskID, KFD_ADV_IN_CONNECTION_EVT, ADV_IN_CONN_WAIT );
#endif
// Turn off LED that shows we're advertising
HalLedSet( HAL_LED_2, HAL_LED_MODE_OFF );
}
break;
为什么我把里面所有 HalLedSet()都注释掉了,开发板的灯还是依然没有任何改变,还是原程序一样。是不是真的被封装了?