From 4813340a696fbfba85221480df52f063c4339cfe Mon Sep 17 00:00:00 2001 From: TeTeHacko Date: Fri, 13 Nov 2026 01:06:06 +0100 Subject: [PATCH] FwUpdate binary: cap the missing-units reply at 150 B (companion frame limit); ota_mesh_push --text --- examples/simple_repeater/MyMesh.cpp | 5 ++++- examples/simple_room_server/MyMesh.cpp | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/examples/simple_repeater/MyMesh.cpp b/examples/simple_repeater/MyMesh.cpp index 352cb592..93227b4e 100644 --- a/examples/simple_repeater/MyMesh.cpp +++ b/examples/simple_repeater/MyMesh.cpp @@ -481,7 +481,10 @@ int MyMesh::handleRequest(ClientInfo *sender, uint32_t sender_timestamp, uint8_t // only, helpers/FwUpdate.h). 0 = no reply: chunks are fire and forget. if (payload_len >= 1 && payload[0] == 0xF0) { extern int maintHandleRequest(bool admin, const uint8_t* req, int len, uint8_t* reply, int reply_max); - int n = maintHandleRequest(sender->isAdmin(), payload, (int)payload_len, &reply_data[4], 160); + // 150: tag + reply pads to 160 B, and the companion's push frame (6 + padded + // length - 4) must stay within MAX_FRAME_SIZE 176 -- a 163 B reply padded to + // 176 made a 178 B frame that the companion silently dropped + int n = maintHandleRequest(sender->isAdmin(), payload, (int)payload_len, &reply_data[4], 150); return n > 0 ? 4 + n : 0; } diff --git a/examples/simple_room_server/MyMesh.cpp b/examples/simple_room_server/MyMesh.cpp index 1351985f..156c2a0d 100644 --- a/examples/simple_room_server/MyMesh.cpp +++ b/examples/simple_room_server/MyMesh.cpp @@ -159,7 +159,10 @@ int MyMesh::handleRequest(ClientInfo *sender, uint32_t sender_timestamp, uint8_t // only, helpers/FwUpdate.h). 0 = no reply: chunks are fire and forget. if (payload_len >= 1 && payload[0] == 0xF0) { extern int maintHandleRequest(bool admin, const uint8_t* req, int len, uint8_t* reply, int reply_max); - int n = maintHandleRequest(sender->isAdmin(), payload, (int)payload_len, &reply_data[4], 160); + // 150: tag + reply pads to 160 B, and the companion's push frame (6 + padded + // length - 4) must stay within MAX_FRAME_SIZE 176 -- a 163 B reply padded to + // 176 made a 178 B frame that the companion silently dropped + int n = maintHandleRequest(sender->isAdmin(), payload, (int)payload_len, &reply_data[4], 150); return n > 0 ? 4 + n : 0; }