fix dea mio formula

thanks @Leptopt1los for working on that instead of sleeping lol
This commit is contained in:
MX 2024-01-31 00:50:52 +03:00
parent 28723949c4
commit 4fd0ce3eb5
No known key found for this signature in database
GPG Key ID: 7CCC66B7DBDD1C83

View File

@ -255,7 +255,7 @@ static bool subghz_protocol_keeloq_gen_data(
// Centurion -> no serial in hop, uses fixed value 0x1CE - normal learning // Centurion -> no serial in hop, uses fixed value 0x1CE - normal learning
} else if(strcmp(instance->manufacture_name, "Dea_Mio") == 0) { } else if(strcmp(instance->manufacture_name, "Dea_Mio") == 0) {
uint8_t first_disc_num = (instance->generic.serial >> 8) & 0xF; uint8_t first_disc_num = (instance->generic.serial >> 8) & 0xF;
uint8_t result_disc = (0xC + ((first_disc_num % 4) ? 2 : 0)); uint8_t result_disc = (0xC + (first_disc_num % 4));
uint32_t dea_serial = (instance->generic.serial & 0xFF) | uint32_t dea_serial = (instance->generic.serial & 0xFF) |
(((uint32_t)result_disc) << 8); (((uint32_t)result_disc) << 8);
decrypt = btn << 28 | (dea_serial & 0xFFF) << 16 | instance->generic.cnt; decrypt = btn << 28 | (dea_serial & 0xFFF) << 16 | instance->generic.cnt;