new window ID is returned

This commit is contained in:
2026-02-09 23:24:09 +00:00
parent c4288d4542
commit 61a310516b
3 changed files with 20 additions and 1 deletions
+8
View File
@@ -16,3 +16,11 @@ void initIdentificationPacket(IdentificationPacket* packet, const char* name,
strncpy(packet->deviceName, name, strlen(name));
packet->deviceName[strlen(name)] = '\0';
}
void initWindowIDReply(WindowIDReply* pkt, int16_t id) {
memset(pkt, 0, sizeof(*pkt));
pkt->StarMarker = 0x02;
pkt->EndMarker = 0x03;
pkt->wID = id;
}
+8
View File
@@ -27,4 +27,12 @@ struct __attribute__((packed)) NewWindowBody {
char EndMarker;
};
struct __attribute__((packed)) WindowIDReply {
char StarMarker;
int16_t wID;
char EndMarker;
};
void initWindowIDReply(WindowIDReply* pkt, int16_t id);
#endif
+4 -1
View File
@@ -124,8 +124,11 @@ void loop(void) {
}
LOG_INFO(F("Successfully added a new window: %d\n"), newWindowID);
// Now we return the ID of this new window - esdi should expect it
WindowIDReply wID;
initWindowIDReply(&wID, newWindowID);
WalkieTalkie::SendData(&wID);
break;
}