I can't understand how this piece of code works.
Does it force the current root node to give up from the online mode and let another one assume as the root node?
Code: Select all
if (espconn_mesh_connect(&g_ser_conn)) {
MESH_DEMO_PRINT("connect err\n");
if (espconn_mesh_is_root())
espconn_mesh_enable(mesh_enable_cb, MESH_LOCAL);
else
espconn_mesh_enable(mesh_enable_cb, MESH_ONLINE);
return;
}
How does MESH_LOCAL differ from MESH_ONLINE when non-root node tries to connect to the mesh?
Thank you!