From 965aa3eec1b6da26848d47f8b4fb591f0bc53709 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 26 May 2022 09:36:26 +0200 Subject: sen5x: verify crc when reading data --- include/driver/sen5x.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/driver/sen5x.h') diff --git a/include/driver/sen5x.h b/include/driver/sen5x.h index 47d92a0..bc7b54b 100644 --- a/include/driver/sen5x.h +++ b/include/driver/sen5x.h @@ -13,6 +13,9 @@ class SEN5x { unsigned char txbuf[2]; unsigned char rxbuf[24]; + unsigned char crcWord(unsigned char byte1, unsigned char byte2); + bool crcValid(unsigned char* data, unsigned char length); + public: SEN5x() {} -- cgit v1.2.3