SubGhz: loading/saving files from any folder below the parent (#1142)

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Skorpionm
2022-04-21 20:10:50 +04:00
committed by GitHub
parent 7c692a9f36
commit 0ff9f43eab
10 changed files with 126 additions and 117 deletions

View File

@@ -293,27 +293,19 @@ static bool subghz_protocol_encoder_raw_worker_init(SubGhzProtocolEncoderRAW* in
return instance->is_runing;
}
void subghz_protocol_raw_gen_fff_data(
FlipperFormat* flipper_format,
const char* path,
const char* file_name) {
string_t temp_str;
string_init(temp_str);
void subghz_protocol_raw_gen_fff_data(FlipperFormat* flipper_format, const char* file_path) {
do {
stream_clean(flipper_format_get_raw_stream(flipper_format));
if(!flipper_format_write_string_cstr(flipper_format, "Protocol", "RAW")) {
FURI_LOG_E(TAG, "Unable to add Protocol");
break;
}
string_printf(temp_str, "%s/%s%s", path, file_name, SUBGHZ_APP_EXTENSION);
if(!flipper_format_write_string_cstr(
flipper_format, "File_name", string_get_cstr(temp_str))) {
if(!flipper_format_write_string_cstr(flipper_format, "File_name", file_path)) {
FURI_LOG_E(TAG, "Unable to add File_name");
break;
}
} while(false);
string_clear(temp_str);
}
bool subghz_protocol_encoder_raw_deserialize(void* context, FlipperFormat* flipper_format) {

View File

@@ -113,13 +113,9 @@ void subghz_protocol_raw_file_encoder_worker_set_callback_end(
/**
* File generation for RAW work.
* @param flipper_format Pointer to a FlipperFormat instance
* @param path File path
* @param file_name File name
* @param file_path File path
*/
void subghz_protocol_raw_gen_fff_data(
FlipperFormat* flipper_format,
const char* path,
const char* file_name);
void subghz_protocol_raw_gen_fff_data(FlipperFormat* flipper_format, const char* file_path);
/**
* Deserialize and generating an upload to send.