Skip to content

接收的消息同时含有期望的字符串和“OK”时,at_echo->__expect_notify还没来得及获取,at_echo->status = AT_ECHO_STATUS_EXPECT;就立马有被任务“at_parser”更新成at_echo->status = AT_ECHO_STATUS_OK; #330

@zhaoxwgit

Description

@zhaoxwgit
    if (at_parse_status == AT_PARSE_STATUS_EXPECT) {
        at_echo->status = AT_ECHO_STATUS_EXPECT;
        if (at_echo->__is_expecting) {
            tos_sem_post(&at_echo->__expect_notify);
        }
    } else if (at_parse_status == AT_PARSE_STATUS_OK) {
        if (!at_echo->__is_expecting) {
        	at_echo->status = AT_ECHO_STATUS_OK;
            tos_sem_post(&at_echo->__status_set_notify);
        }
    } else if (at_parse_status == AT_PARSE_STATUS_FAIL) {
        at_echo->status = AT_ECHO_STATUS_FAIL;
        if (!at_echo->__is_expecting) {
            tos_sem_post(&at_echo->__status_set_notify);
        }
    } else if (at_parse_status == AT_PARSE_STATUS_ERROR) {
        at_echo->status = AT_ECHO_STATUS_ERROR;
        if (!at_echo->__is_expecting) {
            tos_sem_post(&at_echo->__status_set_notify);
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions