User data length when proto = binary

traderlopez
Posts: 20
Joined: Thu Sep 22, 2016 12:55 pm

User data length when proto = binary

Postby traderlopez » Thu Oct 13, 2016 5:32 pm

Maybe a little bug, and a question. Thanks in advance for your support.

I send binary data from server to device in the mesh. Header length is 16, total length 18.

When I use espconn_mesh_get_usr_data, reported user data length is 1 instead of 2. Returned pointer for data is pointing to 17th byte (&buffer[16]), which seems correct, but the length should be 2.

I want to know as well if this function is using any dynamic allocation to return the buffer for user data, or just positions the user data pointer where the user data starts.


This is an example of the information being sent towards a node in the mesh:

sending:
40 11 11 00 5c cf 7f c1 0b 64 c0 a8 00 64 58 1b 60 3e


Thanks very much.
Francisco Lopez.

ESP_Alen

Re: User data length when proto = binary

Postby ESP_Alen » Fri Oct 14, 2016 10:14 am

traderlopez wrote:Maybe a little bug, and a question. Thanks in advance for your support.

I send binary data from server to device in the mesh. Header length is 16, total length 18.

When I use espconn_mesh_get_usr_data, reported user data length is 1 instead of 2. Returned pointer for data is pointing to 17th byte (&buffer[16]), which seems correct, but the length should be 2.

I want to know as well if this function is using any dynamic allocation to return the buffer for user data, or just positions the user data pointer where the user data starts.


This is an example of the information being sent towards a node in the mesh:

sending:
40 11 11 00 5c cf 7f c1 0b 64 c0 a8 00 64 58 1b 60 3e


Thanks very much.
Francisco Lopez.


1. the total length in mesh packet header is 0x0011, so the data length is 1.
40 11 11 00 5c cf 7f c1 0b 64 c0 a8 00 64 58 1b 60 3e
2. the function just positions the user data pointer where the user data starts.

traderlopez
Posts: 20
Joined: Thu Sep 22, 2016 12:55 pm

Re: User data length when proto = binary

Postby traderlopez » Mon Oct 17, 2016 7:48 pm

I'm not sure where I messed up the computation right now, I'll review it once again. It seems very obvious now that 0x11 - 0x10 (16) is 1, so the reported length is perfect.

Thanks very much for your support, Alen.

ESP_Alen

Re: User data length when proto = binary

Postby ESP_Alen » Tue Oct 18, 2016 3:50 pm

traderlopez wrote:I'm not sure where I messed up the computation right now, I'll review it once again. It seems very obvious now that 0x11 - 0x10 (16) is 1, so the reported length is perfect.

Thanks very much for your support, Alen.


Welcome.

Who is online

Users browsing this forum: No registered users and 59 guests