Use PacketCRC helper

This commit is contained in:
2023-12-09 09:57:11 +11:00
parent 33551d7e01
commit 041f09896a
3 changed files with 74 additions and 22 deletions

18
PacketCRC.h Normal file
View File

@@ -0,0 +1,18 @@
#ifndef PACKET_CRC_H
#define PACKET_CRC_H
#include <CRC16.h>
class PacketCRC {
public:
PacketCRC();
~PacketCRC();
// Method to calculate CRC for a packet
bool check(const uint8_t* packet);
uint16_t calculate(const uint8_t* packet);
private:
CRC16 crc;
};
#endif // PACKET_CRC_H