mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
* repeater: various "region" CLI changes
* transport codes 0000 and FFFF reserved
This commit is contained in:
parent
2e63499ae5
commit
963290ea15
5 changed files with 28 additions and 6 deletions
|
|
@ -9,6 +9,11 @@ uint16_t TransportKey::calcTransportCode(const mesh::Packet* packet) const {
|
|||
sha.update(&type, 1);
|
||||
sha.update(packet->payload, packet->payload_len);
|
||||
sha.finalizeHMAC(key, sizeof(key), &code, 2);
|
||||
if (code == 0) { // reserve codes 0000 and FFFF
|
||||
code++;
|
||||
} else if (code == 0xFFFF) {
|
||||
code--;
|
||||
}
|
||||
return code;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue