Initial commit: add stepper controller firmware
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
#pragma once
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <ESP8266WebServer.h>
|
||||
#include "config/ConfigManager.h"
|
||||
#include "motor/StepperController.h"
|
||||
#include "network/NetworkManager.h"
|
||||
#include "ota/OtaManager.h"
|
||||
|
||||
class WebServerManager {
|
||||
public:
|
||||
WebServerManager(ConfigManager& config, StepperController& motor, NetworkManager& network, OtaManager& ota);
|
||||
void begin();
|
||||
void update();
|
||||
|
||||
private:
|
||||
void registerRoutes();
|
||||
void handleRoot();
|
||||
void handleConfigPage();
|
||||
void handleStatus();
|
||||
void handleCommand();
|
||||
void handleConfigGet();
|
||||
void handleConfigPost();
|
||||
void handleFactoryReset();
|
||||
void handleNotFound();
|
||||
String renderPage() const;
|
||||
bool parseFloatArg(const String& name, float& value) const;
|
||||
|
||||
ESP8266WebServer server_{80};
|
||||
ConfigManager& config_;
|
||||
StepperController& motor_;
|
||||
NetworkManager& network_;
|
||||
OtaManager& ota_;
|
||||
};
|
||||
Reference in New Issue
Block a user