Initial commit

This commit is contained in:
Scott Powell
2025-01-13 14:07:48 +11:00
commit 6c7efdd0f6
59 changed files with 8604 additions and 0 deletions

23
src/Packet.cpp Normal file
View File

@@ -0,0 +1,23 @@
#include "Packet.h"
#include <string.h>
#include <SHA256.h>
namespace mesh {
Packet::Packet() {
header = 0;
path_len = 0;
payload_len = 0;
}
void Packet::calculatePacketHash(uint8_t* hash) const {
SHA256 sha;
uint8_t t = getPayloadType();
sha.update(&t, 1);
sha.update(payload, payload_len);
sha.finalize(hash, MAX_HASH_SIZE);
}
}