Browse Source

Correct H10301 parity check

Eric Betts 1 year ago
parent
commit
30d5c440e6
1 changed files with 4 additions and 3 deletions
  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 eBit = (eBitMask & bits) >> 25;
     uint8_t oBit = (oBitMask & bits) >> 0;
     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(
     FURI_LOG_D(
         PLUGIN_APP_ID,
         PLUGIN_APP_ID,