mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-11-02 10:51:57 +00:00
Merge pull request #3357 from skandragon/feat/picow-wifi-ble
Add WiFi to RPI PicoW (and perhaps others)
This commit is contained in:
@@ -48,6 +48,16 @@ public:
|
||||
char default_scope_name[31];
|
||||
uint8_t default_scope_key[16];
|
||||
int8_t tz_offset = 0;
|
||||
#ifdef ENABLE_WIFI_INTERFACE
|
||||
#ifndef WIFI_SSID
|
||||
#define WIFI_SSID ""
|
||||
#endif
|
||||
char wifi_ssid[33] = {0}; // if empty, the compile-time WIFI_SSID is used
|
||||
char wifi_pwd[64] = {0};
|
||||
uint8_t wifi_enabled = 1; // enabled by default to allow wifi only builds to work. wifi won't be started if ssid is empty
|
||||
// use ssid from prefs, or fallback to ssid from build flags
|
||||
const char* getWifiSSID() const { return wifi_ssid[0] ? wifi_ssid : WIFI_SSID; }
|
||||
#endif
|
||||
|
||||
private:
|
||||
class RadioPrefs : public CommonRadioPrefs {
|
||||
@@ -164,6 +174,21 @@ private:
|
||||
|
||||
DynamicConfigSerializer custom;
|
||||
|
||||
#ifdef ENABLE_WIFI_INTERFACE
|
||||
class WiFiPrefs : public ConfigSerializer {
|
||||
NodePrefs* _parent;
|
||||
protected:
|
||||
void structure() override {
|
||||
def("ssid", _parent->wifi_ssid, sizeof(_parent->wifi_ssid));
|
||||
def("pwd", _parent->wifi_pwd, sizeof(_parent->wifi_pwd));
|
||||
def("enabled", _parent->wifi_enabled);
|
||||
}
|
||||
public:
|
||||
WiFiPrefs(NodePrefs* parent) : _parent(parent) { }
|
||||
};
|
||||
WiFiPrefs wifi;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
void structure() override {
|
||||
def("name", node_name, sizeof(node_name));
|
||||
@@ -176,9 +201,16 @@ protected:
|
||||
def("repeat", repeat);
|
||||
def("comp", companion);
|
||||
def("custom", custom);
|
||||
#ifdef ENABLE_WIFI_INTERFACE
|
||||
def("wifi", wifi);
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
NodePrefs() : radio(this), gps(this), companion(this), custom(&radio) {
|
||||
NodePrefs() : radio(this), gps(this), companion(this), custom(&radio)
|
||||
#ifdef ENABLE_WIFI_INTERFACE
|
||||
, wifi(this)
|
||||
#endif
|
||||
{
|
||||
node_name[0] = 0;
|
||||
default_scope_name[0] = 0;
|
||||
memset(default_scope_key, 0, sizeof(default_scope_key));
|
||||
|
||||
Reference in New Issue
Block a user