ClusterDuck Protocol
Public Types | Public Member Functions | List of all members
DuckDetect Class Reference
Inheritance diagram for DuckDetect:
Duck

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...
 
- Public Member Functions inherited from Duck
 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

- Protected Member Functions inherited from Duck
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 Protected Member Functions inherited from Duck
static void toggleReceiveFlag ()
 
static void setReceiveFlag (bool value)
 
static bool getReceiveFlag ()
 
static void onPacketReceived ()
 
static bool imAlive (void *)
 
static bool reboot (void *)
 
- Protected Attributes inherited from Duck
String deviceId
 
DuckLoraduckLora = DuckLora::getInstance()
 
DuckNetduckNet = DuckNet::getInstance()
 
- Static Protected Attributes inherited from Duck
static volatile bool receivedFlag = false
 

Member Function Documentation

◆ Duck()

Duck::Duck

Construct a new Duck object.

Parameters
ida unique id

◆ onReceiveRssi()

void DuckDetect::onReceiveRssi ( rssiCallback  rssiCb)
inline

Regsiter a callback for receiving and handling RSSI value.

Parameters
rssiCba call back defined with the following signature: void (*)(const int)

◆ sendPing()

void DuckDetect::sendPing ( bool  startReceive)

Send a ping message to devices in the mesh network.

Parameters
startReceivetrue if the device must to be ready to receive a response immediately, false if response needs to be deffered.

◆ setupWithDefaults()

void DuckDetect::setupWithDefaults ( String  ssid = "",
String  password = "" 
)
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.

Parameters
ssidwifi access point ssid (defaults to an empty string if not provided)
passwordwifi password (defaults to an empty string if not provided)

Reimplemented from Duck.


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