diff options
Diffstat (limited to 'lib/subghz/protocols/hormann.c')
-rw-r--r-- | lib/subghz/protocols/hormann.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/subghz/protocols/hormann.c b/lib/subghz/protocols/hormann.c index f6f684cc..ac631251 100644 --- a/lib/subghz/protocols/hormann.c +++ b/lib/subghz/protocols/hormann.c @@ -154,7 +154,11 @@ bool subghz_protocol_encoder_hormann_deserialize(void* context, FlipperFormat* f FURI_LOG_E(TAG, "Deserialize error"); break; } - + if(instance->generic.data_count_bit != + subghz_protocol_hormann_const.min_count_bit_for_found) { + FURI_LOG_E(TAG, "Wrong number of bits in key"); + break; + } //optional parameter parameter flipper_format_read_uint32( flipper_format, "Repeat", (uint32_t*)&instance->encoder.repeat, 1); @@ -319,7 +323,19 @@ bool subghz_protocol_decoder_hormann_serialize( bool subghz_protocol_decoder_hormann_deserialize(void* context, FlipperFormat* flipper_format) { furi_assert(context); SubGhzProtocolDecoderHormann* instance = context; - return subghz_block_generic_deserialize(&instance->generic, flipper_format); + bool ret = false; + do { + if(!subghz_block_generic_deserialize(&instance->generic, flipper_format)) { + break; + } + if(instance->generic.data_count_bit != + subghz_protocol_hormann_const.min_count_bit_for_found) { + FURI_LOG_E(TAG, "Wrong number of bits in key"); + break; + } + ret = true; + } while(false); + return ret; } void subghz_protocol_decoder_hormann_get_string(void* context, string_t output) { |