Fix SL 72bit false detections

This commit is contained in:
MX 2023-03-30 03:57:27 +03:00
parent bac1859432
commit e381951ecc
No known key found for this signature in database
GPG key ID: 7CCC66B7DBDD1C83
2 changed files with 20 additions and 5 deletions

View file

@ -1,11 +1,13 @@
### New changes ### New changes
* Plugins: Show External CC1101 module status in Weather Station and in POCSAG Pager plugins * Plugins: Show External CC1101 module status in Weather Station and in POCSAG Pager plugins
* SubGHz: Fix false detections of StarLine 72bit, flipper can decode only 64bit
* SubGHz: Clear code in "Add Manually" scene (by @gid9798 | PR #403) * SubGHz: Clear code in "Add Manually" scene (by @gid9798 | PR #403)
* Infrared: Universal remote assets updated (by @amec0e | PR #404) * Infrared: Universal remote assets updated (by @amec0e | PR #404)
* Plugins: GPS NMEA (UART) modifications * Plugins: GPS NMEA (UART) modifications
``` ```
- Ability to change baudrate using Up button, hold button to switch between baudrates (9600, 57600, 115200) (i set 57600 as default) - Ability to change baudrate using Up button, hold button to switch between baudrates (9600, 57600, 115200) (i set 57600 as default)
- Ok button will set backlight to always on mode, to disable press ok button again (it will restore default settings after app exit too) - Ok button will set backlight to always on mode, to disable press ok button again (it will restore default settings after app exit too)
- Long press Right button to change speed from knots to kilometers per hour
- Exit from app using long press on back button instead of short press, may be useful in case you want to turn backlight on and accidentally click back - Exit from app using long press on back button instead of short press, may be useful in case you want to turn backlight on and accidentally click back
``` ```
* OFW: Picopass: Elite progress * OFW: Picopass: Elite progress

View file

@ -419,11 +419,14 @@ void subghz_protocol_decoder_star_line_feed(void* context, bool level, uint32_t
if(duration >= (subghz_protocol_star_line_const.te_long + if(duration >= (subghz_protocol_star_line_const.te_long +
subghz_protocol_star_line_const.te_delta)) { subghz_protocol_star_line_const.te_delta)) {
instance->decoder.parser_step = StarLineDecoderStepReset; instance->decoder.parser_step = StarLineDecoderStepReset;
if(instance->decoder.decode_count_bit >= if((instance->decoder.decode_count_bit >=
subghz_protocol_star_line_const.min_count_bit_for_found) { subghz_protocol_star_line_const.min_count_bit_for_found) &&
(instance->decoder.decode_count_bit <=
subghz_protocol_star_line_const.min_count_bit_for_found + 2)) {
if(instance->generic.data != instance->decoder.decode_data) { if(instance->generic.data != instance->decoder.decode_data) {
instance->generic.data = instance->decoder.decode_data; instance->generic.data = instance->decoder.decode_data;
instance->generic.data_count_bit = instance->decoder.decode_count_bit; instance->generic.data_count_bit =
subghz_protocol_star_line_const.min_count_bit_for_found;
if(instance->base.callback) if(instance->base.callback)
instance->base.callback(&instance->base, instance->base.context); instance->base.callback(&instance->base, instance->base.context);
} }
@ -447,14 +450,24 @@ void subghz_protocol_decoder_star_line_feed(void* context, bool level, uint32_t
subghz_protocol_star_line_const.te_delta) && subghz_protocol_star_line_const.te_delta) &&
(DURATION_DIFF(duration, subghz_protocol_star_line_const.te_short) < (DURATION_DIFF(duration, subghz_protocol_star_line_const.te_short) <
subghz_protocol_star_line_const.te_delta)) { subghz_protocol_star_line_const.te_delta)) {
subghz_protocol_blocks_add_bit(&instance->decoder, 0); if(instance->decoder.decode_count_bit <
subghz_protocol_star_line_const.min_count_bit_for_found) {
subghz_protocol_blocks_add_bit(&instance->decoder, 0);
} else {
instance->decoder.decode_count_bit++;
}
instance->decoder.parser_step = StarLineDecoderStepSaveDuration; instance->decoder.parser_step = StarLineDecoderStepSaveDuration;
} else if( } else if(
(DURATION_DIFF(instance->decoder.te_last, subghz_protocol_star_line_const.te_long) < (DURATION_DIFF(instance->decoder.te_last, subghz_protocol_star_line_const.te_long) <
subghz_protocol_star_line_const.te_delta) && subghz_protocol_star_line_const.te_delta) &&
(DURATION_DIFF(duration, subghz_protocol_star_line_const.te_long) < (DURATION_DIFF(duration, subghz_protocol_star_line_const.te_long) <
subghz_protocol_star_line_const.te_delta)) { subghz_protocol_star_line_const.te_delta)) {
subghz_protocol_blocks_add_bit(&instance->decoder, 1); if(instance->decoder.decode_count_bit <
subghz_protocol_star_line_const.min_count_bit_for_found) {
subghz_protocol_blocks_add_bit(&instance->decoder, 1);
} else {
instance->decoder.decode_count_bit++;
}
instance->decoder.parser_step = StarLineDecoderStepSaveDuration; instance->decoder.parser_step = StarLineDecoderStepSaveDuration;
} else { } else {
instance->decoder.parser_step = StarLineDecoderStepReset; instance->decoder.parser_step = StarLineDecoderStepReset;