mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-10-31 13:52:15 +01:00
Merge pull request #61 from cjkas/fix/socket-buffer-4k
fix: make the socket buffer big enough for the largest event
This commit is contained in:
commit
e06ee3a060
4 changed files with 19 additions and 12 deletions
|
|
@ -337,6 +337,9 @@ bool Transceiver::receive(somfy_rx_t *rx) {
|
|||
return false;
|
||||
}
|
||||
void Transceiver::emitFrame(somfy_frame_t *frame, somfy_rx_t *rx) {
|
||||
// The largest socket event: every pulse as up to 10 digits and a comma,
|
||||
// plus about 300 bytes of fields and framing.
|
||||
static_assert(MAX_TIMINGS * 11 + 512 <= MAX_SOCK_RESPONSE, "remoteFrame can outgrow the socket buffer");
|
||||
if(sockEmit.activeClients(ROOM_EMIT_FRAME) > 0) {
|
||||
JsonSockEvent *json = sockEmit.beginEmit("remoteFrame");
|
||||
json->beginObject();
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@ static void removeClient(uint32_t asyncId) {
|
|||
if(slots[i].asyncId == asyncId) slots[i].asyncId = 0;
|
||||
}
|
||||
|
||||
#define MAX_SOCK_RESPONSE 2048
|
||||
static char g_response[MAX_SOCK_RESPONSE];
|
||||
|
||||
bool room_t::isJoined(uint8_t num) {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,10 @@
|
|||
|
||||
#define SOCK_MAX_ROOMS 1
|
||||
#define ROOM_EMIT_FRAME 0
|
||||
// The buffer every socket event is formatted into. An event that doesn't
|
||||
// fit is logged and not sent, so the largest one has to fit: see remoteFrame
|
||||
// in Transceiver.cpp.
|
||||
#define MAX_SOCK_RESPONSE 4096
|
||||
|
||||
struct room_t {
|
||||
uint8_t clients[5] = {255, 255, 255, 255, 255};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue