mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-10-31 22:02:17 +01:00
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:
parent
ea973809e2
commit
77237111ea
22 changed files with 851 additions and 22 deletions
|
|
@ -34,6 +34,29 @@
|
|||
TYPE(unpairShade, 23, 'c') \
|
||||
TYPE(setRollingCode, 24, 'c') \
|
||||
TYPE(sendRemoteCommand, 25, 'c') \
|
||||
TYPE(addRoom, 26, 'c') \
|
||||
TYPE(addShade, 27, 'c') \
|
||||
TYPE(addGroup, 28, 'c') \
|
||||
TYPE(saveRoom, 29, 'c') \
|
||||
TYPE(saveShade, 30, 'c') \
|
||||
TYPE(saveGroup, 31, 'c') \
|
||||
TYPE(deleteRoom, 32, 'c') \
|
||||
TYPE(deleteShade, 33, 'c') \
|
||||
TYPE(deleteGroup, 34, 'c') \
|
||||
TYPE(linkRemote, 35, 'c') \
|
||||
TYPE(unlinkRemote, 36, 'c') \
|
||||
TYPE(linkToGroup, 37, 'c') \
|
||||
TYPE(unlinkFromGroup, 38, 'c') \
|
||||
TYPE(linkRepeater, 39, 'c') \
|
||||
TYPE(unlinkRepeater, 40, 'c') \
|
||||
TYPE(setPaired, 41, 'c') \
|
||||
TYPE(roomSortOrder, 42, 'c') \
|
||||
TYPE(shadeSortOrder, 43, 'c') \
|
||||
TYPE(groupSortOrder, 44, 'c') \
|
||||
TYPE(getNextRoom, 45, 'c') \
|
||||
TYPE(getNextShade, 46, 'c') \
|
||||
TYPE(getNextGroup, 47, 'c') \
|
||||
TYPE(groupOptions, 48, 'c') \
|
||||
TYPE(shadeState, 128, 'd') \
|
||||
TYPE(shade, 129, 'd') \
|
||||
TYPE(shadeRemoved, 130, 'd') \
|
||||
|
|
@ -124,6 +147,8 @@
|
|||
FIELD(repeat, "re", 'i', 0) \
|
||||
FIELD(sunny, "sn", 'b', 0) \
|
||||
FIELD(windy, "wn", 'b', 0) \
|
||||
/* the edit ops */ \
|
||||
FIELD(validation, "vc", 'i', 0) \
|
||||
/* the header */ \
|
||||
FIELD(maxRooms, "xr", 'i', 0) \
|
||||
FIELD(maxShades, "xs", 'i', 0) \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue