refactor: split the transports into the modules GLOSSARY.md names

Code moves unchanged; only files and names change.

- entryPoints/WebUiRoutes.cpp: registerWebUiRoutes(), the port 80 routes
  and the UI's files, with the helpers only they use.
- entryPoints/ApiRoutes.cpp: registerApiRoutes(), the port 8081 routes.
- entryPoints/Web.cpp keeps the servers' lifecycle, auth and the handlers
  both route sets call; entryPoints/WebRoutes.h is what the three share.
- entryPoints/MQTT.* -> MqttConnection.*, class MQTTClass -> MqttConnection.
- outputs/SomfyMqtt.cpp -> outputs/MqttPublisher.cpp.
- outputs/Sockets.* -> outputs/SocketEmitter.*.

The subscribe and unsubscribe lists (the latter repeated
groups/+/direction/set) become MqttCommands' MQTT_COMMAND_TOPICS, and a
native test checks the parser takes every topic in it. GLOSSARY.md gains
MqttConnection and Change fan-out.

328 native tests. Flash: esp32devdbg +3,112 bytes (the routes are a second
ArduinoJson file), esp32dev -2,336 bytes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
cjkas 2026-10-16 13:47:56 +02:00
parent 4c5bc01fe5
commit a0ad301779
20 changed files with 1186 additions and 1066 deletions

View file

@ -1,31 +0,0 @@
#ifndef MQTT_H
#define MQTT_H
#include <Arduino.h>
#include <PubSubClient.h>
#include <ArduinoJson.h>
class MQTTClass {
public:
uint64_t lastConnect = 0;
bool suspended = false;
char clientId[32] = {'\0'};
bool begin();
bool loop();
bool end();
bool connect();
bool disconnect();
bool connected();
void reset();
bool unpublish(const char *topic);
bool publish(const char *topic, const char *payload, bool retain = false);
bool publish(const char *topic, uint8_t val, bool retain = false);
bool publish(const char *topic, int8_t val, bool retain = false);
bool publish(const char *topic, uint32_t val, bool retain = false);
bool publish(const char *topic, uint16_t val, bool retain = false);
bool publish(const char *topic, bool val, bool retain = false);
bool publishBuffer(const char *topic, uint8_t *data, uint16_t len, bool retain = false);
bool publishDisco(const char *topic, JsonObject &obj, bool retain = false);
bool subscribe(const char *topic);
bool unsubscribe(const char *topic);
static void receive(const char *topic, byte *payload, uint32_t length);
};
#endif