summaryrefslogtreecommitdiff
path: root/daemon/stm32crc.h
diff options
context:
space:
mode:
authorTomasz Sterna <tomek@xiaoka.com>2015-01-03 16:38:02 +0100
committerTomasz Sterna <tomek@xiaoka.com>2015-01-03 19:07:48 +0100
commit4e7da1944f5fa75a0739c0757d40a8102f045365 (patch)
tree5f3fe179256536e4135eb4d5031a1d754af5e26c /daemon/stm32crc.h
parent4150005566bec7827ce1cdd759a2397d47eba583 (diff)
parente6ec758b364fcaf9fda35e56740c3fcd7e8fe25e (diff)
Merge remote-tracking branch 'javispedro/js-testing'
Conflicts: daemon/daemon.pro daemon/dbusconnector.cpp daemon/manager.cpp daemon/watchcommands.cpp daemon/watchcommands.h daemon/watchconnector.cpp daemon/watchconnector.h log4qt-debug.conf log4qt-release.conf rpm/pebble.spec rpm/pebble.yaml
Diffstat (limited to 'daemon/stm32crc.h')
-rw-r--r--daemon/stm32crc.h24
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