2.10.1. esp_wifi_softap — Espressif WiFi SoftAP

This module is a wrapper for the Espressif WiFi SoftAP interface.


Source code: src/drivers/esp_wifi/softap.h, src/drivers/esp_wifi/softap.c

Test code: tst/drivers/esp_wifi/softap/main.c


Functions

int esp_wifi_softap_init(const char *ssid_p, const char *password_p)

Initialize the WiFi SoftAP interface.

Return
zero(0) or negative error code.
Parameters
  • ssid_p: SSID of the SoftAP.
  • password_p: Password of SoftAP.

int esp_wifi_softap_set_ip_info(const struct inet_if_ip_info_t *info_p)

Set the ip address, netmask and gateway of the WiFi SoftAP.

Return
zero(0) or negative error code.

int esp_wifi_softap_get_ip_info(struct inet_if_ip_info_t *info_p)

Get the SoftAP ip address, netmask and gateway.

Return
zero(0) or negative error code.
Parameters
  • info_p: Read ip information.

int esp_wifi_softap_get_number_of_connected_stations(void)

Get the number of stations connected to the SoftAP.

Return
Number of conencted stations.

int esp_wifi_softap_get_station_info(struct esp_wifi_softap_station_info_t *info_p, int length)

Get the information of stations connected to the SoftAP, including MAC and IP addresses.

Return
Number of valid station information entries or negative error code.
Parameters
  • info_p: An array to write the station information to.
  • length: Length of the info array.

int esp_wifi_softap_dhcp_server_start(void)

Enable the SoftAP DHCP server.

Return
zero(0) or negative error code.

int esp_wifi_softap_dhcp_server_stop(void)

Disable the SoftAP DHCP server. The DHCP server is enabled by default.

Return
zero(0) or negative error code.

enum esp_wifi_dhcp_status_t esp_wifi_softap_dhcp_server_status(void)

Get the SoftAP DHCP server status.

Return
DHCP server status.

struct
#include <softap.h>

Public Members

uint8_t esp_wifi_softap_station_info_t::bssid[6]
struct inet_ip_addr_t esp_wifi_softap_station_info_t::ip_address