Network Tunnel API¶
Brief Description UART-based IP tunnel network interface for QEMU simulator. Provides a lwIP network interface that tunnels IP packets over UART1, enabling full TCP/IP stack functionality in QEMU without network device emulation. Key features:
Architecture:
|
Configuration Structure¶
Configuration for UART tunnel network interface. Definition: typedef struct {
const char* hostname;
uint8_t ip_addr[4];
uint8_t netmask[4];
uint8_t gateway[4];
} netif_uart_tunnel_config_t;
Fields:
|
Lifecycle Functions¶
Initialize UART tunnel network interface. Creates and configures a lwIP network interface that tunnels IP packets over UART1. Starts a background task to handle packet reception from UART. Signature: esp_err_t netif_uart_tunnel_init(const netif_uart_tunnel_config_t *config);
Parameters:
Returns:
Note Thread-safe. Only call once; subsequent calls return ESP_ERR_INVALID_STATE. |
Deinitialize UART tunnel network interface. Stops the receive task and cleans up resources. Active network connections will be closed by lwIP stack. Signature: esp_err_t netif_uart_tunnel_deinit(void);
Parameters:
Returns:
Note Thread-safe. Idempotent after first call. All active TCP/UDP connections will be terminated. |
Get the esp_netif handle for the UART tunnel interface. Useful for registering event handlers or querying interface status. Signature: esp_netif_t* netif_uart_tunnel_get_handle(void);
Parameters:
Returns:
Note Thread-safe. Handle remains valid until deinit is called. |