Skip to content

Commit 3e96806

Browse files
committed
honeywell read old files with 62-63bits
change them on the fly to new format during reading, files are not replaced, they will contain old format, you can fix them manually by replacing header to FF FE and bits to 64
1 parent cf57618 commit 3e96806

1 file changed

Lines changed: 20 additions & 4 deletions

File tree

lib/subghz/protocols/honeywell.c

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -371,10 +371,26 @@ SubGhzProtocolStatus
371371
subghz_protocol_decoder_honeywell_deserialize(void* context, FlipperFormat* flipper_format) {
372372
furi_assert(context);
373373
SubGhzProtocolDecoderHoneywell* instance = context;
374-
return subghz_block_generic_deserialize_check_count_bit(
375-
&instance->generic,
376-
flipper_format,
377-
subghz_protocol_honeywell_const.min_count_bit_for_found);
374+
375+
SubGhzProtocolStatus res = SubGhzProtocolStatusError;
376+
res = subghz_block_generic_deserialize(&instance->generic, flipper_format);
377+
if(res != SubGhzProtocolStatusOk) {
378+
return res;
379+
}
380+
381+
if(instance->generic.data_count_bit != 64) {
382+
// Removing possible artifacts from higher bits and setting header to FF FE
383+
instance->generic.data =
384+
((((((0xFF << 16) | ((instance->generic.data >> 40) & 0xFFFF)) << 16) |
385+
((instance->generic.data >> 24) & 0xFFFF))
386+
<< 16) |
387+
((instance->generic.data >> 8) & 0xFFFF))
388+
<< 8 |
389+
(instance->generic.data & 0xFF);
390+
instance->generic.data_count_bit = 64;
391+
}
392+
393+
return res;
378394
}
379395

380396
void subghz_protocol_decoder_honeywell_get_string(void* context, FuriString* output) {

0 commit comments

Comments
 (0)