From a062a3acd654db5aadcb7cdac91a1aa711d2f7f2 Mon Sep 17 00:00:00 2001 From: Rodrigo Alfonso Date: Fri, 3 Jan 2025 08:39:35 -0300 Subject: [PATCH] Extracting event constants --- lib/LinkRawWireless.hpp | 4 ++++ lib/LinkWirelessMultiboot.hpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/LinkRawWireless.hpp b/lib/LinkRawWireless.hpp index c5f68c1..62b2b5a 100644 --- a/lib/LinkRawWireless.hpp +++ b/lib/LinkRawWireless.hpp @@ -84,6 +84,10 @@ class LinkRawWireless { static constexpr int COMMAND_RECEIVE_DATA = 0x26; static constexpr int COMMAND_WAIT = 0x27; static constexpr int COMMAND_BYE = 0x3d; + static constexpr int EVENT_WAIT_TIMEOUT = 0x27; + static constexpr int EVENT_DATA_AVAILABLE = 0x28; + static constexpr int EVENT_DISCONNECTED = 0x29; + static constexpr u16 LOGIN_PARTS[] = {0x494e, 0x494e, 0x544e, 0x544e, 0x4e45, 0x4e45, 0x4f44, 0x4f44, 0x8001}; diff --git a/lib/LinkWirelessMultiboot.hpp b/lib/LinkWirelessMultiboot.hpp index 7eabfa6..fe79ce9 100644 --- a/lib/LinkWirelessMultiboot.hpp +++ b/lib/LinkWirelessMultiboot.hpp @@ -519,7 +519,7 @@ class LinkWirelessMultiboot { return FAILURE; } - if (remoteCommand.commandId != 0x28) { + if (remoteCommand.commandId != LinkRawWireless::EVENT_DATA_AVAILABLE) { _LWMLOG_("! expected EVENT 0x28"); _LWMLOG_("! but got " + toHex(remoteCommand.commandId)); return FAILURE;