Chapter 2. API Reference
• ESP_ERR_WIFI_ARG
• ESP_ERR_WIFI_FAIL
Parameters
• [out] ap_record: pointer to one AP record
• [out] buffer: pointer to the mesh networking IE of this AP
esp_err_t esp_mesh_flush_upstream_packets(void)
Flush upstream packets pending in to_parent queue and to_parent_p2p queue.
Return
• ESP_OK
esp_err_t esp_mesh_get_subnet_nodes_num(const mesh_addr_t *child_mac, int *nodes_num)
Get the number of nodes in the subnet of a specific child.
Return
• ESP_OK
• ESP_ERR_MESH_NOT_START
• ESP_ERR_MESH_ARGUMENT
Parameters
• [in] child_mac: an associated child address of this device
• [out] nodes_num: pointer to the number of nodes in the subnet of a specific child
esp_err_t esp_mesh_get_subnet_nodes_list(const mesh_addr_t *child_mac, mesh_addr_t
*nodes, int nodes_num)
Get nodes in the subnet of a specific child.
Return
• ESP_OK
• ESP_ERR_MESH_NOT_START
• ESP_ERR_MESH_ARGUMENT
Parameters
• [in] child_mac: an associated child address of this device
• [out] nodes: pointer to nodes in the subnet of a specific child
• [in] nodes_num: the number of nodes in the subnet of a specific child
esp_err_t esp_mesh_disconnect(void)
Disconnect from current parent.
Return
• ESP_OK
esp_err_t esp_mesh_connect(void)
Connect to current parent.
Return
• ESP_OK
esp_err_t esp_mesh_flush_scan_result(void)
Flush scan result.
Return
• ESP_OK
esp_err_t esp_mesh_switch_channel(const uint8_t *new_bssid, int csa_newchan, int csa_count)
Cause the root device to add Channel Switch Announcement Element (CSA IE) to beacon.
• Set the new channel
• Set how many beacons with CSA IE will be sent before changing a new channel
• Enable the channel switch function
Attention This API is only called by the root.
Return
• ESP_OK
Parameters
• [in] new_bssid: the new router BSSID if the router changes
Espressif Systems 152
Submit Document Feedback
Release v4.4