handle Wiegand 8-bit keys (#4837)

Co-authored-by: Samuel Sieb <samuel@sieb.net>
This commit is contained in:
Samuel Sieb 2023-05-16 14:30:14 -07:00 committed by GitHub
parent 492bad645b
commit edfd82fd42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -102,6 +102,16 @@ void Wiegand::loop() {
uint8_t key = KEYS[value];
this->send_key_(key);
}
} else if (count == 8) {
if ((value ^ 0xf0) >> 4 == (value & 0xf)) {
value &= 0xf;
for (auto *trigger : this->key_triggers_)
trigger->trigger(value);
if (value < 12) {
uint8_t key = KEYS[value];
this->send_key_(key);
}
}
} else {
ESP_LOGD(TAG, "received unknown %d-bit value: %llx", count, value);
}