-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7babcac
commit 70a2c93
Showing
9 changed files
with
168 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,36 @@ | ||
#pragma once | ||
|
||
#include <ArduinoLog.h> | ||
#if defined(ESP8266) | ||
#include <ESPAsyncTCP.h> | ||
#elif defined(ESP32) | ||
#include <AsyncTCP.h> | ||
#endif | ||
#include "LEDs.h" | ||
#include "Main.h" | ||
#include "Storage.h" | ||
#include <ArduinoJson.h> | ||
#include <AsyncJson.h> | ||
#include <ESPAsyncWebServer.h> | ||
|
||
void handlePostSegment(uint8_t *data, size_t &len, | ||
class API { | ||
public: | ||
API(LEDs &leds, Storage &storage); | ||
void init(); | ||
static constexpr const char *MIME_TYPE_TEXT = "plain/text"; | ||
|
||
private: | ||
void handlePostSegment(uint8_t *data, size_t &len, | ||
AsyncWebServerRequest *request); | ||
void handlePutStatus(uint8_t *data, size_t &len, | ||
AsyncWebServerRequest *request); | ||
void handlePutStatus(uint8_t *data, size_t &len, | ||
void handleGetSegments(AsyncWebServerRequest *request); | ||
void handlePutLEDs(uint8_t *data, size_t &len, | ||
AsyncWebServerRequest *request); | ||
void handleGetSegments(AsyncWebServerRequest *request); | ||
void handlePutLEDs(uint8_t *data, size_t &len, AsyncWebServerRequest *request); | ||
void handleNotFound(AsyncWebServerRequest *request); | ||
void initServer(); | ||
|
||
AsyncWebServer *server; | ||
LEDs *leds; | ||
Storage *storage; | ||
int8 statusColorIndexBuffer[NUM_SEGMENTS]; | ||
char responseBuffer[100]; | ||
}; |
Oops, something went wrong.