Add unencrypted packet support to the cache

This commit is contained in:
Steve Gilberd 2025-10-27 15:46:28 +13:00
parent d46f7b66ba
commit 5f8a67863d
No known key found for this signature in database
GPG Key ID: 3CA3675E3C90637F
2 changed files with 4 additions and 2 deletions

View File

@ -52,6 +52,7 @@ PacketCacheEntry *PacketCache::cache(const meshtastic_MeshPacket *p, bool preser
m.reply_id = p->decoded.reply_id;
else if (p->decoded.request_id)
m.request_id = p->decoded.request_id;
m.tx_unencrypted = !!p->decoded.tx_unencrypted;
}
e->payload_len = p->decoded.payload.size;
memcpy(((unsigned char *)e) + sizeof(PacketCacheEntry), p->decoded.payload.bytes, p->decoded.payload.size);
@ -203,6 +204,7 @@ void PacketCache::rehydrate(const PacketCacheEntry *e, meshtastic_MeshPacket *p)
p->decoded.reply_id = m.reply_id;
else if (m.request_id)
p->decoded.request_id = m.request_id;
p->decoded.tx_unencrypted = m.tx_unencrypted;
}
}
}

View File

@ -44,8 +44,8 @@ typedef struct PacketCacheMetadata {
struct {
uint8_t _bitfield2;
union {
uint8_t priority : 7; // meshtastic_MeshPacket::priority
uint8_t reserved : 1; // Reserved for future use
uint8_t priority : 7; // meshtastic_MeshPacket::priority
uint8_t tx_unencrypted : 1; // meshtastic_MeshPacket::tx_unencrypted
};
};
} PacketCacheMetadata;