diff --git a/models/cross/xremote_remote_item.c b/models/cross/xremote_remote_item.c index 7b7d7078347..27b13456572 100644 --- a/models/cross/xremote_remote_item.c +++ b/models/cross/xremote_remote_item.c @@ -254,7 +254,8 @@ bool xremote_pause_save(FlipperFormat* ff, int32_t time, const char* name) { bool xremote_sg_signal_save(SubGhzRemote* remote, FlipperFormat* ff, const char* name) { if(!flipper_format_write_comment_cstr(ff, "") || !flipper_format_write_string_cstr(ff, "remote_type", "SG") || - !flipper_format_write_string_cstr(ff, "name", name)) { + !flipper_format_write_string_cstr(ff, "name", name) || + !flipper_format_write_string_cstr(ff, "filename", xremote_sg_remote_get_filename(remote))) { return false; } return xremote_sg_signal_save_data(remote, ff); diff --git a/models/subghz/xremote_sg_remote.c b/models/subghz/xremote_sg_remote.c index 41691e52224..083569ed103 100644 --- a/models/subghz/xremote_sg_remote.c +++ b/models/subghz/xremote_sg_remote.c @@ -24,6 +24,7 @@ struct SubGhzRemote { FuriString* name; + FuriString* filename; FuriString* path; SubGhzTxRx* txrx; uint32_t frequency; @@ -34,6 +35,10 @@ const char* xremote_sg_remote_get_name(SubGhzRemote* remote) { return furi_string_get_cstr(remote->name); } +const char* xremote_sg_remote_get_filename(SubGhzRemote* remote) { + return furi_string_get_cstr(remote->filename); +} + void subghz_preset_init( void* context, const char* preset_name, @@ -56,6 +61,7 @@ const char* subghz_txrx_radio_device_get_name(SubGhzTxRx* instance) { SubGhzRemote* xremote_sg_remote_alloc() { SubGhzRemote* remote = malloc(sizeof(SubGhzRemote)); remote->name = furi_string_alloc(); + remote->filename = furi_string_alloc(); remote->path = furi_string_alloc(); // SubGhz Settings @@ -86,6 +92,7 @@ SubGhzRemote* xremote_sg_remote_alloc() { void xremote_sg_remote_free(SubGhzRemote* remote) { furi_string_free(remote->path); furi_string_free(remote->name); + furi_string_free(remote->filename); // TXRX subghz_receiver_free(remote->txrx->receiver); @@ -145,6 +152,7 @@ bool xremote_sg_remote_load(SubGhzRemote* remote, FuriString* path) { } //remote->name = fileName; furi_string_set_str(remote->name, fileName); + furi_string_set_str(remote->filename, fileName); uint32_t version; if(!flipper_format_read_header(ff, buf, &version)) break; if(!furi_string_equal(buf, "Flipper SubGhz RAW File") || (version != 1)) break; @@ -181,6 +189,8 @@ bool xremote_sg_remote_load(SubGhzRemote* remote, FuriString* path) { break; } + + /*if(!strcmp(furi_string_get_cstr(buf), "RAW")) { subghz_protocol_raw_gen_fff_data( remote->txrx->fff_data, diff --git a/models/subghz/xremote_sg_remote.h b/models/subghz/xremote_sg_remote.h index 8ca93e8666e..8861f08bb68 100644 --- a/models/subghz/xremote_sg_remote.h +++ b/models/subghz/xremote_sg_remote.h @@ -9,6 +9,7 @@ typedef struct SubGhzRemote SubGhzRemote; const char* xremote_sg_remote_get_name(SubGhzRemote* remote); +const char* xremote_sg_remote_get_filename(SubGhzRemote* remote); SubGhzRemote* xremote_sg_remote_alloc(); diff --git a/xremote_i.h b/xremote_i.h index ef0d4362953..e2853e9ccf1 100644 --- a/xremote_i.h +++ b/xremote_i.h @@ -99,6 +99,7 @@ struct InfraredSignal { struct CrossRemoteItem { FuriString* name; + FuriString* filename; InfraredSignal* ir_signal; SubGhzRemote* sg_signal; int16_t type;