From f66d02d6083969e55eea21155c527c4634d224cc Mon Sep 17 00:00:00 2001 From: tomasyk <50111214+tomasyk@users.noreply.github.com> Date: Sun, 5 Jan 2020 15:45:46 +0100 Subject: [PATCH] Remove comparing bufffer functionality I am using HID for Oregon Scientific WMRS200, and polling reports removed any sequence of 2 or more identical characters, e.g. instead valid sequence FF FF 0 42 0 B8 0 2C 3C 0 0 0 62 1 i get FF 0 42 0 B8 0 2C 3C 0 62 1 There is no need to compare previous buffer with current buffer, as they can be identical and still this should not be ignored. My sequences are built from smaller sequences, where first byte is lenght of sequence to concatenate. Usually it is concatenated from sequences of 1 byte. E.g. 01 FF, 01 FF, 01 00, 01 42 etc. But current code is filtering second 01 FF and result is only one FF in sequence, instead of FF FF. Filtering is not needed, because data are obtained using inTransfer. --- hiduniversal.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/hiduniversal.cpp b/hiduniversal.cpp index bbd06af7..cb9b0576 100644 --- a/hiduniversal.cpp +++ b/hiduniversal.cpp @@ -406,12 +406,6 @@ uint8_t HIDUniversal::Poll() { if(read > constBuffLen) read = constBuffLen; - bool identical = BuffersIdentical(read, buf, prevBuf); - - SaveBuffer(read, buf, prevBuf); - - if(identical) - return 0; #if 0 Notify(PSTR("\r\nBuf: "), 0x80);