![]() |
Firmware for an ad-hoc mesh network of Internet-of-Things devices based on LoRa (Long Range radio) that can be deployed quickly and cheaply.
|
Internal network abstraction. More...
#include <DuckNet.h>
Public Member Functions | |
void | setupWebServer (bool createCaptivePortal=false, String html="") |
Set up the WebServer. More... | |
void | setupWifiAp (const char *accessPoint="🆘 DUCK EMERGENCY PORTAL") |
Set up the WiFi access point. More... | |
int | setupDns () |
Set up DNS. More... | |
void | setupInternet (String ssid, String password) |
Set up internet access. More... | |
bool | ssidAvailable (String val="") |
Checks if the given ssid is available. More... | |
void | setSsid (String val) |
Set the WiFi network ssid. More... | |
void | setPassword (String val) |
Set the WiFi password. More... | |
String | getSsid () |
Get the WiFi network ssid. More... | |
String | getPassword () |
Get the WiFi password ssid. More... | |
void | setDeviceId (String deviceId) |
Set the Duck's device id. More... | |
bool | isWifiConnected () |
Provide Wifi connection status. More... | |
Static Public Member Functions | |
static DuckNet * | getInstance () |
Get a singletom instance of the DuckNet class. More... | |
Static Public Attributes | |
static DNSServer | dnsServer |
Internal network abstraction.
Provides access to Webserver, DNS, WiFi and OTA update functionalities.
|
static |
String DuckNet::getPassword | ( | ) |
Get the WiFi password ssid.
String DuckNet::getSsid | ( | ) |
Get the WiFi network ssid.
|
inline |
Provide Wifi connection status.
void DuckNet::setDeviceId | ( | String | deviceId | ) |
void DuckNet::setPassword | ( | String | val | ) |
Set the WiFi password.
val | the password string to set |
void DuckNet::setSsid | ( | String | val | ) |
Set the WiFi network ssid.
val | the ssid string to set |
int DuckNet::setupDns | ( | ) |
Set up DNS.
void DuckNet::setupInternet | ( | String | ssid, |
String | password | ||
) |
Set up internet access.
ssid | the ssid of the WiFi network |
password | password to join the network |
void DuckNet::setupWebServer | ( | bool | createCaptivePortal = false , |
String | html = "" |
||
) |
Set up the WebServer.
The WebServer is used to communicate with the Duck over ad-hoc WiFi connection.
createCaptivePortal | set to true if Captive WiFi connection is needed. Defaults to false |
html | A string representing custom HTML code used for the portal. Default is an empty string Default portal web page is used if the string is empty |
void DuckNet::setupWifiAp | ( | const char * | accessPoint = "🆘 DUCK EMERGENCY PORTAL" | ) |
Set up the WiFi access point.
accessPoint | a string representing the access point. Default to "🆘 DUCK EMERGENCY PORTAL" |
bool DuckNet::ssidAvailable | ( | String | val = "" | ) |
Checks if the given ssid is available.
val | ssid to check, default is an empty string and will use the internal default ssid |
|
static |