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.

从cc2650开发板port到cc2640模块,为什么搜索设备,搜不了几次就死机了

Other Parts Discussed in Thread: CC2650

void SimpleBLECentral_processRoleEvent(gapPeripheralObserverRoleEvent_t *pEvent)
{
  switch ( pEvent->gap.opcode )
  {
  case GAP_DEVICE_INIT_DONE_EVENT:  
    {
#ifdef DEMO_DEBUG_BUILD       
      LCD_WRITE_STRING(Util_convertBdAddr2Str(pEvent->initDone.devAddr),
                       LCD_PAGE1);
#endif        
    }
    break;
    
  case GAP_DEVICE_INFO_EVENT:
    {
      xx_on_advData(pEvent->deviceInfo.addrType, pEvent->deviceInfo.addr, pEvent->deviceInfo.rssi, 
                         pEvent->deviceInfo.pEvtData, pEvent->deviceInfo.dataLen);
    }
    break;
    
  case GAP_DEVICE_DISCOVERY_EVENT:
    {
      // discovery complete
      xx_agingTimerCb();
      
      //GAPObserverRole_CancelDiscovery(); 
      
      GAPObserverRole_StartDiscovery( DEFAULT_DISCOVERY_MODE,
                                     DEFAULT_DISCOVERY_ACTIVE_SCAN,
                                     DEFAULT_DISCOVERY_WHITE_LIST);      //DEFAULT_DISCOVERY_WHITE_LIST
    }
    break;
    
  default:
    break;
  }
}

程序如上,在cc2650的开发板上都没问题,下载到模块后,如果开启了连续搜索广播,就是不注释GAPObserverRole_StartDiscovery,

没几次设备就会死机

用的PeripheralObserver,这段函数主要是搜索从设备的广播,处理数据。