From 3698fc8d02c01a966d3300fb211f7fb515cc1ef5 Mon Sep 17 00:00:00 2001 From: Justin Nesselrotte Date: Wed, 19 Feb 2025 18:10:41 -0700 Subject: [PATCH] Fixed repeat in subghz tx_from_file command (#4099) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fixed repeat in subghz tx_from_file command * Fix PVS warnings Co-authored-by: あく --- applications/main/subghz/subghz_cli.c | 2 +- lib/lfrfid/protocols/protocol_noralsy.c | 33 ++++++++----------------- 2 files changed, 11 insertions(+), 24 deletions(-) diff --git a/applications/main/subghz/subghz_cli.c b/applications/main/subghz/subghz_cli.c index 6375f2eee4..88f9bfa38d 100644 --- a/applications/main/subghz/subghz_cli.c +++ b/applications/main/subghz/subghz_cli.c @@ -615,7 +615,7 @@ void subghz_cli_command_tx_from_file(Cli* cli, FuriString* args, void* context) if(furi_string_size(args)) { char* args_cstr = (char*)furi_string_get_cstr(args); StrintParseError parse_err = StrintParseNoError; - parse_err |= strint_to_uint32(args_cstr, &args_cstr, &frequency, 10); + parse_err |= strint_to_uint32(args_cstr, &args_cstr, &repeat, 10); parse_err |= strint_to_uint32(args_cstr, &args_cstr, &device_ind, 10); if(parse_err) { cli_print_usage( diff --git a/lib/lfrfid/protocols/protocol_noralsy.c b/lib/lfrfid/protocols/protocol_noralsy.c index 8ee9ab30a7..27cf8cb6ba 100644 --- a/lib/lfrfid/protocols/protocol_noralsy.c +++ b/lib/lfrfid/protocols/protocol_noralsy.c @@ -168,10 +168,7 @@ bool protocol_noralsy_write_data(ProtocolNoralsy* protocol, void* data) { return result; } -static void protocol_noralsy_render_data_internal( - ProtocolNoralsy* protocol, - FuriString* result, - bool brief) { +static void protocol_noralsy_render_data_internal(ProtocolNoralsy* protocol, FuriString* result) { UNUSED(protocol); uint32_t raw2 = bit_lib_get_bits_32(protocol->data, 32, 32); uint32_t raw3 = bit_lib_get_bits_32(protocol->data, 64, 32); @@ -181,31 +178,21 @@ static void protocol_noralsy_render_data_internal( uint8_t year = (raw2 & 0x000ff000) >> 12; bool tag_is_gen_z = (year > 0x60); - if(brief) { - furi_string_printf( - result, - "Card ID: %07lx\n" - "Year: %s%02x", - cardid, - tag_is_gen_z ? "19" : "20", - year); - } else { - furi_string_printf( - result, - "Card ID: %07lx\n" - "Year: %s%02x", - cardid, - tag_is_gen_z ? "19" : "20", - year); - } + furi_string_printf( + result, + "Card ID: %07lx\n" + "Year: %s%02x", + cardid, + tag_is_gen_z ? "19" : "20", + year); } void protocol_noralsy_render_data(ProtocolNoralsy* protocol, FuriString* result) { - protocol_noralsy_render_data_internal(protocol, result, false); + protocol_noralsy_render_data_internal(protocol, result); } void protocol_noralsy_render_brief_data(ProtocolNoralsy* protocol, FuriString* result) { - protocol_noralsy_render_data_internal(protocol, result, true); + protocol_noralsy_render_data_internal(protocol, result); } const ProtocolBase protocol_noralsy = {