PL::EspNetworkInterface class
-
class EspNetworkInterface : public virtual PL::NetworkInterface
Internal ESP network interface class.
Subclassed by PL::EspWiFiStation
Public Functions
-
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
-
virtual bool IsConnected() = 0
Checks if the network interface is connected.
- Returns:
true if the network interface is connected
-
virtual esp_err_t Initialize() = 0
Initializes the hardware interface.
- Returns:
error code
-
virtual esp_err_t Enable() = 0
Enables the hardware interface.
- Returns:
error code
-
virtual esp_err_t Disable() = 0
Disables the hardware interface.
- Returns:
error code
-
virtual bool IsEnabled() = 0
Checks if the hardware interface is enabled.
- Returns:
true if the hardware interface is enabled
-
std::string GetName()
Gets the hardware interface name.
- Returns:
name
-
void SetName(const std::string &name)
Sets the hardware interface name.
- Parameters:
name –
-
virtual esp_err_t Lock(TickType_t timeout = portMAX_DELAY) = 0
Locks the object.
- Parameters:
timeout – timeout in FreeRTOS ticks
- Returns:
error code
-
virtual esp_err_t Unlock() = 0
Unlocks the object.
- Returns:
error code
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
-
virtual esp_err_t EnableIpV4DhcpClient() override