Function esp_idf_svc::sys::esp_mesh_recv
source · pub unsafe extern "C" fn esp_mesh_recv(
from: *mut mesh_addr_t,
data: *mut mesh_data_t,
timeout_ms: i32,
flag: *mut i32,
opt: *mut mesh_opt_t,
opt_count: i32,
) -> i32
Expand description
@brief Receive a packet targeted to self over the mesh network
@attention Mesh RX queue should be checked regularly to avoid running out of memory. - Use esp_mesh_get_rx_pending() to check the number of packets available in the queue waiting to be received by applications.
@param[out] from the address of the original source of the packet @param[out] data pointer to the received mesh packet - Field proto is the data protocol in use. Should follow it to parse the received data. - Field tos is the transmission tos (type of service) in use. @param[in] timeout_ms wait time if a packet isn’t immediately available (0:no wait, portMAX_DELAY:wait forever) @param[out] flag bitmap for data received - MESH_DATA_FROMDS represents data from external IP network - MESH_DATA_TODS represents data directed upward within the mesh network
flag could be MESH_DATA_FROMDS or MESH_DATA_TODS.
@param[out] opt options desired to receive - MESH_OPT_RECV_DS_ADDR attaches the DS address @param[in] opt_count option count desired to receive - Currently, this API only takes one option, so opt_count is only supported to be 1.
@return
- ESP_OK
- ESP_ERR_MESH_ARGUMENT
- ESP_ERR_MESH_NOT_START
- ESP_ERR_MESH_TIMEOUT
- ESP_ERR_MESH_DISCARD