mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-10-31 22:02:17 +01:00
refactor: move the transports into entryPoints and outputs
The HTTP servers and MQTT command handling go to src/entryPoints/, the socket emitter and the MQTT and socket output of shades, groups and rooms to src/outputs/. GLOSSARY.md names what they become once split: WebUiRoutes, ApiRoutes and MqttCommands in, MqttPublisher and SocketEmitter out. Only files and include paths change. esp32devdbg flash goes from 1,546,405 to 1,546,257 bytes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
7396786b8c
commit
e624a4177d
16 changed files with 42 additions and 15 deletions
31
src/entryPoints/MQTT.h
Normal file
31
src/entryPoints/MQTT.h
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#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
|
||||
Loading…
Add table
Add a link
Reference in a new issue