diff --git a/applications/main/clock_app/resources/subplaylist/example_playlist.txt b/applications/main/clock_app/resources/subplaylist/example_playlist.txt index efa883cb08..e644351456 100644 --- a/applications/main/clock_app/resources/subplaylist/example_playlist.txt +++ b/applications/main/clock_app/resources/subplaylist/example_playlist.txt @@ -1,5 +1,6 @@ # Example file, it will not work, you need to add paths to your files! +delay: 60000 sub: /ext/subghz/Vehicles/Tesla/Tesla_charge_AM270.sub sub: /ext/subghz/Vehicles/Tesla/Tesla_charge_AM650.sub sub: /ext/subghz/Test1.sub -sub: /ext/subghz/Test2.sub \ No newline at end of file +sub: /ext/subghz/Test2.sub diff --git a/applications/main/subghz/subghz_cli.c b/applications/main/subghz/subghz_cli.c index e23b9c4dbc..0a4e217643 100644 --- a/applications/main/subghz/subghz_cli.c +++ b/applications/main/subghz/subghz_cli.c @@ -586,6 +586,7 @@ void subghz_cli_command_tx_from_file(Cli* cli, FuriString* args, void* context) furi_string_set(file_name, EXT_PATH("subghz/test.sub")); uint32_t repeat = 10; uint32_t device_ind = 0; // 0 - CC1101_INT, 1 - CC1101_EXT + uint32_t delay = 0; // Delay in milliseconds Storage* storage = furi_record_open(RECORD_STORAGE); FlipperFormat* fff_data_file = flipper_format_file_alloc(storage); @@ -756,6 +757,11 @@ void subghz_cli_command_tx_from_file(Cli* cli, FuriString* args, void* context) flipper_format_delete_key(fff_data_file, "Repeat"); } + // Load delay + if(!flipper_format_read_uint32(fff_data_file, "Delay", &delay, 1)) { + delay = 0; // Default to 0 if delay is not specified + } + if(is_init_protocol) { check_file = true; } else { @@ -801,6 +807,11 @@ void subghz_cli_command_tx_from_file(Cli* cli, FuriString* args, void* context) subghz_transmitter_deserialize(transmitter, fff_data_raw); } + // Apply delay if specified + if(delay > 0 && repeat) { + furi_delay_ms(delay); + } + } while(!cli_cmd_interrupt_received(cli) && (repeat && !strcmp(furi_string_get_cstr(temp_str), "RAW")));