diff options
Diffstat (limited to 'daemon/stm32crc.h')
| -rw-r--r-- | daemon/stm32crc.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/daemon/stm32crc.h b/daemon/stm32crc.h new file mode 100644 index 0000000..b21f5ed --- /dev/null +++ b/daemon/stm32crc.h @@ -0,0 +1,24 @@ +#ifndef STM32CRC_H +#define STM32CRC_H + +#include <QByteArray> + +class Stm32Crc +{ +public: + Stm32Crc(); + + void reset(); + + void addData(const char *data, int length); + void addData(const QByteArray &data); + + quint32 result() const; + +private: + quint32 crc; + quint8 buffer[4]; + quint8 rem; +}; + +#endif // STM32CRC_H |
