Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[npl] ble_npl_eventq_remove() 函数隐患 #18

Open
Jackistang opened this issue May 24, 2022 · 0 comments
Open

[npl] ble_npl_eventq_remove() 函数隐患 #18

Jackistang opened this issue May 24, 2022 · 0 comments

Comments

@Jackistang
Copy link

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 里都有应用:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant