mirror of
https://github.com/D4C1-Labs/Flipper-ARF.git
synced 2026-03-30 19:06:01 +00:00
Compare commits
2 Commits
dev-cb1daa
...
dev-dc0f30
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dc0f30dad9 | ||
|
|
38f261e23b |
@@ -743,14 +743,6 @@ void subghz_protocol_decoder_psa_feed(void* context, bool level, uint32_t durati
|
|||||||
}
|
}
|
||||||
if(end_diff <= 199) {
|
if(end_diff <= 199) {
|
||||||
instance->validation_field = (uint16_t)(instance->decode_data_low & 0xFFFF);
|
instance->validation_field = (uint16_t)(instance->decode_data_low & 0xFFFF);
|
||||||
if((instance->validation_field & 0xf) != 0xa) {
|
|
||||||
instance->decode_data_low = 0;
|
|
||||||
instance->decode_data_high = 0;
|
|
||||||
instance->decode_count_bit = 0;
|
|
||||||
new_state = PSADecoderState0;
|
|
||||||
instance->state = new_state;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
instance->key2_low = instance->decode_data_low;
|
instance->key2_low = instance->decode_data_low;
|
||||||
instance->key2_high = instance->decode_data_high;
|
instance->key2_high = instance->decode_data_high;
|
||||||
instance->mode_serialize = 1;
|
instance->mode_serialize = 1;
|
||||||
@@ -766,6 +758,17 @@ void subghz_protocol_decoder_psa_feed(void* context, bool level, uint32_t durati
|
|||||||
instance->mode_serialize = 0x36;
|
instance->mode_serialize = 0x36;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Only fire callback if decrypted or validation nibble matches
|
||||||
|
if(instance->decrypted != 0x50 &&
|
||||||
|
(instance->validation_field & 0xf) != 0xa) {
|
||||||
|
instance->decode_data_low = 0;
|
||||||
|
instance->decode_data_high = 0;
|
||||||
|
instance->decode_count_bit = 0;
|
||||||
|
new_state = PSADecoderState0;
|
||||||
|
instance->state = new_state;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
instance->generic.data = ((uint64_t)instance->key1_high << 32) | instance->key1_low;
|
instance->generic.data = ((uint64_t)instance->key1_high << 32) | instance->key1_low;
|
||||||
instance->generic.data_count_bit = 64;
|
instance->generic.data_count_bit = 64;
|
||||||
instance->decoder.decode_data = instance->generic.data;
|
instance->decoder.decode_data = instance->generic.data;
|
||||||
@@ -1034,14 +1037,6 @@ void subghz_protocol_decoder_psa_feed(void* context, bool level, uint32_t durati
|
|||||||
}
|
}
|
||||||
|
|
||||||
instance->validation_field = (uint16_t)(instance->decode_data_low & 0xFFFF);
|
instance->validation_field = (uint16_t)(instance->decode_data_low & 0xFFFF);
|
||||||
if((instance->validation_field & 0xf) != 0xa) {
|
|
||||||
instance->decode_data_low = 0;
|
|
||||||
instance->decode_data_high = 0;
|
|
||||||
instance->decode_count_bit = 0;
|
|
||||||
new_state = PSADecoderState0;
|
|
||||||
instance->state = new_state;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
instance->key2_low = instance->decode_data_low;
|
instance->key2_low = instance->decode_data_low;
|
||||||
instance->key2_high = instance->decode_data_high;
|
instance->key2_high = instance->decode_data_high;
|
||||||
instance->mode_serialize = 2;
|
instance->mode_serialize = 2;
|
||||||
@@ -1057,6 +1052,17 @@ void subghz_protocol_decoder_psa_feed(void* context, bool level, uint32_t durati
|
|||||||
instance->mode_serialize = 0x36;
|
instance->mode_serialize = 0x36;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Only fire callback if decrypted or validation nibble matches
|
||||||
|
if(instance->decrypted != 0x50 &&
|
||||||
|
(instance->validation_field & 0xf) != 0xa) {
|
||||||
|
instance->decode_data_low = 0;
|
||||||
|
instance->decode_data_high = 0;
|
||||||
|
instance->decode_count_bit = 0;
|
||||||
|
new_state = PSADecoderState0;
|
||||||
|
instance->state = new_state;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
instance->generic.data = ((uint64_t)instance->key1_high << 32) | instance->key1_low;
|
instance->generic.data = ((uint64_t)instance->key1_high << 32) | instance->key1_low;
|
||||||
instance->generic.data_count_bit = 64;
|
instance->generic.data_count_bit = 64;
|
||||||
instance->decoder.decode_data = instance->generic.data;
|
instance->decoder.decode_data = instance->generic.data;
|
||||||
|
|||||||
Reference in New Issue
Block a user