Function esp_idf_svc::sys::esp_now_send

source ·
pub unsafe extern "C" fn esp_now_send(
    peer_addr: *const u8,
    data: *const u8,
    len: usize,
) -> i32
Expand description

@brief Send ESPNOW data

@attention 1. If peer_addr is not NULL, send data to the peer whose MAC address matches peer_addr @attention 2. If peer_addr is NULL, send data to all of the peers that are added to the peer list @attention 3. The maximum length of data must be less than ESP_NOW_MAX_DATA_LEN @attention 4. The buffer pointed to by data argument does not need to be valid after esp_now_send returns

@param peer_addr peer MAC address @param data data to send @param len length of data

@return - ESP_OK : succeed - ESP_ERR_ESPNOW_NOT_INIT : ESPNOW is not initialized - ESP_ERR_ESPNOW_ARG : invalid argument - ESP_ERR_ESPNOW_INTERNAL : internal error - ESP_ERR_ESPNOW_NO_MEM : out of memory, when this happens, you can delay a while before sending the next data - ESP_ERR_ESPNOW_NOT_FOUND : peer is not found - ESP_ERR_ESPNOW_IF : current Wi-Fi interface doesn’t match that of peer - ESP_ERR_ESPNOW_CHAN: current Wi-Fi channel doesn’t match that of peer