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_WIFI Class Reference

#include <Loom_Wifi.h>

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

Public Member Functions

 Loom_WIFI (Manager &man, CommunicationMode mode, const char *name="", const char *password="", int connectionRetries=5)
 
 Loom_WIFI (Manager &man)
 
void loadConfigFromJSON (char *json)
 
WiFiClient & getClient ()
 
WiFiUDP * getUDP ()
 
bool verifyConnection ()
 
void connect_to_network ()
 
void start_ap ()
 
void storeNewWiFiCreds (const char *name, const char *password)
 
IPAddress getIPAddress ()
 
IPAddress getSubnetMask ()
 
IPAddress getGateway ()
 
IPAddress getBroadcast ()
 
bool isConnected ()
 
void useMax ()
 
void setBatchSD (Loom_BatchSD &batch)
 
void setMaxRetries (int retries)
 
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 initialize () override
 
void package () 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

WiFi 101 library integrated with the manager to allow for easy sleep

Author
Will Richards

Constructor & Destructor Documentation

◆ Loom_WIFI() [1/2]

Loom_WIFI::Loom_WIFI ( Manager man,
CommunicationMode  mode,
const char *  name = "",
const char *  password = "",
int  connectionRetries = 5 
)

Construct a new WiFi Manager

Parameters
manReference to the manager to control all aspects of every module
modeWhether or not to try to connect to an access point or create our own
nameThe name of the WiFi access point we are going to connect to
passwordThe password (if applicable) to connect to the access point

◆ Loom_WIFI() [2/2]

Loom_WIFI::Loom_WIFI ( 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_to_network()

void Loom_WIFI::connect_to_network ( )

Connect to an already existing access point

◆ getBroadcast()

IPAddress Loom_WIFI::getBroadcast ( )

Get the broadcast IP of the network

◆ getClient()

WiFiClient & Loom_WIFI::getClient ( )
inline

Returns a reference to the WifiClient

Returns
wifiClient

◆ getGateway()

IPAddress Loom_WIFI::getGateway ( )

Get the gateway IP of the network

◆ getIPAddress()

IPAddress Loom_WIFI::getIPAddress ( )

Get the IP address of the WiFi module

◆ getSubnetMask()

IPAddress Loom_WIFI::getSubnetMask ( )

Get the subnet mask of the connected network

◆ getUDP()

WiFiUDP * Loom_WIFI::getUDP ( )
inline

Get a reference to the UDP communication handler

◆ initialize()

void Loom_WIFI::initialize ( )
overrideprotectedvirtual

Implements Module.

◆ ipToString()

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

Convert an IP address to a string

◆ isConnected()

bool Loom_WIFI::isConnected ( )

Return the current connection state of the WiFi module

◆ loadConfigFromJSON()

void Loom_WIFI::loadConfigFromJSON ( char *  json)

Load the Wifi credentials from a JSON string, used to pull credentials from a file

This automatically frees the input json

Parameters
jsonStringJSON formatted string containing the SSID and password

◆ measure()

void Loom_WIFI::measure ( )
inlineoverrideprotectedvirtual

Implements Module.

◆ package()

void Loom_WIFI::package ( )
overrideprotectedvirtual

Implements Module.

◆ power_down()

void Loom_WIFI::power_down ( )
overrideprotectedvirtual

Implements Module.

◆ power_up()

void Loom_WIFI::power_up ( )
overrideprotectedvirtual

Implements Module.

◆ setBatchSD()

void Loom_WIFI::setBatchSD ( Loom_BatchSD batch)
inline

Set an instance of BatchSD to check if we need to power up

◆ setMaxRetries()

void Loom_WIFI::setMaxRetries ( int  retries)
inline

Set the number of connection retries

◆ start_ap()

void Loom_WIFI::start_ap ( )

Create our own access point

◆ useMax()

void Loom_WIFI::useMax ( )
inline

Called by max to ignore WiFi verification requests

◆ verifyConnection()

bool Loom_WIFI::verifyConnection ( )

Attempt to ping Google, this tests if we are truly connected to the internet


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