Merge pull request #2772 from jmichelp/master

Fix wiegand InnerRange56
This commit is contained in:
Iceman 2025-03-08 19:39:38 +01:00 committed by GitHub
commit 9910a5fee6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1367,8 +1367,8 @@ static bool Pack_IR56(int format_idx, wiegand_card_t *card, wiegand_message_t *p
if (!validate_card_limit(format_idx, card)) return false; if (!validate_card_limit(format_idx, card)) return false;
set_linear_field(packed, card->FacilityCode, 1, 24); packed->Bot = card->CardNumber;
set_linear_field(packed, card->CardNumber, 25, 32); packed->Mid = card->FacilityCode;
if (preamble) if (preamble)
return add_HID_header(packed); return add_HID_header(packed);
@ -1381,8 +1381,8 @@ static bool Unpack_IR56(wiegand_message_t *packed, wiegand_card_t *card) {
if (packed->Length != 56) return false; if (packed->Length != 56) return false;
card->FacilityCode = get_linear_field(packed, 1, 24); card->FacilityCode = packed->Mid;
card->CardNumber = get_linear_field(packed, 25, 32); card->CardNumber = packed->Bot;
return true; return true;
} }
// --------------------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------------------