Stream all responses. Fix missing ETH IP address #310

This commit is contained in:
Robert Strouse 2024-04-09 13:46:51 -07:00
parent 6ba354c7ff
commit 026f9315b1
19 changed files with 1361 additions and 456 deletions

View file

@ -2,7 +2,7 @@
#include <ETH.h>
#ifndef configsettings_h
#define configsettings_h
#include "WResp.h"
#define FW_VERSION "v2.4.2"
enum DeviceStatus {
DS_OK = 0,
@ -26,6 +26,8 @@ struct appver_t {
char suffix[4] = "";
void parse(const char *ver);
bool toJSON(JsonObject &obj);
void toJSON(JsonResponse &json);
void toJSON(JsonSockEvent *json);
int8_t compare(appver_t &ver);
void copy(appver_t &ver);
};
@ -36,6 +38,7 @@ class BaseSettings {
bool loadFile(const char* filename);
bool fromJSON(JsonObject &obj);
bool toJSON(JsonObject &obj);
void toJSON(JsonResponse &json);
bool parseIPAddress(JsonObject &obj, const char *prop, IPAddress *);
bool parseValueString(JsonObject &obj, const char *prop, char *dest, size_t size);
int parseValueInt(JsonObject &obj, const char *prop, int defVal);
@ -50,6 +53,7 @@ class NTPSettings: BaseSettings {
char posixZone[64] = "";
bool fromJSON(JsonObject &obj);
bool toJSON(JsonObject &obj);
void toJSON(JsonResponse &json);
bool apply();
bool begin();
bool save();
@ -66,6 +70,7 @@ class WifiSettings: BaseSettings {
bool begin();
bool fromJSON(JsonObject &obj);
bool toJSON(JsonObject &obj);
void toJSON(JsonResponse &json);
String mapEncryptionType(int type);
bool ssidExists(const char *ssid);
void printNetworks();
@ -88,6 +93,7 @@ class EthernetSettings: BaseSettings {
bool begin();
bool fromJSON(JsonObject &obj);
bool toJSON(JsonObject &obj);
void toJSON(JsonResponse &json);
bool load();
bool save();
void print();
@ -105,6 +111,7 @@ class IPSettings: BaseSettings {
bool begin();
bool fromJSON(JsonObject &obj);
bool toJSON(JsonObject &obj);
void toJSON(JsonResponse &json);
bool load();
bool save();
void print();
@ -129,6 +136,7 @@ class SecuritySettings: BaseSettings {
bool load();
void print();
bool toJSON(JsonObject &obj);
void toJSON(JsonResponse &json);
bool fromJSON(JsonObject &obj);
};
class MQTTSettings: BaseSettings {
@ -146,6 +154,7 @@ class MQTTSettings: BaseSettings {
bool save();
bool load();
bool toJSON(JsonObject &obj);
void toJSON(JsonResponse &json);
bool fromJSON(JsonObject &obj);
};
enum class conn_types : byte {
@ -175,6 +184,7 @@ class ConfigSettings: BaseSettings {
bool requiresAuth();
bool fromJSON(JsonObject &obj);
bool toJSON(JsonObject &obj);
void toJSON(JsonResponse &json);
bool begin();
bool save();
bool load();