refactor(comms): clean up Communication folder structure
- Delete dead code: CommandHandler (700-line God Class) and
HTTPRequestHandler — both replaced by new architecture in Stage 4
- Create Drivers/ group for the three low-level protocol drivers,
mirroring the Transport/ pattern:
MQTTAsyncClient → Drivers/MQTTDriver (class: MQTTDriver)
WebSocketServer → Drivers/WebSocketDriver (class: WebSocketDriver)
UARTCommandHandler → Drivers/UARTDriver (class: UARTDriver)
- Update all includes and type references across CommunicationRouter,
all three Transport wrappers, and MQTTHandler
- Add -std=gnu++14 + build_unflags to platformio.ini so std::make_unique
compiles on ESP32 (required by CommunicationRouter::registerHandlers)
Build: passing
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5,18 +5,17 @@
|
||||
|
||||
class ConfigManager;
|
||||
|
||||
// Forward declare the transport so we don't pull in all of MQTT yet.
|
||||
// In Stage 3 this will be MQTTTransport; for now it wraps MQTTAsyncClient.
|
||||
class MQTTAsyncClient;
|
||||
// Forward declare the driver to avoid pulling in full MQTTDriver header.
|
||||
class MQTTDriver;
|
||||
|
||||
class MQTTHandler : public ICommandHandler {
|
||||
public:
|
||||
MQTTHandler(ConfigManager& configManager, MQTTAsyncClient& mqttClient);
|
||||
MQTTHandler(ConfigManager& configManager, MQTTDriver& mqttClient);
|
||||
|
||||
std::vector<String> commands() const override;
|
||||
CommandResult execute(const CommandEnvelope& envelope) override;
|
||||
|
||||
private:
|
||||
ConfigManager& _configManager;
|
||||
MQTTAsyncClient& _mqttClient;
|
||||
MQTTDriver& _mqttClient;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user