Loom_Ethernet class

InternetPlat built off of SSLClient running over an Ethernet Featherwing.

Base classes

class LoomInternetPlat
Abstract internet communication module.

Protected functions

auto get_client() -> SSLClient& override
Get the underlying SSLClient implementation, which we will use for all of the other requests.

Protected variables

SSLClient m_client
Underlying Ethernet SSLclient instance.
byte m_mac
The Ethernet MAC address.
IPAddress m_ip
The devices IP address.
bool m_is_connected
Whether or not ethernet initialized successfully.

CONSTRUCTORS / DESTRUCTOR

Loom_Ethernet(LoomManager* manager, const char* module_name = "Ethernet", const JsonArrayConst mac = JsonArray(), const JsonArrayConst ip = JsonArray())
Constructor.
Loom_Ethernet(LoomManager* manager, JsonArrayConst p)
Constructor that takes Json Array, extracts args and delegates to regular constructor.
~Loom_Ethernet() defaulted virtual
Destructor.

OPERATION

void connect() override
Connect to internet.
auto is_connected() const -> bool override
Whether or not connected to internet.
auto open_socket(const uint port) -> UDPPtr override
Open a UDP socket for sending and recieving incoming data.

Function documentation

Loom_Ethernet::Loom_Ethernet(LoomManager* manager, JsonArrayConst p)

Constructor that takes Json Array, extracts args and delegates to regular constructor.

Parameters
manager
in The array of constuctor args to expand

bool Loom_Ethernet::is_connected() const override

Whether or not connected to internet.

Returns True if connect, false otherwise

UDPPtr Loom_Ethernet::open_socket(const uint port) override

Open a UDP socket for sending and recieving incoming data.

Parameters
port in Port to open socket with
Returns A UDP socket for transmitting and recieving, remember to close the socket when you are done!