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.

CC2652R: 开启广播扫描后,运行异常

Part Number: CC2652R

您好,我想请求帮助。使用simple_central_CC26X2R1_LAUNCHXL_tirtos7_ticlang开发时,原始的程序是通过按钮操作,选择”Discover Devices“调用”SimpleCentral_doDiscoverDevices“,我想通过任务方式打开,于是在设备运行一段时间后在任务中直接执行SimpleCentral_doDiscoverDevices(0);,出现异常,进入ICall_abort-->while(j);

  • 我查看了英文论坛下的说明,https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/759422/cc2640r2f-failed-to-re-enable-scan-in-simplecentral-project/2805169?tisearch=e2e-sitesearch&keymatch=GapScan_enable#2805169

    但是在最后里面的说明没有看懂,我也尝试使用定时器回调或者任务回调,依然出现相同异常

  • 您好,

    收到您的问题了,我们升级到英文论坛给工程师看下,有答复尽快给到您。

  • 您好,

    您使用的方法应该是不正确的。 建议您可以再看一下SimpleLink Academy培训和用户指南,以便更熟悉堆栈和IT工作方式。

    一般来说,当接收到事件gap_device_init_done_event时,可以使用函数GapScan_enable()使能扫描。

    您可以查看工程师为您编写的以下代码:

    static void SimpleCentral_processGapMsg(gapEventHdr_t *pMsg)
    {
      switch (pMsg->opcode)
      {
        case GAP_DEVICE_INIT_DONE_EVENT:
        {
          // ...
    
          // Start scanning
          GapScan_enable(0, DEFAULT_SCAN_DURATION, DEFAULT_MAX_SCAN_RES);
          
          break;
        }
        
        // ...
      }
    }