nimble icon indicating copy to clipboard operation
nimble copied to clipboard

[npl] ble_npl_eventq_remove() 函数隐患

Open Jackistang opened this issue 3 years ago • 0 comments

nimble ble_npl_eventq_remove() 函数仅从事件队列里移除某一个事件,而移植实现里复位清空了整个消息队列,这个是有隐患的,可能会导致协议栈工作不正常,需要修改。

void ble_npl_eventq_remove(struct ble_npl_eventq *evq, struct ble_npl_event *ev)
{
    if (!ev->queued)
    {
        return;
    }

    rt_mq_control((struct rt_messagequeue *)evq->q, RT_IPC_CMD_RESET, RT_NULL);
    ev->queued = false;
}

而且这个函数在 controller 和 host 里都有应用:

Jackistang avatar May 24 '22 09:05 Jackistang