mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-08-03 10:46:12 +00:00
feat(ui): message delivery status (DM ACK + channel relay)
End-to-end delivery indicators on the device UI, drawn next to outgoing messages and auto-scaled to the font (legible on landscape e-ink). DM (and room servers, which share the DM path): - Pending / delivered / failed marker driven by the real end-to-end ACK. Pending shows a row of dots — one per send — so auto-resend progress is visible before it resolves to ✓ / ✗. - Auto-resend: new pref dm_resend_count (0-5, default 2), Settings › Messages › Resend. A pending DM whose ACK times out is re-sent (reusing the original timestamp) until resends run out, then ✗. Driven from UITask::loop so it completes in the background, independent of screen. - Incoming dedup: a retry reuses the sender timestamp + text but carries a fresh packet hash, so addDMMsg drops copies matching prefix+ts+text. Channels (flood, no recipient ACK): - ✓ only once a repeater echo confirms the send was relayed into the mesh; no echo is normal, not a failure (no pending/fail shown). A small ring tracks a burst of sends so each matches its echo. Receive-path hashing is gated so the hot flood path is untouched when idle. Shared: - Markers shown in both the history list and the fullscreen message view. - Reusable scalable mini-icon facility in icons.h (bitmap + auto-scale); adding a new status icon is a bitmap plus one draw call. No changes to the upstream mesh library (src/). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
8545454f5b
commit
bcf8774962
@@ -201,6 +201,12 @@ protected:
|
||||
void apcSampleSnr(float snr);
|
||||
void apcOnFailure();
|
||||
void apcTrackFloodSend(const mesh::Packet* pkt);
|
||||
void trackRelaySend(const mesh::Packet* pkt); // arm the UI relayed-into-mesh tracker
|
||||
public:
|
||||
// Seq of the most recently tracked channel send — the UI records it on the
|
||||
// outgoing history entry so a heard echo (onChannelRelayed) can match it back.
|
||||
uint32_t lastChannelRelaySeq() const { return _last_relay_seq; }
|
||||
private:
|
||||
|
||||
// DataStoreHost methods
|
||||
bool onContactLoaded(const ContactInfo& contact) override { return addContact(contact); }
|
||||
@@ -291,6 +297,23 @@ private:
|
||||
uint16_t _apc_flood_len; // its payload length — cheap pre-filter before hashing
|
||||
uint32_t _apc_flood_deadline; // echo-wait deadline for that send
|
||||
bool _apc_flood_pending; // a tracked flood send is awaiting its echo
|
||||
// UI "relayed into mesh" tracker for channel sends — independent of APC. A small
|
||||
// ring so a quick burst of channel sends are each tracked (not just the latest).
|
||||
// Hashing on receive only runs while at least one slot is pending, so the hot
|
||||
// flood-recv path is untouched otherwise.
|
||||
static const int RELAY_RING = 4;
|
||||
struct RelaySlot {
|
||||
uint8_t hash[MAX_HASH_SIZE];
|
||||
uint16_t len;
|
||||
uint32_t deadline;
|
||||
uint32_t seq;
|
||||
bool pending;
|
||||
};
|
||||
RelaySlot _relay[RELAY_RING];
|
||||
int _relay_head; // next ring slot to overwrite
|
||||
int _relay_active; // number of slots currently pending (cheap gate)
|
||||
uint32_t _relay_seq; // monotonic id counter for tracked sends
|
||||
uint32_t _last_relay_seq; // seq of the most recent tracked send (for the UI to record)
|
||||
bool send_unscoped; // force un-scoped flood (instead of using send_scope)
|
||||
char cli_command[80];
|
||||
uint8_t app_target_ver;
|
||||
|
||||
Reference in New Issue
Block a user