Espressif ESP32-S2 Programming Manual page 162

Table of Contents

Advertisement

Chapter 2. API Reference
esp_err_t
esp_mesh_fix_root(bool enable)
Enable network Fixed Root Setting.
• Enabling fixed root disables automatic election of the root node via voting.
• All devices in the network shall use the same Fixed Root Setting (enabled or disabled).
• If Fixed Root is enabled, users should make sure a root node is designated for the network.
Return
• ESP_OK
Parameters
• [in] enable: enable or not
bool esp_mesh_is_root_fixed(void)
Check whether network Fixed Root Setting is enabled.
• Enable/disable network Fixed Root Setting by API esp_mesh_fix_root().
• Network Fixed Root Setting also changes with the "flag"value in parent networking IE.
Return true/false
esp_err_t
esp_mesh_set_parent(const
Set a specified parent for the device.
Attention This API can be called at any time after mesh is configured.
Return
• ESP_OK
• ESP_ERR_ARGUMENT
• ESP_ERR_MESH_NOT_CONFIG
Parameters
• [in] parent: parent configuration, the SSID and the channel of the parent are mandatory.
– If the BSSID is set, make sure that the SSID and BSSID represent the same parent, otherwise
the device will never find this specified parent.
• [in] parent_mesh_id: parent mesh ID,
– If this value is not set, the original mesh ID is used.
• [in] my_type: mesh type
– MESH_STA is not supported.
– If the parent set for the device is the same as the router in the network configuration, then
my_type shall set MESH_ROOT and my_layer shall set MESH_ROOT_LAYER.
• [in] my_layer: mesh layer
– my_layer of the device may change after joining the network.
– If my_type is set MESH_NODE, my_layer shall be greater than MESH_ROOT_LAYER.
– If my_type is set MESH_LEAF, the device becomes a standalone Wi-Fi station and no longer
has the ability to extend the network.
esp_err_t
esp_mesh_scan_get_ap_ie_len(int *len)
Get mesh networking IE length of one AP.
Return
• ESP_OK
• ESP_ERR_WIFI_NOT_INIT
• ESP_ERR_WIFI_ARG
• ESP_ERR_WIFI_FAIL
Parameters
• [out] len: mesh networking IE length
esp_err_t esp_mesh_scan_get_ap_record(wifi_ap_record_t
Get AP record.
Attention Different from esp_wifi_scan_get_ap_records(), this API only gets one of APs scanned each time.
See "manual_networking"example.
Return
• ESP_OK
• ESP_ERR_WIFI_NOT_INIT
Espressif Systems
wifi_config_t
*parent_mesh_id,
mesh_type_t
151
Submit Document Feedback
*parent,
const
mesh_addr_t
my_type, int my_layer)
*ap_record, void *buffer)
Release v4.4

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ESP32-S2 and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents

Save PDF