update honeywell

by Willy-JL

aab879bebf/lib/subghz/protocols/honeywell.c
This commit is contained in:
MX 2024-01-13 15:30:26 +03:00
parent 9aae348cae
commit 34517ec43e
No known key found for this signature in database
GPG Key ID: 7CCC66B7DBDD1C83

View File

@ -86,9 +86,6 @@ void subghz_protocol_decoder_honeywell_addbit(void* context, bool data) {
instance->generic.data_count_bit = instance->generic.data_count_bit =
instance->decoder instance->decoder
.decode_count_bit; //maybe set it to 64, and hack the first 2 bits to 1! will see if replay needs it .decode_count_bit; //maybe set it to 64, and hack the first 2 bits to 1! will see if replay needs it
instance->generic.serial = (instance->decoder.decode_data >> 24) & 0xFFFFF;
instance->generic.btn = (instance->decoder.decode_data >> 16) &
0xFF; //not exactly button, but can contain btn data too.
if(instance->base.callback) if(instance->base.callback)
instance->base.callback(&instance->base, instance->base.context); instance->base.callback(&instance->base, instance->base.context);
instance->decoder.decode_data = 0; instance->decoder.decode_data = 0;
@ -166,6 +163,11 @@ void subghz_protocol_decoder_honeywell_get_string(void* context, FuriString* out
furi_assert(context); furi_assert(context);
SubGhzProtocolDecoderHoneywell* instance = context; SubGhzProtocolDecoderHoneywell* instance = context;
// Parse here and not in decode to avoid visual glitches when loading from file
instance->generic.serial = (instance->generic.data >> 24) & 0xFFFFF;
instance->generic.btn = (instance->generic.data >> 16) &
0xFF; //not exactly button, but can contain btn data too.
uint8_t channel = (instance->generic.data >> 44) & 0xF; uint8_t channel = (instance->generic.data >> 44) & 0xF;
uint8_t contact = (instance->generic.btn & 0x80) >> 7; uint8_t contact = (instance->generic.btn & 0x80) >> 7;
uint8_t tamper = (instance->generic.btn & 0x40) >> 6; uint8_t tamper = (instance->generic.btn & 0x40) >> 6;