Ethernet::Service Class Referenceabstract

Abstract Service class. More...

#include <Ethernet.h>

Inheritance diagram for Ethernet::Service:
Collaboration diagram for Ethernet::Service:

Public Member Functions

virtual void end ()=0
 Tear down the ethernet connection. More...
 
virtual MacAddress getMacAddress () const =0
 Get MAC address. More...
 
virtual bool setMacAddress (const MacAddress &addr)=0
 Set MAC address. More...
 
virtual bool setSpeed (Speed speed)=0
 Set speed of MAC. More...
 
virtual bool setFullDuplex (bool enable)=0
 Set duplex mode of MAC. More...
 
virtual bool setLinkState (bool up)=0
 Set link status of MAC. More...
 
virtual bool setPromiscuous (bool enable)=0
 Set MAC promiscuous mode. More...
 
virtual void setHostname (const String &hostname)=0
 Set DHCP hostname. More...
 
virtual String getHostname () const =0
 Get DHCP hostname. More...
 
virtual IpAddress getIP () const =0
 Get current IP address. More...
 
virtual bool setIP (IpAddress address, IpAddress netmask, IpAddress gateway)=0
 Set static IP address. More...
 
virtual bool isEnabledDHCP () const =0
 Determine if DHCP is active for this interface. More...
 
virtual bool enableDHCP (bool enable)=0
 Enable/disable DHCP on this interface. More...
 
void onEvent (EventDelegate callback)
 Set callback for ethernet events. More...
 
void onGotIp (GotIpDelegate callback)
 Set callback for 'station connected with IP address' event. More...
 

Protected Attributes

EventDelegate eventCallback
 
GotIpDelegate gotIpCallback
 

Detailed Description

Abstract Service class.

Provides a common implementation for TCP/IP ethernet support.

An Ethernet interface requires a MAC layer plus PHY.

The ESP32, for example, contains a MAC but requires an external PHY. Other solutions, such as the W5500, contain MAC+PHY and require the correct PhyFactory to work.

Ethernet implementations should provide appropriate setup methods which are called by the application before invoking begin().

Member Function Documentation

◆ enableDHCP()

virtual bool Ethernet::Service::enableDHCP ( bool  enable)
pure virtual

Enable/disable DHCP on this interface.

Implemented in Ethernet::IdfService.

◆ end()

virtual void Ethernet::Service::end ( )
pure virtual

Tear down the ethernet connection.

Implemented in Ethernet::IdfService.

◆ getHostname()

virtual String Ethernet::Service::getHostname ( ) const
pure virtual

Get DHCP hostname.

Implemented in Ethernet::IdfService.

◆ getIP()

virtual IpAddress Ethernet::Service::getIP ( ) const
pure virtual

Get current IP address.

Implemented in Ethernet::IdfService.

◆ getMacAddress()

virtual MacAddress Ethernet::Service::getMacAddress ( ) const
pure virtual

Get MAC address.

Implemented in Ethernet::IdfService.

◆ isEnabledDHCP()

virtual bool Ethernet::Service::isEnabledDHCP ( ) const
pure virtual

Determine if DHCP is active for this interface.

Implemented in Ethernet::IdfService.

◆ onEvent()

void Ethernet::Service::onEvent ( EventDelegate  callback)
inline

Set callback for ethernet events.

◆ onGotIp()

void Ethernet::Service::onGotIp ( GotIpDelegate  callback)
inline

Set callback for 'station connected with IP address' event.

◆ setFullDuplex()

virtual bool Ethernet::Service::setFullDuplex ( bool  enable)
pure virtual

Set duplex mode of MAC.

Implemented in Ethernet::IdfService.

◆ setHostname()

virtual void Ethernet::Service::setHostname ( const String hostname)
pure virtual

Set DHCP hostname.

Implemented in Ethernet::IdfService.

◆ setIP()

virtual bool Ethernet::Service::setIP ( IpAddress  address,
IpAddress  netmask,
IpAddress  gateway 
)
pure virtual

Set static IP address.

Implemented in Ethernet::IdfService.

◆ setLinkState()

virtual bool Ethernet::Service::setLinkState ( bool  up)
pure virtual

Set link status of MAC.

Implemented in Ethernet::IdfService.

◆ setMacAddress()

virtual bool Ethernet::Service::setMacAddress ( const MacAddress addr)
pure virtual

Set MAC address.

Implemented in Ethernet::IdfService.

◆ setPromiscuous()

virtual bool Ethernet::Service::setPromiscuous ( bool  enable)
pure virtual

Set MAC promiscuous mode.

Implemented in Ethernet::IdfService.

◆ setSpeed()

virtual bool Ethernet::Service::setSpeed ( Speed  speed)
pure virtual

Set speed of MAC.

Implemented in Ethernet::IdfService.

Member Data Documentation

◆ eventCallback

EventDelegate Ethernet::Service::eventCallback
protected

◆ gotIpCallback

GotIpDelegate Ethernet::Service::gotIpCallback
protected

The documentation for this class was generated from the following file: