PL::EspWiFiStation class
-
class EspWiFiStation : public PL::EspNetworkInterface, public PL::WiFiStation
Internal ESP Wi-Fi station class.
Public Functions
-
EspWiFiStation()
Creates an ESP Wi-Fi station.
-
virtual esp_err_t Lock(TickType_t timeout = portMAX_DELAY) override
Locks the object.
- Parameters:
timeout – timeout in FreeRTOS ticks
- Returns:
error code
-
virtual esp_err_t Unlock() override
Unlocks the object.
- Returns:
error code
-
virtual esp_err_t Initialize() override
Initializes the hardware interface.
- Returns:
error code
-
virtual esp_err_t Enable() override
Enables the hardware interface.
- Returns:
error code
-
virtual esp_err_t Disable() override
Disables the hardware interface.
- Returns:
error code
-
virtual bool IsEnabled() override
Checks if the hardware interface is enabled.
- Returns:
true if the hardware interface is enabled
-
virtual bool IsConnected() override
Checks if the network interface is connected.
- Returns:
true if the network interface is connected
-
virtual std::string GetSsid() override
Gets station SSID.
- Returns:
station SSID
-
virtual esp_err_t SetSsid(const std::string &ssid) override
Sets station SSID.
- Parameters:
ssid – station SSID
- Returns:
error code
-
virtual std::string GetPassword() override
Gets station password.
- Returns:
station password
-
virtual esp_err_t SetPassword(const std::string &password) override
Sets station password.
- Parameters:
password – station password
- Returns:
error code
-
virtual esp_err_t EnableIpV4DhcpClient() override
Enables IPv4 DHCP client.
- Returns:
error code
-
virtual esp_err_t DisableIpV4DhcpClient() override
Disables IPv4 DHCP client.
- Returns:
error code
-
virtual esp_err_t EnableIpV6DhcpClient() override
Enables IPv6 DHCP client.
- Returns:
error code
-
virtual esp_err_t DisableIpV6DhcpClient() override
Disables IPv6 DHCP client.
- Returns:
error code
-
virtual bool IsIpV4DhcpClientEnabled() override
Checks if IPv4 DHCP client is enabled.
- Returns:
true if IPv4 DHCP client is enabled
-
virtual bool IsIpV6DhcpClientEnabled() override
Checks if IPv6 DHCP client is enabled.
- Returns:
true if IPv6 DHCP client is enabled
-
virtual IpV4Address GetIpV4Address() override
Gets IPv4 address.
- Returns:
IPv4 address
-
virtual esp_err_t SetIpV4Address(IpV4Address address) override
Sets IPv4 address.
- Parameters:
address – IPv4 address
- Returns:
error code
-
virtual IpV4Address GetIpV4Netmask() override
Gets IPv4 netmask.
- Returns:
IPv4 netmask
-
virtual esp_err_t SetIpV4Netmask(IpV4Address netmask) override
Sets IPv4 netmask.
- Parameters:
netmask – IPv4 netmask
- Returns:
error code
-
virtual IpV4Address GetIpV4Gateway() override
Gets IPv4 gateway.
- Returns:
IPv4 gateway
-
virtual esp_err_t SetIpV4Gateway(IpV4Address gateway) override
Sets IPv4 gateway.
- Parameters:
gateway – IPv4 gateway
- Returns:
error code
-
virtual IpV6Address GetIpV6LinkLocalAddress() override
Gets IPv6 link local address.
- Returns:
IPv6 link local address
-
virtual IpV6Address GetIpV6GlobalAddress() override
Gets IPv6 global address.
- Returns:
IPv6 global address
-
virtual esp_err_t SetIpV6GlobalAddress(IpV6Address address) override
Sets IPv6 global address.
- Parameters:
address – IPv6 global address
- Returns:
error code
-
std::string GetName()
Gets the hardware interface name.
- Returns:
name
-
void SetName(const std::string &name)
Sets the hardware interface name.
- Parameters:
name –
Public Members
-
Event<NetworkInterface> connectedEvent
Network interface connected event.
-
Event<NetworkInterface> disconnectedEvent
Network interface disconnected event.
-
Event<NetworkInterface> gotIpV4AddressEvent
Network interface got IPv4 event.
-
Event<NetworkInterface> lostIpV4AddressEvent
Network interface lost IPv4 event.
-
Event<NetworkInterface> gotIpV6AddressEvent
Network interface got IPv6 event.
-
Event<NetworkInterface> lostIpV6AddressEvent
Network interface lost IPv4 event.
-
Event<HardwareInterface> enabledEvent
hardware interface enabled event
-
Event<HardwareInterface> disabledEvent
hardware interface disabled event
Public Static Attributes
-
static const std::string defaultName
Default hardware interface name.
Protected Functions
-
esp_err_t InitializeNetif(esp_netif_t *netif)
Initializes the interface.
- Parameters:
netif – ESP netif
- Returns:
error code
-
EspWiFiStation()