feat: edit ops and the reads their forms need, for socket protocol 2

The edit routes become ops 26-44 (addRoom ... groupSortOrder): ProtoEdits
turns an op's payload into the route's request, full names and real
booleans, and loop() applies it with applyModelEdit() as the route
does. The reply goes to the client that sent it, with an add's new id,
or the route's reason and a shade's validation code; the HTTP routes
keep sending requestResult.

getNextRoom, getNextShade, getNextGroup and groupOptions (45-48) are
answered by loop() from the shade model, through a new LoopQueue item.

Messages that arrive in pieces, a frame over one TCP segment or several
frames, are put back together by ProtoAssembly: one at a time across
clients, up to 4 KB, in a buffer held only while one is on its way.
A message in pieces is now told from its first frame's opcode, which
also stops a fragmented message's last frame drawing a second reply.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
cjkas 2026-10-24 14:29:53 +02:00
parent ea973809e2
commit 77237111ea
22 changed files with 851 additions and 22 deletions

View file

@ -26,6 +26,10 @@ class ProtoSocket {
bool hasClients() const;
// The reply to a command op once loop() has run its shade request.
void replyRequest(uint32_t client, uint32_t id, const shade_request_t &req, shade_request_result_t result);
// The reply to an edit op once loop() has applied it.
void replyEdit(uint32_t client, uint32_t id, model_edit_type_t type, const edit_result_t &result);
// The reply to a read op, from the shade model. loop() only.
void replyRead(uint32_t client, uint32_t id, uint8_t op, uint8_t groupId);
// Events, loop() only.
void shadeState(SomfyShade &shade);
void shade(SomfyShade &shade);