 |
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.
|
Go to the documentation of this file.
7 #include "../DuckError.h"
59 void setupWifi(
const char* ap =
"🆘 DUCK EMERGENCY PORTAL");
80 void setupWebServer(
bool createCaptivePortal =
false, String html =
"");
113 String senderId =
"", String messageId =
"",
193 static bool reboot(
void*);
DuckNet * duckNet
Definition: Duck.h:147
String getPassword()
Get the WiFi password ssid.
void setupSerial(int baudRate=115200)
Setup serial connection.
Definition: Duck.cpp:11
DuckLora * duckLora
Definition: Duck.h:146
void setDeviceId(String deviceId)
Set the Duck's device id.
void setupInternet(String ssid, String password)
Setup internet access.
Definition: Duck.cpp:78
static bool getReceiveFlag()
Definition: Duck.h:188
Internal LoRa chip abstraction.
Definition: DuckLora.h:58
virtual void run()=0
Implement the duck's specific behavior.
static bool reboot(void *)
Definition: Duck.cpp:147
static void onPacketReceived()
Definition: Duck.cpp:19
int sendPayloadStandard(String msg="", String topic="", String senderId="", String messageId="", String path="")
Send a duck LoRa message.
Definition: Duck.cpp:136
String deviceId
Definition: Duck.h:145
~Duck()
Definition: Duck.h:29
static volatile bool receivedFlag
Definition: Duck.h:185
#define CDPCFG_PIN_LORA_RST
Definition: cdpcfg.h:288
#define CDPCFG_PIN_LORA_DIO1
Definition: cdpcfg.h:297
String getSsid()
Get the WiFi network ssid.
static void setReceiveFlag(bool value)
Definition: Duck.h:187
static DuckLora * getInstance()
Get a singletom instance of the DuckLora class,.
int startReceive()
Tell the duck radio to start receiving packets from the mesh network.
Definition: Duck.cpp:163
bool ssidAvailable(String val="")
Checks if the given ssid is available.
This file is internal to CDP and provides the library access to onboard LoRa module functions as well...
void processPortalRequest()
Handle request from emergency portal.
Definition: Duck.cpp:131
#define CDPCFG_PIN_LORA_CS
Definition: cdpcfg.h:286
String getPassword()
Get the wifi access point password.
Definition: Duck.h:141
bool isWifiConnected()
Provide Wifi connection status.
Definition: DuckNet.h:154
#define CDPCFG_PIN_LORA_DIO0
Definition: cdpcfg.h:287
This file is internal to CDP and provides the library access to networking functions.
Internal network abstraction.
Definition: DuckNet.h:51
bool ssidAvailable(String ssid)
Check if the give access point is available.
Definition: Duck.h:128
bool isWifiConnected()
Check wifi connection status.
Definition: Duck.h:121
Duck()
Construct a new Duck object.
Definition: Duck.h:21
virtual int reconnectWifi(String ssid, String password)
Definition: Duck.h:183
void setupWifi(const char *ap="🆘 DUCK EMERGENCY PORTAL")
Setup WiFi access point.
Definition: Duck.cpp:70
int setupDns()
Setup DNS.
Definition: Duck.cpp:74
int startTransmit()
Tell the duck radio to start receiving packets from the mesh network.
Definition: Duck.cpp:172
virtual void setupWithDefaults(String ssid, String password)
Setup a duck with default settings.
Definition: Duck.h:176
String getSsid()
Get the access point ssid.
Definition: Duck.h:135
void handleOtaUpdate()
Handle over the air firmware update.
Definition: Duck.cpp:123
static void toggleReceiveFlag()
Definition: Duck.h:186
#define CDPCFG_RF_LORA_TXPOW
Transmit Power.
Definition: cdpcfg.h:330
static bool imAlive(void *)
Definition: Duck.cpp:156
void setupWebServer(bool createCaptivePortal=false, String html="")
Setup web server.
Definition: Duck.cpp:65
static DuckNet * getInstance()
Get a singletom instance of the DuckNet class.
void setupOTA()
Definition: Duck.cpp:85
#define CDPCFG_RF_LORA_FREQ
Frequency Range. Set for US Region 915.0Mhz.
Definition: cdpcfg.h:324
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.
Definition: Duck.cpp:28
CDP central compile-time configuration file.