您好,专家,
设置:
- SDK: simplelink_cc13x2_26x2_SDK_5_30_01_01
- sysconfig: sysconfig_1_10_0
- 设备: LAUNCCHXL-CC1352R1F3
我们正在开发一种sub-GHz协议。 在Rx事件期间,我们需要在 非常特定的时间(对讲机Rx设置后的几毫秒)开始侦听。
因此,Rx过程如下所示:
- 设置频率合成器设置
- 使用 triggerType == trig_never发布Rx命令
- 使用RF_requestAccess为 XMS保留对讲机
- 正在等待 Rx事件
- 在Rx事件中,我们运行RF_runDirectCmd以执行挂起命令
A)在单 协议模式下一切正常(禁用BLE)。 但是,当启用BLE时,我注意到系统仅在BLE在 3)和5之间调用RF_scheduleCmd时挂起
事实上:
/* * ==================== RF_scheduleCmd ============================ * Process request to schedule new command from a particular client */ RF_CmdHandle RF_scheduleCmd(RF_Handle h, RF_Op* pOp, RF_ScheduleCmdParams *pSchParams, RF_Callback pCb, RF_EventMask bmEvent) { ... /* If client h2 already has, reject any new commands from h. */ if (h2 && (ClockP_isActive(&h2->state.clkReqAccess))) { /* Set the status value to schedule_error if we could not allocate space. */ cmdHandle = (RF_CmdHandle) RF_ScheduleStatusError; /* Store the reason and the handle why the callback is being invoked. */ RF_Sch.issueRadioFreeCbFlags |= RF_RADIOFREECB_CMDREJECT_FLAG; RF_Sch.clientHndRadioFreeCb = h; /* ISSUE: 1) The radio is reserved by our sub-GHz protocol with RF_requestAccess * 2) But as soon as RF_scheduleCmd returns 'RF_ScheduleStatusError', * the BLE tries again by calling RF_ratDisableChannel following by RF_scheduleCmd */ } else { ... } ... }
b)此外,如果保留对讲机,BLE将呼叫 RF_ratDisableChannel 以放弃 我们的待处理命令:
/* * ======== RF_ratDisableChannel ======== * Disable RAT channel */ RF_Stat RF_ratDisableChannel(RF_Handle h, RF_RatHandle ratHandle) { ... /* If the provided handler is valid. */ if (ratCh && ratCh->status && (ratCh->pClient == h)) { /* If the RF core is active, abort the RAT event. */ if (RF_core.status == RF_CoreStatusActive) { /* Calculate the configuration field of command (the channel we disable). */ uint16_t config = (uint16_t)(RF_RAT_CH_LOWEST + ratCh->handle) << RF_SHIFT_8_BITS; /* Disable the channel within the RF core. It has been checked that RAT channel to be disabled is owned by the input handle h. Call the function that executes the disabling with RF_currClient as input argument in instead of h in order to force the function to accept the disable request. This is required in the case where the client that will disable a RAT channel is not the same client as currently controlling the radio. */ /* * ISSUE: If the previous BLE command was graceffuly rejected, our pending command is disabled here! */ status = RF_runDirectImmediateCmd(RF_currClient, ((uint32_t)CMDR_DIR_CMD_2BYTE(CMD_DISABLE_RAT_CH, config)), NULL); ... } } } }
因此,当发生以下特定序列时,系统会崩溃:
- 设置频率合成器设置
- 使用 triggerType = trig_never发布Rx命令
- 使用 RF_requestAccess将对讲机保留 X毫秒
- 等待接收Rx事件~(X-1) ms后
- BLE 尝试使用 RF_scheduleCmd计划其命令,但这在逻辑上被拒绝(请求对讲机访问)
- BLE调用 RF_ratDisableChannel ,以在 不通知命令所有者的情况下放弃挂起命令。
- 在Rx事件中,我们使用无效的命令句柄运行RF_runDirectCmd (因为该命令不再存在)
问题:
1)能否通过特别检查 RF_scheduleCmd错误代码的处理方式来确认BLE堆栈行为?
2)由于即使在使用DMMSch_setBlockModeOn (DMMPolicy_StackRole_BlePeripheral)暂停BLE时也会发生此行为; 在短时间内或在执行trig_never命令之前阻止任何BLE无线电访问的最佳方法是什么?
3) 为何在正确拒绝BLE命令时,BLE会调用RF_ratDisableChannel? 是否有办法避免这种情况发生,最终使用DMM/BLE堆栈配置?
4)我们如何知道我们的命令已被 RF_ratDisableChannel丢弃?
谢谢!