Revert "Merge branch 'main' into 30-add-dmx-in-capability"

This reverts commit b93ae3d682, reversing
changes made to f3ef3aa9b9.
This commit is contained in:
Hendrik Rauh 2025-03-06 21:44:55 +01:00
parent b93ae3d682
commit 176a12a9b3
5 changed files with 6 additions and 53 deletions

View file

@ -23,7 +23,6 @@
#include <LittleFS.h>
#include "routes/config.h"
#include "routes/networks.h"
#include "routes/channels.h"
//DMXESPSerial dmx1;
//DMXESPSerial dmx2;
@ -396,9 +395,6 @@ void setup()
server.on("/networks", HTTP_GET, [](AsyncWebServerRequest *request)
{ onGetNetworks(request); });
server.on("/dmx", HTTP_GET, [](AsyncWebServerRequest *request)
{ onGetChannels(request, dmx1, dmx2); });
server.onRequestBody([](AsyncWebServerRequest *request, uint8_t *data, size_t len, size_t index, size_t total)
{
if (request->url() == "/config" && request->method() == HTTP_PUT) {

View file

@ -1,29 +0,0 @@
#include "channels.h"
void onGetChannels(AsyncWebServerRequest *request, DMXESPSerial dmx1, DMXESPSerial dmx2)
{
JsonDocument doc;
for (int channel = 1; channel <= DMXCHANNELS; channel++)
{
uint8_t value = dmx1.read(channel);
if (value != 0)
{
doc["dmx1"][String(channel)] = value;
}
}
for (int channel = 1; channel <= DMXCHANNELS; channel++)
{
uint8_t value = dmx2.read(channel);
if (value != 0)
{
doc["dmx2"][String(channel)] = value;
}
}
String jsonBuffer;
serializeJson(doc, jsonBuffer);
request->send(200, "application/json", jsonBuffer);
}

View file

@ -1,8 +0,0 @@
#include <Preferences.h>
#include <ArduinoJson.h>
#include <AsyncWebServer_ESP32_W5500.h>
#include "ESPDMX.h"
extern Preferences config;
void onGetChannels(AsyncWebServerRequest *request, DMXESPSerial dmx1, DMXESPSerial dmx2);