mirror of
https://github.com/mattintech/pyBTMCP.git
synced 2026-07-11 16:41:52 +00:00
36 lines
745 B
C
36 lines
745 B
C
|
|
#ifndef WEB_SERVICE_H
|
||
|
|
#define WEB_SERVICE_H
|
||
|
|
|
||
|
|
#include <Arduino.h>
|
||
|
|
|
||
|
|
// ============================================
|
||
|
|
// Web Service
|
||
|
|
// Manages HTTP server for configuration portal
|
||
|
|
// ============================================
|
||
|
|
class WebService {
|
||
|
|
public:
|
||
|
|
static WebService& getInstance();
|
||
|
|
|
||
|
|
// Prevent copying
|
||
|
|
WebService(const WebService&) = delete;
|
||
|
|
WebService& operator=(const WebService&) = delete;
|
||
|
|
|
||
|
|
// Lifecycle
|
||
|
|
void setup();
|
||
|
|
void loop();
|
||
|
|
|
||
|
|
private:
|
||
|
|
WebService() = default;
|
||
|
|
|
||
|
|
void handleRoot();
|
||
|
|
void handleGetStatus();
|
||
|
|
void handlePostConfig();
|
||
|
|
void handleReset();
|
||
|
|
void handleResetDistance();
|
||
|
|
void handleSetBattery();
|
||
|
|
};
|
||
|
|
|
||
|
|
#define webService WebService::getInstance()
|
||
|
|
|
||
|
|
#endif // WEB_SERVICE_H
|