Преглед изворни кода

Correct H10301 parity check

Eric Betts пре 1 година
родитељ
комит
30d5c440e6
1 измењених фајлова са 4 додато и 3 уклоњено
  1. 4 3
      wiegand.c

+ 4 - 3
wiegand.c

@@ -67,9 +67,10 @@ static int wiegand_h10301_parse(uint8_t bit_length, uint64_t bits, FuriString* d
     uint8_t eBit = (eBitMask & bits) >> 25;
     uint8_t oBit = (oBitMask & bits) >> 0;
 
-    bool eParity = bit_lib_test_parity_32((bits & eParityMask) >> 13, BitLibParityEven) &&
-                   eBit == 1;
-    bool oParity = bit_lib_test_parity_32((bits & oParityMask) >> 1, BitLibParityOdd) && oBit == 1;
+    bool eParity = bit_lib_test_parity_32((bits & eParityMask) >> 13, BitLibParityEven) ==
+                   (eBit == 1);
+    bool oParity = bit_lib_test_parity_32((bits & oParityMask) >> 1, BitLibParityOdd) ==
+                   (oBit == 1);
 
     FURI_LOG_D(
         PLUGIN_APP_ID,