瀏覽代碼

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,