Loom_MaxPub class

Module taking in and translating JSON into data understood by the Google Sheets script API.

Base classes

class LoomPublishPlat
Abstract internet publishing module, implementing google sheets and mongodb functionality.

Protected variables

uint16_t UDP_port
Which UDP port to transmit on.
IPAddress remoteIP
Which IP address to send to.
LoomInternetPlat::UDPPtr UDP_Inst
Pointer to UDP object.

CONSTRUCTORS / DESTRUCTOR

Loom_MaxPub(LoomManager* manager, const LoomModule::Type internet_type)
Constructor.
Loom_MaxPub(LoomManager* manager, JsonArrayConst p)
Constructor that takes Json Array, extracts args and delegates to regular constructor.
void second_stage_ctor() override
Second stage construction.
~Loom_MaxPub()
Destructor.

OPERATION

auto dispatch(JsonObject json) -> bool override
Route command to driver.

GETTERS

auto get_port() const -> uint16_t
Get UDP port device is listening on.

SETTERS

void set_port(const uint16_t port)
Set the UDP port to send on.
void set_ip(const IPAddress ip)
Set the IP address to send to.
void set_ip()
Set the IP addres to send to by getting remote IP from MaxSub if available.
auto send_to_internet(const JsonObject json, LoomInternetPlat* plat) -> bool protected override
Send JSON to the internet, assumes that a valid internet plat was found and can be used.

Function documentation

Loom_MaxPub::Loom_MaxPub(LoomManager* manager, const LoomModule::Type internet_type)

Constructor.

Parameters
manager
internet_type in Set(LoomModule::Type) | <7001> | {7001("Ethernet"), 7002("WiFi"), 7003("LTE")} | Code of the desired internet platform.

Loom_MaxPub::Loom_MaxPub(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

void Loom_MaxPub::second_stage_ctor() override

Second stage construction.

Perform any actions that need all of the devices to be initized beforehand - such as looking up an internet platform This function is guranteed to be called AFTER all modules have been constructed.

uint16_t Loom_MaxPub::get_port() const

Get UDP port device is listening on.

Returns UDP port

void Loom_MaxPub::set_port(const uint16_t port)

Set the UDP port to send on.

Parameters
port in The UDP port to send on

void Loom_MaxPub::set_ip(const IPAddress ip)

Set the IP address to send to.

Parameters
ip in The IP address to set to

bool Loom_MaxPub::send_to_internet(const JsonObject json, LoomInternetPlat* plat) override protected

Send JSON to the internet, assumes that a valid internet plat was found and can be used.

Parameters
json in Json object to send
plat in Internet platform to send on
Returns True if success