ClusterDuck Protocol
|
Public Types | |
using | callbackFunc = void(*)(Packet) |
Papa Duck callback function signature. | |
Public Member Functions | |
void | onReceiveDuckData (callbackFunc cb) |
Register callback for handling data received from duck devices. More... | |
void | run () |
Provide the PapaDuck specific implementation of the base run() method. | |
void | setupWithDefaults (String ssid="", String password="") |
Override the default setup method to match MamaDuck specific defaults. More... | |
int | reconnectWifi (String ssid, String password) |
Reconnect the device's WiFi access point. More... | |
Duck () | |
Construct a new Duck object. | |
Duck (String id) | |
Construct a new Duck object. More... | |
![]() | |
Duck () | |
Construct a new Duck object. | |
Duck (String id) | |
Construct a new Duck object. More... | |
void | setupSerial (int baudRate=115200) |
Setup serial connection. More... | |
void | setupRadio (float band=CDPCFG_RF_LORA_FREQ, int ss=CDPCFG_PIN_LORA_CS, int rst=CDPCFG_PIN_LORA_RST, int di0=CDPCFG_PIN_LORA_DIO0, int di1=CDPCFG_PIN_LORA_DIO1, int txPower=CDPCFG_RF_LORA_TXPOW) |
Setup the radio component. More... | |
void | setupWifi (const char *ap="🆘 DUCK EMERGENCY PORTAL") |
Setup WiFi access point. More... | |
int | setupDns () |
Setup DNS. More... | |
void | setupWebServer (bool createCaptivePortal=false, String html="") |
Setup web server. More... | |
void | setupInternet (String ssid, String password) |
Setup internet access. More... | |
void | setupOTA () |
int | sendPayloadStandard (String msg="", String topic="", String senderId="", String messageId="", String path="") |
Send a duck LoRa message. More... | |
bool | isWifiConnected () |
Check wifi connection status. More... | |
bool | ssidAvailable (String ssid) |
Check if the give access point is available. More... | |
String | getSsid () |
Get the access point ssid. More... | |
String | getPassword () |
Get the wifi access point password. More... | |
Additional Inherited Members | |
![]() | |
int | startReceive () |
Tell the duck radio to start receiving packets from the mesh network. More... | |
int | startTransmit () |
Tell the duck radio to start receiving packets from the mesh network. More... | |
void | processPortalRequest () |
Handle request from emergency portal. | |
void | handleOtaUpdate () |
Handle over the air firmware update. | |
![]() | |
static void | toggleReceiveFlag () |
static void | setReceiveFlag (bool value) |
static bool | getReceiveFlag () |
static void | onPacketReceived () |
static bool | imAlive (void *) |
static bool | reboot (void *) |
![]() | |
String | deviceId |
DuckLora * | duckLora = DuckLora::getInstance() |
DuckNet * | duckNet = DuckNet::getInstance() |
![]() | |
static volatile bool | receivedFlag = false |
Duck::Duck |
Construct a new Duck object.
id | a unique id |
|
inline |
Register callback for handling data received from duck devices.
cb | a callback to handle data received by the papa duck |
|
virtual |
Reconnect the device's WiFi access point.
Allows a Wifi capable device to reconnect the wifi access point if it is lost.
ssid | |
password |
Reimplemented from Duck.
|
virtual |
Override the default setup method to match MamaDuck specific defaults.
In addition to Serial component, the Radio component is also initialized. When ssid and password are provided the duck will setup the wifi related components.
ssid | wifi access point ssid (defaults to an empty string if not provided) |
password | wifi password (defaults to an empty string if not provided) |
Reimplemented from Duck.