mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-22 10:42:49 +00:00
Ignore seen phoneapi packets (#4888)
* Ignore PhoneAPI packet if it's been seen * ignoramus * Also keep track of the last 20 packet IDs * Fill * Make this match the nimble one * Add the log too * Ignore zero ID packets * Remove message entirely * TRunkt
This commit is contained in:
@@ -52,6 +52,7 @@ class PhoneAPI
|
||||
|
||||
// Hashmap of timestamps for last time we received a packet on the API per portnum
|
||||
std::unordered_map<meshtastic_PortNum, uint32_t> lastPortNumToRadio;
|
||||
uint32_t recentToRadioPacketIds[20]; // Last 20 ToRadio MeshPacket IDs we have seen
|
||||
|
||||
/**
|
||||
* Each packet sent to the phone has an incrementing count
|
||||
@@ -159,6 +160,8 @@ class PhoneAPI
|
||||
/// begin a new connection
|
||||
void handleStartConfig();
|
||||
|
||||
bool wasSeenRecently(uint32_t packetId);
|
||||
|
||||
/**
|
||||
* Handle a packet that the phone wants us to send. We can write to it but can not keep a reference to it
|
||||
* @return true true if a packet was queued for sending
|
||||
|
||||
Reference in New Issue
Block a user