Espressif ESP32-S2 Programming Manual page 143

Table of Contents

Advertisement

Chapter 2. API Reference
• ESP_ERR_ESPNOW_NOT_FOUND : peer is not found
Parameters
• peer_addr: peer MAC address
esp_err_t
esp_now_mod_peer(const
Modify a peer.
Return
• ESP_OK : succeed
• ESP_ERR_ESPNOW_NOT_INIT : ESPNOW is not initialized
• ESP_ERR_ESPNOW_ARG : invalid argument
• ESP_ERR_ESPNOW_FULL : peer list is full
Parameters
• peer: peer information
esp_err_t
esp_now_get_peer(const uint8_t *peer_addr,
Get a peer whose MAC address matches peer_addr from peer list.
Return
• ESP_OK : succeed
• ESP_ERR_ESPNOW_NOT_INIT : ESPNOW is not initialized
• ESP_ERR_ESPNOW_ARG : invalid argument
• ESP_ERR_ESPNOW_NOT_FOUND : peer is not found
Parameters
• peer_addr: peer MAC address
• peer: peer information
esp_err_t
esp_now_fetch_peer(bool from_head,
Fetch a peer from peer list. Only return the peer which address is unicast, for the multicast/broadcast address,
the function will ignore and try to find the next in the peer list.
Return
• ESP_OK : succeed
• ESP_ERR_ESPNOW_NOT_INIT : ESPNOW is not initialized
• ESP_ERR_ESPNOW_ARG : invalid argument
• ESP_ERR_ESPNOW_NOT_FOUND : peer is not found
Parameters
• from_head: fetch from head of list or not
• peer: peer information
bool esp_now_is_peer_exist(const uint8_t *peer_addr)
Peer exists or not.
Return
• true : peer exists
• false : peer not exists
Parameters
• peer_addr: peer MAC address
esp_err_t esp_now_get_peer_num(esp_now_peer_num_t
Get the number of peers.
Return
• ESP_OK : succeed
• ESP_ERR_ESPNOW_NOT_INIT : ESPNOW is not initialized
• ESP_ERR_ESPNOW_ARG : invalid argument
Parameters
• num: number of peers
esp_err_t
esp_now_set_pmk(const uint8_t *pmk)
Set the primary master key.
Attention 1. primary master key is used to encrypt local master key
Return
Espressif Systems
esp_now_peer_info_t
*peer)
esp_now_peer_info_t
esp_now_peer_info_t
*num)
132
Submit Document Feedback
*peer)
*peer)
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?

Table of Contents

Save PDF