plugin 238 B

123456789101112131415161718192021222324
  1. commit 30d5c440e6ca1aa92c56999758b38c52f3972c8a
  2. Author: Eric Betts <bettse@fastmail.fm>
  3. Date: Thu Apr 18 16:29:34 2024 -0700
  4. Correct H10301 parity check
  5. diff --git a/wiegand.c b/wiegand.c
  6. index 424d40d40..1a87112d0 100644
  7. --- a/wiegand.c
  8. +++ b/wiegand.c
  9. @@ -67,9 +67,10 @@ static int wiegand_h10301_parse(uint8_t bit_length, uint64_t bits, FuriString* d
  10. uint8_t eBit = (eBitMask & bits) >> 25;
  11. uint8_t oBit = (oBitMask & bits) >> 0;
  12. - bool eParity = bit_lib_test_parity_32((bits & eParityMask) >> 13, BitLibParityEven) &&
  13. - eBit == 1;
  14. - bool oParity = bit_lib_test_parity_32((bits & oParityMask) >> 1, BitLibParityOdd) && oBit == 1;
  15. + bool eParity = bit_lib_test_parity_32((bits & eParityMask) >> 13, BitLibParityEven) ==
  16. + (eBit == 1);
  17. + bool oParity = bit_lib_test_parity_32((bits & oParityMask) >> 1, BitLibParityOdd) ==
  18. + (oBit == 1);
  19. FURI_LOG_D(
  20. PLUGIN_APP_ID,