This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
看 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;