Updated mdns to use protobufs (completely untested)

This commit is contained in:
Niklas Jensen
2026-01-30 14:56:15 +01:00
committed by nikguin04
parent e1f44a6f06
commit 72e2522dcd
9 changed files with 221 additions and 219 deletions
+7 -9
View File
@@ -1,18 +1,18 @@
#pragma once
#include <esp_http_server.h>
#include <ArduinoJson.h>
#include <ESPmDNS.h>
#include <template/stateful_service.h>
#include <template/stateful_endpoint.h>
#include <template/stateful_persistence.h>
#include <template/stateful_proto_endpoint.h>
#include <template/stateful_persistence_pb.h>
#include <settings/mdns_settings.h>
#include <utils/timing.h>
#include <string>
#define MDNS_SETTINGS_FILE "/config/mdnsSettings.pb"
class MDNSService : public StatefulService<MDNSSettings> {
private:
FSPersistence<MDNSSettings> _persistence;
FSPersistencePB<MDNSSettings> _persistence;
bool _started {false};
void reconfigureMDNS();
@@ -27,9 +27,7 @@ class MDNSService : public StatefulService<MDNSSettings> {
void begin();
esp_err_t getStatus(httpd_req_t *request);
void getStatus(JsonVariant &root);
esp_err_t queryServices(httpd_req_t *request, api_Request *protoReq);
static esp_err_t queryServices(httpd_req_t *request, JsonVariant &json);
StatefulHttpEndpoint<MDNSSettings> endpoint;
StatefulProtoEndpoint<MDNSSettings, api_MDNSSettings> protoEndpoint;
};