1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-13 05:06:30 +04:00

Merge branch 'fz-dev' into dev

This commit is contained in:
MX
2023-03-03 23:22:40 +03:00
130 changed files with 1608 additions and 1628 deletions

View File

@@ -259,12 +259,13 @@ void subghz_protocol_decoder_raw_feed(void* context, bool level, uint32_t durati
}
}
bool subghz_protocol_decoder_raw_deserialize(void* context, FlipperFormat* flipper_format) {
SubGhzProtocolStatus
subghz_protocol_decoder_raw_deserialize(void* context, FlipperFormat* flipper_format) {
furi_assert(context);
UNUSED(context);
UNUSED(flipper_format);
//ToDo stub, for backwards compatibility
return true;
return SubGhzProtocolStatusOk;
}
void subghz_protocol_decoder_raw_get_string(void* context, FuriString* output) {
@@ -342,25 +343,32 @@ void subghz_protocol_raw_gen_fff_data(FlipperFormat* flipper_format, const char*
} while(false);
}
bool subghz_protocol_encoder_raw_deserialize(void* context, FlipperFormat* flipper_format) {
SubGhzProtocolStatus
subghz_protocol_encoder_raw_deserialize(void* context, FlipperFormat* flipper_format) {
furi_assert(context);
SubGhzProtocolEncoderRAW* instance = context;
bool res = false;
SubGhzProtocolStatus res = SubGhzProtocolStatusError;
FuriString* temp_str;
temp_str = furi_string_alloc();
do {
if(!flipper_format_rewind(flipper_format)) {
FURI_LOG_E(TAG, "Rewind error");
res = SubGhzProtocolStatusErrorParserOthers;
break;
}
if(!flipper_format_read_string(flipper_format, "File_name", temp_str)) {
FURI_LOG_E(TAG, "Missing File_name");
res = SubGhzProtocolStatusErrorParserOthers;
break;
}
furi_string_set(instance->file_name, temp_str);
res = subghz_protocol_encoder_raw_worker_init(instance);
if(!subghz_protocol_encoder_raw_worker_init(instance)) {
res = SubGhzProtocolStatusErrorEncoderGetUpload;
break;
}
res = SubGhzProtocolStatusOk;
} while(false);
furi_string_free(temp_str);
return res;