Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PsychicHttp #3726

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ lib_deps =
fastled/FastLED @ 3.6.0
IRremoteESP8266 @ 2.8.2
makuna/NeoPixelBus @ 2.7.5
https://github.com/Aircoookie/ESPAsyncWebServer.git @ ~2.0.7
https://github.com/hoeken/PsychicHttp @ 1.0.1
# ESP-NOW library (includes mandatory QuickDebug library)
; gmag11/QuickESPNow @ 0.6.2
https://github.com/blazoncek/QuickESPNow.git#optional-debug
Expand Down
30 changes: 15 additions & 15 deletions wled00/fcn_declare.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void prepareArtnetPollReply(ArtPollReply* reply);
void sendArtnetPollReply(ArtPollReply* reply, IPAddress ipAddress, uint16_t portAddress);

//file.cpp
bool handleFileRead(AsyncWebServerRequest*, String path);
bool handleFileRead(PsychicRequest*, String path);
bool writeObjectToFileUsingId(const char* file, uint16_t id, JsonDocument* content);
bool writeObjectToFile(const char* file, const char* key, JsonDocument* content);
bool readObjectFromFileUsingId(const char* file, uint16_t id, JsonDocument* dest);
Expand Down Expand Up @@ -150,9 +150,9 @@ void serializeState(JsonObject root, bool forPreset = false, bool includeBri = t
void serializeInfo(JsonObject root);
void serializeModeNames(JsonArray root);
void serializeModeData(JsonArray root);
void serveJson(AsyncWebServerRequest* request);
void serveJson(PsychicRequest* request);
#ifdef WLED_ENABLE_JSONLIVE
bool serveLiveLeds(AsyncWebServerRequest* request, uint32_t wsClient = 0);
bool serveLiveLeds(PsychicRequest* request, uint32_t wsClient = 0);
#endif

//led.cpp
Expand Down Expand Up @@ -223,8 +223,8 @@ void handleRemote(uint8_t *data, size_t len);

//set.cpp
bool isAsterisksOnly(const char* str, byte maxLen);
void handleSettingsSet(AsyncWebServerRequest *request, byte subPage);
bool handleSet(AsyncWebServerRequest *request, const String& req, bool apply=true);
void handleSettingsSet(PsychicRequest *request, byte subPage);
bool handleSet(PsychicRequest *request, const String& req, bool apply=true);

//udp.cpp
void notify(byte callMode, bool followUp=false);
Expand Down Expand Up @@ -413,24 +413,24 @@ void updateBaudRate(uint32_t rate);
//wled_server.cpp
bool isIp(String str);
void createEditHandler(bool enable);
bool captivePortal(AsyncWebServerRequest *request);
bool captivePortal(PsychicRequest *request);
void initServer();
void serveIndex(AsyncWebServerRequest* request);
void serveIndex(PsychicRequest* request);
String msgProcessor(const String& var);
void serveMessage(AsyncWebServerRequest* request, uint16_t code, const String& headl, const String& subl="", byte optionT=255);
void serveJsonError(AsyncWebServerRequest* request, uint16_t code, uint16_t error);
void serveMessage(PsychicRequest* request, uint16_t code, const String& headl, const String& subl="", byte optionT=255);
void serveJsonError(PsychicRequest* request, uint16_t code, uint16_t error);
String dmxProcessor(const String& var);
void serveSettings(AsyncWebServerRequest* request, bool post = false);
void serveSettingsJS(AsyncWebServerRequest* request);
void serveSettings(PsychicRequest* request, bool post = false);
void serveSettingsJS(PsychicRequest* request);

//ws.cpp
void handleWs();
void wsEvent(AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventType type, void * arg, uint8_t *data, size_t len);
void sendDataWs(AsyncWebSocketClient * client = nullptr);
void wsEvent(PsychicHttpServer * server, PsychicWebSocketClient * client, AwsEventType type, void * arg, uint8_t *data, size_t len);
void sendDataWs(PsychicWebSocketClient * client = nullptr);

//xml.cpp
void XML_response(AsyncWebServerRequest *request, char* dest = nullptr);
void URL_response(AsyncWebServerRequest *request);
void XML_response(PsychicRequest *request, char* dest = nullptr);
void URL_response(PsychicRequest *request);
void getSettingsJS(byte subPage, char* dest);

#endif
6 changes: 3 additions & 3 deletions wled00/src/dependencies/espalexa/Espalexa.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ class Espalexa {
private:
//private member vars
#ifdef ESPALEXA_ASYNC
AsyncWebServer* serverAsync;
AsyncWebServerRequest* server; //this saves many #defines
PsychicHttpServer* serverAsync;
PsychicRequest* server; //this saves many #defines
String body = "";
#elif defined ARDUINO_ARCH_ESP32
WebServer* server;
Expand Down Expand Up @@ -321,7 +321,7 @@ class Espalexa {

//initialize interfaces
#ifdef ESPALEXA_ASYNC
bool begin(AsyncWebServer* externalServer = nullptr)
bool begin(PsychicHttpServer* externalServer = nullptr)
#elif defined ARDUINO_ARCH_ESP32
bool begin(WebServer* externalServer = nullptr)
#else
Expand Down
4 changes: 2 additions & 2 deletions wled00/wled.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
#include "my_config.h"
#endif

#include <ESPAsyncWebServer.h>
#include <PsychicHttp.h>
#ifdef WLED_ADD_EEPROM_SUPPORT
#include <EEPROM.h>
#endif
Expand Down Expand Up @@ -708,7 +708,7 @@ WLED_GLOBAL bool ledStatusState _INIT(false); // the current LED state
#endif

// server library objects
WLED_GLOBAL AsyncWebServer server _INIT_N(((80)));
WLED_GLOBAL PsychicHttpServer server _INIT_N(((80)));
#ifdef WLED_ENABLE_WEBSOCKETS
WLED_GLOBAL AsyncWebSocket ws _INIT_N((("/ws")));
#endif
Expand Down
4 changes: 2 additions & 2 deletions wled00/ws.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ unsigned long wsLastLiveTime = 0;

#define WS_LIVE_INTERVAL 40

void wsEvent(AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventType type, void * arg, uint8_t *data, size_t len)
void wsEvent(PsychicHttpServer * server, PsychicWebSocketClient * client, AwsEventType type, void * arg, uint8_t *data, size_t len)
{
if(type == WS_EVT_CONNECT){
//client connected
Expand Down Expand Up @@ -96,7 +96,7 @@ void wsEvent(AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventTyp
}
}

void sendDataWs(AsyncWebSocketClient * client)
void sendDataWs(PsychicWebSocketClient * client)
{
if (!ws.count()) return;
AsyncWebSocketMessageBuffer * buffer;
Expand Down
Loading