Loom 4 v4.5
Arduino library for Internet of Things Rapid Prototyping in environmental sensing
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
Loom_Ethernet Class Reference

#include <Loom_Ethernet.h>

Inheritance diagram for Loom_Ethernet:
Inheritance graph
[legend]
Collaboration diagram for Loom_Ethernet:
Collaboration graph
[legend]

Public Member Functions

 Loom_Ethernet (Manager &man, uint8_t mac[6], IPAddress ip)
 
 Loom_Ethernet (Manager &man)
 
void loadConfigFromJSON (char *json)
 
void connect ()
 
EthernetClient & getClient ()
 
EthernetUDP * getUDP ()
 
IPAddress getIPAddress ()
 
IPAddress getSubnetMask ()
 
IPAddress getGateway ()
 
IPAddress getBroadcast ()
 
void ipToString (IPAddress ip, char array[16])
 
- Public Member Functions inherited from Module
 Module (const char *modName)
 
void setModuleName (const char *modName)
 
virtual const char * getModuleName ()
 
virtual void printModuleName (const char *message)
 
virtual void initialize ()=0
 
virtual void measure ()=0
 
virtual void package ()=0
 
virtual void power_up ()=0
 
virtual void power_down ()=0
 
virtual void display_data ()
 

Protected Member Functions

void measure () override
 
void package () override
 
void initialize () override
 
void power_up () override
 
void power_down () override
 

Additional Inherited Members

- Public Attributes inherited from Module
bool moduleInitialized = true
 
int module_address = -1
 

Detailed Description

Ethernet driver for loom devices

Author
Will Richards

Constructor & Destructor Documentation

◆ Loom_Ethernet() [1/2]

Loom_Ethernet::Loom_Ethernet ( Manager man,
uint8_t  mac[6],
IPAddress  ip 
)

Construct a new WiFi Manager

Parameters
manReference to the manager to control all aspects of every module
macThe mac address of our device
ipThe IP address we want to use if DHCP isn't active

◆ Loom_Ethernet() [2/2]

Loom_Ethernet::Loom_Ethernet ( Manager man)

Construct a new WiFi manager, passing the credentials in as a json document

Parameters
manReference to the manager
jsonStringJSON string to pull the credentials from

Member Function Documentation

◆ connect()

void Loom_Ethernet::connect ( )

Attempt to connect to the configured network

◆ getBroadcast()

IPAddress Loom_Ethernet::getBroadcast ( )

Get the broadcast IP of the network

◆ getClient()

EthernetClient & Loom_Ethernet::getClient ( )
inline

Returns a reference to the Ethernet Client

Returns
Ethernet client

◆ getGateway()

IPAddress Loom_Ethernet::getGateway ( )

Get the gateway IP of the network

◆ getIPAddress()

IPAddress Loom_Ethernet::getIPAddress ( )

Get the IP address of the Ethernet module

◆ getSubnetMask()

IPAddress Loom_Ethernet::getSubnetMask ( )

Get the subnet mask of the connected network

◆ getUDP()

EthernetUDP * Loom_Ethernet::getUDP ( )
inline

Get a reference to the UDP communication handler

◆ initialize()

void Loom_Ethernet::initialize ( )
overrideprotectedvirtual

Implements Module.

◆ ipToString()

void Loom_Ethernet::ipToString ( IPAddress  ip,
char  array[16] 
)
inline

Convert an IP address to a string

◆ loadConfigFromJSON()

void Loom_Ethernet::loadConfigFromJSON ( char *  json)

Load the Ethernet connection information from JSON

This frees the input parameter

Parameters
jsonStringJSON formatted string containing the mac address and IP

◆ measure()

void Loom_Ethernet::measure ( )
inlineoverrideprotectedvirtual

Implements Module.

◆ package()

void Loom_Ethernet::package ( )
inlineoverrideprotectedvirtual

Implements Module.

◆ power_down()

void Loom_Ethernet::power_down ( )
inlineoverrideprotectedvirtual

Implements Module.

◆ power_up()

void Loom_Ethernet::power_up ( )
inlineoverrideprotectedvirtual

Implements Module.


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