User data length when proto = binary
-
- 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.
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.
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.
-
- 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.
Thanks very much for your support, 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
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.