new window ID is returned
This commit is contained in:
@@ -16,3 +16,11 @@ void initIdentificationPacket(IdentificationPacket* packet, const char* name,
|
|||||||
strncpy(packet->deviceName, name, strlen(name));
|
strncpy(packet->deviceName, name, strlen(name));
|
||||||
packet->deviceName[strlen(name)] = '\0';
|
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;
|
||||||
|
}
|
||||||
|
|||||||
@@ -27,4 +27,12 @@ struct __attribute__((packed)) NewWindowBody {
|
|||||||
char EndMarker;
|
char EndMarker;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct __attribute__((packed)) WindowIDReply {
|
||||||
|
char StarMarker;
|
||||||
|
int16_t wID;
|
||||||
|
char EndMarker;
|
||||||
|
};
|
||||||
|
|
||||||
|
void initWindowIDReply(WindowIDReply* pkt, int16_t id);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+4
-1
@@ -124,8 +124,11 @@ void loop(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
LOG_INFO(F("Successfully added a new window: %d\n"), newWindowID);
|
LOG_INFO(F("Successfully added a new window: %d\n"), newWindowID);
|
||||||
|
|
||||||
// Now we return the ID of this new window - esdi should expect it
|
// Now we return the ID of this new window - esdi should expect it
|
||||||
|
WindowIDReply wID;
|
||||||
|
initWindowIDReply(&wID, newWindowID);
|
||||||
|
WalkieTalkie::SendData(&wID);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user