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

mwifi_root_write return MDF_OK instead of error code #72

Open
BartoszKubiak opened this issue Jul 25, 2019 · 2 comments
Open

mwifi_root_write return MDF_OK instead of error code #72

BartoszKubiak opened this issue Jul 25, 2019 · 2 comments

Comments

@BartoszKubiak
Copy link
Contributor

MDF to v1.0-beta1-2-gc1cc50f
If I use mwifi_root_write() with MAC that doesn't exist and MWIFI_COMMUNICATE_MULTICAST, it still return MDF_OK instead of ESP_ERR_MESH_NO_ROUTE_FOUND

source code:

	...
        mwifi_data.group = false;
        mwifi_data.communicate = MWIFI_COMMUNICATE_MULTICAST;
      	...	
        MDF_LOGI("root write: %.*s to " MACSTR, recv_length, data, MAC2STR(addr_list));
        ret = mwifi_root_write(addr_list, addrs_num, &mwifi_data, data, recv_length, true);
        if (ret != MDF_OK)
        {
            MDF_LOGE("<%s> mwifi_root_write", mdf_err_to_name(ret));
        } else
	{
            MDF_LOGI("<%s> mwifi_root_write", mdf_err_to_name(ret));
	}

result:
I (8060) [UART2MESH, 466]: root write: {"request":"introduce"} to 30:ae:a4:cc:4d:40
W (8061) [mwifi, 552]: <ESP_ERR_MESH_NO_ROUTE_FOUND> Node failed to send packets, dest_addr: 30:ae:a4:cc:4d:40, flag: 0x22, opt->type: 0x08, opt->len: 13, data->tos: 0, data: 0x3ffba524, size: 23
W (8076) [mwifi, 681]: <ESP_ERR_MESH_NO_ROUTE_FOUND> Root node failed to send packets, dest_mac: 30:ae:a4:cc:4d:40
I (8087) [UART2MESH, 473]: <MDF_OK> mwifi_root_write

reason:
mwifi_transmit_write() at the end returns always MDF_OK instead of ret, so mwifi_root_write() also returns MDF_OK

after fixing mwifi_transmit_write():
I (10735) [UART2MESH, 466]: root write: {"request":"introduce"} to 30:ae:a4:cc:4d:45
W (10737) [mwifi, 552]: <ESP_ERR_MESH_NO_ROUTE_FOUND> Node failed to send packets, dest_addr: 30:ae:a4:cc:4d:45, flag: 0x22, opt->type: 0x08, opt->len: 13, data->tos: 0, data: 0x3ffba524, size: 23
W (10751) [mwifi, 681]: <ESP_ERR_MESH_NO_ROUTE_FOUND> Root node failed to send packets, dest_mac: 30:ae:a4:cc:4d:45
W (10762) [mwifi, 1086]: Mwifi_transmit_write
E (10767) [UART2MESH, 470]: <ESP_ERR_MESH_NO_ROUTE_FOUND> mwifi_root_write

@zhanzhaocheng
Copy link
Collaborator

Thank you very much for your feedback, we will fix it as soon as possible.

wujiangang pushed a commit that referenced this issue Jul 25, 2019
1. mwifi_get_root_status() sometimes returns false even though root is connected #67
2. mwifi_root_write return MDF_OK instead of error code #72
@zhanzhaocheng
Copy link
Collaborator

I have fixed this problem please update esp-mdf verification

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

2 participants