From 61a310516bada3ee39d09f2c808a2fd1a484db92 Mon Sep 17 00:00:00 2001 From: Eduardo Silva Date: Mon, 9 Feb 2026 23:24:09 +0000 Subject: [PATCH] new window ID is returned --- src/communication/packets.cpp | 8 ++++++++ src/communication/packets.h | 8 ++++++++ src/main.cpp | 5 ++++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/communication/packets.cpp b/src/communication/packets.cpp index 591a718..dd404a5 100644 --- a/src/communication/packets.cpp +++ b/src/communication/packets.cpp @@ -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; +} diff --git a/src/communication/packets.h b/src/communication/packets.h index 44cd6bb..e0e7afe 100644 --- a/src/communication/packets.h +++ b/src/communication/packets.h @@ -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 diff --git a/src/main.cpp b/src/main.cpp index 445e07a..87a459d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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; }