Ack message cleanup

This commit is contained in:
HarukiToreda
2025-09-28 00:58:48 -04:00
parent 28502c93c9
commit 3e4f654f58
5 changed files with 113 additions and 55 deletions

View File

@@ -13,10 +13,11 @@ enum class MessageType : uint8_t { BROADCAST = 0, DM_TO_US = 1 };
// Delivery status for messages we sent
enum class AckStatus : uint8_t {
UNKNOWN = 0, // default (not yet resolved)
ACKED = 1, // got a valid ACK
NONE = 0, // just sent, waiting (no symbol shown)
ACKED = 1, // got a valid ACK from destination
NACKED = 2, // explicitly failed
TIMEOUT = 3 // no ACK after retry window
TIMEOUT = 3, // no ACK after retry window
RELAYED = 4 // got an ACK from relay, not destination
};
struct StoredMessage {
@@ -43,7 +44,7 @@ struct StoredMessage {
// Default constructor to initialize all fields safely
StoredMessage()
: timestamp(0), sender(0), channelIndex(0), text(""), dest(0xffffffff), type(MessageType::BROADCAST),
isBootRelative(false), ackStatus(AckStatus::UNKNOWN)
isBootRelative(false), ackStatus(AckStatus::NONE) // start as NONE (waiting, no symbol)
{
}
};
@@ -92,4 +93,4 @@ class MessageStore
};
// Global instance (defined in MessageStore.cpp)
extern MessageStore messageStore;
extern MessageStore messageStore;