ClusterDuck Protocol
|
Public Types | |
using | rssiCallback = void(*)(const int) |
callback definition for receiving RSSI value | |
Public Member Functions | |
void | sendPing (bool startReceive) |
Send a ping message to devices in the mesh network. More... | |
void | run () |
Provide the DuckDetect specific implementation of the base run() method. | |
void | setupWithDefaults (String ssid="", String password="") |
Override the default setup method to match DuckDetect specific defaults. More... | |
void | onReceiveRssi (rssiCallback rssiCb) |
Regsiter a callback for receiving and handling RSSI value. 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... | |
virtual int | reconnectWifi (String ssid, String password) |
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 |
Regsiter a callback for receiving and handling RSSI value.
rssiCb | a call back defined with the following signature: void (*)(const int) |
void DuckDetect::sendPing | ( | bool | startReceive | ) |
Send a ping message to devices in the mesh network.
startReceive | true if the device must to be ready to receive a response immediately, false if response needs to be deffered. |
|
virtual |
Override the default setup method to match DuckDetect 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.