mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-12-12 20:49:49 +04:00
Fixed repeat in subghz tx_from_file command (#4099)
* Fixed repeat in subghz tx_from_file command * Fix PVS warnings Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
committed by
GitHub
parent
04fa7a9a7f
commit
3698fc8d02
@@ -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(
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user