mirror of
https://github.com/meshtastic/firmware.git
synced 2025-10-27 15:02:41 +00:00
Add unencrypted packet support to the cache
This commit is contained in:
parent
d46f7b66ba
commit
5f8a67863d
@ -52,6 +52,7 @@ PacketCacheEntry *PacketCache::cache(const meshtastic_MeshPacket *p, bool preser
|
|||||||
m.reply_id = p->decoded.reply_id;
|
m.reply_id = p->decoded.reply_id;
|
||||||
else if (p->decoded.request_id)
|
else if (p->decoded.request_id)
|
||||||
m.request_id = 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;
|
e->payload_len = p->decoded.payload.size;
|
||||||
memcpy(((unsigned char *)e) + sizeof(PacketCacheEntry), p->decoded.payload.bytes, 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;
|
p->decoded.reply_id = m.reply_id;
|
||||||
else if (m.request_id)
|
else if (m.request_id)
|
||||||
p->decoded.request_id = m.request_id;
|
p->decoded.request_id = m.request_id;
|
||||||
|
p->decoded.tx_unencrypted = m.tx_unencrypted;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,8 +44,8 @@ typedef struct PacketCacheMetadata {
|
|||||||
struct {
|
struct {
|
||||||
uint8_t _bitfield2;
|
uint8_t _bitfield2;
|
||||||
union {
|
union {
|
||||||
uint8_t priority : 7; // meshtastic_MeshPacket::priority
|
uint8_t priority : 7; // meshtastic_MeshPacket::priority
|
||||||
uint8_t reserved : 1; // Reserved for future use
|
uint8_t tx_unencrypted : 1; // meshtastic_MeshPacket::tx_unencrypted
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
} PacketCacheMetadata;
|
} PacketCacheMetadata;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user