您好:
使用CC2652R1测试central工程,使一直处于扫描状态,出现死机。
修改内容为:在static void SimpleCentral_init(void)函数的最后一句添加GapScan_enable(0, 0, 0);。其他没有修改任何地方。
死机时出现的现象为:
请问这是什么原因,谢谢。
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.
您好:
使用CC2652R1测试central工程,使一直处于扫描状态,出现死机。
修改内容为:在static void SimpleCentral_init(void)函数的最后一句添加GapScan_enable(0, 0, 0);。其他没有修改任何地方。
死机时出现的现象为:
请问这是什么原因,谢谢。
看下关于这个函数的说明, 注意duration 持续时间应为大于GapScan_setPhyParams设置的扫描间隔时间
,设为0就会出现问题
/** * Start scanning. * * If duration is zero period shall be ignored and the scanner will continue * scanning until @ref GapScan_disable is called. * If period is zero and duration is non-zero, the scanner will scan once * until duration has expired or @ref GapScan_disable is called. * If both the duration and period are non-zero, the scanner will continue * scanning periodically until @ref GapScan_disable() is called. * * @param period - Scan period. Ignored if duration is zero. 1.28 sec unit. * Range: 0x00-0xffff, where 0x00 is continuously scanning. * @param duration - Scan duration. 10 ms unit. The time of duration shall be * greater than the time of scan interval set by @ref GapScan_setPhyParams. * Range: 0x00-0xffff, where 0x00 is continuously scanning. * @param maxNumReport - If non-zero, the list of advertising reports (the number * of which is up to maxNumReport) will be generated and come with * @ref GAP_EVT_SCAN_DISABLED. * * @return @ref SUCCESS * @return @ref bleNotReady * @return @ref bleInvalidRange * @return @ref bleMemAllocError * @return @ref bleAlreadyInRequestedMode * @return @ref bleIncorrectMode */ status_t GapScan_enable(uint16_t period, uint16_t duration, uint8_t maxNumReport);
我想用multirole主从一体这个工程,能够连接上一次连接的从机,并且能够连接2个从机。直接可以用multirole这个工程就能实现吗?
换个方法试试,主机扫描结束后,应用层任务会收到响应的事件通知,你可以在这个事件通知的处理中重新开启扫描,这样就实现了循环扫描了,不过扫描功耗很高,不同于从机的广播。