What does layer2_cap do?

JJ_Bras
Posts: 3
Joined: Wed Dec 01, 2021 1:30 pm

What does layer2_cap do?

Postby JJ_Bras » Thu Oct 03, 2024 7:27 pm

Hi everyone,

I'm working with eps-idf 5.3 and I'm using the manual_network example from examples folder. It's working perfectly, but I don´t understood what's the layer2_cap member from mesh_assoc_t struct, It's used to meet a valid root to connect.

Code: Select all

            if (assoc.mesh_type != MESH_IDLE &&
                assoc.layer_cap && 
                assoc.assoc < assoc.assoc_cap && 
                record.rssi > -70) 
            {
                if (assoc.layer < parent_assoc.layer || 
                    assoc.layer2_cap < parent_assoc.layer2_cap) 
                {
                    parent_found = true;
                    memcpy(&parent_record, &record, sizeof(record));
                    memcpy(&parent_assoc, &assoc, sizeof(assoc));
                    if (parent_assoc.layer_cap != 1) {
                        my_type = MESH_NODE;
                    } else {
                        my_type = MESH_LEAF;
                    }
                    my_layer = parent_assoc.layer + 1;
                    break;
                }
            }

Who is online

Users browsing this forum: No registered users and 15 guests