ClusterDuck Protocol
|
External APIs to build and control a duck device. More...
#include <ClusterDuck.h>
Public Member Functions | |
ClusterDuck () | |
Construct a new Cluster Duck object. | |
String | duckMac (boolean format) |
Get the Duck Mac Address. More... | |
String | uuidCreator () |
Create a uuid string. More... | |
volatile bool | getInterrupt () |
Get the interrupt state. More... | |
void | flipFlag () |
Toggle the flag that indicates a message is received. | |
void | flipInterrupt () |
Toggle the interrupt state flag. | |
int | ping () |
Transmit a ping message. More... | |
void | setupDetect () |
Shortcut to setup a Duck Detector. More... | |
int | runDetect () |
starts the Duck Detector run thread. More... | |
int | handlePacket () |
Handles a received LoRa packet. More... | |
String | getPacketData (int pSize) |
Get the Packet data. More... | |
Packet | getLastPacket () |
Get the last received LoRa packet. More... | |
void | couple (byte byteCode, String outgoing) |
Append a chunk to the packet. More... | |
bool | idInPath (String path) |
Determine if a Duck device_id is present in the path. More... | |
volatile bool | getFlag () |
Get the packet receive flag status. More... | |
int | startReceive () |
Set the Duck to be ready to recieve LoRa packets. More... | |
int | startTransmit () |
Set the Duck to be ready to transmit LoRa packets. More... | |
int | getRSSI () |
Get the current RSSI value. 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 | setupOTA () |
void | processPortalRequest () |
String * | getPortalDataArray () |
String | getPortalDataString () |
bool | runCaptivePortal () |
Protected Attributes | |
String | _deviceId = "" |
External APIs to build and control a duck device.
This class exposes all the necessary APIs to setup/build a duck as well as customizig the duck's behavior.
void ClusterDuck::couple | ( | byte | byteCode, |
String | outgoing | ||
) |
Append a chunk to the packet.
A chunk is part of the Duck LoRa packet and is formated as [tag][length][payload] where a tag is a single byte identifying the chunk. Currently supported tags:
byteCode | identifies the tag to append |
outgoing | the payload for the tag to be appended to the LoRa packet |
String ClusterDuck::duckMac | ( | boolean | format | ) |
Get the Duck Mac Address.
format | true if the mac address is formated as MM:MM:MM:SS:SS:SS |
volatile bool ClusterDuck::getFlag | ( | ) |
Get the packet receive flag status.
volatile bool ClusterDuck::getInterrupt | ( | ) |
Get the interrupt state.
Packet ClusterDuck::getLastPacket | ( | ) |
Get the last received LoRa packet.
String ClusterDuck::getPacketData | ( | int | pSize | ) |
Get the Packet data.
pSize | the length of the packet |
String ClusterDuck::getPassword | ( | ) |
Get the WiFi password ssid.
int ClusterDuck::getRSSI | ( | ) |
Get the current RSSI value.
String ClusterDuck::getSSID | ( | ) |
Get the WiFi network ssid.
int ClusterDuck::handlePacket | ( | ) |
Handles a received LoRa packet.
bool ClusterDuck::idInPath | ( | String | path | ) |
Determine if a Duck device_id is present in the path.
path | path retrieved from the LoRa packet |
int ClusterDuck::ping | ( | ) |
Transmit a ping message.
int ClusterDuck::runDetect | ( | ) |
starts the Duck Detector run thread.
void ClusterDuck::setPassword | ( | String | val | ) |
Set the WiFi password.
val | the password string to set |
void ClusterDuck::setSSID | ( | String | val | ) |
Set the WiFi network ssid.
val | the ssid string to set |
void ClusterDuck::setupDetect | ( | ) |
bool ClusterDuck::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 |
int ClusterDuck::startReceive | ( | ) |
Set the Duck to be ready to recieve LoRa packets.
int ClusterDuck::startTransmit | ( | ) |
Set the Duck to be ready to transmit LoRa packets.
String ClusterDuck::uuidCreator | ( | ) |
Create a uuid string.