the size allocated for the HTTP request response was too little, while the size for the buffer of the websocket output was increased already. add a new member variable and use it in both context, such that increasing the buffer size to accomodate more space (for the JSON data in particular) will benefit both contexts in the future.
27 lines
805 B
C++
27 lines
805 B
C++
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
#pragma once
|
|
|
|
#include "ArduinoJson.h"
|
|
#include <ESPAsyncWebServer.h>
|
|
#include <VeDirectFrameHandler.h>
|
|
|
|
class WebApiWsVedirectLiveClass {
|
|
public:
|
|
WebApiWsVedirectLiveClass();
|
|
void init(AsyncWebServer* server);
|
|
void loop();
|
|
|
|
private:
|
|
void generateJsonResponse(JsonVariant& root);
|
|
void onLivedataStatus(AsyncWebServerRequest* request);
|
|
void onWebsocketEvent(AsyncWebSocket* server, AsyncWebSocketClient* client, AwsEventType type, void* arg, uint8_t* data, size_t len);
|
|
|
|
AsyncWebServer* _server;
|
|
AsyncWebSocket _ws;
|
|
|
|
uint32_t _lastWsPublish = 0;
|
|
uint32_t _lastVedirectUpdateCheck = 0;
|
|
uint32_t _lastWsCleanup = 0;
|
|
uint32_t _newestVedirectTimestamp = 0;
|
|
static constexpr uint16_t _responseSize = 1024 + 128;
|
|
}; |