Espressif ESP32-S2 Programming Manual page 211

Table of Contents

Advertisement

Chapter 2. API Reference
esp_err_t
esp_netif_set_driver_config(esp_netif_t
Configures driver related options of esp_netif object.
Return
• ESP_OK on success
• ESP_ERR_ESP_NETIF_INVALID_PARAMS if invalid parameters provided
Parameters
• [inout] esp_netif: pointer to the object to be configured
• [in] driver_config: pointer esp-netif io driver related configuration
esp_err_t
esp_netif_attach(esp_netif_t *esp_netif, esp_netif_iodriver_handle driver_handle)
Attaches esp_netif instance to the io driver handle.
Calling this function enables connecting specific esp_netif object with already initialized io driver to update
esp_netif object with driver specific configuration (i.e. calls post_attach callback, which typically sets io driver
callbacks to esp_netif instance and starts the driver)
Return
• ESP_OK on success
• ESP_ERR_ESP_NETIF_DRIVER_ATTACH_FAILED if driver's pot_attach callback failed
Parameters
• [inout] esp_netif: pointer to esp_netif object to be attached
• [in] driver_handle: pointer to the driver handle
esp_err_t
esp_netif_receive(esp_netif_t *esp_netif, void *buffer, size_t len, void *eb)
Passes the raw packets from communication media to the appropriate TCP/IP stack.
This function is called from the configured (peripheral) driver layer. The data are then forwarded as frames to
the TCP/IP stack.
Return
• ESP_OK
Parameters
• [in] esp_netif: Handle to esp-netif instance
• [in] buffer: Received data
• [in] len: Length of the data frame
• [in] eb: Pointer to internal buffer (used in Wi-Fi driver)
void esp_netif_action_start(void *esp_netif,
Default building block for network interface action upon IO driver start event Creates network interface, if
AUTOUP enabled turns the interface on, if DHCPS enabled starts dhcp server.
Note This API can be directly used as event handler
Parameters
• [in] esp_netif: Handle to esp-netif instance
• base:
• event_id:
• data:
void esp_netif_action_stop(void *esp_netif,
Default building block for network interface action upon IO driver stop event.
Note This API can be directly used as event handler
Parameters
• [in] esp_netif: Handle to esp-netif instance
• base:
• event_id:
• data:
void esp_netif_action_connected(void *esp_netif,
Default building block for network interface action upon IO driver connected event.
Note This API can be directly used as event handler
Espressif Systems
esp_netif_driver_ifconfig_t *driver_config)
esp_event_base_t
esp_event_base_t
esp_event_base_t
*data)
200
Submit Document Feedback
*esp_netif,
base, int32_t event_id, void *data)
base, int32_t event_id, void *data)
base, int32_t event_id, void
const
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