Chapter 2. API Reference
Parameters
• [in] esp_netif: Handle to esp-netif instance
• [in] ip_info: Store the old IP information for the specified interface
int esp_netif_get_netif_impl_index(esp_netif_t *esp_netif)
Get net interface index from network stack implementation.
Note This index could be used in setsockopt() to bind socket with multicast interface
Return implementation specific index of interface represented with supplied esp_netif
Parameters
• [in] esp_netif: Handle to esp-netif instance
esp_err_t
esp_netif_get_netif_impl_name(esp_netif_t *esp_netif, char *name)
Get net interface name from network stack implementation.
Note This name could be used in setsockopt() to bind socket with appropriate interface
Return
• ESP_OK
• ESP_ERR_ESP_NETIF_INVALID_PARAMS
Parameters
• [in] esp_netif: Handle to esp-netif instance
• [out] name: Interface name as specified in underlying TCP/IP stack. Note that the actual name
will be copied to the specified buffer, which must be allocated to hold maximum interface name size
(6 characters for lwIP)
esp_err_t
esp_netif_dhcps_option(esp_netif_t *esp_netif, esp_netif_dhcp_option_mode_t opt_op,
Set or Get DHCP server option.
Return
• ESP_OK
• ESP_ERR_ESP_NETIF_INVALID_PARAMS
• ESP_ERR_ESP_NETIF_DHCP_ALREADY_STOPPED
• ESP_ERR_ESP_NETIF_DHCP_ALREADY_STARTED
Parameters
• [in] esp_netif: Handle to esp-netif instance
• [in] opt_op: ESP_NETIF_OP_SET to set an option, ESP_NETIF_OP_GET to get an option.
• [in] opt_id: Option index to get or set, must be one of the supported enum values.
• [inout] opt_val: Pointer to the option parameter.
• [in] opt_len: Length of the option parameter.
esp_err_t
esp_netif_dhcpc_option(esp_netif_t *esp_netif, esp_netif_dhcp_option_mode_t opt_op,
Set or Get DHCP client option.
Return
• ESP_OK
• ESP_ERR_ESP_NETIF_INVALID_PARAMS
• ESP_ERR_ESP_NETIF_DHCP_ALREADY_STOPPED
• ESP_ERR_ESP_NETIF_DHCP_ALREADY_STARTED
Parameters
• [in] esp_netif: Handle to esp-netif instance
• [in] opt_op: ESP_NETIF_OP_SET to set an option, ESP_NETIF_OP_GET to get an option.
• [in] opt_id: Option index to get or set, must be one of the supported enum values.
• [inout] opt_val: Pointer to the option parameter.
• [in] opt_len: Length of the option parameter.
esp_err_t
esp_netif_dhcpc_start(esp_netif_t *esp_netif)
Start DHCP client (only if enabled in interface object)
Espressif Systems
esp_netif_dhcp_option_id_t opt_id, void *opt_val, uint32_t
opt_len)
esp_netif_dhcp_option_id_t opt_id, void *opt_val, uint32_t
opt_len)
204
Submit Document Feedback
Release v4.4
Need help?
Do you have a question about the ESP32-S2 and is the answer not in the manual?