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.

CC2541 GAPRole_TerminateConnection调用后有时候会无法进入GAP_LINK_TERMINATED_EVENT

代码如下:

if(events & SBP_BLE_SLEEP_EVT)
{

  SBP_BLE_Sleep_Func();

  return (events ^ SBP_BLE_SLEEP_EVT);
}

void SBP_BLE_Sleep_Func(void)
{
  if(Ble_rf.Ble_EnableSleepFlg != false)
  {
    U8 Adv_Status;
    
    os_env.BLE_statu = 2;
    os_env.lock_Comm_Mone = 4;


    Adv_Status = false;
    GAPRole_SetParameter( GAPROLE_ADVERT_ENABLED, sizeof(U8), &Adv_Status);
    
    GAPRole_TerminateConnection();
    
    Ble_rf.Ble_EnableSleepFlg = false;                      
    osal_stop_timerEx(gu8_simpleBLEPeripheral_TaskID,SBP_BLE_SLEEP_EVT);

  }
}

从机断开后,有时候会出现无法进入GAP_LINK_TERMINATED_EVENT的情况,请问这是为什么呢?