1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-14 06:23:07 +01:00

add registerRequestHandler to the API with examples

This commit is contained in:
andreas
2024-11-14 18:15:12 +01:00
parent 506dd7ea9f
commit 538f643fbf
9 changed files with 133 additions and 4 deletions

View File

@@ -4,6 +4,7 @@
#include <functional>
#include "GwMessage.h"
#include "GwLog.h"
#include "GwApi.h"
class GwWebServer{
private:
AsyncWebServer *server;
@@ -11,7 +12,7 @@ class GwWebServer{
GwLog *logger;
public:
typedef GwRequestMessage *(RequestCreator)(AsyncWebServerRequest *request);
using HandlerFunction=std::function<void(AsyncWebServerRequest *)>;
using HandlerFunction=GwApi::HandlerFunction;
GwWebServer(GwLog *logger, GwRequestQueue *queue,int port);
~GwWebServer();
void begin();