diff --git a/applications/main/archive/archive.c b/applications/main/archive/archive.c index 0d61983f2..588087fd2 100644 --- a/applications/main/archive/archive.c +++ b/applications/main/archive/archive.c @@ -21,7 +21,7 @@ static void archive_tick_event_callback(void* context) { static ArchiveApp* archive_alloc() { ArchiveApp* archive = malloc(sizeof(ArchiveApp)); - string_init(archive->fav_move_str); + archive->fav_move_str = furi_string_alloc(); archive->scene_manager = scene_manager_alloc(&archive_scene_handlers, archive); archive->view_dispatcher = view_dispatcher_alloc(); diff --git a/applications/main/archive/archive_i.h b/applications/main/archive/archive_i.h index 7f4ff5a7b..b96145827 100644 --- a/applications/main/archive/archive_i.h +++ b/applications/main/archive/archive_i.h @@ -36,7 +36,7 @@ struct ArchiveApp { Loading* loading; FuriPubSubSubscription* loader_stop_subscription; - string_t fav_move_str; + FuriString* fav_move_str; char text_store[MAX_NAME_LEN]; char file_extension[MAX_EXT_LEN + 1]; }; diff --git a/applications/main/archive/helpers/archive_menu.h b/applications/main/archive/helpers/archive_menu.h index 201333987..47b8baa61 100644 --- a/applications/main/archive/helpers/archive_menu.h +++ b/applications/main/archive/helpers/archive_menu.h @@ -1,34 +1,33 @@ #pragma once #include -#include typedef struct { - string_t text; + FuriString* text; uint32_t event; } ArchiveContextMenuItem_t; static void ArchiveContextMenuItem_t_init(ArchiveContextMenuItem_t* obj) { - string_init(obj->text); + obj->text = furi_string_alloc(); obj->event = 0; // ArchiveBrowserEventFileMenuNone } static void ArchiveContextMenuItem_t_init_set( ArchiveContextMenuItem_t* obj, const ArchiveContextMenuItem_t* src) { - string_init_set(obj->text, src->text); + obj->text = furi_string_alloc_set(src->text); obj->event = src->event; } static void ArchiveContextMenuItem_t_set( ArchiveContextMenuItem_t* obj, const ArchiveContextMenuItem_t* src) { - string_init_set(obj->text, src->text); + obj->text = furi_string_alloc_set(src->text); obj->event = src->event; } static void ArchiveContextMenuItem_t_clear(ArchiveContextMenuItem_t* obj) { - string_clear(obj->text); + furi_string_free(obj->text); } ARRAY_DEF( @@ -42,8 +41,9 @@ ARRAY_DEF( #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-function" // Using in applications/archive/views/archive_browser_view.c -static void archive_menu_add_item(ArchiveContextMenuItem_t* obj, string_t text, uint32_t event) { - string_init_move(obj->text, text); +static void + archive_menu_add_item(ArchiveContextMenuItem_t* obj, FuriString* text, uint32_t event) { + obj->text = furi_string_alloc_move(text); obj->event = event; } #pragma GCC diagnostic pop \ No newline at end of file diff --git a/applications/main/archive/scenes/archive_scene_info.c b/applications/main/archive/scenes/archive_scene_info.c index 08c403b4b..6b9e1c1af 100644 --- a/applications/main/archive/scenes/archive_scene_info.c +++ b/applications/main/archive/scenes/archive_scene_info.c @@ -18,12 +18,12 @@ void archive_scene_info_on_enter(void* context) { widget_add_button_element( instance->widget, GuiButtonTypeLeft, "Back", archive_scene_info_widget_callback, instance); - string_t filename; - string_t dirname; - string_t str_size; - string_init(filename); - string_init(dirname); - string_init(str_size); + FuriString* filename; + FuriString* dirname; + FuriString* str_size; + filename = furi_string_alloc(); + dirname = furi_string_alloc(); + str_size = furi_string_alloc(); ArchiveFile_t* current = archive_get_current_file(instance->browser); char file_info_message[128]; @@ -31,48 +31,49 @@ void archive_scene_info_on_enter(void* context) { // Filename path_extract_filename(current->path, filename, false); - snprintf(file_info_message, sizeof(file_info_message), "\e#%s\e#", string_get_cstr(filename)); + snprintf( + file_info_message, sizeof(file_info_message), "\e#%s\e#", furi_string_get_cstr(filename)); widget_add_text_box_element( instance->widget, 0, 0, 128, 25, AlignLeft, AlignCenter, file_info_message, false); // Directory path - path_extract_dirname(string_get_cstr(current->path), dirname); - if(strcmp(string_get_cstr(dirname), "/any") == 0) { - string_replace_str(dirname, STORAGE_ANY_PATH_PREFIX, "/"); + path_extract_dirname(furi_string_get_cstr(current->path), dirname); + if(strcmp(furi_string_get_cstr(dirname), "/any") == 0) { + furi_string_replace(dirname, STORAGE_ANY_PATH_PREFIX, "/"); } else { - string_replace_str(dirname, STORAGE_ANY_PATH_PREFIX, ""); + furi_string_replace(dirname, STORAGE_ANY_PATH_PREFIX, ""); } // File size FileInfo fileinfo; - storage_common_stat(fs_api, string_get_cstr(current->path), &fileinfo); + storage_common_stat(fs_api, furi_string_get_cstr(current->path), &fileinfo); if(fileinfo.size <= 1024) { - string_printf(str_size, "%d", fileinfo.size); + furi_string_printf(str_size, "%d", fileinfo.size); snprintf( file_info_message, sizeof(file_info_message), "Size: \e#%s\e# bytes\n%s", - string_get_cstr(str_size), - string_get_cstr(dirname)); + furi_string_get_cstr(str_size), + furi_string_get_cstr(dirname)); } else { - string_printf(str_size, "%d", fileinfo.size / 1024); + furi_string_printf(str_size, "%d", fileinfo.size / 1024); snprintf( file_info_message, sizeof(file_info_message), "Size: \e#%s\e# Kb.\n%s", - string_get_cstr(str_size), - string_get_cstr(dirname)); + furi_string_get_cstr(str_size), + furi_string_get_cstr(dirname)); } widget_add_text_box_element( instance->widget, 0, 25, 128, 25, AlignLeft, AlignCenter, file_info_message, true); // This one to return and cursor select this file - path_extract_filename_no_ext(string_get_cstr(current->path), filename); - strlcpy(instance->text_store, string_get_cstr(filename), MAX_NAME_LEN); + path_extract_filename_no_ext(furi_string_get_cstr(current->path), filename); + strlcpy(instance->text_store, furi_string_get_cstr(filename), MAX_NAME_LEN); - string_clear(filename); - string_clear(dirname); - string_clear(str_size); + furi_string_free(filename); + furi_string_free(dirname); + furi_string_free(str_size); view_dispatcher_switch_to_view(instance->view_dispatcher, ArchiveViewWidget); } diff --git a/applications/main/archive/scenes/archive_scene_rename.c b/applications/main/archive/scenes/archive_scene_rename.c index 89f9ad4ff..5512b0619 100644 --- a/applications/main/archive/scenes/archive_scene_rename.c +++ b/applications/main/archive/scenes/archive_scene_rename.c @@ -22,22 +22,22 @@ void archive_scene_rename_on_enter(void* context) { TextInput* text_input = archive->text_input; ArchiveFile_t* current = archive_get_current_file(archive->browser); - string_t path_name; - string_init(path_name); + FuriString* path_name; + path_name = furi_string_alloc(); if(current->type == ArchiveFileTypeFolder) { - path_extract_basename(string_get_cstr(current->path), path_name); - strlcpy(archive->text_store, string_get_cstr(path_name), MAX_NAME_LEN); + path_extract_basename(furi_string_get_cstr(current->path), path_name); + strlcpy(archive->text_store, furi_string_get_cstr(path_name), MAX_NAME_LEN); text_input_set_header_text(text_input, "Rename directory:"); } else /*if(current->type != ArchiveFileTypeUnknown) */ { path_extract_filename(current->path, path_name, true); - strlcpy(archive->text_store, string_get_cstr(path_name), MAX_NAME_LEN); + strlcpy(archive->text_store, furi_string_get_cstr(path_name), MAX_NAME_LEN); path_extract_extension(current->path, archive->file_extension, MAX_EXT_LEN); text_input_set_header_text(text_input, "Rename file:"); } /*else { path_extract_filename(current->path, path_name, false); - strlcpy(archive->text_store, string_get_cstr(path_name), MAX_NAME_LEN); + strlcpy(archive->text_store, furi_string_get_cstr(path_name), MAX_NAME_LEN); text_input_set_header_text(text_input, "Rename unknown file:"); }*/ @@ -49,7 +49,7 @@ void archive_scene_rename_on_enter(void* context) { MAX_TEXT_INPUT_LEN, false); - string_clear(path_name); + furi_string_free(path_name); view_dispatcher_switch_to_view(archive->view_dispatcher, ArchiveViewTextInput); } @@ -63,27 +63,29 @@ bool archive_scene_rename_on_event(void* context, SceneManagerEvent event) { const char* path_src = archive_get_name(archive->browser); ArchiveFile_t* file = archive_get_current_file(archive->browser); - string_t path_dst; - string_init(path_dst); + FuriString* path_dst; + path_dst = furi_string_alloc(); if(file->type == ArchiveFileTypeFolder) { // Rename folder/dir path_extract_dirname(path_src, path_dst); - string_cat_printf(path_dst, "/%s", archive->text_store); + furi_string_cat_printf(path_dst, "/%s", archive->text_store); } else if(file->type != ArchiveFileTypeUnknown) { // Rename known type path_extract_dirname(path_src, path_dst); - string_cat_printf(path_dst, "/%s%s", archive->text_store, known_ext[file->type]); + furi_string_cat_printf( + path_dst, "/%s%s", archive->text_store, known_ext[file->type]); } else { // Rename unknown type path_extract_dirname(path_src, path_dst); - string_cat_printf(path_dst, "/%s%s", archive->text_store, archive->file_extension); + furi_string_cat_printf( + path_dst, "/%s%s", archive->text_store, archive->file_extension); } // Long time process if this is directory view_dispatcher_switch_to_view(archive->view_dispatcher, ArchiveViewStack); archive_show_loading_popup(archive, true); - FS_Error error = - archive_rename_file_or_dir(archive->browser, path_src, string_get_cstr(path_dst)); + FS_Error error = archive_rename_file_or_dir( + archive->browser, path_src, furi_string_get_cstr(path_dst)); archive_show_loading_popup(archive, false); archive_show_file_menu(archive->browser, false); @@ -92,11 +94,12 @@ bool archive_scene_rename_on_event(void* context, SceneManagerEvent event) { if(error == FSE_OK || error == FSE_EXIST) { scene_manager_next_scene(archive->scene_manager, ArchiveAppSceneBrowser); } else { - string_t dialog_msg; - string_init(dialog_msg); - string_cat_printf(dialog_msg, "Cannot rename\nCode: %d", error); - dialog_message_show_storage_error(archive->dialogs, string_get_cstr(dialog_msg)); - string_clear(dialog_msg); + FuriString* dialog_msg; + dialog_msg = furi_string_alloc(); + furi_string_cat_printf(dialog_msg, "Cannot rename\nCode: %d", error); + dialog_message_show_storage_error( + archive->dialogs, furi_string_get_cstr(dialog_msg)); + furi_string_free(dialog_msg); } consumed = true; } diff --git a/applications/main/archive/views/archive_browser_view.c b/applications/main/archive/views/archive_browser_view.c index 5a9ae093c..024d167ea 100644 --- a/applications/main/archive/views/archive_browser_view.c +++ b/applications/main/archive/views/archive_browser_view.c @@ -48,24 +48,24 @@ void archive_browser_set_callback( static void render_item_menu(Canvas* canvas, ArchiveBrowserViewModel* model) { if(menu_array_size(model->context_menu) == 0) { // Context menu is empty, init array - string_t item_run; - string_t item_pin; - string_t item_info; - string_t item_rename; - string_t item_delete; + FuriString* item_run; + FuriString* item_pin; + FuriString* item_info; + FuriString* item_rename; + FuriString* item_delete; - string_init_set_str(item_run, "Run In App"); - string_init_set_str(item_pin, "Pin"); - string_init_set_str(item_info, "Info"); - string_init_set_str(item_rename, "Rename"); - string_init_set_str(item_delete, "Delete"); + item_run = furi_string_alloc_set("Run In App"); + item_pin = furi_string_alloc_set("Pin"); + item_info = furi_string_alloc_set("Info"); + item_rename = furi_string_alloc_set("Rename"); + item_delete = furi_string_alloc_set("Delete"); // Need init context menu ArchiveFile_t* selected = files_array_get(model->files, model->item_idx - model->array_offset); if((selected->fav) || (model->tab_idx == ArchiveTabFavorites)) { - string_set_str(item_pin, "Unpin"); + furi_string_set(item_pin, "Unpin"); } if(selected->type == ArchiveFileTypeFolder) { @@ -96,7 +96,7 @@ static void render_item_menu(Canvas* canvas, ArchiveBrowserViewModel* model) { } else if(model->tab_idx == ArchiveTabFavorites) { //FURI_LOG_D(TAG, "ArchiveTabFavorites"); - string_set_str(item_rename, "Move"); + furi_string_set(item_rename, "Move"); archive_menu_add_item( menu_array_push_raw(model->context_menu), @@ -152,11 +152,11 @@ static void render_item_menu(Canvas* canvas, ArchiveBrowserViewModel* model) { ArchiveBrowserEventFileMenuDelete); } - string_clear(item_run); - string_clear(item_pin); - string_clear(item_info); - string_clear(item_rename); - string_clear(item_delete); + furi_string_free(item_run); + furi_string_free(item_pin); + furi_string_free(item_info); + furi_string_free(item_rename); + furi_string_free(item_delete); } /*else { FURI_LOG_D(TAG, "menu_array_size already set: %d", menu_array_size(model->context_menu)); }*/ @@ -178,7 +178,7 @@ static void render_item_menu(Canvas* canvas, ArchiveBrowserViewModel* model) { model->menu_idx);*/ for(size_t i = 0; i < size_menu; i++) { ArchiveContextMenuItem_t* current = menu_array_get(model->context_menu, i); - canvas_draw_str(canvas, 82, 21 + i * line_height, string_get_cstr(current->text)); + canvas_draw_str(canvas, 82, 21 + i * line_height, furi_string_get_cstr(current->text)); } canvas_draw_icon(canvas, 74, 14 + model->menu_idx * line_height, &I_ButtonRight_4x7); diff --git a/applications/main/bad_usb/bad_usb_app.c b/applications/main/bad_usb/bad_usb_app.c index de33dd513..bb29d3be5 100644 --- a/applications/main/bad_usb/bad_usb_app.c +++ b/applications/main/bad_usb/bad_usb_app.c @@ -1,6 +1,5 @@ #include "bad_usb_app_i.h" #include "bad_usb_settings_filename.h" -#include "m-string.h" #include #include #include @@ -32,7 +31,7 @@ static void bad_usb_load_settings(BadUsbApp* app) { char chr; while((storage_file_read(settings_file, &chr, 1) == 1) && !storage_file_eof(settings_file) && !isspace(chr)) { - string_push_back(app->keyboard_layout, chr); + furi_string_push_back(app->keyboard_layout, chr); } } storage_file_close(settings_file); @@ -44,8 +43,8 @@ static void bad_usb_save_settings(BadUsbApp* app) { if(storage_file_open(settings_file, BAD_USB_SETTINGS_PATH, FSAM_WRITE, FSOM_OPEN_ALWAYS)) { storage_file_write( settings_file, - string_get_cstr(app->keyboard_layout), - string_size(app->keyboard_layout)); + furi_string_get_cstr(app->keyboard_layout), + furi_string_size(app->keyboard_layout)); storage_file_write(settings_file, "\n", 1); } storage_file_close(settings_file); @@ -57,8 +56,8 @@ BadUsbApp* bad_usb_app_alloc(char* arg) { app->bad_usb_script = NULL; - string_init(app->file_path); - string_init(app->keyboard_layout); + app->file_path = furi_string_alloc(); + app->keyboard_layout = furi_string_alloc(); if(arg && strlen(arg)) { furi_string_set(app->file_path, arg); } @@ -101,12 +100,12 @@ BadUsbApp* bad_usb_app_alloc(char* arg) { app->error = BadUsbAppErrorCloseRpc; scene_manager_next_scene(app->scene_manager, BadUsbSceneError); } else { - if(!string_empty_p(app->file_path)) { + if(!furi_string_empty(app->file_path)) { app->bad_usb_script = bad_usb_script_open(app->file_path); bad_usb_script_set_keyboard_layout(app->bad_usb_script, app->keyboard_layout); scene_manager_next_scene(app->scene_manager, BadUsbSceneWork); } else { - string_set_str(app->file_path, BAD_USB_APP_BASE_FOLDER); + furi_string_set(app->file_path, BAD_USB_APP_BASE_FOLDER); scene_manager_next_scene(app->scene_manager, BadUsbSceneFileSelect); } } @@ -145,8 +144,8 @@ void bad_usb_app_free(BadUsbApp* app) { bad_usb_save_settings(app); - string_clear(app->file_path); - string_clear(app->keyboard_layout); + furi_string_free(app->file_path); + furi_string_free(app->keyboard_layout); free(app); } diff --git a/applications/main/bad_usb/bad_usb_app_i.h b/applications/main/bad_usb/bad_usb_app_i.h index 392411485..e950c0198 100644 --- a/applications/main/bad_usb/bad_usb_app_i.h +++ b/applications/main/bad_usb/bad_usb_app_i.h @@ -34,8 +34,8 @@ struct BadUsbApp { Submenu* submenu; BadUsbAppError error; - string_t file_path; - string_t keyboard_layout; + FuriString* file_path; + FuriString* keyboard_layout; BadUsb* bad_usb_view; BadUsbScript* bad_usb_script; }; diff --git a/applications/main/bad_usb/bad_usb_script.c b/applications/main/bad_usb/bad_usb_script.c index 778ccfe84..c30812bd0 100644 --- a/applications/main/bad_usb/bad_usb_script.c +++ b/applications/main/bad_usb/bad_usb_script.c @@ -600,12 +600,12 @@ static void bad_usb_script_set_default_keyboard_layout(BadUsbScript* bad_usb) { memcpy(bad_usb->layout, hid_asciimap, MIN(sizeof(hid_asciimap), sizeof(bad_usb->layout))); } -BadUsbScript* bad_usb_script_open(string_t file_path) { +BadUsbScript* bad_usb_script_open(FuriString* file_path) { furi_assert(file_path); BadUsbScript* bad_usb = malloc(sizeof(BadUsbScript)); - string_init(bad_usb->file_path); - string_set(bad_usb->file_path, file_path); + bad_usb->file_path = furi_string_alloc(); + furi_string_set(bad_usb->file_path, file_path); bad_usb_script_set_default_keyboard_layout(bad_usb); bad_usb->st.state = BadUsbStateInit; @@ -629,7 +629,7 @@ void bad_usb_script_close(BadUsbScript* bad_usb) { free(bad_usb); } -void bad_usb_script_set_keyboard_layout(BadUsbScript* bad_usb, string_t layout_path) { +void bad_usb_script_set_keyboard_layout(BadUsbScript* bad_usb, FuriString* layout_path) { furi_assert(bad_usb); if((bad_usb->st.state == BadUsbStateRunning) || (bad_usb->st.state == BadUsbStateDelay)) { @@ -638,9 +638,9 @@ void bad_usb_script_set_keyboard_layout(BadUsbScript* bad_usb, string_t layout_p } File* layout_file = storage_file_alloc(furi_record_open(RECORD_STORAGE)); - if(!string_empty_p(layout_path)) { + if(!furi_string_empty(layout_path)) { if(storage_file_open( - layout_file, string_get_cstr(layout_path), FSAM_READ, FSOM_OPEN_EXISTING)) { + layout_file, furi_string_get_cstr(layout_path), FSAM_READ, FSOM_OPEN_EXISTING)) { uint16_t layout[128]; if(storage_file_read(layout_file, layout, sizeof(layout)) == sizeof(layout)) { memcpy(bad_usb->layout, layout, sizeof(layout)); diff --git a/applications/main/bad_usb/bad_usb_script.h b/applications/main/bad_usb/bad_usb_script.h index 49cf0f3f8..d3bc37fbe 100644 --- a/applications/main/bad_usb/bad_usb_script.h +++ b/applications/main/bad_usb/bad_usb_script.h @@ -31,7 +31,7 @@ BadUsbScript* bad_usb_script_open(FuriString* file_path); void bad_usb_script_close(BadUsbScript* bad_usb); -void bad_usb_script_set_keyboard_layout(BadUsbScript* bad_usb, string_t layout_path); +void bad_usb_script_set_keyboard_layout(BadUsbScript* bad_usb, FuriString* layout_path); void bad_usb_script_start(BadUsbScript* bad_usb); diff --git a/applications/main/bad_usb/scenes/bad_usb_scene_config_layout.c b/applications/main/bad_usb/scenes/bad_usb_scene_config_layout.c index a1067f215..44dcd55af 100644 --- a/applications/main/bad_usb/scenes/bad_usb_scene_config_layout.c +++ b/applications/main/bad_usb/scenes/bad_usb_scene_config_layout.c @@ -6,12 +6,12 @@ static bool bad_usb_layout_select(BadUsbApp* bad_usb) { furi_assert(bad_usb); - string_t predefined_path; - string_init(predefined_path); - if(!string_empty_p(bad_usb->keyboard_layout)) { - string_set(predefined_path, bad_usb->keyboard_layout); + FuriString* predefined_path; + predefined_path = furi_string_alloc(); + if(!furi_string_empty(bad_usb->keyboard_layout)) { + furi_string_set(predefined_path, bad_usb->keyboard_layout); } else { - string_set_str(predefined_path, BAD_USB_APP_PATH_LAYOUT_FOLDER); + furi_string_set(predefined_path, BAD_USB_APP_PATH_LAYOUT_FOLDER); } DialogsFileBrowserOptions browser_options; @@ -22,7 +22,7 @@ static bool bad_usb_layout_select(BadUsbApp* bad_usb) { bool res = dialog_file_browser_show( bad_usb->dialogs, bad_usb->keyboard_layout, predefined_path, &browser_options); - string_clear(predefined_path); + furi_string_free(predefined_path); return res; } diff --git a/applications/main/bad_usb/scenes/bad_usb_scene_work.c b/applications/main/bad_usb/scenes/bad_usb_scene_work.c index dd493d628..2971c01e9 100644 --- a/applications/main/bad_usb/scenes/bad_usb_scene_work.c +++ b/applications/main/bad_usb/scenes/bad_usb_scene_work.c @@ -31,17 +31,17 @@ bool bad_usb_scene_work_on_event(void* context, SceneManagerEvent event) { void bad_usb_scene_work_on_enter(void* context) { BadUsbApp* app = context; - string_t file_name; - string_init(file_name); + FuriString* file_name; + file_name = furi_string_alloc(); path_extract_filename(app->file_path, file_name, true); - bad_usb_set_file_name(app->bad_usb_view, string_get_cstr(file_name)); - string_clear(file_name); + bad_usb_set_file_name(app->bad_usb_view, furi_string_get_cstr(file_name)); + furi_string_free(file_name); - string_t layout; - string_init(layout); + FuriString* layout; + layout = furi_string_alloc(); path_extract_filename(app->keyboard_layout, layout, true); - bad_usb_set_layout(app->bad_usb_view, string_get_cstr(layout)); - string_clear(layout); + bad_usb_set_layout(app->bad_usb_view, furi_string_get_cstr(layout)); + furi_string_free(layout); bad_usb_set_state(app->bad_usb_view, bad_usb_script_get_state(app->bad_usb_script)); diff --git a/applications/main/bad_usb/views/bad_usb_view.c b/applications/main/bad_usb/views/bad_usb_view.c index a31ba6356..fd746c341 100644 --- a/applications/main/bad_usb/views/bad_usb_view.c +++ b/applications/main/bad_usb/views/bad_usb_view.c @@ -25,21 +25,22 @@ static void bad_usb_draw_callback(Canvas* canvas, void* _model) { disp_str = furi_string_alloc_set(model->file_name); elements_string_fit_width(canvas, disp_str, 128 - 2); canvas_set_font(canvas, FontSecondary); - canvas_draw_str(canvas, 2, 8, string_get_cstr(disp_str)); + canvas_draw_str(canvas, 2, 8, furi_string_get_cstr(disp_str)); if(strlen(model->layout) == 0) { - string_set(disp_str, "(default)"); + furi_string_set(disp_str, "(default)"); } else { - string_reset(disp_str); - string_push_back(disp_str, '('); + furi_string_reset(disp_str); + furi_string_push_back(disp_str, '('); for(size_t i = 0; i < strlen(model->layout); i++) - string_push_back(disp_str, model->layout[i]); - string_push_back(disp_str, ')'); + furi_string_push_back(disp_str, model->layout[i]); + furi_string_push_back(disp_str, ')'); } elements_string_fit_width(canvas, disp_str, 128 - 2); - canvas_draw_str(canvas, 2, 8 + canvas_current_font_height(canvas), string_get_cstr(disp_str)); + canvas_draw_str( + canvas, 2, 8 + canvas_current_font_height(canvas), furi_string_get_cstr(disp_str)); - string_reset(disp_str); + furi_string_reset(disp_str); canvas_draw_icon(canvas, 22, 24, &I_UsbTree_48x22); @@ -88,14 +89,14 @@ static void bad_usb_draw_callback(Canvas* canvas, void* _model) { furi_string_printf( disp_str, "%u", ((model->state.line_cur - 1) * 100) / model->state.line_nb); canvas_draw_str_aligned( - canvas, 114, 40, AlignRight, AlignBottom, string_get_cstr(disp_str)); - string_reset(disp_str); + canvas, 114, 40, AlignRight, AlignBottom, furi_string_get_cstr(disp_str)); + furi_string_reset(disp_str); canvas_draw_icon(canvas, 117, 26, &I_Percent_10x14); } else if(model->state.state == BadUsbStateDone) { canvas_draw_icon(canvas, 4, 23, &I_EviSmile1_18x21); canvas_set_font(canvas, FontBigNumbers); canvas_draw_str_aligned(canvas, 114, 40, AlignRight, AlignBottom, "100"); - string_reset(disp_str); + furi_string_reset(disp_str); canvas_draw_icon(canvas, 117, 26, &I_Percent_10x14); } else if(model->state.state == BadUsbStateDelay) { if(model->anim_frame == 0) { @@ -107,14 +108,14 @@ static void bad_usb_draw_callback(Canvas* canvas, void* _model) { furi_string_printf( disp_str, "%u", ((model->state.line_cur - 1) * 100) / model->state.line_nb); canvas_draw_str_aligned( - canvas, 114, 40, AlignRight, AlignBottom, string_get_cstr(disp_str)); - string_reset(disp_str); + canvas, 114, 40, AlignRight, AlignBottom, furi_string_get_cstr(disp_str)); + furi_string_reset(disp_str); canvas_draw_icon(canvas, 117, 26, &I_Percent_10x14); canvas_set_font(canvas, FontSecondary); furi_string_printf(disp_str, "delay %us", model->state.delay_remain); canvas_draw_str_aligned( - canvas, 127, 50, AlignRight, AlignBottom, string_get_cstr(disp_str)); - string_reset(disp_str); + canvas, 127, 50, AlignRight, AlignBottom, furi_string_get_cstr(disp_str)); + furi_string_reset(disp_str); } else { canvas_draw_icon(canvas, 4, 26, &I_Clock_18x18); } diff --git a/applications/main/lfrfid/scenes/lfrfid_scene_raw_info.c b/applications/main/lfrfid/scenes/lfrfid_scene_raw_info.c index e5193521d..f403c1f38 100644 --- a/applications/main/lfrfid/scenes/lfrfid_scene_raw_info.c +++ b/applications/main/lfrfid/scenes/lfrfid_scene_raw_info.c @@ -34,7 +34,7 @@ void lfrfid_scene_raw_info_on_enter(void* context) { } view_dispatcher_switch_to_view(app->view_dispatcher, LfRfidViewWidget); - //string_clear(tmp_string); + //furi_string_free(tmp_string); } bool lfrfid_scene_raw_info_on_event(void* context, SceneManagerEvent event) { diff --git a/applications/main/lfrfid/scenes/lfrfid_scene_read_success.c b/applications/main/lfrfid/scenes/lfrfid_scene_read_success.c index 6b3795f58..b3b60b5ee 100644 --- a/applications/main/lfrfid/scenes/lfrfid_scene_read_success.c +++ b/applications/main/lfrfid/scenes/lfrfid_scene_read_success.c @@ -17,7 +17,7 @@ void lfrfid_scene_read_success_on_enter(void* context) { protocol_dict_get_manufacturer(app->dict, app->protocol_id)); widget_add_string_element( - widget, 16, 3, AlignLeft, AlignTop, FontPrimary, string_get_cstr(tmp_string)); + widget, 16, 3, AlignLeft, AlignTop, FontPrimary, furi_string_get_cstr(tmp_string)); furi_string_reset(tmp_string); size_t size = protocol_dict_get_data_size(app->dict, app->protocol_id); @@ -29,7 +29,7 @@ void lfrfid_scene_read_success_on_enter(void* context) { break; } else { if(i != 0) { - string_cat_printf(tmp_string, ":"); + furi_string_cat_printf(tmp_string, ":"); } furi_string_cat_printf(tmp_string, "%02X", data[i]); } diff --git a/applications/main/lfrfid/scenes/lfrfid_scene_save_type.c b/applications/main/lfrfid/scenes/lfrfid_scene_save_type.c index 0bd490b5b..6077348f1 100644 --- a/applications/main/lfrfid/scenes/lfrfid_scene_save_type.c +++ b/applications/main/lfrfid/scenes/lfrfid_scene_save_type.c @@ -21,8 +21,7 @@ void lfrfid_scene_save_type_on_enter(void* context) { protocol_dict_get_manufacturer(app->dict, i), protocol_dict_get_name(app->dict, i)) != 0) && (strcmp(protocol_dict_get_manufacturer(app->dict, i), "N/A") != 0)) { - string_init_printf( - state->menu_item_name[i], + state->menu_item_name[i] = furi_string_alloc_printf( "%s %s", protocol_dict_get_manufacturer(app->dict, i), protocol_dict_get_name(app->dict, i)); diff --git a/applications/main/lfrfid/scenes/lfrfid_scene_saved_info.c b/applications/main/lfrfid/scenes/lfrfid_scene_saved_info.c index c6ae99dbf..c901629c3 100644 --- a/applications/main/lfrfid/scenes/lfrfid_scene_saved_info.c +++ b/applications/main/lfrfid/scenes/lfrfid_scene_saved_info.c @@ -18,7 +18,7 @@ void lfrfid_scene_saved_info_on_enter(void* context) { protocol_dict_get_data(app->dict, app->protocol_id, data, size); for(uint8_t i = 0; i < size; i++) { if(i != 0) { - string_cat_printf(tmp_string, ":"); + furi_string_cat_printf(tmp_string, ":"); } furi_string_cat_printf(tmp_string, "%02X", data[i]); diff --git a/applications/main/nfc/scenes/nfc_scene_mfkey_nonces_info.c b/applications/main/nfc/scenes/nfc_scene_mfkey_nonces_info.c index 14637fa11..89964f340 100644 --- a/applications/main/nfc/scenes/nfc_scene_mfkey_nonces_info.c +++ b/applications/main/nfc/scenes/nfc_scene_mfkey_nonces_info.c @@ -15,8 +15,8 @@ void nfc_scene_mfkey_nonces_info_on_enter(void* context) { temp_str = furi_string_alloc(); uint16_t nonces_saved = mfkey32_get_auth_sectors(temp_str); - widget_add_text_scroll_element(nfc->widget, 0, 22, 128, 42, string_get_cstr(temp_str)); - string_printf(temp_str, "Nonce pairs saved %d", nonces_saved); + widget_add_text_scroll_element(nfc->widget, 0, 22, 128, 42, furi_string_get_cstr(temp_str)); + furi_string_printf(temp_str, "Nonce pairs saved %d", nonces_saved); widget_add_string_element( nfc->widget, 0, 0, AlignLeft, AlignTop, FontPrimary, furi_string_get_cstr(temp_str)); widget_add_string_element( diff --git a/applications/main/subghz/scenes/subghz_scene_decode_raw.c b/applications/main/subghz/scenes/subghz_scene_decode_raw.c index 7593d3aec..4412cc023 100644 --- a/applications/main/subghz/scenes/subghz_scene_decode_raw.c +++ b/applications/main/subghz/scenes/subghz_scene_decode_raw.c @@ -33,30 +33,30 @@ SubGhzFileEncoderWorker* file_worker_encoder; static void subghz_scene_receiver_update_statusbar(void* context) { SubGhz* subghz = context; - string_t history_stat_str; - string_init(history_stat_str); + FuriString* history_stat_str; + history_stat_str = furi_string_alloc(); if(!subghz_history_get_text_space_left(subghz->txrx->history, history_stat_str)) { - string_t frequency_str; - string_t modulation_str; + FuriString* frequency_str; + FuriString* modulation_str; - string_init(frequency_str); - string_init(modulation_str); + frequency_str = furi_string_alloc(); + modulation_str = furi_string_alloc(); subghz_get_frequency_modulation(subghz, frequency_str, modulation_str); subghz_view_receiver_add_data_statusbar( subghz->subghz_receiver, - string_get_cstr(frequency_str), - string_get_cstr(modulation_str), - string_get_cstr(history_stat_str)); + furi_string_get_cstr(frequency_str), + furi_string_get_cstr(modulation_str), + furi_string_get_cstr(history_stat_str)); - string_clear(frequency_str); - string_clear(modulation_str); + furi_string_free(frequency_str); + furi_string_free(modulation_str); } else { subghz_view_receiver_add_data_statusbar( - subghz->subghz_receiver, string_get_cstr(history_stat_str), "", ""); + subghz->subghz_receiver, furi_string_get_cstr(history_stat_str), "", ""); } - string_clear(history_stat_str); + furi_string_free(history_stat_str); } void subghz_scene_decode_raw_callback(SubGhzCustomEvent event, void* context) { @@ -71,11 +71,11 @@ static void subghz_scene_add_to_history_callback( void* context) { furi_assert(context); SubGhz* subghz = context; - string_t str_buff; - string_init(str_buff); + FuriString* str_buff; + str_buff = furi_string_alloc(); if(subghz_history_add_to_history(subghz->txrx->history, decoder_base, subghz->txrx->preset)) { - string_reset(str_buff); + furi_string_reset(str_buff); subghz->state_notifications = SubGhzNotificationStateRxDone; @@ -83,19 +83,19 @@ static void subghz_scene_add_to_history_callback( subghz->txrx->history, str_buff, subghz_history_get_item(subghz->txrx->history) - 1); subghz_view_receiver_add_item_to_menu( subghz->subghz_receiver, - string_get_cstr(str_buff), + furi_string_get_cstr(str_buff), subghz_history_get_type_protocol( subghz->txrx->history, subghz_history_get_item(subghz->txrx->history) - 1)); subghz_scene_receiver_update_statusbar(subghz); } subghz_receiver_reset(receiver); - string_clear(str_buff); + furi_string_free(str_buff); } bool subghz_scene_decode_raw_start(SubGhz* subghz) { - string_t file_name; - string_init(file_name); + FuriString* file_name; + file_name = furi_string_alloc(); bool success = false; do { if(!flipper_format_rewind(subghz->txrx->fff_data)) { @@ -112,10 +112,10 @@ bool subghz_scene_decode_raw_start(SubGhz* subghz) { } while(false); if(success) { - //FURI_LOG_I(TAG, "Listening at \033[0;33m%s\033[0m.", string_get_cstr(file_name)); + //FURI_LOG_I(TAG, "Listening at \033[0;33m%s\033[0m.", furi_string_get_cstr(file_name)); file_worker_encoder = subghz_file_encoder_worker_alloc(); - if(subghz_file_encoder_worker_start(file_worker_encoder, string_get_cstr(file_name))) { + if(subghz_file_encoder_worker_start(file_worker_encoder, furi_string_get_cstr(file_name))) { //the worker needs a file in order to open and read part of the file furi_delay_ms(100); } else { @@ -127,7 +127,7 @@ bool subghz_scene_decode_raw_start(SubGhz* subghz) { } } - string_clear(file_name); + furi_string_free(file_name); return success; } @@ -150,13 +150,14 @@ bool subghz_scene_decode_raw_next(SubGhz* subghz) { } // Update progress info - string_t progress_str; - string_init(progress_str); + FuriString* progress_str; + progress_str = furi_string_alloc(); subghz_file_encoder_worker_get_text_progress(file_worker_encoder, progress_str); - subghz_view_receiver_add_data_progress(subghz->subghz_receiver, string_get_cstr(progress_str)); + subghz_view_receiver_add_data_progress( + subghz->subghz_receiver, furi_string_get_cstr(progress_str)); - string_clear(progress_str); + furi_string_free(progress_str); return true; // More samples available } @@ -164,8 +165,8 @@ bool subghz_scene_decode_raw_next(SubGhz* subghz) { void subghz_scene_decode_raw_on_enter(void* context) { SubGhz* subghz = context; - string_t str_buff; - string_init(str_buff); + FuriString* str_buff; + str_buff = furi_string_alloc(); subghz_view_receiver_set_lock(subghz->subghz_receiver, subghz->lock); subghz_view_receiver_set_mode(subghz->subghz_receiver, SubGhzViewReceiverModeFile); @@ -193,14 +194,14 @@ void subghz_scene_decode_raw_on_enter(void* context) { //Load history to receiver subghz_view_receiver_exit(subghz->subghz_receiver); for(uint8_t i = 0; i < subghz_history_get_item(subghz->txrx->history); i++) { - string_reset(str_buff); + furi_string_reset(str_buff); subghz_history_get_text_item_menu(subghz->txrx->history, str_buff, i); subghz_view_receiver_add_item_to_menu( subghz->subghz_receiver, - string_get_cstr(str_buff), + furi_string_get_cstr(str_buff), subghz_history_get_type_protocol(subghz->txrx->history, i)); } - string_clear(str_buff); + furi_string_free(str_buff); subghz_view_receiver_set_idx_menu(subghz->subghz_receiver, subghz->txrx->idx_menu_chosen); } diff --git a/applications/main/subghz/scenes/subghz_scene_receiver_info.c b/applications/main/subghz/scenes/subghz_scene_receiver_info.c index c6e2e1bdc..516e63494 100644 --- a/applications/main/subghz/scenes/subghz_scene_receiver_info.c +++ b/applications/main/subghz/scenes/subghz_scene_receiver_info.c @@ -160,7 +160,7 @@ bool subghz_scene_receiver_info_on_event(void* context, SceneManagerEvent event) subghz_begin( subghz, subghz_setting_get_preset_data_by_name( - subghz->setting, string_get_cstr(subghz->txrx->preset->name))); + subghz->setting, furi_string_get_cstr(subghz->txrx->preset->name))); subghz_rx(subghz, subghz->txrx->preset->frequency); } if(subghz->txrx->hopper_state == SubGhzHopperStatePause) { diff --git a/applications/main/subghz/scenes/subghz_scene_save_name.c b/applications/main/subghz/scenes/subghz_scene_save_name.c index c154ee962..561ebe9c3 100644 --- a/applications/main/subghz/scenes/subghz_scene_save_name.c +++ b/applications/main/subghz/scenes/subghz_scene_save_name.c @@ -13,10 +13,10 @@ void subghz_scene_save_name_text_input_callback(void* context) { view_dispatcher_send_custom_event(subghz->view_dispatcher, SubGhzCustomEventSceneSaveName); } -void subghz_scene_save_name_get_timefilename(string_t name, uint32_t frequency) { +void subghz_scene_save_name_get_timefilename(FuriString* name, uint32_t frequency) { FuriHalRtcDateTime datetime = {0}; furi_hal_rtc_get_datetime(&datetime); - string_printf( + furi_string_printf( name, "RAW_%.4d.%.2d.%.2d-%.2d.%.2d.%.2d-%d.%.2dMHz", datetime.year, diff --git a/applications/main/subghz/scenes/subghz_scene_set_seed_bft.c b/applications/main/subghz/scenes/subghz_scene_set_seed_bft.c index f16d7c951..dcb7e6850 100644 --- a/applications/main/subghz/scenes/subghz_scene_set_seed_bft.c +++ b/applications/main/subghz/scenes/subghz_scene_set_seed_bft.c @@ -75,7 +75,7 @@ bool subghz_scene_set_seed_bft_on_event(void* context, SceneManagerEvent event) subghz_transmitter_free(subghz->txrx->transmitter); if(!generated_protocol) { - string_set_str( + furi_string_set( subghz->error_str, "Function requires\nan SD card with\nfresh databases."); scene_manager_next_scene(subghz->scene_manager, SubGhzSceneShowError); } diff --git a/applications/main/subghz/scenes/subghz_scene_set_seed_faac_433.c b/applications/main/subghz/scenes/subghz_scene_set_seed_faac_433.c index 39559d4a3..efe16f0b3 100644 --- a/applications/main/subghz/scenes/subghz_scene_set_seed_faac_433.c +++ b/applications/main/subghz/scenes/subghz_scene_set_seed_faac_433.c @@ -75,7 +75,7 @@ bool subghz_scene_set_seed_faac_433_on_event(void* context, SceneManagerEvent ev subghz_transmitter_free(subghz->txrx->transmitter); if(!generated_protocol) { - string_set_str( + furi_string_set( subghz->error_str, "Function requires\nan SD card with\nfresh databases."); scene_manager_next_scene(subghz->scene_manager, SubGhzSceneShowError); } diff --git a/applications/main/subghz/scenes/subghz_scene_set_seed_faac_868.c b/applications/main/subghz/scenes/subghz_scene_set_seed_faac_868.c index f6815a16b..dd9f45652 100644 --- a/applications/main/subghz/scenes/subghz_scene_set_seed_faac_868.c +++ b/applications/main/subghz/scenes/subghz_scene_set_seed_faac_868.c @@ -75,7 +75,7 @@ bool subghz_scene_set_seed_faac_868_on_event(void* context, SceneManagerEvent ev subghz_transmitter_free(subghz->txrx->transmitter); if(!generated_protocol) { - string_set_str( + furi_string_set( subghz->error_str, "Function requires\nan SD card with\nfresh databases."); scene_manager_next_scene(subghz->scene_manager, SubGhzSceneShowError); } diff --git a/applications/main/subghz/subghz.c b/applications/main/subghz/subghz.c index f811edec4..0295ddd01 100644 --- a/applications/main/subghz/subghz.c +++ b/applications/main/subghz/subghz.c @@ -1,6 +1,5 @@ /* Abandon hope, all ye who enter here. */ -#include #include #include #include "subghz_i.h" @@ -214,7 +213,7 @@ SubGhz* subghz_alloc(bool alloc_for_tx_only) { subghz->lock = SubGhzLockOff; subghz->txrx = malloc(sizeof(SubGhzTxRx)); subghz->txrx->preset = malloc(sizeof(SubGhzPresetDefinition)); - string_init(subghz->txrx->preset->name); + subghz->txrx->preset->name = furi_string_alloc(); if(!alloc_for_tx_only) { subghz_preset_init( subghz, @@ -358,7 +357,7 @@ void subghz_free(SubGhz* subghz, bool alloc_for_tx_only) { if(!alloc_for_tx_only) { subghz_history_free(subghz->txrx->history); } - string_clear(subghz->txrx->preset->name); + furi_string_free(subghz->txrx->preset->name); free(subghz->txrx->preset); free(subghz->txrx->secure_data); free(subghz->txrx); diff --git a/applications/main/subghz/subghz_cli.c b/applications/main/subghz/subghz_cli.c index fad5e9b00..1769b7003 100644 --- a/applications/main/subghz/subghz_cli.c +++ b/applications/main/subghz/subghz_cli.c @@ -19,7 +19,7 @@ #define SUBGHZ_FREQUENCY_RANGE_STR \ "299999755...348000000 or 386999938...464000000 or 778999847...928000000" -void subghz_cli_command_tx_carrier(Cli* cli, string_t args, void* context) { +void subghz_cli_command_tx_carrier(Cli* cli, FuriString* args, void* context) { UNUSED(context); uint32_t frequency = 433920000; diff --git a/applications/main/subghz/subghz_history.c b/applications/main/subghz/subghz_history.c index 576b1912d..d4faa0b49 100644 --- a/applications/main/subghz/subghz_history.c +++ b/applications/main/subghz/subghz_history.c @@ -21,7 +21,7 @@ typedef struct { FuriString* item_str; FlipperFormat* flipper_string; - string_t protocol_name; + FuriString* protocol_name; bool is_file; uint8_t type; SubGhzPresetDefinition* preset; @@ -39,7 +39,7 @@ struct SubGhzHistory { uint32_t last_update_timestamp; uint16_t last_index_write; uint8_t code_last_hash_data; - string_t tmp_string; + FuriString* tmp_string; bool write_tmp_files; Storage* storage; SubGhzHistoryStruct* history; @@ -49,10 +49,11 @@ struct SubGhzHistory { #define LOG_DELAY 0 #endif -void subghz_history_generate_temp_filename(string_t filename, uint32_t index) { +FuriString* subghz_history_generate_temp_filename(uint32_t index) { FuriHalRtcDateTime datetime = {0}; furi_hal_rtc_get_datetime(&datetime); - string_init_printf(filename, "%03d%s", index, SUBGHZ_HISTORY_TMP_EXTENSION); + FuriString* filename = furi_string_alloc_printf("%03d%s", index, SUBGHZ_HISTORY_TMP_EXTENSION); + return filename; } bool subghz_history_is_tmp_dir_exists(SubGhzHistory* instance) { @@ -144,9 +145,9 @@ SubGhzHistory* subghz_history_alloc(void) { void subghz_history_item_free(void* current_item) { furi_assert(current_item); SubGhzHistoryItem* item = (SubGhzHistoryItem*)current_item; - string_clear(item->item_str); - string_clear(item->preset->name); - string_clear(item->protocol_name); + furi_string_free(item->item_str); + furi_string_free(item->preset->name); + furi_string_free(item->protocol_name); free(item->preset); item->type = 0; @@ -166,7 +167,7 @@ void subghz_history_clean_item_array(SubGhzHistory* instance) { void subghz_history_free(SubGhzHistory* instance) { furi_assert(instance); - string_clear(instance->tmp_string); + furi_string_free(instance->tmp_string); subghz_history_clean_item_array(instance); SubGhzHistoryItemArray_clear(instance->history->data); @@ -200,7 +201,7 @@ const char* subghz_history_get_preset(SubGhzHistory* instance, uint16_t idx) { void subghz_history_reset(SubGhzHistory* instance) { furi_assert(instance); - string_reset(instance->tmp_string); + furi_string_reset(instance->tmp_string); subghz_history_clean_item_array(instance); @@ -224,7 +225,7 @@ const char* subghz_history_get_protocol_name(SubGhzHistory* instance, uint16_t i furi_assert(instance); SubGhzHistoryItem* item = SubGhzHistoryItemArray_get(instance->history->data, idx); - return string_get_cstr(item->protocol_name); + return furi_string_get_cstr(item->protocol_name); } FlipperFormat* subghz_history_get_raw_data(SubGhzHistory* instance, uint16_t idx) { @@ -236,15 +237,15 @@ FlipperFormat* subghz_history_get_raw_data(SubGhzHistory* instance, uint16_t idx bool result_ok = false; if(instance->write_tmp_files && item->is_file) { // We have files! - string_t filename; - string_t dir_path; - string_init(filename); - string_init(dir_path); - subghz_history_generate_temp_filename(filename, idx); - string_init_printf( - dir_path, "%s/%s", SUBGHZ_HISTORY_TMP_DIR, string_get_cstr(filename)); + FuriString* filename; + FuriString* dir_path; + filename = furi_string_alloc(); + dir_path = furi_string_alloc(); + filename = subghz_history_generate_temp_filename(idx); + dir_path = furi_string_alloc_printf( + "%s/%s", SUBGHZ_HISTORY_TMP_DIR, furi_string_get_cstr(filename)); - if(storage_file_exists(instance->storage, string_get_cstr(dir_path))) { + if(storage_file_exists(instance->storage, furi_string_get_cstr(dir_path))) { #ifdef FURI_DEBUG FURI_LOG_D(TAG, "Exist: %s", dir_path); furi_delay_ms(LOG_DELAY); @@ -255,7 +256,7 @@ FlipperFormat* subghz_history_get_raw_data(SubGhzHistory* instance, uint16_t idx stream_clean(dst_stream); size_t size = stream_load_from_file( - dst_stream, instance->storage, string_get_cstr(dir_path)); + dst_stream, instance->storage, furi_string_get_cstr(dir_path)); if(size > 0) { #ifdef FURI_DEBUG FURI_LOG_I(TAG, "Save ok!"); @@ -273,8 +274,8 @@ FlipperFormat* subghz_history_get_raw_data(SubGhzHistory* instance, uint16_t idx FURI_LOG_E(TAG, "Can't convert filename to file"); } - string_clear(filename); - string_clear(dir_path); + furi_string_free(filename); + furi_string_free(dir_path); } else { #ifdef FURI_DEBUG FURI_LOG_W(TAG, "Write TMP files failed!"); @@ -285,14 +286,14 @@ FlipperFormat* subghz_history_get_raw_data(SubGhzHistory* instance, uint16_t idx } } -bool subghz_history_get_text_space_left(SubGhzHistory* instance, string_t output) { +bool subghz_history_get_text_space_left(SubGhzHistory* instance, FuriString* output) { furi_assert(instance); if(instance->last_index_write == SUBGHZ_HISTORY_MAX) { if(output != NULL) furi_string_printf(output, "Memory is FULL"); return true; } if(output != NULL) { - string_printf(output, "%02u/%02u", instance->last_index_write, SUBGHZ_HISTORY_MAX); + furi_string_printf(output, "%02u/%02u", instance->last_index_write, SUBGHZ_HISTORY_MAX); } return false; } @@ -323,8 +324,8 @@ bool subghz_history_add_to_history( instance->code_last_hash_data = subghz_protocol_decoder_base_get_hash_data(decoder_base); instance->last_update_timestamp = furi_get_tick(); - string_t text; - string_init(text); + FuriString* text; + text = furi_string_alloc(); SubGhzHistoryItem* item = SubGhzHistoryItemArray_push_raw(instance->history->data); item->preset = malloc(sizeof(SubGhzPresetDefinition)); item->type = decoder_base->protocol->type; @@ -334,8 +335,8 @@ bool subghz_history_add_to_history( item->preset->data = preset->data; item->preset->data_size = preset->data_size; - string_init(item->item_str); - string_init(item->protocol_name); + item->item_str = furi_string_alloc(); + item->protocol_name = furi_string_alloc(); bool tmp_file_for_raw = false; @@ -352,10 +353,11 @@ bool subghz_history_add_to_history( FURI_LOG_E(TAG, "Missing Protocol"); break; } else { - string_init_printf(item->protocol_name, "%s", string_get_cstr(instance->tmp_string)); + item->protocol_name = + furi_string_alloc_printf("%s", furi_string_get_cstr(instance->tmp_string)); } - if(!strcmp(string_get_cstr(instance->tmp_string), "RAW")) { - string_printf( + if(!strcmp(furi_string_get_cstr(instance->tmp_string), "RAW")) { + furi_string_printf( item->item_str, "RAW %03ld.%02ld", preset->frequency / 1000000 % 1000, @@ -366,8 +368,8 @@ bool subghz_history_add_to_history( } tmp_file_for_raw = true; break; - } else if(!strcmp(string_get_cstr(instance->tmp_string), "KeeLoq")) { - string_set_str(instance->tmp_string, "KL "); + } else if(!strcmp(furi_string_get_cstr(instance->tmp_string), "KeeLoq")) { + furi_string_set(instance->tmp_string, "KL "); if(!flipper_format_read_string(item->flipper_string, "Manufacture", text)) { FURI_LOG_E(TAG, "Missing Protocol"); break; @@ -412,22 +414,23 @@ bool subghz_history_add_to_history( // If we can write to files if(instance->write_tmp_files && tmp_file_for_raw) { - string_t filename; - string_t dir_path; - string_init(filename); - string_init(dir_path); + FuriString* filename; + FuriString* dir_path; + filename = furi_string_alloc(); + dir_path = furi_string_alloc(); - subghz_history_generate_temp_filename(filename, instance->last_index_write); - string_cat_printf(dir_path, "%s/%s", SUBGHZ_HISTORY_TMP_DIR, string_get_cstr(filename)); + filename = subghz_history_generate_temp_filename(instance->last_index_write); + furi_string_cat_printf( + dir_path, "%s/%s", SUBGHZ_HISTORY_TMP_DIR, furi_string_get_cstr(filename)); #ifdef FURI_DEBUG - FURI_LOG_I(TAG, "Save temp file: %s", string_get_cstr(dir_path)); + FURI_LOG_I(TAG, "Save temp file: %s", furi_string_get_cstr(dir_path)); #endif if(!subghz_history_tmp_write_file_split(instance, item, dir_path)) { // Plan B! subghz_history_tmp_write_file_full(instance, item, dir_path); } - string_clear(filename); - string_clear(dir_path); + furi_string_free(filename); + furi_string_free(dir_path); } else { #ifdef FURI_DEBUG @@ -435,7 +438,7 @@ bool subghz_history_add_to_history( #endif } - string_clear(text); + furi_string_free(text); instance->last_index_write++; return true; @@ -444,7 +447,7 @@ bool subghz_history_add_to_history( bool subghz_history_tmp_write_file_split( SubGhzHistory* instance, void* current_item, - string_t dir_path) { + FuriString* dir_path) { UNUSED(instance); UNUSED(current_item); UNUSED(dir_path); @@ -459,15 +462,15 @@ bool subghz_history_tmp_write_file_split( void subghz_history_tmp_write_file_full( SubGhzHistory* instance, void* current_item, - string_t dir_path) { + FuriString* dir_path) { SubGhzHistoryItem* item = (SubGhzHistoryItem*)current_item; #ifdef FURI_DEBUG - FURI_LOG_W(TAG, "Save temp file full: %s", string_get_cstr(dir_path)); + FURI_LOG_W(TAG, "Save temp file full: %s", furi_string_get_cstr(dir_path)); #endif Stream* dst = flipper_format_get_raw_stream(item->flipper_string); stream_rewind(dst); - if(stream_save_to_file(dst, instance->storage, string_get_cstr(dir_path), FSOM_CREATE_ALWAYS) > - 0) { + if(stream_save_to_file( + dst, instance->storage, furi_string_get_cstr(dir_path), FSOM_CREATE_ALWAYS) > 0) { flipper_format_free(item->flipper_string); item->flipper_string = NULL; #ifdef FURI_DEBUG diff --git a/applications/main/subghz/subghz_history_private.h b/applications/main/subghz/subghz_history_private.h index 0ff802835..aac330c33 100644 --- a/applications/main/subghz/subghz_history_private.h +++ b/applications/main/subghz/subghz_history_private.h @@ -5,10 +5,9 @@ /** * @brief Generate filename like 000.tmp * - * @param filename - input parameter * @param index - index of file, timestamp doesn't accepted! */ -void subghz_history_generate_temp_filename(string_t filename, uint32_t index); +FuriString* subghz_history_generate_temp_filename(uint32_t index); /** * @brief Check if directory for temporary files is exists @@ -62,7 +61,7 @@ void subghz_history_clean_item_array(SubGhzHistory* instance); void subghz_history_tmp_write_file_full( SubGhzHistory* instance, void* current_item, - string_t dir_path); + FuriString* dir_path); /** * @brief Write temp splited to lines @@ -76,4 +75,4 @@ void subghz_history_tmp_write_file_full( bool subghz_history_tmp_write_file_split( SubGhzHistory* instance, void* current_item, - string_t dir_path); \ No newline at end of file + FuriString* dir_path); \ No newline at end of file diff --git a/applications/main/subghz/subghz_i.h b/applications/main/subghz/subghz_i.h index 739827f1a..832ae8696 100644 --- a/applications/main/subghz/subghz_i.h +++ b/applications/main/subghz/subghz_i.h @@ -103,7 +103,7 @@ struct SubGhz { SubGhzTestStatic* subghz_test_static; SubGhzTestPacket* subghz_test_packet; #endif - string_t error_str; + FuriString* error_str; SubGhzSetting* setting; SubGhzLastSettings* last_settings; SubGhzLock lock; diff --git a/applications/main/subghz/views/receiver.c b/applications/main/subghz/views/receiver.c index 46fc3b61b..5355df463 100644 --- a/applications/main/subghz/views/receiver.c +++ b/applications/main/subghz/views/receiver.c @@ -52,10 +52,10 @@ struct SubGhzViewReceiver { }; typedef struct { - string_t frequency_str; - string_t preset_str; - string_t history_stat_str; - string_t progress_str; + FuriString* frequency_str; + FuriString* preset_str; + FuriString* history_stat_str; + FuriString* progress_str; SubGhzReceiverHistory* history; uint16_t idx; uint16_t list_offset; @@ -168,7 +168,7 @@ void subghz_view_receiver_add_data_progress( furi_assert(subghz_receiver); with_view_model( subghz_receiver->view, (SubGhzViewReceiverModel * model) { - string_set_str(model->progress_str, progress_str); + furi_string_set(model->progress_str, progress_str); return true; }); } @@ -196,7 +196,7 @@ void subghz_view_receiver_draw(Canvas* canvas, SubGhzViewReceiverModel* model) { elements_button_left(canvas, "Config"); canvas_draw_line(canvas, 46, 51, 125, 51); } else { - canvas_draw_str(canvas, 3, 62, string_get_cstr(model->progress_str)); + canvas_draw_str(canvas, 3, 62, furi_string_get_cstr(model->progress_str)); } bool scrollbar = model->history_item > 4; @@ -365,9 +365,9 @@ void subghz_view_receiver_exit(void* context) { SubGhzViewReceiver* subghz_receiver = context; with_view_model( subghz_receiver->view, (SubGhzViewReceiverModel * model) { - string_reset(model->frequency_str); - string_reset(model->preset_str); - string_reset(model->history_stat_str); + furi_string_reset(model->frequency_str); + furi_string_reset(model->preset_str); + furi_string_reset(model->history_stat_str); for M_EACH(item_menu, model->history->data, SubGhzReceiverMenuItemArray_t) { @@ -401,10 +401,10 @@ SubGhzViewReceiver* subghz_view_receiver_alloc() { with_view_model( subghz_receiver->view, (SubGhzViewReceiverModel * model) { - string_init(model->frequency_str); - string_init(model->preset_str); - string_init(model->history_stat_str); - string_init(model->progress_str); + model->frequency_str = furi_string_alloc(); + model->preset_str = furi_string_alloc(); + model->history_stat_str = furi_string_alloc(); + model->progress_str = furi_string_alloc(); model->bar_show = SubGhzViewReceiverBarShowDefault; model->history = malloc(sizeof(SubGhzReceiverHistory)); SubGhzReceiverMenuItemArray_init(model->history->data); @@ -420,10 +420,10 @@ void subghz_view_receiver_free(SubGhzViewReceiver* subghz_receiver) { with_view_model( subghz_receiver->view, (SubGhzViewReceiverModel * model) { - string_clear(model->frequency_str); - string_clear(model->preset_str); - string_clear(model->history_stat_str); - string_clear(model->progress_str); + furi_string_free(model->frequency_str); + furi_string_free(model->preset_str); + furi_string_free(model->history_stat_str); + furi_string_free(model->progress_str); for M_EACH(item_menu, model->history->data, SubGhzReceiverMenuItemArray_t) { furi_string_free(item_menu->item_str); diff --git a/applications/main/subghz/views/subghz_read_raw.c b/applications/main/subghz/views/subghz_read_raw.c index 374c26252..1b1d3c8c9 100644 --- a/applications/main/subghz/views/subghz_read_raw.c +++ b/applications/main/subghz/views/subghz_read_raw.c @@ -376,8 +376,8 @@ bool subghz_read_raw_input(InputEvent* event, void* context) { model->status = SubGhzReadRAWStatusStart; model->rssi_history_end = false; model->ind_write = 0; - string_set_str(model->sample_write, "0 spl."); - string_reset(model->file_name); + furi_string_set(model->sample_write, "0 spl."); + furi_string_reset(model->file_name); instance->callback(SubGhzCustomEventViewReadRAWErase, instance->context); } } @@ -508,10 +508,10 @@ SubGhzReadRAW* subghz_read_raw_alloc(bool raw_send_only) { with_view_model( instance->view, (SubGhzReadRAWModel * model) { - string_init(model->frequency_str); - string_init(model->preset_str); - string_init(model->sample_write); - string_init(model->file_name); + model->frequency_str = furi_string_alloc(); + model->preset_str = furi_string_alloc(); + model->sample_write = furi_string_alloc(); + model->file_name = furi_string_alloc(); model->raw_send_only = raw_send_only; model->rssi_history = malloc(SUBGHZ_READ_RAW_RSSI_HISTORY_SIZE * sizeof(uint8_t)); return true; diff --git a/applications/main/subghz/views/transmitter.c b/applications/main/subghz/views/transmitter.c index 2158c3055..75828a13b 100644 --- a/applications/main/subghz/views/transmitter.c +++ b/applications/main/subghz/views/transmitter.c @@ -82,9 +82,9 @@ void subghz_view_transmitter_draw(Canvas* canvas, SubGhzViewTransmitterModel* mo canvas_clear(canvas); canvas_set_color(canvas, ColorBlack); canvas_set_font(canvas, FontSecondary); - elements_multiline_text(canvas, 0, 7, string_get_cstr(model->key_str)); - canvas_draw_str(canvas, 78, 7, string_get_cstr(model->frequency_str)); - canvas_draw_str(canvas, 113, 7, string_get_cstr(model->preset_str)); + elements_multiline_text(canvas, 0, 7, furi_string_get_cstr(model->key_str)); + canvas_draw_str(canvas, 78, 7, furi_string_get_cstr(model->frequency_str)); + canvas_draw_str(canvas, 113, 7, furi_string_get_cstr(model->preset_str)); if(model->show_button) subghz_view_transmitter_button_right(canvas, "Send"); } diff --git a/applications/main/unirfremix/unirfremix_app.c b/applications/main/unirfremix/unirfremix_app.c index 13d47988c..3968b6df6 100644 --- a/applications/main/unirfremix/unirfremix_app.c +++ b/applications/main/unirfremix/unirfremix_app.c @@ -27,9 +27,9 @@ typedef struct { uint32_t frequency; - string_t name; + FuriString* name; - string_t protocol; + FuriString* protocol; uint32_t repeat; uint8_t* data; @@ -52,20 +52,20 @@ typedef struct { NotificationApp* notification; UniRFPreset* txpreset; - string_t up_file; - string_t down_file; - string_t left_file; - string_t right_file; - string_t ok_file; - string_t empty; + FuriString* up_file; + FuriString* down_file; + FuriString* left_file; + FuriString* right_file; + FuriString* ok_file; + FuriString* empty; - string_t up_l; - string_t left_l; - string_t right_l; - string_t down_l; - string_t ok_l; + FuriString* up_l; + FuriString* left_l; + FuriString* right_l; + FuriString* down_l; + FuriString* ok_l; - string_t file_path; + FuriString* file_path; char* up_label; char* down_label; @@ -92,20 +92,20 @@ typedef struct { bool tx_not_allowed; int file_blank; - string_t signal; + FuriString* signal; } UniRFRemix; UniRFPreset* unirfremix_preset_alloc(void) { UniRFPreset* preset = malloc(sizeof(UniRFPreset)); - string_init(preset->name); - string_init(preset->protocol); + preset->name = furi_string_alloc(); + preset->protocol = furi_string_alloc(); preset->repeat = 200; return preset; } void unirfremix_preset_free(UniRFPreset* preset) { - string_clear(preset->name); - string_clear(preset->protocol); + furi_string_free(preset->name); + furi_string_free(preset->protocol); free(preset); } @@ -147,13 +147,13 @@ static const char* int_to_char(int number) { */ //get filename without path static char* extract_filename(const char* name, int len) { - string_t tmp; - string_init(tmp); + FuriString* tmp; + tmp = furi_string_alloc(); //remove path path_extract_filename_no_ext(name, tmp); - return char_to_str((char*)string_get_cstr(tmp), len); + return char_to_str((char*)furi_string_get_cstr(tmp), len); } /* @@ -165,7 +165,7 @@ static char* extract_filename(const char* name, int len) { * set error flag if missing map file */ -void unirfremix_cfg_set_check(UniRFRemix* app, string_t file_name) { +void unirfremix_cfg_set_check(UniRFRemix* app, FuriString* file_name) { Storage* storage = furi_record_open(RECORD_STORAGE); FlipperFormat* fff_data_file = flipper_format_file_alloc(storage); @@ -181,8 +181,8 @@ void unirfremix_cfg_set_check(UniRFRemix* app, string_t file_name) { int label_len = 16; //check that map file exists - if(!flipper_format_file_open_existing(fff_data_file, string_get_cstr(file_name))) { - FURI_LOG_E(TAG, "Could not open MAP file %s", string_get_cstr(file_name)); + if(!flipper_format_file_open_existing(fff_data_file, furi_string_get_cstr(file_name))) { + FURI_LOG_E(TAG, "Could not open MAP file %s", furi_string_get_cstr(file_name)); } else { //Filename Assignment/Check Start @@ -199,8 +199,8 @@ void unirfremix_cfg_set_check(UniRFRemix* app, string_t file_name) { } else { //check name length for proper screen fit //then set filename as label. Might be replaced with defined label later on below. - app->up_label = extract_filename(string_get_cstr(app->up_file), label_len); - FURI_LOG_I(TAG, "UP file: %s", string_get_cstr(app->up_file)); + app->up_label = extract_filename(furi_string_get_cstr(app->up_file), label_len); + FURI_LOG_I(TAG, "UP file: %s", furi_string_get_cstr(app->up_file)); } //Repeat process for Down @@ -210,8 +210,8 @@ void unirfremix_cfg_set_check(UniRFRemix* app, string_t file_name) { app->down_label = "N/A"; app->down_enabled = 0; } else { - app->down_label = extract_filename(string_get_cstr(app->down_file), label_len); - FURI_LOG_I(TAG, "DOWN file: %s", string_get_cstr(app->down_file)); + app->down_label = extract_filename(furi_string_get_cstr(app->down_file), label_len); + FURI_LOG_I(TAG, "DOWN file: %s", furi_string_get_cstr(app->down_file)); } //Repeat process for Left @@ -221,8 +221,8 @@ void unirfremix_cfg_set_check(UniRFRemix* app, string_t file_name) { app->left_label = "N/A"; app->left_enabled = 0; } else { - app->left_label = extract_filename(string_get_cstr(app->left_file), label_len); - FURI_LOG_I(TAG, "LEFT file: %s", string_get_cstr(app->left_file)); + app->left_label = extract_filename(furi_string_get_cstr(app->left_file), label_len); + FURI_LOG_I(TAG, "LEFT file: %s", furi_string_get_cstr(app->left_file)); } //Repeat process for Right @@ -232,8 +232,8 @@ void unirfremix_cfg_set_check(UniRFRemix* app, string_t file_name) { app->right_label = "N/A"; app->right_enabled = 0; } else { - app->right_label = extract_filename(string_get_cstr(app->right_file), label_len); - FURI_LOG_I(TAG, "RIGHT file: %s", string_get_cstr(app->right_file)); + app->right_label = extract_filename(furi_string_get_cstr(app->right_file), label_len); + FURI_LOG_I(TAG, "RIGHT file: %s", furi_string_get_cstr(app->right_file)); } //Repeat process for Ok @@ -243,8 +243,8 @@ void unirfremix_cfg_set_check(UniRFRemix* app, string_t file_name) { app->ok_label = "N/A"; app->ok_enabled = 0; } else { - app->ok_label = extract_filename(string_get_cstr(app->ok_file), label_len); - FURI_LOG_I(TAG, "OK file: %s", string_get_cstr(app->ok_file)); + app->ok_label = extract_filename(furi_string_get_cstr(app->ok_file), label_len); + FURI_LOG_I(TAG, "OK file: %s", furi_string_get_cstr(app->ok_file)); } //File definitions are done. @@ -265,7 +265,7 @@ void unirfremix_cfg_set_check(UniRFRemix* app, string_t file_name) { app->up_label = "N/A"; } else { //set label from map to variable and shrink to fit screen - app->up_label = char_to_str((char*)string_get_cstr(app->up_l), label_len); + app->up_label = char_to_str((char*)furi_string_get_cstr(app->up_l), label_len); } FURI_LOG_I(TAG, "UP label: %s", app->up_label); } @@ -279,7 +279,7 @@ void unirfremix_cfg_set_check(UniRFRemix* app, string_t file_name) { if(app->down_enabled == 0) { app->down_label = "N/A"; } else { - app->down_label = char_to_str((char*)string_get_cstr(app->down_l), label_len); + app->down_label = char_to_str((char*)furi_string_get_cstr(app->down_l), label_len); } FURI_LOG_I(TAG, "DOWN label: %s", app->down_label); } @@ -293,7 +293,7 @@ void unirfremix_cfg_set_check(UniRFRemix* app, string_t file_name) { if(app->left_enabled == 0) { app->left_label = "N/A"; } else { - app->left_label = char_to_str((char*)string_get_cstr(app->left_l), label_len); + app->left_label = char_to_str((char*)furi_string_get_cstr(app->left_l), label_len); } FURI_LOG_I(TAG, "LEFT label: %s", app->left_label); } @@ -307,7 +307,8 @@ void unirfremix_cfg_set_check(UniRFRemix* app, string_t file_name) { if(app->right_enabled == 0) { app->right_label = "N/A"; } else { - app->right_label = char_to_str((char*)string_get_cstr(app->right_l), label_len); + app->right_label = + char_to_str((char*)furi_string_get_cstr(app->right_l), label_len); } FURI_LOG_I(TAG, "RIGHT label: %s", app->right_label); } @@ -321,7 +322,7 @@ void unirfremix_cfg_set_check(UniRFRemix* app, string_t file_name) { if(app->ok_enabled == 0) { app->ok_label = "N/A"; } else { - app->ok_label = char_to_str((char*)string_get_cstr(app->ok_l), label_len); + app->ok_label = char_to_str((char*)furi_string_get_cstr(app->ok_l), label_len); } FURI_LOG_I(TAG, "OK label: %s", app->ok_label); } @@ -351,11 +352,11 @@ void unirfremix_cfg_set_check(UniRFRemix* app, string_t file_name) { //if button is still enabled, check that file exists if(app->up_enabled == 1) { - string_set(file_name, app->up_file); + furi_string_set(file_name, app->up_file); fff_data_file = flipper_format_file_alloc(storage); - if(!flipper_format_file_open_existing(fff_data_file, string_get_cstr(file_name))) { - FURI_LOG_W(TAG, "Could not open UP file %s", string_get_cstr(file_name)); + if(!flipper_format_file_open_existing(fff_data_file, furi_string_get_cstr(file_name))) { + FURI_LOG_W(TAG, "Could not open UP file %s", furi_string_get_cstr(file_name)); //disable button, and set label to "N/A" app->up_enabled = 0; @@ -369,11 +370,11 @@ void unirfremix_cfg_set_check(UniRFRemix* app, string_t file_name) { } if(app->down_enabled == 1) { - string_set(file_name, app->down_file); + furi_string_set(file_name, app->down_file); fff_data_file = flipper_format_file_alloc(storage); - if(!flipper_format_file_open_existing(fff_data_file, string_get_cstr(file_name))) { - FURI_LOG_W(TAG, "Could not open DOWN file %s", string_get_cstr(file_name)); + if(!flipper_format_file_open_existing(fff_data_file, furi_string_get_cstr(file_name))) { + FURI_LOG_W(TAG, "Could not open DOWN file %s", furi_string_get_cstr(file_name)); app->down_enabled = 0; app->down_label = "N/A"; @@ -385,11 +386,11 @@ void unirfremix_cfg_set_check(UniRFRemix* app, string_t file_name) { } if(app->left_enabled == 1) { - string_set(file_name, app->left_file); + furi_string_set(file_name, app->left_file); fff_data_file = flipper_format_file_alloc(storage); - if(!flipper_format_file_open_existing(fff_data_file, string_get_cstr(file_name))) { - FURI_LOG_W(TAG, "Could not open LEFT file %s", string_get_cstr(file_name)); + if(!flipper_format_file_open_existing(fff_data_file, furi_string_get_cstr(file_name))) { + FURI_LOG_W(TAG, "Could not open LEFT file %s", furi_string_get_cstr(file_name)); app->left_enabled = 0; app->left_label = "N/A"; @@ -401,11 +402,11 @@ void unirfremix_cfg_set_check(UniRFRemix* app, string_t file_name) { } if(app->right_enabled == 1) { - string_set(file_name, app->right_file); + furi_string_set(file_name, app->right_file); fff_data_file = flipper_format_file_alloc(storage); - if(!flipper_format_file_open_existing(fff_data_file, string_get_cstr(file_name))) { - FURI_LOG_W(TAG, "Could not open RIGHT file %s", string_get_cstr(file_name)); + if(!flipper_format_file_open_existing(fff_data_file, furi_string_get_cstr(file_name))) { + FURI_LOG_W(TAG, "Could not open RIGHT file %s", furi_string_get_cstr(file_name)); app->right_enabled = 0; app->right_label = "N/A"; @@ -417,11 +418,11 @@ void unirfremix_cfg_set_check(UniRFRemix* app, string_t file_name) { } if(app->ok_enabled == 1) { - string_set(file_name, app->ok_file); + furi_string_set(file_name, app->ok_file); fff_data_file = flipper_format_file_alloc(storage); - if(!flipper_format_file_open_existing(fff_data_file, string_get_cstr(file_name))) { - FURI_LOG_W(TAG, "Could not open OK file %s", string_get_cstr(file_name)); + if(!flipper_format_file_open_existing(fff_data_file, furi_string_get_cstr(file_name))) { + FURI_LOG_W(TAG, "Could not open OK file %s", furi_string_get_cstr(file_name)); app->ok_enabled = 0; app->ok_label = "N/A"; @@ -448,17 +449,17 @@ static void unirfremix_end_send(UniRFRemix* app) { bool unirfremix_set_preset(UniRFPreset* p, const char* preset) { if(!strcmp(preset, "FuriHalSubGhzPresetOok270Async")) { - string_set(p->name, "AM270"); + furi_string_set(p->name, "AM270"); } else if(!strcmp(preset, "FuriHalSubGhzPresetOok650Async")) { - string_set(p->name, "AM650"); + furi_string_set(p->name, "AM650"); } else if(!strcmp(preset, "FuriHalSubGhzPreset2FSKDev238Async")) { - string_set(p->name, "FM238"); + furi_string_set(p->name, "FM238"); } else if(!strcmp(preset, "FuriHalSubGhzPreset2FSKDev476Async")) { - string_set(p->name, "FM476"); + furi_string_set(p->name, "FM476"); } else if(!strcmp(preset, "FuriHalSubGhzPresetCustom")) { FURI_LOG_E(TAG, "Custom preset unsupported now"); return false; - // string_set(p->name, "CUSTOM"); + // furi_string_set(p->name, "CUSTOM"); } else { FURI_LOG_E(TAG, "Unsupported preset"); return false; @@ -479,8 +480,8 @@ bool unirfremix_key_load( return false; } - string_t temp_str; - string_init(temp_str); + FuriString* temp_str; + temp_str = furi_string_alloc(); bool res = false; @@ -494,19 +495,19 @@ bool unirfremix_key_load( // load preset from file if(!flipper_format_read_string(fff_file, "Preset", temp_str)) { FURI_LOG_W(TAG, "Could not read Preset. Defaulting to Ook650Async"); - string_set(temp_str, "FuriHalSubGhzPresetOok650Async"); + furi_string_set(temp_str, "FuriHalSubGhzPresetOok650Async"); } - if(!unirfremix_set_preset(preset, string_get_cstr(temp_str))) { + if(!unirfremix_set_preset(preset, furi_string_get_cstr(temp_str))) { FURI_LOG_E(TAG, "Could not set preset"); break; } - if(!strcmp(string_get_cstr(temp_str), "FuriHalSubGhzPresetCustom")) { + if(!strcmp(furi_string_get_cstr(temp_str), "FuriHalSubGhzPresetCustom")) { // TODO: check if preset is custom FURI_LOG_E(TAG, "Could not use custom preset"); break; } size_t preset_index = - subghz_setting_get_inx_preset_by_name(setting, string_get_cstr(preset->name)); + subghz_setting_get_inx_preset_by_name(setting, furi_string_get_cstr(preset->name)); preset->data = subghz_setting_get_preset_data(setting, preset_index); preset->data_size = subghz_setting_get_preset_data_size(setting, preset_index); @@ -515,7 +516,7 @@ bool unirfremix_key_load( FURI_LOG_E(TAG, "Could not read Protocol."); break; } - if(!string_cmp_str(preset->protocol, "RAW")) { + if(!furi_string_cmp_str(preset->protocol, "RAW")) { subghz_protocol_raw_gen_fff_data(fff_data, path); } else { stream_copy_full( @@ -529,19 +530,19 @@ bool unirfremix_key_load( } preset->decoder = subghz_receiver_search_decoder_base_by_name( - receiver, string_get_cstr(preset->protocol)); + receiver, furi_string_get_cstr(preset->protocol)); if(preset->decoder) { if(!subghz_protocol_decoder_base_deserialize(preset->decoder, fff_data)) { break; } } else { - FURI_LOG_E(TAG, "Protocol %s not found", string_get_cstr(temp_str)); + FURI_LOG_E(TAG, "Protocol %s not found", furi_string_get_cstr(temp_str)); } res = true; } while(0); - string_clear(temp_str); + furi_string_free(temp_str); return res; } @@ -556,15 +557,15 @@ bool unirfremix_save_protocol_to_file(FlipperFormat* fff_file, const char* dev_f Stream* flipper_format_stream = flipper_format_get_raw_stream(fff_file); bool saved = false; - string_t file_dir; - string_init(file_dir); + FuriString* file_dir; + file_dir = furi_string_alloc(); path_extract_dirname(dev_file_name, file_dir); do { flipper_format_delete_key(fff_file, "Repeat"); flipper_format_delete_key(fff_file, "Manufacture"); - if(!storage_simply_mkdir(storage, string_get_cstr(file_dir))) { + if(!storage_simply_mkdir(storage, furi_string_get_cstr(file_dir))) { FURI_LOG_E(TAG, "(save) Cannot mkdir"); break; } @@ -580,7 +581,7 @@ bool unirfremix_save_protocol_to_file(FlipperFormat* fff_file, const char* dev_f saved = true; FURI_LOG_D(TAG, "(save) OK Save"); } while(0); - string_clear(file_dir); + furi_string_free(file_dir); furi_record_close(RECORD_STORAGE); return saved; } @@ -590,7 +591,7 @@ void unirfremix_tx_stop(UniRFRemix* app) { return; } - if(!string_cmp_str(app->txpreset->protocol, "RAW")) { + if(!furi_string_cmp_str(app->txpreset->protocol, "RAW")) { while(!furi_hal_subghz_is_async_tx_complete()) { furi_delay_ms(15); } @@ -603,7 +604,7 @@ void unirfremix_tx_stop(UniRFRemix* app) { FURI_LOG_D(TAG, "Checking if protocol is dynamic"); const SubGhzProtocol* registry = - subghz_protocol_registry_get_by_name(string_get_cstr(app->txpreset->protocol)); + subghz_protocol_registry_get_by_name(furi_string_get_cstr(app->txpreset->protocol)); FURI_LOG_D(TAG, "Protocol-TYPE %d", registry->type); if(registry && registry->type == SubGhzProtocolTypeDynamic) { FURI_LOG_D(TAG, "Protocol is dynamic. Saving key"); @@ -642,7 +643,7 @@ static bool unirfremix_send_sub(UniRFRemix* app, FlipperFormat* fff_data) { } app->tx_transmitter = subghz_transmitter_alloc_init( - app->environment, string_get_cstr(app->txpreset->protocol)); + app->environment, furi_string_get_cstr(app->txpreset->protocol)); if(!app->tx_transmitter) { break; } @@ -713,16 +714,16 @@ static void unirfremix_send_signal(UniRFRemix* app, Storage* storage, const char unirfremix_send_sub(app, app->tx_fff_data); } -static void unirfremix_process_signal(UniRFRemix* app, string_t signal) { +static void unirfremix_process_signal(UniRFRemix* app, FuriString* signal) { view_port_update(app->view_port); - FURI_LOG_I(TAG, "signal = %s", string_get_cstr(signal)); + FURI_LOG_I(TAG, "signal = %s", furi_string_get_cstr(signal)); - if(strlen(string_get_cstr(signal)) > 12) { + if(strlen(furi_string_get_cstr(signal)) > 12) { Storage* storage = furi_record_open(RECORD_STORAGE); - unirfremix_send_signal(app, storage, string_get_cstr(signal)); + unirfremix_send_signal(app, storage, furi_string_get_cstr(signal)); furi_record_close(RECORD_STORAGE); - } else if(strlen(string_get_cstr(signal)) < 10) { + } else if(strlen(furi_string_get_cstr(signal)) < 10) { unirfremix_end_send(app); } } @@ -867,21 +868,21 @@ UniRFRemix* unirfremix_alloc(void) { void unirfremix_free(UniRFRemix* app, bool with_subghz) { furi_hal_power_suppress_charge_exit(); - string_clear(app->up_file); - string_clear(app->down_file); - string_clear(app->left_file); - string_clear(app->right_file); - string_clear(app->ok_file); - string_clear(app->empty); + furi_string_free(app->up_file); + furi_string_free(app->down_file); + furi_string_free(app->left_file); + furi_string_free(app->right_file); + furi_string_free(app->ok_file); + furi_string_free(app->empty); - string_clear(app->up_l); - string_clear(app->down_l); - string_clear(app->left_l); - string_clear(app->right_l); - string_clear(app->ok_l); + furi_string_free(app->up_l); + furi_string_free(app->down_l); + furi_string_free(app->left_l); + furi_string_free(app->right_l); + furi_string_free(app->ok_l); - string_clear(app->file_path); - string_clear(app->signal); + furi_string_free(app->file_path); + furi_string_free(app->signal); gui_remove_view_port(app->gui, app->view_port); furi_record_close(RECORD_GUI); @@ -909,21 +910,21 @@ int32_t unirfremix_app(void* p) { UNUSED(p); UniRFRemix* app = unirfremix_alloc(); - string_init(app->file_path); + app->file_path = furi_string_alloc(); //setup variables before population - string_init(app->up_file); - string_init(app->down_file); - string_init(app->left_file); - string_init(app->right_file); - string_init(app->ok_file); - string_init(app->empty); + app->up_file = furi_string_alloc(); + app->down_file = furi_string_alloc(); + app->left_file = furi_string_alloc(); + app->right_file = furi_string_alloc(); + app->ok_file = furi_string_alloc(); + app->empty = furi_string_alloc(); - string_init(app->up_l); - string_init(app->down_l); - string_init(app->left_l); - string_init(app->right_l); - string_init(app->ok_l); + app->up_l = furi_string_alloc(); + app->down_l = furi_string_alloc(); + app->left_l = furi_string_alloc(); + app->right_l = furi_string_alloc(); + app->ok_l = furi_string_alloc(); app->file_result = 3; @@ -933,7 +934,7 @@ int32_t unirfremix_app(void* p) { } furi_record_close(RECORD_STORAGE); - string_set_str(app->file_path, UNIRFMAP_FOLDER); + furi_string_set(app->file_path, UNIRFMAP_FOLDER); DialogsApp* dialogs = furi_record_open(RECORD_DIALOGS); @@ -961,11 +962,11 @@ int32_t unirfremix_app(void* p) { FURI_LOG_D( TAG, "U: %s - D: %s - L: %s - R: %s - O: %s ", - string_get_cstr(app->up_file), - string_get_cstr(app->down_file), - string_get_cstr(app->left_file), - string_get_cstr(app->right_file), - string_get_cstr(app->ok_file)); + furi_string_get_cstr(app->up_file), + furi_string_get_cstr(app->down_file), + furi_string_get_cstr(app->left_file), + furi_string_get_cstr(app->right_file), + furi_string_get_cstr(app->ok_file)); //variables to control multiple button presses and status updates app->send_status = "Idle"; @@ -994,8 +995,8 @@ int32_t unirfremix_app(void* p) { if(input.type == InputTypePress) { if(app->up_enabled) { if(app->processing == 0) { - *app->signal = *app->empty; - *app->signal = *app->up_file; + app->signal = app->empty; + app->signal = app->up_file; app->button = 1; app->processing = 1; } @@ -1012,8 +1013,8 @@ int32_t unirfremix_app(void* p) { if(input.type == InputTypePress) { if(app->down_enabled) { if(app->processing == 0) { - *app->signal = *app->empty; - *app->signal = *app->down_file; + app->signal = app->empty; + app->signal = app->down_file; app->button = 2; app->processing = 1; } @@ -1030,8 +1031,8 @@ int32_t unirfremix_app(void* p) { if(input.type == InputTypePress) { if(app->right_enabled) { if(app->processing == 0) { - *app->signal = *app->empty; - *app->signal = *app->right_file; + app->signal = app->empty; + app->signal = app->right_file; app->button = 3; app->processing = 1; } @@ -1048,8 +1049,8 @@ int32_t unirfremix_app(void* p) { if(input.type == InputTypePress) { if(app->left_enabled) { if(app->processing == 0) { - *app->signal = *app->empty; - *app->signal = *app->left_file; + app->signal = app->empty; + app->signal = app->left_file; app->button = 4; app->processing = 1; } @@ -1066,8 +1067,8 @@ int32_t unirfremix_app(void* p) { if(input.type == InputTypePress) { if(app->ok_enabled) { if(app->processing == 0) { - *app->signal = *app->empty; - *app->signal = *app->ok_file; + app->signal = app->empty; + app->signal = app->ok_file; app->button = 5; app->processing = 1; } diff --git a/applications/plugins/doom/doom_music_player_worker.c b/applications/plugins/doom/doom_music_player_worker.c index 406cf0576..8b7f95f11 100644 --- a/applications/plugins/doom/doom_music_player_worker.c +++ b/applications/plugins/doom/doom_music_player_worker.c @@ -326,8 +326,8 @@ bool music_player_worker_load_fmf_from_file(MusicPlayerWorker* instance, const c furi_assert(file_path); bool result = false; - string_t temp_str; - string_init(temp_str); + FuriString* temp_str; + temp_str = furi_string_alloc(); Storage* storage = furi_record_open(RECORD_STORAGE); FlipperFormat* file = flipper_format_file_alloc(storage); @@ -337,7 +337,8 @@ bool music_player_worker_load_fmf_from_file(MusicPlayerWorker* instance, const c uint32_t version = 0; if(!flipper_format_read_header(file, temp_str, &version)) break; - if(string_cmp_str(temp_str, MUSIC_PLAYER_FILETYPE) || (version != MUSIC_PLAYER_VERSION)) { + if(furi_string_cmp_str(temp_str, MUSIC_PLAYER_FILETYPE) || + (version != MUSIC_PLAYER_VERSION)) { FURI_LOG_E(TAG, "Incorrect file format or version"); break; } @@ -360,7 +361,7 @@ bool music_player_worker_load_fmf_from_file(MusicPlayerWorker* instance, const c break; } - if(!music_player_worker_parse_notes(instance, string_get_cstr(temp_str))) { + if(!music_player_worker_parse_notes(instance, furi_string_get_cstr(temp_str))) { break; } @@ -369,7 +370,7 @@ bool music_player_worker_load_fmf_from_file(MusicPlayerWorker* instance, const c furi_record_close(RECORD_STORAGE); flipper_format_free(file); - string_clear(temp_str); + furi_string_free(temp_str); return result; } @@ -379,8 +380,8 @@ bool music_player_worker_load_rtttl_from_file(MusicPlayerWorker* instance, const furi_assert(file_path); bool result = false; - string_t content; - string_init(content); + FuriString* content; + content = furi_string_alloc(); Storage* storage = furi_record_open(RECORD_STORAGE); File* file = storage_file_alloc(storage); @@ -395,17 +396,17 @@ bool music_player_worker_load_rtttl_from_file(MusicPlayerWorker* instance, const uint8_t buffer[65] = {0}; ret = storage_file_read(file, buffer, sizeof(buffer) - 1); for(size_t i = 0; i < ret; i++) { - string_push_back(content, buffer[i]); + furi_string_push_back(content, buffer[i]); } } while(ret > 0); - string_strim(content); - if(!string_size(content)) { + furi_string_trim(content); + if(!furi_string_size(content)) { FURI_LOG_E(TAG, "Empty file"); break; } - if(!music_player_worker_load_rtttl_from_string(instance, string_get_cstr(content))) { + if(!music_player_worker_load_rtttl_from_string(instance, furi_string_get_cstr(content))) { FURI_LOG_E(TAG, "Invalid file content"); break; } @@ -415,7 +416,7 @@ bool music_player_worker_load_rtttl_from_file(MusicPlayerWorker* instance, const storage_file_free(file); furi_record_close(RECORD_STORAGE); - string_clear(content); + furi_string_free(content); return result; } diff --git a/applications/plugins/doom/sound.h b/applications/plugins/doom/sound.h index b33ac93c6..514381334 100644 --- a/applications/plugins/doom/sound.h +++ b/applications/plugins/doom/sound.h @@ -1,6 +1,5 @@ #ifndef sound_h #define sound_h -#include #include #include #include diff --git a/applications/plugins/esp8266_deauth/esp8266_deauth.c b/applications/plugins/esp8266_deauth/esp8266_deauth.c index 253ad650f..d36580ec1 100644 --- a/applications/plugins/esp8266_deauth/esp8266_deauth.c +++ b/applications/plugins/esp8266_deauth/esp8266_deauth.c @@ -6,7 +6,6 @@ #include #include #include -//#include //#include //#include //#include @@ -250,8 +249,8 @@ static int32_t uart_worker(void* context) { #if ENABLE_MODULE_POWER bool initialized = false; - string_t receivedString; - string_init(receivedString); + FuriString* receivedString; + receivedString = furi_string_alloc(); #endif // ENABLE_MODULE_POWER while(true) { @@ -280,7 +279,7 @@ static int32_t uart_worker(void* context) { if(!(dataReceivedLength > strlen(MODULE_CONTEXT_INITIALIZATION))) { DEAUTH_APP_LOG_I("[UART] Found possible init candidate"); for(uint16_t i = 0; i < dataReceivedLength; i++) { - string_push_back(receivedString, dataBuffer[i]); + furi_string_push_back(receivedString, dataBuffer[i]); } } } else @@ -297,15 +296,15 @@ static int32_t uart_worker(void* context) { #if ENABLE_MODULE_POWER if(!app->m_wifiDeauthModuleInitialized) { - if(string_cmp_str(receivedString, MODULE_CONTEXT_INITIALIZATION) == 0) { + if(furi_string_cmp_str(receivedString, MODULE_CONTEXT_INITIALIZATION) == 0) { DEAUTH_APP_LOG_I("[UART] Initialized"); initialized = true; app->m_wifiDeauthModuleInitialized = true; app->m_context = ModuleActive; - string_clear(receivedString); + furi_string_free(receivedString); } else { DEAUTH_APP_LOG_I("[UART] Not an initialization command"); - string_reset(receivedString); + furi_string_reset(receivedString); } } #endif // ENABLE_MODULE_POWER diff --git a/applications/plugins/flipfrid/flipfrid.c b/applications/plugins/flipfrid/flipfrid.c index ba059ff7f..807c26659 100644 --- a/applications/plugins/flipfrid/flipfrid.c +++ b/applications/plugins/flipfrid/flipfrid.c @@ -55,8 +55,8 @@ static void flipfrid_timer_callback(FuriMessageQueue* event_queue) { FlipFridState* flipfrid_alloc() { FlipFridState* flipfrid = malloc(sizeof(FlipFridState)); - string_init(flipfrid->notification_msg); - string_init(flipfrid->attack_name); + flipfrid->notification_msg = furi_string_alloc(); + flipfrid->attack_name = furi_string_alloc(); flipfrid->previous_scene = NoneScene; flipfrid->current_scene = SceneEntryPoint; @@ -95,8 +95,8 @@ void flipfrid_free(FlipFridState* flipfrid) { notification_message(flipfrid->notify, &sequence_blink_stop); // Strings - string_clear(flipfrid->notification_msg); - string_clear(flipfrid->attack_name); + furi_string_free(flipfrid->notification_msg); + furi_string_free(flipfrid->attack_name); free(flipfrid->data); free(flipfrid->payload); diff --git a/applications/plugins/flipfrid/flipfrid.h b/applications/plugins/flipfrid/flipfrid.h index 6be427f68..248e2322e 100644 --- a/applications/plugins/flipfrid/flipfrid.h +++ b/applications/plugins/flipfrid/flipfrid.h @@ -4,7 +4,6 @@ #include #include #include -#include #include #include #include @@ -65,17 +64,17 @@ typedef struct { u_int8_t menu_index; u_int8_t menu_proto_index; - string_t data_str; + FuriString* data_str; uint8_t data[6]; uint8_t payload[6]; uint8_t attack_step; FlipFridAttacks attack; FlipFridProtos proto; - string_t attack_name; - string_t proto_name; + FuriString* attack_name; + FuriString* proto_name; DialogsApp* dialogs; - string_t notification_msg; + FuriString* notification_msg; uint8_t key_index; LFRFIDWorker* worker; ProtocolDict* dict; diff --git a/applications/plugins/flipfrid/scene/flipfrid_scene_entrypoint.c b/applications/plugins/flipfrid/scene/flipfrid_scene_entrypoint.c index bdd919118..b457a11db 100644 --- a/applications/plugins/flipfrid/scene/flipfrid_scene_entrypoint.c +++ b/applications/plugins/flipfrid/scene/flipfrid_scene_entrypoint.c @@ -1,7 +1,7 @@ #include "flipfrid_scene_entrypoint.h" -string_t menu_items[4]; -string_t menu_proto_items[4]; +FuriString* menu_items[4]; +FuriString* menu_proto_items[4]; void flipfrid_scene_entrypoint_menu_callback( FlipFridState* context, @@ -11,22 +11,22 @@ void flipfrid_scene_entrypoint_menu_callback( case FlipFridAttackDefaultValues: context->attack = FlipFridAttackDefaultValues; context->current_scene = SceneAttack; - string_set_str(context->attack_name, "Default Values"); + furi_string_set(context->attack_name, "Default Values"); break; case FlipFridAttackBfCustomerId: context->attack = FlipFridAttackBfCustomerId; context->current_scene = SceneAttack; - string_set_str(context->attack_name, "Bad Customer ID"); + furi_string_set(context->attack_name, "Bad Customer ID"); break; case FlipFridAttackLoadFile: context->attack = FlipFridAttackLoadFile; context->current_scene = SceneSelectFile; - string_set_str(context->attack_name, "Load File"); + furi_string_set(context->attack_name, "Load File"); break; case FlipFridAttackLoadFileCustomUids: context->attack = FlipFridAttackLoadFileCustomUids; context->current_scene = SceneLoadCustomUids; - string_set_str(context->attack_name, "Load Custom UIDs"); + furi_string_set(context->attack_name, "Load Custom UIDs"); break; default: break; @@ -35,19 +35,19 @@ void flipfrid_scene_entrypoint_menu_callback( switch(proto_index) { case EM4100: context->proto = EM4100; - string_set_str(context->proto_name, "EM4100"); + furi_string_set(context->proto_name, "EM4100"); break; case HIDProx: context->proto = HIDProx; - string_set_str(context->proto_name, "HIDProx"); + furi_string_set(context->proto_name, "HIDProx"); break; case PAC: context->proto = PAC; - string_set_str(context->proto_name, "PAC/Stanley"); + furi_string_set(context->proto_name, "PAC/Stanley"); break; case H10301: context->proto = H10301; - string_set_str(context->proto_name, "H10301"); + furi_string_set(context->proto_name, "H10301"); break; default: break; @@ -65,33 +65,33 @@ void flipfrid_scene_entrypoint_on_enter(FlipFridState* context) { context->menu_index = 0; for(uint32_t i = 0; i < 4; i++) { - string_init(menu_items[i]); + menu_items[i] = furi_string_alloc(); } - string_set(menu_items[0], "Default Values"); - string_set(menu_items[1], "BF Customer ID"); - string_set(menu_items[2], "Load File"); - string_set(menu_items[3], "Load uids from file"); + furi_string_set(menu_items[0], "Default Values"); + furi_string_set(menu_items[1], "BF Customer ID"); + furi_string_set(menu_items[2], "Load File"); + furi_string_set(menu_items[3], "Load uids from file"); context->menu_proto_index = 0; for(uint32_t i = 0; i < 4; i++) { - string_init(menu_proto_items[i]); + menu_proto_items[i] = furi_string_alloc(); } - string_set(menu_proto_items[0], "EM4100"); - string_set(menu_proto_items[1], "HIDProx"); - string_set(menu_proto_items[2], "PAC/Stanley"); - string_set(menu_proto_items[3], "H10301"); + furi_string_set(menu_proto_items[0], "EM4100"); + furi_string_set(menu_proto_items[1], "HIDProx"); + furi_string_set(menu_proto_items[2], "PAC/Stanley"); + furi_string_set(menu_proto_items[3], "H10301"); } void flipfrid_scene_entrypoint_on_exit(FlipFridState* context) { UNUSED(context); for(uint32_t i = 0; i < 4; i++) { - string_clear(menu_items[i]); + furi_string_free(menu_items[i]); } for(uint32_t i = 0; i < 4; i++) { - string_clear(menu_proto_items[i]); + furi_string_free(menu_proto_items[i]); } } @@ -151,12 +151,17 @@ void flipfrid_scene_entrypoint_on_draw(Canvas* canvas, FlipFridState* context) { 24, AlignCenter, AlignTop, - string_get_cstr(menu_items[context->menu_index - 1])); + furi_string_get_cstr(menu_items[context->menu_index - 1])); } canvas_set_font(canvas, FontPrimary); canvas_draw_str_aligned( - canvas, 64, 36, AlignCenter, AlignTop, string_get_cstr(menu_items[context->menu_index])); + canvas, + 64, + 36, + AlignCenter, + AlignTop, + furi_string_get_cstr(menu_items[context->menu_index])); if(context->menu_index < FlipFridAttackLoadFileCustomUids) { canvas_set_font(canvas, FontSecondary); @@ -166,7 +171,7 @@ void flipfrid_scene_entrypoint_on_draw(Canvas* canvas, FlipFridState* context) { 48, AlignCenter, AlignTop, - string_get_cstr(menu_items[context->menu_index + 1])); + furi_string_get_cstr(menu_items[context->menu_index + 1])); } if(context->menu_proto_index > EM4100) { @@ -177,7 +182,7 @@ void flipfrid_scene_entrypoint_on_draw(Canvas* canvas, FlipFridState* context) { -12, AlignCenter, AlignTop, - string_get_cstr(menu_proto_items[context->menu_proto_index - 1])); + furi_string_get_cstr(menu_proto_items[context->menu_proto_index - 1])); } canvas_set_font(canvas, FontPrimary); @@ -190,7 +195,7 @@ void flipfrid_scene_entrypoint_on_draw(Canvas* canvas, FlipFridState* context) { 4, AlignCenter, AlignTop, - string_get_cstr(menu_proto_items[context->menu_proto_index])); + furi_string_get_cstr(menu_proto_items[context->menu_proto_index])); canvas_set_font(canvas, FontPrimary); canvas_draw_str_aligned(canvas, 101, 4, AlignCenter, AlignTop, ">"); @@ -203,6 +208,6 @@ void flipfrid_scene_entrypoint_on_draw(Canvas* canvas, FlipFridState* context) { -12, AlignCenter, AlignTop, - string_get_cstr(menu_proto_items[context->menu_proto_index + 1])); + furi_string_get_cstr(menu_proto_items[context->menu_proto_index + 1])); } } \ No newline at end of file diff --git a/applications/plugins/flipfrid/scene/flipfrid_scene_load_custom_uids.c b/applications/plugins/flipfrid/scene/flipfrid_scene_load_custom_uids.c index d2e4ce136..cc9e9871d 100644 --- a/applications/plugins/flipfrid/scene/flipfrid_scene_load_custom_uids.c +++ b/applications/plugins/flipfrid/scene/flipfrid_scene_load_custom_uids.c @@ -21,9 +21,9 @@ bool flipfrid_load_uids(FlipFridState* context, const char* file_path) { bool flipfrid_load_custom_uids_from_file(FlipFridState* context) { // Input events and views are managed by file_select - string_t uid_path; - string_init(uid_path); - string_set_str(uid_path, RFIDFUZZER_APP_PATH_FOLDER); + FuriString* uid_path; + uid_path = furi_string_alloc(); + furi_string_set(uid_path, RFIDFUZZER_APP_PATH_FOLDER); DialogsFileBrowserOptions browser_options; dialog_file_browser_set_basic_options(&browser_options, LFRFID_UIDS_EXTENSION, &I_125_10px); @@ -32,10 +32,10 @@ bool flipfrid_load_custom_uids_from_file(FlipFridState* context) { bool res = dialog_file_browser_show(context->dialogs, uid_path, uid_path, &browser_options); if(res) { - res = flipfrid_load_uids(context, string_get_cstr(uid_path)); + res = flipfrid_load_uids(context, furi_string_get_cstr(uid_path)); } - string_clear(uid_path); + furi_string_free(uid_path); return res; } diff --git a/applications/plugins/flipfrid/scene/flipfrid_scene_load_file.c b/applications/plugins/flipfrid/scene/flipfrid_scene_load_file.c index 92f947719..76864018b 100644 --- a/applications/plugins/flipfrid/scene/flipfrid_scene_load_file.c +++ b/applications/plugins/flipfrid/scene/flipfrid_scene_load_file.c @@ -8,61 +8,61 @@ bool flipfrid_load(FlipFridState* context, const char* file_path) { bool result = false; Storage* storage = furi_record_open(RECORD_STORAGE); FlipperFormat* fff_data_file = flipper_format_file_alloc(storage); - string_t temp_str; - string_init(temp_str); + FuriString* temp_str; + temp_str = furi_string_alloc(); do { if(!flipper_format_file_open_existing(fff_data_file, file_path)) { FURI_LOG_E(TAG, "Error open file %s", file_path); - string_reset(context->notification_msg); - string_set_str(context->notification_msg, "Error open file"); + furi_string_reset(context->notification_msg); + furi_string_set(context->notification_msg, "Error open file"); break; } // FileType if(!flipper_format_read_string(fff_data_file, "Filetype", temp_str)) { FURI_LOG_E(TAG, "Missing or incorrect Filetype"); - string_reset(context->notification_msg); - string_set_str(context->notification_msg, "Missing or incorrect Filetypes"); + furi_string_reset(context->notification_msg); + furi_string_set(context->notification_msg, "Missing or incorrect Filetypes"); break; } else { - FURI_LOG_I(TAG, "Filetype: %s", string_get_cstr(temp_str)); + FURI_LOG_I(TAG, "Filetype: %s", furi_string_get_cstr(temp_str)); } // Key type if(!flipper_format_read_string(fff_data_file, "Key type", temp_str)) { FURI_LOG_E(TAG, "Missing or incorrect Key type"); - string_reset(context->notification_msg); - string_set_str(context->notification_msg, "Missing or incorrect Key type"); + furi_string_reset(context->notification_msg); + furi_string_set(context->notification_msg, "Missing or incorrect Key type"); break; } else { - FURI_LOG_I(TAG, "Key type: %s", string_get_cstr(temp_str)); + FURI_LOG_I(TAG, "Key type: %s", furi_string_get_cstr(temp_str)); if(context->proto == EM4100) { - if(strcmp(string_get_cstr(temp_str), "EM4100") != 0) { + if(strcmp(furi_string_get_cstr(temp_str), "EM4100") != 0) { FURI_LOG_E(TAG, "Unsupported Key type"); - string_reset(context->notification_msg); - string_set_str(context->notification_msg, "Unsupported Key type"); + furi_string_reset(context->notification_msg); + furi_string_set(context->notification_msg, "Unsupported Key type"); break; } } else if(context->proto == PAC) { - if(strcmp(string_get_cstr(temp_str), "PAC/Stanley") != 0) { + if(strcmp(furi_string_get_cstr(temp_str), "PAC/Stanley") != 0) { FURI_LOG_E(TAG, "Unsupported Key type"); - string_reset(context->notification_msg); - string_set_str(context->notification_msg, "Unsupported Key type"); + furi_string_reset(context->notification_msg); + furi_string_set(context->notification_msg, "Unsupported Key type"); break; } } else if(context->proto == H10301) { - if(strcmp(string_get_cstr(temp_str), "H10301") != 0) { + if(strcmp(furi_string_get_cstr(temp_str), "H10301") != 0) { FURI_LOG_E(TAG, "Unsupported Key type"); - string_reset(context->notification_msg); - string_set_str(context->notification_msg, "Unsupported Key type"); + furi_string_reset(context->notification_msg); + furi_string_set(context->notification_msg, "Unsupported Key type"); break; } } else { - if(strcmp(string_get_cstr(temp_str), "HIDProx") != 0) { + if(strcmp(furi_string_get_cstr(temp_str), "HIDProx") != 0) { FURI_LOG_E(TAG, "Unsupported Key type"); - string_reset(context->notification_msg); - string_set_str(context->notification_msg, "Unsupported Key type"); + furi_string_reset(context->notification_msg); + furi_string_set(context->notification_msg, "Unsupported Key type"); break; } } @@ -71,38 +71,38 @@ bool flipfrid_load(FlipFridState* context, const char* file_path) { // Data if(!flipper_format_read_string(fff_data_file, "Data", context->data_str)) { FURI_LOG_E(TAG, "Missing or incorrect Data"); - string_reset(context->notification_msg); - string_set_str(context->notification_msg, "Missing or incorrect Key"); + furi_string_reset(context->notification_msg); + furi_string_set(context->notification_msg, "Missing or incorrect Key"); break; } else { - FURI_LOG_I(TAG, "Key: %s", string_get_cstr(context->data_str)); + FURI_LOG_I(TAG, "Key: %s", furi_string_get_cstr(context->data_str)); if(context->proto == EM4100) { - if(string_size(context->data_str) != 14) { + if(furi_string_size(context->data_str) != 14) { FURI_LOG_E(TAG, "Incorrect Key length"); - string_reset(context->notification_msg); - string_set_str(context->notification_msg, "Incorrect Key length"); + furi_string_reset(context->notification_msg); + furi_string_set(context->notification_msg, "Incorrect Key length"); break; } } else if(context->proto == PAC) { - if(string_size(context->data_str) != 11) { + if(furi_string_size(context->data_str) != 11) { FURI_LOG_E(TAG, "Incorrect Key length"); - string_reset(context->notification_msg); - string_set_str(context->notification_msg, "Incorrect Key length"); + furi_string_reset(context->notification_msg); + furi_string_set(context->notification_msg, "Incorrect Key length"); break; } } else if(context->proto == H10301) { - if(string_size(context->data_str) != 8) { + if(furi_string_size(context->data_str) != 8) { FURI_LOG_E(TAG, "Incorrect Key length"); - string_reset(context->notification_msg); - string_set_str(context->notification_msg, "Incorrect Key length"); + furi_string_reset(context->notification_msg); + furi_string_set(context->notification_msg, "Incorrect Key length"); break; } } else { - if(string_size(context->data_str) != 17) { + if(furi_string_size(context->data_str) != 17) { FURI_LOG_E(TAG, "Incorrect Key length"); - string_reset(context->notification_msg); - string_set_str(context->notification_msg, "Incorrect Key length"); + furi_string_reset(context->notification_msg); + furi_string_set(context->notification_msg, "Incorrect Key length"); break; } } @@ -110,8 +110,8 @@ bool flipfrid_load(FlipFridState* context, const char* file_path) { // String to uint8_t for(uint8_t i = 0; i < 6; i++) { char temp_str2[3]; - temp_str2[0] = string_get_cstr(context->data_str)[i * 3]; - temp_str2[1] = string_get_cstr(context->data_str)[i * 3 + 1]; + temp_str2[0] = furi_string_get_cstr(context->data_str)[i * 3]; + temp_str2[1] = furi_string_get_cstr(context->data_str)[i * 3 + 1]; temp_str2[2] = '\0'; context->data[i] = (uint8_t)strtol(temp_str2, NULL, 16); } @@ -119,12 +119,12 @@ bool flipfrid_load(FlipFridState* context, const char* file_path) { result = true; } while(0); - string_clear(temp_str); + furi_string_free(temp_str); flipper_format_free(fff_data_file); if(result) { FURI_LOG_I(TAG, "Loaded successfully"); - string_reset(context->notification_msg); - string_set_str(context->notification_msg, "Source loaded."); + furi_string_reset(context->notification_msg); + furi_string_set(context->notification_msg, "Source loaded."); } return result; } @@ -169,9 +169,9 @@ void flipfrid_scene_load_file_on_draw(Canvas* canvas, FlipFridState* context) { } bool flipfrid_load_protocol_from_file(FlipFridState* context) { - string_t user_file_path; - string_init(user_file_path); - string_set_str(user_file_path, LFRFID_APP_PATH_FOLDER); + FuriString* user_file_path; + user_file_path = furi_string_alloc(); + furi_string_set(user_file_path, LFRFID_APP_PATH_FOLDER); DialogsFileBrowserOptions browser_options; dialog_file_browser_set_basic_options(&browser_options, LFRFID_APP_EXTENSION, &I_125_10px); @@ -181,10 +181,10 @@ bool flipfrid_load_protocol_from_file(FlipFridState* context) { context->dialogs, user_file_path, user_file_path, &browser_options); if(res) { - res = flipfrid_load(context, string_get_cstr(user_file_path)); + res = flipfrid_load(context, furi_string_get_cstr(user_file_path)); } - string_clear(user_file_path); + furi_string_free(user_file_path); return res; } \ No newline at end of file diff --git a/applications/plugins/flipfrid/scene/flipfrid_scene_run_attack.c b/applications/plugins/flipfrid/scene/flipfrid_scene_run_attack.c index 2e97fc817..18e0d9c82 100644 --- a/applications/plugins/flipfrid/scene/flipfrid_scene_run_attack.c +++ b/applications/plugins/flipfrid/scene/flipfrid_scene_run_attack.c @@ -337,7 +337,7 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) { if(context->proto == EM4100) { bool end_of_list = false; while(true) { - string_reset(context->data_str); + furi_string_reset(context->data_str); if(!stream_read_line(context->uids_stream, context->data_str)) { context->attack_step = 0; counter = 0; @@ -348,13 +348,13 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) { end_of_list = true; break; }; - if(string_get_char(context->data_str, 0) == '#') continue; - if(string_size(context->data_str) != 11) break; + if(furi_string_get_char(context->data_str, 0) == '#') continue; + if(furi_string_size(context->data_str) != 11) break; break; } if(end_of_list) break; - FURI_LOG_D(TAG, string_get_cstr(context->data_str)); - if(string_size(context->data_str) != 11) { + FURI_LOG_D(TAG, furi_string_get_cstr(context->data_str)); + if(furi_string_size(context->data_str) != 11) { context->attack_step = 0; counter = 0; context->is_attacking = false; @@ -366,8 +366,8 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) { // string is valid, parse it in context->payload for(uint8_t i = 0; i < 5; i++) { char temp_str[3]; - temp_str[0] = string_get_cstr(context->data_str)[i * 2]; - temp_str[1] = string_get_cstr(context->data_str)[i * 2 + 1]; + temp_str[0] = furi_string_get_cstr(context->data_str)[i * 2]; + temp_str[1] = furi_string_get_cstr(context->data_str)[i * 2 + 1]; temp_str[2] = '\0'; context->payload[i] = (uint8_t)strtol(temp_str, NULL, 16); } @@ -375,7 +375,7 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) { } else if(context->proto == PAC) { bool end_of_list = false; while(true) { - string_reset(context->data_str); + furi_string_reset(context->data_str); if(!stream_read_line(context->uids_stream, context->data_str)) { context->attack_step = 0; counter = 0; @@ -386,13 +386,13 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) { end_of_list = true; break; }; - if(string_get_char(context->data_str, 0) == '#') continue; - if(string_size(context->data_str) != 9) break; + if(furi_string_get_char(context->data_str, 0) == '#') continue; + if(furi_string_size(context->data_str) != 9) break; break; } if(end_of_list) break; - FURI_LOG_D(TAG, string_get_cstr(context->data_str)); - if(string_size(context->data_str) != 9) { + FURI_LOG_D(TAG, furi_string_get_cstr(context->data_str)); + if(furi_string_size(context->data_str) != 9) { context->attack_step = 0; counter = 0; context->is_attacking = false; @@ -404,8 +404,8 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) { // string is valid, parse it in context->payload for(uint8_t i = 0; i < 4; i++) { char temp_str[3]; - temp_str[0] = string_get_cstr(context->data_str)[i * 2]; - temp_str[1] = string_get_cstr(context->data_str)[i * 2 + 1]; + temp_str[0] = furi_string_get_cstr(context->data_str)[i * 2]; + temp_str[1] = furi_string_get_cstr(context->data_str)[i * 2 + 1]; temp_str[2] = '\0'; context->payload[i] = (uint8_t)strtol(temp_str, NULL, 16); } @@ -413,7 +413,7 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) { } else if(context->proto == H10301) { bool end_of_list = false; while(true) { - string_reset(context->data_str); + furi_string_reset(context->data_str); if(!stream_read_line(context->uids_stream, context->data_str)) { context->attack_step = 0; counter = 0; @@ -424,13 +424,13 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) { end_of_list = true; break; }; - if(string_get_char(context->data_str, 0) == '#') continue; - if(string_size(context->data_str) != 7) break; + if(furi_string_get_char(context->data_str, 0) == '#') continue; + if(furi_string_size(context->data_str) != 7) break; break; } if(end_of_list) break; - FURI_LOG_D(TAG, string_get_cstr(context->data_str)); - if(string_size(context->data_str) != 7) { + FURI_LOG_D(TAG, furi_string_get_cstr(context->data_str)); + if(furi_string_size(context->data_str) != 7) { context->attack_step = 0; counter = 0; context->is_attacking = false; @@ -442,8 +442,8 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) { // string is valid, parse it in context->payload for(uint8_t i = 0; i < 3; i++) { char temp_str[3]; - temp_str[0] = string_get_cstr(context->data_str)[i * 2]; - temp_str[1] = string_get_cstr(context->data_str)[i * 2 + 1]; + temp_str[0] = furi_string_get_cstr(context->data_str)[i * 2]; + temp_str[1] = furi_string_get_cstr(context->data_str)[i * 2 + 1]; temp_str[2] = '\0'; context->payload[i] = (uint8_t)strtol(temp_str, NULL, 16); } @@ -451,7 +451,7 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) { } else { bool end_of_list = false; while(true) { - string_reset(context->data_str); + furi_string_reset(context->data_str); if(!stream_read_line(context->uids_stream, context->data_str)) { context->attack_step = 0; counter = 0; @@ -462,13 +462,13 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) { end_of_list = true; break; }; - if(string_get_char(context->data_str, 0) == '#') continue; - if(string_size(context->data_str) != 13) break; + if(furi_string_get_char(context->data_str, 0) == '#') continue; + if(furi_string_size(context->data_str) != 13) break; break; } - FURI_LOG_D(TAG, string_get_cstr(context->data_str)); + FURI_LOG_D(TAG, furi_string_get_cstr(context->data_str)); if(end_of_list) break; - if(string_size(context->data_str) != 13) { + if(furi_string_size(context->data_str) != 13) { context->attack_step = 0; counter = 0; context->is_attacking = false; @@ -480,8 +480,8 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) { // string is valid, parse it in context->payload for(uint8_t i = 0; i < 6; i++) { char temp_str[3]; - temp_str[0] = string_get_cstr(context->data_str)[i * 2]; - temp_str[1] = string_get_cstr(context->data_str)[i * 2 + 1]; + temp_str[0] = furi_string_get_cstr(context->data_str)[i * 2]; + temp_str[1] = furi_string_get_cstr(context->data_str)[i * 2 + 1]; temp_str[2] = '\0'; context->payload[i] = (uint8_t)strtol(temp_str, NULL, 16); } @@ -538,7 +538,7 @@ void flipfrid_scene_run_attack_on_event(FlipFridEvent event, FlipFridState* cont context->attack_step = 0; context->is_attacking = false; - string_reset(context->notification_msg); + furi_string_reset(context->notification_msg); context->current_scene = SceneEntryPoint; notification_message(context->notify, &sequence_blink_stop); break; @@ -557,7 +557,7 @@ void flipfrid_scene_run_attack_on_draw(Canvas* canvas, FlipFridState* context) { // Title canvas_set_font(canvas, FontPrimary); canvas_draw_str_aligned( - canvas, 64, 2, AlignCenter, AlignTop, string_get_cstr(context->attack_name)); + canvas, 64, 2, AlignCenter, AlignTop, furi_string_get_cstr(context->attack_name)); char uid[18]; char speed[16]; @@ -606,7 +606,7 @@ void flipfrid_scene_run_attack_on_draw(Canvas* canvas, FlipFridState* context) { canvas_set_font(canvas, FontSecondary); canvas_draw_str_aligned( - canvas, 64, 26, AlignCenter, AlignTop, string_get_cstr(context->proto_name)); + canvas, 64, 26, AlignCenter, AlignTop, furi_string_get_cstr(context->proto_name)); snprintf(speed, sizeof(speed), "Time delay: %d", context->time_between_cards); diff --git a/applications/plugins/flipfrid/scene/flipfrid_scene_select_field.c b/applications/plugins/flipfrid/scene/flipfrid_scene_select_field.c index 9c4dc0a2c..607ff4aca 100644 --- a/applications/plugins/flipfrid/scene/flipfrid_scene_select_field.c +++ b/applications/plugins/flipfrid/scene/flipfrid_scene_select_field.c @@ -65,12 +65,12 @@ void flipfrid_center_displayed_key(FlipFridState* context, uint8_t index) { display_menu[15] = ' '; } - string_reset(context->notification_msg); - string_set_str(context->notification_msg, display_menu); + furi_string_reset(context->notification_msg); + furi_string_set(context->notification_msg, display_menu); } void flipfrid_scene_select_field_on_enter(FlipFridState* context) { - string_clear(context->notification_msg); + furi_string_free(context->notification_msg); } void flipfrid_scene_select_field_on_exit(FlipFridState* context) { @@ -84,7 +84,7 @@ void flipfrid_scene_select_field_on_tick(FlipFridState* context) { void flipfrid_scene_select_field_on_event(FlipFridEvent event, FlipFridState* context) { if(event.evt_type == EventTypeKey) { if(event.input_type == InputTypeShort) { - const char* key_cstr = string_get_cstr(context->data_str); + const char* key_cstr = furi_string_get_cstr(context->data_str); int data_len = sizeof(context->data) / sizeof(context->data[0]); // don't look, it's ugly but I'm a python dev so... @@ -121,12 +121,12 @@ void flipfrid_scene_select_field_on_event(FlipFridEvent event, FlipFridState* co } break; case InputKeyOk: - string_reset(context->notification_msg); + furi_string_reset(context->notification_msg); context->current_scene = SceneAttack; break; case InputKeyBack: context->key_index = 0; - string_reset(context->notification_msg); + furi_string_reset(context->notification_msg); context->current_scene = SceneSelectFile; break; } @@ -154,5 +154,5 @@ void flipfrid_scene_select_field_on_draw(Canvas* canvas, FlipFridState* context) flipfrid_center_displayed_key(context, context->key_index); canvas_set_font(canvas, FontSecondary); canvas_draw_str_aligned( - canvas, 64, 45, AlignCenter, AlignTop, string_get_cstr(context->notification_msg)); + canvas, 64, 45, AlignCenter, AlignTop, furi_string_get_cstr(context->notification_msg)); } diff --git a/applications/plugins/mousejacker/mousejacker.c b/applications/plugins/mousejacker/mousejacker.c index 99fade1c5..bd53cbaa1 100644 --- a/applications/plugins/mousejacker/mousejacker.c +++ b/applications/plugins/mousejacker/mousejacker.c @@ -104,9 +104,9 @@ static void hexlify(uint8_t* in, uint8_t size, char* out) { static bool open_ducky_script(Stream* stream, PluginState* plugin_state) { DialogsApp* dialogs = furi_record_open("dialogs"); bool result = false; - string_t path; - string_init(path); - string_set_str(path, MOUSEJACKER_APP_PATH_FOLDER); + FuriString* path; + path = furi_string_alloc(); + furi_string_set(path, MOUSEJACKER_APP_PATH_FOLDER); DialogsFileBrowserOptions browser_options; dialog_file_browser_set_basic_options( @@ -117,13 +117,13 @@ static bool open_ducky_script(Stream* stream, PluginState* plugin_state) { furi_record_close("dialogs"); if(ret) { - if(!file_stream_open(stream, string_get_cstr(path), FSAM_READ, FSOM_OPEN_EXISTING)) { + if(!file_stream_open(stream, furi_string_get_cstr(path), FSAM_READ, FSOM_OPEN_EXISTING)) { FURI_LOG_D(TAG, "Cannot open file \"%s\"", (path)); } else { result = true; } } - string_clear(path); + furi_string_free(path); plugin_state->is_ducky_running = true; @@ -133,9 +133,9 @@ static bool open_ducky_script(Stream* stream, PluginState* plugin_state) { static bool open_addrs_file(Stream* stream) { DialogsApp* dialogs = furi_record_open("dialogs"); bool result = false; - string_t path; - string_init(path); - string_set_str(path, NRFSNIFF_APP_PATH_FOLDER); + FuriString* path; + path = furi_string_alloc(); + furi_string_set(path, NRFSNIFF_APP_PATH_FOLDER); DialogsFileBrowserOptions browser_options; dialog_file_browser_set_basic_options( @@ -146,13 +146,13 @@ static bool open_addrs_file(Stream* stream) { furi_record_close("dialogs"); if(ret) { - if(!file_stream_open(stream, string_get_cstr(path), FSAM_READ, FSOM_OPEN_EXISTING)) { + if(!file_stream_open(stream, furi_string_get_cstr(path), FSAM_READ, FSOM_OPEN_EXISTING)) { FURI_LOG_D(TAG, "Cannot open file \"%s\"", (path)); } else { result = true; } } - string_clear(path); + furi_string_free(path); return result; } diff --git a/applications/plugins/playlist/playlist.c b/applications/plugins/playlist/playlist.c index 33292a2fe..f0f9ea0c3 100644 --- a/applications/plugins/playlist/playlist.c +++ b/applications/plugins/playlist/playlist.c @@ -39,10 +39,10 @@ typedef struct { int current_playlist_repetition; // current playlist repetition // last 3 files - string_t prev_0_path; // current file - string_t prev_1_path; // previous file - string_t prev_2_path; // previous previous file - string_t prev_3_path; // you get the idea + FuriString* prev_0_path; // current file + FuriString* prev_1_path; // previous file + FuriString* prev_2_path; // previous previous file + FuriString* prev_3_path; // you get the idea int state; // current state @@ -56,7 +56,7 @@ typedef struct { DisplayMeta* meta; - string_t file_path; // path to the playlist file + FuriString* file_path; // path to the playlist file bool ctl_request_exit; // can be set to true if the worker should exit bool ctl_pause; // can be set to true if the worker should pause @@ -73,7 +73,7 @@ typedef struct { DisplayMeta* meta; PlaylistWorker* worker; - string_t file_path; // Path to the playlist file + FuriString* file_path; // Path to the playlist file } Playlist; //////////////////////////////////////////////////////////////////////////////// @@ -83,23 +83,23 @@ void meta_set_state(DisplayMeta* meta, int state) { view_port_update(meta->view_port); } -static FuriHalSubGhzPreset str_to_preset(string_t preset) { - if(string_cmp_str(preset, "FuriHalSubGhzPresetOok270Async") == 0) { +static FuriHalSubGhzPreset str_to_preset(FuriString* preset) { + if(furi_string_cmp_str(preset, "FuriHalSubGhzPresetOok270Async") == 0) { return FuriHalSubGhzPresetOok270Async; } - if(string_cmp_str(preset, "FuriHalSubGhzPresetOok650Async") == 0) { + if(furi_string_cmp_str(preset, "FuriHalSubGhzPresetOok650Async") == 0) { return FuriHalSubGhzPresetOok650Async; } - if(string_cmp_str(preset, "FuriHalSubGhzPreset2FSKDev238Async") == 0) { + if(furi_string_cmp_str(preset, "FuriHalSubGhzPreset2FSKDev238Async") == 0) { return FuriHalSubGhzPreset2FSKDev238Async; } - if(string_cmp_str(preset, "FuriHalSubGhzPreset2FSKDev476Async") == 0) { + if(furi_string_cmp_str(preset, "FuriHalSubGhzPreset2FSKDev476Async") == 0) { return FuriHalSubGhzPreset2FSKDev476Async; } - if(string_cmp_str(preset, "FuriHalSubGhzPresetMSK99_97KbAsync") == 0) { + if(furi_string_cmp_str(preset, "FuriHalSubGhzPresetMSK99_97KbAsync") == 0) { return FuriHalSubGhzPresetMSK99_97KbAsync; } - if(string_cmp_str(preset, "FuriHalSubGhzPresetMSK99_97KbAsync") == 0) { + if(furi_string_cmp_str(preset, "FuriHalSubGhzPresetMSK99_97KbAsync") == 0) { return FuriHalSubGhzPresetMSK99_97KbAsync; } return FuriHalSubGhzPresetCustom; @@ -117,8 +117,8 @@ static int playlist_worker_process( FlipperFormat* fff_file, FlipperFormat* fff_data, const char* path, - string_t preset, - string_t protocol) { + FuriString* preset, + FuriString* protocol) { // actual sending of .sub file if(!flipper_format_file_open_existing(fff_file, path)) { @@ -148,7 +148,7 @@ static int playlist_worker_process( return -4; } - if(!string_cmp_str(protocol, "RAW")) { + if(!furi_string_cmp_str(protocol, "RAW")) { subghz_protocol_raw_gen_fff_data(fff_data, path); } else { stream_copy_full( @@ -159,7 +159,7 @@ static int playlist_worker_process( // (try to) send file SubGhzEnvironment* environment = subghz_environment_alloc(); SubGhzTransmitter* transmitter = - subghz_transmitter_alloc_init(environment, string_get_cstr(protocol)); + subghz_transmitter_alloc_init(environment, furi_string_get_cstr(protocol)); subghz_transmitter_deserialize(transmitter, fff_data); @@ -216,9 +216,9 @@ static bool playlist_worker_play_playlist_once( Storage* storage, FlipperFormat* fff_head, FlipperFormat* fff_data, - string_t data, - string_t preset, - string_t protocol) { + FuriString* data, + FuriString* preset, + FuriString* protocol) { // if(!flipper_format_rewind(fff_head)) { FURI_LOG_E(TAG, "Failed to rewind file"); @@ -233,17 +233,20 @@ static bool playlist_worker_play_playlist_once( meta_set_state(worker->meta, STATE_SENDING); ++worker->meta->current_count; - const char* str = string_get_cstr(data); + const char* str = furi_string_get_cstr(data); // it's not fancy, but it works for now :) - string_reset(worker->meta->prev_3_path); - string_set_str(worker->meta->prev_3_path, string_get_cstr(worker->meta->prev_2_path)); - string_reset(worker->meta->prev_2_path); - string_set_str(worker->meta->prev_2_path, string_get_cstr(worker->meta->prev_1_path)); - string_reset(worker->meta->prev_1_path); - string_set_str(worker->meta->prev_1_path, string_get_cstr(worker->meta->prev_0_path)); - string_reset(worker->meta->prev_0_path); - string_set_str(worker->meta->prev_0_path, str); + furi_string_reset(worker->meta->prev_3_path); + furi_string_set( + worker->meta->prev_3_path, furi_string_get_cstr(worker->meta->prev_2_path)); + furi_string_reset(worker->meta->prev_2_path); + furi_string_set( + worker->meta->prev_2_path, furi_string_get_cstr(worker->meta->prev_1_path)); + furi_string_reset(worker->meta->prev_1_path); + furi_string_set( + worker->meta->prev_1_path, furi_string_get_cstr(worker->meta->prev_0_path)); + furi_string_reset(worker->meta->prev_0_path); + furi_string_set(worker->meta->prev_0_path, str); view_port_update(worker->meta->view_port); for(int i = 0; i < 1; i++) { @@ -285,8 +288,8 @@ static int32_t playlist_worker_thread(void* ctx) { FlipperFormat* fff_head = flipper_format_file_alloc(storage); PlaylistWorker* worker = ctx; - if(!flipper_format_file_open_existing(fff_head, string_get_cstr(worker->file_path))) { - FURI_LOG_E(TAG, "Failed to open %s", string_get_cstr(worker->file_path)); + if(!flipper_format_file_open_existing(fff_head, furi_string_get_cstr(worker->file_path))) { + FURI_LOG_E(TAG, "Failed to open %s", furi_string_get_cstr(worker->file_path)); worker->is_running = false; furi_record_close(RECORD_STORAGE); @@ -297,10 +300,12 @@ static int32_t playlist_worker_thread(void* ctx) { playlist_worker_wait_pause(worker); FlipperFormat* fff_data = flipper_format_string_alloc(); - string_t data, preset, protocol; - string_init(data); - string_init(preset); - string_init(protocol); + FuriString* data; + FuriString* preset; + FuriString* protocol; + data = furi_string_alloc(); + preset = furi_string_alloc(); + protocol = furi_string_alloc(); for(int i = 0; i < MAX(1, worker->meta->playlist_repetitions); i++) { // infinite repetitions if playlist_repetitions is 0 @@ -330,9 +335,9 @@ static int32_t playlist_worker_thread(void* ctx) { furi_record_close(RECORD_STORAGE); flipper_format_free(fff_head); - string_clear(data); - string_clear(preset); - string_clear(protocol); + furi_string_free(data); + furi_string_free(preset); + furi_string_free(protocol); flipper_format_free(fff_data); @@ -351,18 +356,18 @@ void playlist_meta_reset(DisplayMeta* instance) { instance->current_count = 0; instance->current_playlist_repetition = 0; - string_reset(instance->prev_0_path); - string_reset(instance->prev_1_path); - string_reset(instance->prev_2_path); - string_reset(instance->prev_3_path); + furi_string_reset(instance->prev_0_path); + furi_string_reset(instance->prev_1_path); + furi_string_reset(instance->prev_2_path); + furi_string_reset(instance->prev_3_path); } DisplayMeta* playlist_meta_alloc() { DisplayMeta* instance = malloc(sizeof(DisplayMeta)); - string_init(instance->prev_0_path); - string_init(instance->prev_1_path); - string_init(instance->prev_2_path); - string_init(instance->prev_3_path); + instance->prev_0_path = furi_string_alloc(); + instance->prev_1_path = furi_string_alloc(); + instance->prev_2_path = furi_string_alloc(); + instance->prev_3_path = furi_string_alloc(); playlist_meta_reset(instance); instance->state = STATE_NONE; instance->playlist_repetitions = 1; @@ -370,10 +375,10 @@ DisplayMeta* playlist_meta_alloc() { } void playlist_meta_free(DisplayMeta* instance) { - string_clear(instance->prev_0_path); - string_clear(instance->prev_1_path); - string_clear(instance->prev_2_path); - string_clear(instance->prev_3_path); + furi_string_free(instance->prev_0_path); + furi_string_free(instance->prev_1_path); + furi_string_free(instance->prev_2_path); + furi_string_free(instance->prev_3_path); free(instance); } @@ -391,7 +396,7 @@ PlaylistWorker* playlist_worker_alloc(DisplayMeta* meta) { instance->meta = meta; instance->ctl_pause = true; // require the user to manually start the worker - string_init(instance->file_path); + instance->file_path = furi_string_alloc(); return instance; } @@ -399,7 +404,7 @@ PlaylistWorker* playlist_worker_alloc(DisplayMeta* meta) { void playlist_worker_free(PlaylistWorker* instance) { furi_assert(instance); furi_thread_free(instance->thread); - string_clear(instance->file_path); + furi_string_free(instance->file_path); free(instance); } @@ -420,7 +425,7 @@ void playlist_worker_start(PlaylistWorker* instance, const char* file_path) { furi_assert(instance); furi_assert(!instance->is_running); - string_set_str(instance->file_path, file_path); + furi_string_set(instance->file_path, file_path); instance->is_running = true; // reset meta (current/total) @@ -440,8 +445,8 @@ static void render_callback(Canvas* canvas, void* ctx) { canvas_set_color(canvas, ColorBlack); canvas_set_font(canvas, FontSecondary); - string_t temp_str; - string_init(temp_str); + FuriString* temp_str; + temp_str = furi_string_alloc(); switch(app->meta->state) { case STATE_NONE: @@ -456,24 +461,26 @@ static void render_callback(Canvas* canvas, void* ctx) { path_extract_filename(app->file_path, temp_str, true); canvas_set_font(canvas, FontPrimary); - draw_centered_boxed_str(canvas, 1, 1, 15, 6, string_get_cstr(temp_str)); + draw_centered_boxed_str(canvas, 1, 1, 15, 6, furi_string_get_cstr(temp_str)); } canvas_set_font(canvas, FontSecondary); // draw loaded count { - string_printf(temp_str, "%d Items in playlist", app->meta->total_count); - canvas_draw_str_aligned(canvas, 1, 19, AlignLeft, AlignTop, string_get_cstr(temp_str)); + furi_string_printf(temp_str, "%d Items in playlist", app->meta->total_count); + canvas_draw_str_aligned( + canvas, 1, 19, AlignLeft, AlignTop, furi_string_get_cstr(temp_str)); if(app->meta->playlist_repetitions <= 0) { - string_printf(temp_str, "Repeat: inf", app->meta->playlist_repetitions); + furi_string_printf(temp_str, "Repeat: inf", app->meta->playlist_repetitions); } else if(app->meta->playlist_repetitions == 1) { - string_printf(temp_str, "Repeat: no", app->meta->playlist_repetitions); + furi_string_printf(temp_str, "Repeat: no", app->meta->playlist_repetitions); } else { - string_printf(temp_str, "Repeat: %dx", app->meta->playlist_repetitions); + furi_string_printf(temp_str, "Repeat: %dx", app->meta->playlist_repetitions); } - canvas_draw_str_aligned(canvas, 1, 29, AlignLeft, AlignTop, string_get_cstr(temp_str)); + canvas_draw_str_aligned( + canvas, 1, 29, AlignLeft, AlignTop, furi_string_get_cstr(temp_str)); } // draw buttons @@ -511,11 +518,12 @@ static void render_callback(Canvas* canvas, void* ctx) { // draw progress text { canvas_set_font(canvas, FontSecondary); - string_printf(temp_str, "[%d/%d]", app->meta->current_count, app->meta->total_count); + furi_string_printf( + temp_str, "[%d/%d]", app->meta->current_count, app->meta->total_count); canvas_draw_str_aligned( - canvas, 11, HEIGHT - 8, AlignLeft, AlignTop, string_get_cstr(temp_str)); + canvas, 11, HEIGHT - 8, AlignLeft, AlignTop, furi_string_get_cstr(temp_str)); - int h = canvas_string_width(canvas, string_get_cstr(temp_str)); + int h = canvas_string_width(canvas, furi_string_get_cstr(temp_str)); int xs = 11 + h + 2; int w = WIDTH - xs - 1; canvas_draw_box(canvas, xs, HEIGHT - 5, w, 1); @@ -527,20 +535,20 @@ static void render_callback(Canvas* canvas, void* ctx) { { if(app->meta->playlist_repetitions <= 0) { - string_printf(temp_str, "[%d/Inf]", app->meta->current_playlist_repetition); + furi_string_printf(temp_str, "[%d/Inf]", app->meta->current_playlist_repetition); } else { - string_printf( + furi_string_printf( temp_str, "[%d/%d]", app->meta->current_playlist_repetition, app->meta->playlist_repetitions); } canvas_set_color(canvas, ColorBlack); - int w = canvas_string_width(canvas, string_get_cstr(temp_str)); + int w = canvas_string_width(canvas, furi_string_get_cstr(temp_str)); draw_corner_aligned(canvas, w + 6, 13, AlignRight, AlignTop); canvas_set_color(canvas, ColorWhite); canvas_draw_str_aligned( - canvas, WIDTH - 3, 3, AlignRight, AlignTop, string_get_cstr(temp_str)); + canvas, WIDTH - 3, 3, AlignRight, AlignTop, furi_string_get_cstr(temp_str)); } // draw last and current file @@ -549,41 +557,41 @@ static void render_callback(Canvas* canvas, void* ctx) { canvas_set_font(canvas, FontSecondary); // current - if(!string_empty_p(app->meta->prev_0_path)) { + if(!furi_string_empty(app->meta->prev_0_path)) { path_extract_filename(app->meta->prev_0_path, temp_str, true); - int w = canvas_string_width(canvas, string_get_cstr(temp_str)); + int w = canvas_string_width(canvas, furi_string_get_cstr(temp_str)); canvas_set_color(canvas, ColorBlack); canvas_draw_rbox(canvas, 1, 1, w + 4, 12, 2); canvas_set_color(canvas, ColorWhite); canvas_draw_str_aligned( - canvas, 3, 3, AlignLeft, AlignTop, string_get_cstr(temp_str)); + canvas, 3, 3, AlignLeft, AlignTop, furi_string_get_cstr(temp_str)); } // last 3 canvas_set_color(canvas, ColorBlack); - if(!string_empty_p(app->meta->prev_1_path)) { + if(!furi_string_empty(app->meta->prev_1_path)) { path_extract_filename(app->meta->prev_1_path, temp_str, true); canvas_draw_str_aligned( - canvas, 3, 15, AlignLeft, AlignTop, string_get_cstr(temp_str)); + canvas, 3, 15, AlignLeft, AlignTop, furi_string_get_cstr(temp_str)); } - if(!string_empty_p(app->meta->prev_2_path)) { + if(!furi_string_empty(app->meta->prev_2_path)) { path_extract_filename(app->meta->prev_2_path, temp_str, true); canvas_draw_str_aligned( - canvas, 3, 26, AlignLeft, AlignTop, string_get_cstr(temp_str)); + canvas, 3, 26, AlignLeft, AlignTop, furi_string_get_cstr(temp_str)); } - if(!string_empty_p(app->meta->prev_3_path)) { + if(!furi_string_empty(app->meta->prev_3_path)) { path_extract_filename(app->meta->prev_3_path, temp_str, true); canvas_draw_str_aligned( - canvas, 3, 37, AlignLeft, AlignTop, string_get_cstr(temp_str)); + canvas, 3, 37, AlignLeft, AlignTop, furi_string_get_cstr(temp_str)); } } break; } - string_clear(temp_str); + furi_string_free(temp_str); furi_mutex_release(app->mutex); } @@ -596,8 +604,8 @@ static void input_callback(InputEvent* event, void* ctx) { Playlist* playlist_alloc(DisplayMeta* meta) { Playlist* app = malloc(sizeof(Playlist)); - string_init(app->file_path); - string_set_str(app->file_path, PLAYLIST_FOLDER); + app->file_path = furi_string_alloc(); + furi_string_set(app->file_path, PLAYLIST_FOLDER); app->meta = meta; app->worker = NULL; @@ -623,15 +631,15 @@ void playlist_start_worker(Playlist* app, DisplayMeta* meta) { // count playlist items Storage* storage = furi_record_open(RECORD_STORAGE); app->meta->total_count = - playlist_count_playlist_items(storage, string_get_cstr(app->file_path)); + playlist_count_playlist_items(storage, furi_string_get_cstr(app->file_path)); furi_record_close(RECORD_STORAGE); // start thread - playlist_worker_start(app->worker, string_get_cstr(app->file_path)); + playlist_worker_start(app->worker, furi_string_get_cstr(app->file_path)); } void playlist_free(Playlist* app) { - string_clear(app->file_path); + furi_string_free(app->file_path); gui_remove_view_port(app->gui, app->view_port); furi_record_close(RECORD_GUI); @@ -715,7 +723,7 @@ int32_t playlist_app(void* p) { if(!app->worker->is_running) { app->worker->ctl_pause = false; app->worker->ctl_request_exit = false; - playlist_worker_start(app->worker, string_get_cstr(app->file_path)); + playlist_worker_start(app->worker, furi_string_get_cstr(app->file_path)); } else { app->worker->ctl_pause = !app->worker->ctl_pause; } diff --git a/applications/plugins/playlist/playlist_file.c b/applications/plugins/playlist/playlist_file.c index 2faf02a3c..e3540648e 100644 --- a/applications/plugins/playlist/playlist_file.c +++ b/applications/plugins/playlist/playlist_file.c @@ -9,13 +9,13 @@ int playlist_count_playlist_items(Storage* storage, const char* file_path) { return -1; } int count = 0; - string_t data; - string_init(data); + FuriString* data; + data = furi_string_alloc(); while(flipper_format_read_string(format, "sub", data)) { ++count; } flipper_format_file_close(format); flipper_format_free(format); - string_clear(data); + furi_string_free(data); return count; } diff --git a/applications/plugins/subbrute/helpers/subbrute_worker.c b/applications/plugins/subbrute/helpers/subbrute_worker.c index 80275698e..9e5c56d79 100644 --- a/applications/plugins/subbrute/helpers/subbrute_worker.c +++ b/applications/plugins/subbrute/helpers/subbrute_worker.c @@ -23,7 +23,7 @@ struct SubBruteWorker { // Preset and frequency needed FuriHalSubGhzPreset preset; uint32_t frequency; - string_t protocol_name; + FuriString* protocol_name; //SubBruteWorkerCallback callback; //void* context; @@ -47,7 +47,7 @@ SubBruteWorker* subbrute_worker_alloc() { instance->transmitter = NULL; instance->flipper_format = flipper_format_string_alloc(); - string_init(instance->protocol_name); + instance->protocol_name = furi_string_alloc(); // SubGhzTxRxWorker instance->subghz_txrx = subghz_tx_rx_worker_alloc(); @@ -71,7 +71,7 @@ void subbrute_worker_free(SubBruteWorker* instance) { flipper_format_free(instance->flipper_format); - string_clear(instance->protocol_name); + furi_string_free(instance->protocol_name); // SubGhzTxRxWorker subghz_tx_rx_worker_free(instance->subghz_txrx); @@ -94,8 +94,8 @@ bool subbrute_worker_start( instance->frequency = frequency; instance->preset = preset; - string_clear(instance->protocol_name); - string_init_printf(instance->protocol_name, "%s", protocol_name); + furi_string_free(instance->protocol_name); + instance->protocol_name = furi_string_alloc_printf("%s", protocol_name); bool res = false; @@ -235,8 +235,8 @@ bool subbrute_worker_init_manual_transmit( instance->preset = preset; instance->frequency = frequency; - string_clear(instance->protocol_name); - string_init_printf(instance->protocol_name, "%s", protocol_name); + furi_string_free(instance->protocol_name); + instance->protocol_name = furi_string_alloc_printf("%s", protocol_name); furi_hal_subghz_reset(); furi_hal_subghz_idle(); @@ -258,7 +258,7 @@ bool subbrute_worker_init_manual_transmit( #endif instance->transmitter = subghz_transmitter_alloc_init( - instance->environment, string_get_cstr(instance->protocol_name)); + instance->environment, furi_string_get_cstr(instance->protocol_name)); furi_hal_subghz_reset(); furi_hal_subghz_load_preset(instance->preset); @@ -320,7 +320,7 @@ bool subbrute_worker_manual_transmit(SubBruteWorker* instance, const char* paylo stream_write_cstring(stream, payload); instance->transmitter = subghz_transmitter_alloc_init( - instance->environment, string_get_cstr(instance->protocol_name)); + instance->environment, furi_string_get_cstr(instance->protocol_name)); subghz_transmitter_deserialize(instance->transmitter, instance->flipper_format); furi_hal_subghz_reset(); furi_hal_subghz_load_preset(instance->preset); diff --git a/applications/plugins/subbrute/scenes/subbrute_scene_load_file.c b/applications/plugins/subbrute/scenes/subbrute_scene_load_file.c index 05a7125e1..d7d64bc46 100644 --- a/applications/plugins/subbrute/scenes/subbrute_scene_load_file.c +++ b/applications/plugins/subbrute/scenes/subbrute_scene_load_file.c @@ -16,10 +16,10 @@ void subbrute_scene_load_file_on_enter(void* context) { SubBruteState* instance = (SubBruteState*)context; // Input events and views are managed by file_browser - string_t app_folder; - string_t load_path; - string_init(load_path); - string_init_set_str(app_folder, SUBBRUTE_PATH); + FuriString* app_folder; + FuriString* load_path; + load_path = furi_string_alloc(); + app_folder = furi_string_alloc_set(SUBBRUTE_PATH); DialogsFileBrowserOptions browser_options; dialog_file_browser_set_basic_options(&browser_options, SUBBRUTE_FILE_EXT, &I_sub1_10px); @@ -31,8 +31,8 @@ void subbrute_scene_load_file_on_enter(void* context) { FURI_LOG_D( TAG, "load_path: %s, app_folder: %s", - string_get_cstr(load_path), - string_get_cstr(app_folder)); + furi_string_get_cstr(load_path), + furi_string_get_cstr(app_folder)); #endif if(res) { load_result = subbrute_device_load_from_file(instance->device, load_path); @@ -51,12 +51,12 @@ void subbrute_scene_load_file_on_enter(void* context) { } else { FURI_LOG_E(TAG, "Returned error: %d", load_result); - string_t dialog_msg; - string_init(dialog_msg); - string_cat_printf( + FuriString* dialog_msg; + dialog_msg = furi_string_alloc(); + furi_string_cat_printf( dialog_msg, "Cannot parse\nfile: %s", subbrute_device_error_get_desc(load_result)); - dialog_message_show_storage_error(instance->dialogs, string_get_cstr(dialog_msg)); - string_clear(dialog_msg); + dialog_message_show_storage_error(instance->dialogs, furi_string_get_cstr(dialog_msg)); + furi_string_free(dialog_msg); scene_manager_search_and_switch_to_previous_scene( instance->scene_manager, SubBruteSceneStart); } @@ -65,8 +65,8 @@ void subbrute_scene_load_file_on_enter(void* context) { instance->scene_manager, SubBruteSceneStart); } - string_clear(app_folder); - string_clear(load_path); + furi_string_free(app_folder); + furi_string_free(load_path); } void subbrute_scene_load_file_on_exit(void* context) { diff --git a/applications/plugins/subbrute/scenes/subbrute_scene_run_attack.c b/applications/plugins/subbrute/scenes/subbrute_scene_run_attack.c index 385f43b9b..3521b30e8 100644 --- a/applications/plugins/subbrute/scenes/subbrute_scene_run_attack.c +++ b/applications/plugins/subbrute/scenes/subbrute_scene_run_attack.c @@ -92,7 +92,7 @@ void subbrute_scene_run_attack_on_enter(void* context) { instance->worker, instance->device->frequency, instance->device->preset, - string_get_cstr(instance->device->protocol_name))) { + furi_string_get_cstr(instance->device->protocol_name))) { FURI_LOG_W(TAG, "Worker Continuous init failed!"); } } else { @@ -101,7 +101,7 @@ void subbrute_scene_run_attack_on_enter(void* context) { instance->worker, instance->device->frequency, instance->device->preset, - string_get_cstr(instance->device->protocol_name))) { + furi_string_get_cstr(instance->device->protocol_name))) { FURI_LOG_W(TAG, "Worker init failed!"); } diff --git a/applications/plugins/subbrute/scenes/subbrute_scene_save_name.c b/applications/plugins/subbrute/scenes/subbrute_scene_save_name.c index 88a497db5..44b790c3d 100644 --- a/applications/plugins/subbrute/scenes/subbrute_scene_save_name.c +++ b/applications/plugins/subbrute/scenes/subbrute_scene_save_name.c @@ -1,4 +1,3 @@ -#include #include #include #include @@ -26,10 +25,10 @@ void subbrute_scene_save_name_on_enter(void* context) { SUBBRUTE_MAX_LEN_NAME, true); - string_set_str(device->load_path, SUBBRUTE_PATH); + furi_string_set(device->load_path, SUBBRUTE_PATH); - ValidatorIsFile* validator_is_file = - validator_is_file_alloc_init(string_get_cstr(device->load_path), SUBBRUTE_FILE_EXT, ""); + ValidatorIsFile* validator_is_file = validator_is_file_alloc_init( + furi_string_get_cstr(device->load_path), SUBBRUTE_FILE_EXT, ""); text_input_set_validator(text_input, validator_is_file_callback, validator_is_file); view_dispatcher_switch_to_view(instance->view_dispatcher, SubBruteViewTextInput); @@ -50,14 +49,14 @@ bool subbrute_scene_save_name_on_event(void* context, SceneManagerEvent event) { #endif bool success = false; if(strcmp(instance->device->text_store, "")) { - string_cat_printf( + furi_string_cat_printf( instance->device->load_path, "/%s%s", instance->device->text_store, SUBBRUTE_FILE_EXT); if(subbrute_device_save_file( - instance->device, string_get_cstr(instance->device->load_path))) { + instance->device, furi_string_get_cstr(instance->device->load_path))) { scene_manager_next_scene(instance->scene_manager, SubBruteSceneSaveSuccess); success = true; consumed = true; @@ -83,5 +82,5 @@ void subbrute_scene_save_name_on_exit(void* context) { text_input_reset(instance->text_input); - string_reset(instance->device->load_path); + furi_string_reset(instance->device->load_path); } diff --git a/applications/plugins/subbrute/scenes/subbrute_scene_setup_attack.c b/applications/plugins/subbrute/scenes/subbrute_scene_setup_attack.c index 2da28f672..c41954e7d 100644 --- a/applications/plugins/subbrute/scenes/subbrute_scene_setup_attack.c +++ b/applications/plugins/subbrute/scenes/subbrute_scene_setup_attack.c @@ -31,7 +31,7 @@ void subbrute_scene_setup_attack_on_enter(void* context) { instance->worker, instance->device->frequency, instance->device->preset, - string_get_cstr(instance->device->protocol_name))) { + furi_string_get_cstr(instance->device->protocol_name))) { FURI_LOG_W(TAG, "Worker init failed!"); } @@ -144,7 +144,7 @@ bool subbrute_scene_setup_attack_on_event(void* context, SceneManagerEvent event // view, // instance->device->frequency, // instance->device->preset, - // string_get_cstr(instance->device->protocol_name)); + // furi_string_get_cstr(instance->device->protocol_name)); // } subbrute_device_create_packet_parsed( instance->device, instance->device->key_index, false); diff --git a/applications/plugins/subbrute/subbrute.c b/applications/plugins/subbrute/subbrute.c index 488073b0a..f969ee13d 100644 --- a/applications/plugins/subbrute/subbrute.c +++ b/applications/plugins/subbrute/subbrute.c @@ -1,7 +1,6 @@ #include #include #include -#include #include #include diff --git a/applications/plugins/subbrute/subbrute_device.c b/applications/plugins/subbrute/subbrute_device.c index 4fbaba5dd..cfcf63e60 100644 --- a/applications/plugins/subbrute/subbrute_device.c +++ b/applications/plugins/subbrute/subbrute_device.c @@ -54,9 +54,9 @@ SubBruteDevice* subbrute_device_alloc() { instance->state = SubBruteDeviceStateIDLE; instance->key_index = 0; - string_init(instance->load_path); - string_init(instance->preset_name); - string_init(instance->protocol_name); + instance->load_path = furi_string_alloc(); + instance->preset_name = furi_string_alloc(); + instance->protocol_name = furi_string_alloc(); instance->decoder_result = NULL; instance->receiver = NULL; @@ -91,9 +91,9 @@ void subbrute_device_free(SubBruteDevice* instance) { FURI_LOG_D(TAG, "before free"); #endif - string_clear(instance->load_path); - string_clear(instance->preset_name); - string_clear(instance->protocol_name); + furi_string_free(instance->load_path); + furi_string_free(instance->preset_name); + furi_string_free(instance->protocol_name); free(instance); } @@ -194,41 +194,41 @@ bool subbrute_device_create_packet_parsed(SubBruteDevice* instance, uint64_t ste //char step_payload[32]; //memset(step_payload, '0', sizeof(step_payload)); memset(instance->payload, 0, sizeof(instance->payload)); - string_t candidate; - string_init(candidate); + FuriString* candidate; + candidate = furi_string_alloc(); if(instance->attack == SubBruteAttackLoadFile) { if(step >= sizeof(instance->file_key)) { return false; } char subbrute_payload_byte[4]; - string_set_str(candidate, instance->file_key); + furi_string_set(candidate, instance->file_key); snprintf(subbrute_payload_byte, 4, "%02X ", (uint8_t)step); - string_replace_at(candidate, instance->load_index * 3, 3, subbrute_payload_byte); + furi_string_replace_at(candidate, instance->load_index * 3, 3, subbrute_payload_byte); //snprintf(step_payload, sizeof(step_payload), "%02X", (uint8_t)instance->file_key[step]); } else { //snprintf(step_payload, sizeof(step_payload), "%16X", step); //snprintf(step_payload, sizeof(step_payload), "%016llX", step); - string_t buffer; - string_init(buffer); - string_init_printf(buffer, "%16X", step); + FuriString* buffer; + buffer = furi_string_alloc(); + buffer = furi_string_alloc_printf("%16X", step); int j = 0; - string_set_str(candidate, " "); + furi_string_set(candidate, " "); for(uint8_t i = 0; i < 16; i++) { - if(string_get_char(buffer, i) != ' ') { - string_set_char(candidate, i + j, string_get_char(buffer, i)); + if(furi_string_get_char(buffer, i) != ' ') { + furi_string_set_char(candidate, i + j, furi_string_get_char(buffer, i)); } else { - string_set_char(candidate, i + j, '0'); + furi_string_set_char(candidate, i + j, '0'); } if(i % 2 != 0) { j++; } } - string_clear(buffer); + furi_string_free(buffer); } #ifdef FURI_DEBUG - FURI_LOG_D(TAG, "candidate: %s, step: %d", string_get_cstr(candidate), step); + FURI_LOG_D(TAG, "candidate: %s, step: %d", furi_string_get_cstr(candidate), step); #endif if(small) { @@ -238,7 +238,7 @@ bool subbrute_device_create_packet_parsed(SubBruteDevice* instance, uint64_t ste sizeof(instance->payload), subbrute_key_small_with_tail, instance->bit, - string_get_cstr(candidate), + furi_string_get_cstr(candidate), instance->te); } else { snprintf( @@ -246,7 +246,7 @@ bool subbrute_device_create_packet_parsed(SubBruteDevice* instance, uint64_t ste sizeof(instance->payload), subbrute_key_small_no_tail, instance->bit, - string_get_cstr(candidate)); + furi_string_get_cstr(candidate)); } } else { if(instance->has_tail) { @@ -255,7 +255,7 @@ bool subbrute_device_create_packet_parsed(SubBruteDevice* instance, uint64_t ste sizeof(instance->payload), subbrute_key_file_princeton_end, instance->file_template, - string_get_cstr(candidate), + furi_string_get_cstr(candidate), instance->te); } else { snprintf( @@ -263,7 +263,7 @@ bool subbrute_device_create_packet_parsed(SubBruteDevice* instance, uint64_t ste sizeof(instance->payload), subbrute_key_file_key, instance->file_template, - string_get_cstr(candidate)); + furi_string_get_cstr(candidate)); } } @@ -271,7 +271,7 @@ bool subbrute_device_create_packet_parsed(SubBruteDevice* instance, uint64_t ste //FURI_LOG_D(TAG, "payload: %s", instance->payload); #endif - string_clear(candidate); + furi_string_free(candidate); return true; } @@ -286,7 +286,7 @@ SubBruteFileResult subbrute_device_attack_set(SubBruteDevice* instance, SubBrute case SubBruteAttackLoadFile: // In this case values must be already set // file_result = - // subbrute_device_load_from_file(instance, string_get_cstr(instance->load_path)); + // subbrute_device_load_from_file(instance, furi_string_get_cstr(instance->load_path)); // if(file_result != SubBruteFileResultOk) { // // Failed load file so failed to set attack type // return file_result; // RETURN @@ -306,8 +306,8 @@ SubBruteFileResult subbrute_device_attack_set(SubBruteDevice* instance, SubBrute instance->frequency = 868350000; } instance->bit = 12; - string_set_str(instance->protocol_name, protocol_came); - string_set_str(instance->preset_name, preset_ook650_async); + furi_string_set(instance->protocol_name, protocol_came); + furi_string_set(instance->preset_name, preset_ook650_async); break; case SubBruteAttackChamberlain9bit300: case SubBruteAttackChamberlain9bit315: @@ -320,32 +320,32 @@ SubBruteFileResult subbrute_device_attack_set(SubBruteDevice* instance, SubBrute instance->frequency = 390000000; } instance->bit = 9; - string_set_str(instance->protocol_name, protocol_cham_code); - string_set_str(instance->preset_name, preset_ook650_async); + furi_string_set(instance->protocol_name, protocol_cham_code); + furi_string_set(instance->preset_name, preset_ook650_async); break; case SubBruteAttackLinear10bit300: instance->frequency = 300000000; instance->bit = 10; - string_set_str(instance->protocol_name, protocol_linear); - string_set_str(instance->preset_name, preset_ook650_async); + furi_string_set(instance->protocol_name, protocol_linear); + furi_string_set(instance->preset_name, preset_ook650_async); break; case SubBruteAttackLinear10bit310: instance->frequency = 310000000; instance->bit = 10; - string_set_str(instance->protocol_name, protocol_linear); - string_set_str(instance->preset_name, preset_ook650_async); + furi_string_set(instance->protocol_name, protocol_linear); + furi_string_set(instance->preset_name, preset_ook650_async); break; case SubBruteAttackNICE12bit433: instance->frequency = 433920000; instance->bit = 12; - string_set_str(instance->protocol_name, protocol_nice_flo); - string_set_str(instance->preset_name, preset_ook650_async); + furi_string_set(instance->protocol_name, protocol_nice_flo); + furi_string_set(instance->preset_name, preset_ook650_async); break; case SubBruteAttackNICE12bit868: instance->frequency = 868350000; instance->bit = 12; - string_set_str(instance->protocol_name, protocol_nice_flo); - string_set_str(instance->preset_name, preset_ook650_async); + furi_string_set(instance->protocol_name, protocol_nice_flo); + furi_string_set(instance->preset_name, preset_ook650_async); break; default: FURI_LOG_E(TAG, "Unknown attack type: %d", type); @@ -365,7 +365,7 @@ SubBruteFileResult subbrute_device_attack_set(SubBruteDevice* instance, SubBrute uint8_t protocol_check_result = SubBruteFileResultProtocolNotFound; if(type != SubBruteAttackLoadFile) { instance->decoder_result = subghz_receiver_search_decoder_base_by_name( - instance->receiver, string_get_cstr(instance->protocol_name)); + instance->receiver, furi_string_get_cstr(instance->protocol_name)); if(!instance->decoder_result || instance->decoder_result->protocol->type == SubGhzProtocolTypeDynamic) { @@ -375,7 +375,8 @@ SubBruteFileResult subbrute_device_attack_set(SubBruteDevice* instance, SubBrute } } else { // And here we need to set preset enum - instance->preset = subbrute_device_convert_preset(string_get_cstr(instance->preset_name)); + instance->preset = + subbrute_device_convert_preset(furi_string_get_cstr(instance->preset_name)); protocol_check_result = SubBruteFileResultOk; } @@ -387,19 +388,19 @@ SubBruteFileResult subbrute_device_attack_set(SubBruteDevice* instance, SubBrute } instance->has_tail = - (strcmp(string_get_cstr(instance->protocol_name), protocol_princeton) == 0); + (strcmp(furi_string_get_cstr(instance->protocol_name), protocol_princeton) == 0); // Calc max value if(instance->attack == SubBruteAttackLoadFile) { instance->max_value = 0xFF; } else { - string_t max_value_s; - string_init(max_value_s); + FuriString* max_value_s; + max_value_s = furi_string_alloc(); for(uint8_t i = 0; i < instance->bit; i++) { - string_cat_printf(max_value_s, "1"); + furi_string_cat_printf(max_value_s, "1"); } - instance->max_value = (uint64_t)strtol(string_get_cstr(max_value_s), NULL, 2); - string_clear(max_value_s); + instance->max_value = (uint64_t)strtol(furi_string_get_cstr(max_value_s), NULL, 2); + furi_string_free(max_value_s); } // Now we are ready to set file template for using in the future with snprintf @@ -409,8 +410,8 @@ SubBruteFileResult subbrute_device_attack_set(SubBruteDevice* instance, SubBrute sizeof(instance->file_template), subbrute_key_file_start, instance->frequency, - string_get_cstr(instance->preset_name), - string_get_cstr(instance->protocol_name), + furi_string_get_cstr(instance->preset_name), + furi_string_get_cstr(instance->protocol_name), instance->bit); // strncat(instance->file_template, "\n", sizeof(instance->file_template)); // strncat(instance->file_template, subbrute_key_file_key, sizeof(instance->file_template)); @@ -430,18 +431,18 @@ SubBruteFileResult subbrute_device_attack_set(SubBruteDevice* instance, SubBrute return SubBruteFileResultOk; } -uint8_t subbrute_device_load_from_file(SubBruteDevice* instance, string_t file_path) { +uint8_t subbrute_device_load_from_file(SubBruteDevice* instance, FuriString* file_path) { furi_assert(instance); #ifdef FURI_DEBUG - FURI_LOG_D(TAG, "subbrute_device_load_from_file: %s", string_get_cstr(file_path)); + FURI_LOG_D(TAG, "subbrute_device_load_from_file: %s", furi_string_get_cstr(file_path)); #endif SubBruteFileResult result = SubBruteFileResultUnknown; Storage* storage = furi_record_open(RECORD_STORAGE); FlipperFormat* fff_data_file = flipper_format_file_alloc(storage); - string_t temp_str; - string_init(temp_str); + FuriString* temp_str; + temp_str = furi_string_alloc(); uint32_t temp_data32; instance->receiver = subghz_receiver_alloc_init(instance->environment); @@ -449,8 +450,8 @@ uint8_t subbrute_device_load_from_file(SubBruteDevice* instance, string_t file_p furi_hal_subghz_reset(); do { - if(!flipper_format_file_open_existing(fff_data_file, string_get_cstr(file_path))) { - FURI_LOG_E(TAG, "Error open file %s", string_get_cstr(file_path)); + if(!flipper_format_file_open_existing(fff_data_file, furi_string_get_cstr(file_path))) { + FURI_LOG_E(TAG, "Error open file %s", furi_string_get_cstr(file_path)); result = SubBruteFileResultErrorOpenFile; break; } @@ -477,7 +478,7 @@ uint8_t subbrute_device_load_from_file(SubBruteDevice* instance, string_t file_p FURI_LOG_E(TAG, "Preset FAIL"); result = SubBruteFileResultPresetInvalid; } else { - string_init_set_str(instance->preset_name, string_get_cstr(temp_str)); + instance->preset_name = furi_string_alloc_set(furi_string_get_cstr(temp_str)); } // Protocol @@ -486,17 +487,17 @@ uint8_t subbrute_device_load_from_file(SubBruteDevice* instance, string_t file_p result = SubBruteFileResultMissingProtocol; break; } else { - string_init_set_str(instance->protocol_name, string_get_cstr(temp_str)); + instance->protocol_name = furi_string_alloc_set(furi_string_get_cstr(temp_str)); #ifdef FURI_DEBUG - FURI_LOG_D(TAG, "Protocol: %s", string_get_cstr(instance->protocol_name)); + FURI_LOG_D(TAG, "Protocol: %s", furi_string_get_cstr(instance->protocol_name)); #endif } instance->decoder_result = subghz_receiver_search_decoder_base_by_name( - instance->receiver, string_get_cstr(instance->protocol_name)); + instance->receiver, furi_string_get_cstr(instance->protocol_name)); if(!instance->decoder_result || - strcmp(string_get_cstr(instance->protocol_name), "RAW") == 0) { + strcmp(furi_string_get_cstr(instance->protocol_name), "RAW") == 0) { FURI_LOG_E(TAG, "RAW unsupported"); result = SubBruteFileResultProtocolNotSupported; break; @@ -514,7 +515,7 @@ uint8_t subbrute_device_load_from_file(SubBruteDevice* instance, string_t file_p #endif // instance->decoder_result = subghz_receiver_search_decoder_base_by_name( - // instance->receiver, string_get_cstr(instance->protocol_name)); + // instance->receiver, furi_string_get_cstr(instance->protocol_name)); // // if(!instance->decoder_result) { // FURI_LOG_E(TAG, "Protocol not found"); @@ -541,7 +542,10 @@ uint8_t subbrute_device_load_from_file(SubBruteDevice* instance, string_t file_p break; } else { snprintf( - instance->file_key, sizeof(instance->file_key), "%s", string_get_cstr(temp_str)); + instance->file_key, + sizeof(instance->file_key), + "%s", + furi_string_get_cstr(temp_str)); #ifdef FURI_DEBUG FURI_LOG_D(TAG, "Key: %s", instance->file_key); #endif @@ -573,7 +577,7 @@ uint8_t subbrute_device_load_from_file(SubBruteDevice* instance, string_t file_p result = SubBruteFileResultOk; } while(0); - string_clear(temp_str); + furi_string_free(temp_str); flipper_format_file_close(fff_data_file); flipper_format_free(fff_data_file); furi_record_close(RECORD_STORAGE); @@ -612,14 +616,14 @@ void subbrute_device_attack_set_default_values( instance->max_value = (uint64_t)0x00; - string_clear(instance->protocol_name); - string_clear(instance->preset_name); + furi_string_free(instance->protocol_name); + furi_string_free(instance->preset_name); - string_clear(instance->load_path); - string_init(instance->load_path); + furi_string_free(instance->load_path); + instance->load_path = furi_string_alloc(); - string_init_set_str(instance->protocol_name, protocol_raw); - string_init_set_str(instance->preset_name, preset_ook650_async); + instance->protocol_name = furi_string_alloc_set(protocol_raw); + instance->preset_name = furi_string_alloc_set(preset_ook650_async); instance->preset = FuriHalSubGhzPresetOok650Async; instance->repeat = 5; @@ -634,25 +638,25 @@ void subbrute_device_attack_set_default_values( } FuriHalSubGhzPreset subbrute_device_convert_preset(const char* preset_name) { - string_t preset; - string_init_set_str(preset, preset_name); + FuriString* preset; + preset = furi_string_alloc_set(preset_name); FuriHalSubGhzPreset preset_value; - if(string_cmp_str(preset, preset_ook270_async) == 0) { + if(furi_string_cmp_str(preset, preset_ook270_async) == 0) { preset_value = FuriHalSubGhzPresetOok270Async; - } else if(string_cmp_str(preset, preset_ook650_async) == 0) { + } else if(furi_string_cmp_str(preset, preset_ook650_async) == 0) { preset_value = FuriHalSubGhzPresetOok650Async; - } else if(string_cmp_str(preset, preset_2fsk_dev238_async) == 0) { + } else if(furi_string_cmp_str(preset, preset_2fsk_dev238_async) == 0) { preset_value = FuriHalSubGhzPreset2FSKDev238Async; - } else if(string_cmp_str(preset, preset_2fsk_dev476_async) == 0) { + } else if(furi_string_cmp_str(preset, preset_2fsk_dev476_async) == 0) { preset_value = FuriHalSubGhzPreset2FSKDev476Async; - } else if(string_cmp_str(preset, preset_msk99_97_kb_async) == 0) { + } else if(furi_string_cmp_str(preset, preset_msk99_97_kb_async) == 0) { preset_value = FuriHalSubGhzPresetMSK99_97KbAsync; - } else if(string_cmp_str(preset, preset_gfs99_97_kb_async) == 0) { + } else if(furi_string_cmp_str(preset, preset_gfs99_97_kb_async) == 0) { preset_value = FuriHalSubGhzPresetMSK99_97KbAsync; } else { preset_value = FuriHalSubGhzPresetCustom; } - string_clear(preset); + furi_string_free(preset); return preset_value; } diff --git a/applications/plugins/subbrute/subbrute_device.h b/applications/plugins/subbrute/subbrute_device.h index c2a6ed38f..0d95f0f2a 100644 --- a/applications/plugins/subbrute/subbrute_device.h +++ b/applications/plugins/subbrute/subbrute_device.h @@ -61,7 +61,7 @@ typedef struct { // Current step uint64_t key_index; - string_t load_path; + FuriString* load_path; // Index of group to bruteforce in loaded file uint8_t load_index; @@ -78,8 +78,8 @@ typedef struct { // Loaded info for attack type FuriHalSubGhzPreset preset; - string_t preset_name; - string_t protocol_name; + FuriString* preset_name; + FuriString* protocol_name; uint32_t frequency; uint32_t repeat; uint32_t bit; @@ -96,7 +96,7 @@ bool subbrute_device_save_file(SubBruteDevice* instance, const char* key_name); const char* subbrute_device_error_get_desc(SubBruteFileResult error_id); bool subbrute_device_create_packet_parsed(SubBruteDevice* context, uint64_t step, bool small); SubBruteFileResult subbrute_device_attack_set(SubBruteDevice* context, SubBruteAttacks type); -uint8_t subbrute_device_load_from_file(SubBruteDevice* context, string_t file_path); +uint8_t subbrute_device_load_from_file(SubBruteDevice* context, FuriString* file_path); FuriHalSubGhzPreset subbrute_device_convert_preset(const char* preset); void subbrute_device_attack_set_default_values( SubBruteDevice* context, diff --git a/applications/plugins/subbrute/subbrute_i.h b/applications/plugins/subbrute/subbrute_i.h index 28a9a73e3..edd64362e 100644 --- a/applications/plugins/subbrute/subbrute_i.h +++ b/applications/plugins/subbrute/subbrute_i.h @@ -7,7 +7,6 @@ #include "lib/toolbox/path.h" #include #include -#include #include #include diff --git a/applications/plugins/subbrute/views/subbrute_main_view.c b/applications/plugins/subbrute/views/subbrute_main_view.c index 1159a33b3..a5a67d2fa 100644 --- a/applications/plugins/subbrute/views/subbrute_main_view.c +++ b/applications/plugins/subbrute/views/subbrute_main_view.c @@ -33,7 +33,7 @@ void subbrute_main_view_set_callback( instance->context = context; } -void center_displayed_key(string_t result, const char* key_cstr, uint8_t index) { +void center_displayed_key(FuriString* result, const char* key_cstr, uint8_t index) { uint8_t str_index = (index * 3); char display_menu[] = { @@ -75,7 +75,7 @@ void center_displayed_key(string_t result, const char* key_cstr, uint8_t index) display_menu[15] = ' '; } } - string_init_set_str(result, display_menu); + result = furi_string_alloc_set(display_menu); } void subbrute_main_view_draw(Canvas* canvas, SubBruteMainViewModel* model) { @@ -96,19 +96,19 @@ void subbrute_main_view_draw(Canvas* canvas, SubBruteMainViewModel* model) { snprintf(msg_index, sizeof(msg_index), "Field index : %d", m->index); canvas_draw_str_aligned(canvas, 64, 26, AlignCenter, AlignTop, msg_index); - string_t menu_items; - string_init(menu_items); + FuriString* menu_items; + menu_items = furi_string_alloc(); center_displayed_key(menu_items, m->key_field, m->index); canvas_set_font(canvas, FontSecondary); canvas_draw_str_aligned( - canvas, 64, 40, AlignCenter, AlignTop, string_get_cstr(menu_items)); + canvas, 64, 40, AlignCenter, AlignTop, furi_string_get_cstr(menu_items)); elements_button_center(canvas, "Select"); elements_button_left(canvas, "<"); elements_button_right(canvas, ">"); - string_reset(menu_items); + furi_string_reset(menu_items); } else { // Menu canvas_set_color(canvas, ColorBlack); diff --git a/applications/plugins/wav_player/wav_player.c b/applications/plugins/wav_player/wav_player.c index 952a5b395..830e37dbf 100644 --- a/applications/plugins/wav_player/wav_player.c +++ b/applications/plugins/wav_player/wav_player.c @@ -19,9 +19,9 @@ static bool open_wav_stream(Stream* stream) { DialogsApp* dialogs = furi_record_open("dialogs"); bool result = false; - string_t path; - string_init(path); - string_set_str(path, WAVPLAYER_FOLDER); + FuriString* path; + path = furi_string_alloc(); + furi_string_set(path, WAVPLAYER_FOLDER); DialogsFileBrowserOptions browser_options; dialog_file_browser_set_basic_options(&browser_options, ".wav", &I_music_10px); @@ -31,13 +31,13 @@ static bool open_wav_stream(Stream* stream) { furi_record_close("dialogs"); if(ret) { - if(!file_stream_open(stream, string_get_cstr(path), FSAM_READ, FSOM_OPEN_EXISTING)) { - FURI_LOG_E(TAG, "Cannot open file \"%s\"", string_get_cstr(path)); + if(!file_stream_open(stream, furi_string_get_cstr(path), FSAM_READ, FSOM_OPEN_EXISTING)) { + FURI_LOG_E(TAG, "Cannot open file \"%s\"", furi_string_get_cstr(path)); } else { result = true; } } - string_clear(path); + furi_string_free(path); return result; } diff --git a/applications/plugins/wifi_marauder_companion/scenes/wifi_marauder_scene_console_output.c b/applications/plugins/wifi_marauder_companion/scenes/wifi_marauder_scene_console_output.c index be6c25fd4..d1c5e8017 100644 --- a/applications/plugins/wifi_marauder_companion/scenes/wifi_marauder_scene_console_output.c +++ b/applications/plugins/wifi_marauder_companion/scenes/wifi_marauder_scene_console_output.c @@ -7,13 +7,13 @@ void wifi_marauder_console_output_handle_rx_data_cb(uint8_t* buf, size_t len, vo // If text box store gets too big, then truncate it app->text_box_store_strlen += len; if(app->text_box_store_strlen >= WIFI_MARAUDER_TEXT_BOX_STORE_SIZE - 1) { - string_right(app->text_box_store, app->text_box_store_strlen / 2); - app->text_box_store_strlen = string_size(app->text_box_store) + len; + furi_string_right(app->text_box_store, app->text_box_store_strlen / 2); + app->text_box_store_strlen = furi_string_size(app->text_box_store) + len; } // Null-terminate buf and append to text box store buf[len] = '\0'; - string_cat_printf(app->text_box_store, "%s", buf); + furi_string_cat_printf(app->text_box_store, "%s", buf); view_dispatcher_send_custom_event(app->view_dispatcher, WifiMarauderEventRefreshConsoleOutput); } @@ -30,7 +30,7 @@ void wifi_marauder_scene_console_output_on_enter(void* context) { text_box_set_focus(text_box, TextBoxFocusEnd); } if(app->is_command) { - string_reset(app->text_box_store); + furi_string_reset(app->text_box_store); app->text_box_store_strlen = 0; if(0 == strncmp("help", app->selected_tx_string, strlen("help"))) { const char* help_msg = @@ -47,7 +47,7 @@ void wifi_marauder_scene_console_output_on_enter(void* context) { } // Set starting text - for "View Log", this will just be what was already in the text box store - text_box_set_text(app->text_box, string_get_cstr(app->text_box_store)); + text_box_set_text(app->text_box, furi_string_get_cstr(app->text_box_store)); scene_manager_set_scene_state(app->scene_manager, WifiMarauderSceneConsoleOutput, 0); view_dispatcher_switch_to_view(app->view_dispatcher, WifiMarauderAppViewConsoleOutput); @@ -70,7 +70,7 @@ bool wifi_marauder_scene_console_output_on_event(void* context, SceneManagerEven bool consumed = false; if(event.type == SceneManagerEventTypeCustom) { - text_box_set_text(app->text_box, string_get_cstr(app->text_box_store)); + text_box_set_text(app->text_box, furi_string_get_cstr(app->text_box_store)); consumed = true; } else if(event.type == SceneManagerEventTypeTick) { consumed = true; diff --git a/applications/plugins/wifi_marauder_companion/wifi_marauder_app.c b/applications/plugins/wifi_marauder_companion/wifi_marauder_app.c index 59ca9edbe..2a4b23e8b 100644 --- a/applications/plugins/wifi_marauder_companion/wifi_marauder_app.c +++ b/applications/plugins/wifi_marauder_companion/wifi_marauder_app.c @@ -53,8 +53,8 @@ WifiMarauderApp* wifi_marauder_app_alloc() { app->text_box = text_box_alloc(); view_dispatcher_add_view( app->view_dispatcher, WifiMarauderAppViewConsoleOutput, text_box_get_view(app->text_box)); - string_init(app->text_box_store); - string_reserve(app->text_box_store, WIFI_MARAUDER_TEXT_BOX_STORE_SIZE); + app->text_box_store = furi_string_alloc(); + furi_string_reserve(app->text_box_store, WIFI_MARAUDER_TEXT_BOX_STORE_SIZE); app->text_input = text_input_alloc(); view_dispatcher_add_view( @@ -73,7 +73,7 @@ void wifi_marauder_app_free(WifiMarauderApp* app) { view_dispatcher_remove_view(app->view_dispatcher, WifiMarauderAppViewConsoleOutput); view_dispatcher_remove_view(app->view_dispatcher, WifiMarauderAppViewTextInput); text_box_free(app->text_box); - string_clear(app->text_box_store); + furi_string_free(app->text_box_store); text_input_free(app->text_input); // View dispatcher diff --git a/applications/plugins/wifi_marauder_companion/wifi_marauder_app_i.h b/applications/plugins/wifi_marauder_companion/wifi_marauder_app_i.h index a438e7fad..63d340bbc 100644 --- a/applications/plugins/wifi_marauder_companion/wifi_marauder_app_i.h +++ b/applications/plugins/wifi_marauder_companion/wifi_marauder_app_i.h @@ -23,7 +23,7 @@ struct WifiMarauderApp { SceneManager* scene_manager; char text_input_store[WIFI_MARAUDER_TEXT_INPUT_STORE_SIZE + 1]; - string_t text_box_store; + FuriString* text_box_store; size_t text_box_store_strlen; TextBox* text_box; TextInput* text_input; diff --git a/applications/plugins/wifi_scanner/wifi_scanner.c b/applications/plugins/wifi_scanner/wifi_scanner.c index 118bc5005..03dc0e903 100644 --- a/applications/plugins/wifi_scanner/wifi_scanner.c +++ b/applications/plugins/wifi_scanner/wifi_scanner.c @@ -6,7 +6,6 @@ #include #include #include -#include #include #include #include @@ -59,10 +58,10 @@ typedef struct SPluginEvent { } SPluginEvent; typedef struct EAccessPointDesc { - string_t m_accessPointName; + FuriString* m_accessPointName; int16_t m_rssi; - string_t m_secType; - string_t m_bssid; + FuriString* m_secType; + FuriString* m_bssid; unsigned short m_channel; bool m_isHidden; } EAccessPointDesc; @@ -111,13 +110,13 @@ static void wifi_scanner_app_init(SWiFiScannerApp* const app) { app->m_totalAccessPoints = 0; app->m_currentIndexAccessPoint = 0; - string_init(app->m_currentAccesspointDescription.m_accessPointName); - string_set_str(app->m_currentAccesspointDescription.m_accessPointName, "N/A\n"); + app->m_currentAccesspointDescription.m_accessPointName = furi_string_alloc(); + furi_string_set(app->m_currentAccesspointDescription.m_accessPointName, "N/A\n"); app->m_currentAccesspointDescription.m_channel = 0; - string_init(app->m_currentAccesspointDescription.m_bssid); - string_set_str(app->m_currentAccesspointDescription.m_bssid, "N/A\n"); - string_init(app->m_currentAccesspointDescription.m_secType); - string_set_str(app->m_currentAccesspointDescription.m_secType, "N/A\n"); + app->m_currentAccesspointDescription.m_bssid = furi_string_alloc(); + furi_string_set(app->m_currentAccesspointDescription.m_bssid, "N/A\n"); + app->m_currentAccesspointDescription.m_secType = furi_string_alloc(); + furi_string_set(app->m_currentAccesspointDescription.m_secType, "N/A\n"); app->m_currentAccesspointDescription.m_rssi = 0; app->m_currentAccesspointDescription.m_isHidden = false; @@ -238,7 +237,7 @@ static void wifi_module_render_callback(Canvas* const canvas, void* ctx) { offsetY, app->m_currentAccesspointDescription.m_isHidden ? "(Hidden SSID)" : - string_get_cstr(app->m_currentAccesspointDescription.m_accessPointName)); + furi_string_get_cstr(app->m_currentAccesspointDescription.m_accessPointName)); offsetY += fontHeight; @@ -246,7 +245,7 @@ static void wifi_module_render_callback(Canvas* const canvas, void* ctx) { canvas, offsetX, offsetY, - string_get_cstr(app->m_currentAccesspointDescription.m_bssid)); + furi_string_get_cstr(app->m_currentAccesspointDescription.m_bssid)); canvas_set_font(canvas, FontSecondary); //u8g2_SetFont(&canvas->fb, u8g2_font_tinytim_tf); @@ -271,7 +270,7 @@ static void wifi_module_render_callback(Canvas* const canvas, void* ctx) { string, sizeof(string), "ENCR: %s", - string_get_cstr(app->m_currentAccesspointDescription.m_secType)); + furi_string_get_cstr(app->m_currentAccesspointDescription.m_secType)); canvas_draw_str(canvas, offsetX, offsetY, string); offsetY += fontHeight; @@ -346,7 +345,7 @@ static void wifi_module_render_callback(Canvas* const canvas, void* ctx) { canvas, offsetX, offsetY, - string_get_cstr(app->m_currentAccesspointDescription.m_accessPointName)); + furi_string_get_cstr(app->m_currentAccesspointDescription.m_accessPointName)); offsetY += fontHeight + 2; @@ -354,7 +353,7 @@ static void wifi_module_render_callback(Canvas* const canvas, void* ctx) { canvas, offsetX, offsetY, - string_get_cstr(app->m_currentAccesspointDescription.m_bssid)); + furi_string_get_cstr(app->m_currentAccesspointDescription.m_bssid)); DrawSignalStrengthBar( canvas, app->m_currentAccesspointDescription.m_rssi, 5, 5, 12, 25); @@ -480,8 +479,8 @@ static int32_t uart_worker(void* context) { if(events & WorkerEventStop) break; if(events & WorkerEventRx) { size_t length = 0; - string_t receivedString; - string_init(receivedString); + FuriString* receivedString; + receivedString = furi_string_alloc(); do { uint8_t data[64]; length = xStreamBufferReceive(rx_stream, data, 64, 25); @@ -489,45 +488,46 @@ static int32_t uart_worker(void* context) { WIFI_APP_LOG_I("Received Data - length: %i", length); for(uint16_t i = 0; i < length; i++) { - string_push_back(receivedString, data[i]); + furi_string_push_back(receivedString, data[i]); } //notification_message(app->notification, &sequence_set_only_red_255); } } while(length > 0); - if(string_size(receivedString) > 0) { - string_t chunk; - string_init(chunk); + if(furi_string_size(receivedString) > 0) { + FuriString* chunk; + chunk = furi_string_alloc(); size_t begin = 0; size_t end = 0; - size_t stringSize = string_size(receivedString); + size_t stringSize = furi_string_size(receivedString); - WIFI_APP_LOG_I("Received string: %s", string_get_cstr(receivedString)); + WIFI_APP_LOG_I("Received string: %s", furi_string_get_cstr(receivedString)); - string_t chunksArray[EChunkArrayData_ENUM_MAX]; + FuriString* chunksArray[EChunkArrayData_ENUM_MAX]; for(uint8_t i = 0; i < EChunkArrayData_ENUM_MAX; ++i) { - string_init(chunksArray[i]); + chunksArray[i] = furi_string_alloc(); } uint8_t index = 0; do { - end = string_search_char(receivedString, '+', begin); + end = furi_string_search_char(receivedString, '+', begin); - if(end == STRING_FAILURE) { + if(end == FURI_STRING_FAILURE) { end = stringSize; } WIFI_APP_LOG_I("size: %i, begin: %i, end: %i", stringSize, begin, end); - string_set_strn(chunk, &string_get_cstr(receivedString)[begin], end - begin); + furi_string_set_strn( + chunk, &furi_string_get_cstr(receivedString)[begin], end - begin); - WIFI_APP_LOG_I("String chunk: %s", string_get_cstr(chunk)); + WIFI_APP_LOG_I("String chunk: %s", furi_string_get_cstr(chunk)); - string_set(chunksArray[index++], chunk); + furi_string_set(chunksArray[index++], chunk); begin = end + 1; } while(end < stringSize); - string_clear(chunk); + furi_string_free(chunk); app = acquire_mutex((ValueMutex*)context, 25); if(app == NULL) { @@ -535,7 +535,7 @@ static int32_t uart_worker(void* context) { } if(!app->m_wifiModuleInitialized) { - if(string_cmp_str( + if(furi_string_cmp_str( chunksArray[EChunkArrayData_Context], MODULE_CONTEXT_INITIALIZATION) == 0) { app->m_wifiModuleInitialized = true; @@ -543,46 +543,46 @@ static int32_t uart_worker(void* context) { } } else { - if(string_cmp_str( + if(furi_string_cmp_str( chunksArray[EChunkArrayData_Context], MODULE_CONTEXT_MONITOR) == 0) { app->m_context = MonitorMode; } else if( - string_cmp_str( + furi_string_cmp_str( chunksArray[EChunkArrayData_Context], MODULE_CONTEXT_SCAN) == 0) { app->m_context = ScanMode; } else if( - string_cmp_str( + furi_string_cmp_str( chunksArray[EChunkArrayData_Context], MODULE_CONTEXT_SCAN_ANIMATION) == 0) { app->m_context = ScanAnimation; } else if( - string_cmp_str( + furi_string_cmp_str( chunksArray[EChunkArrayData_Context], MODULE_CONTEXT_MONITOR_ANIMATION) == 0) { app->m_context = MonitorAnimation; } if(app->m_context == MonitorMode || app->m_context == ScanMode) { - string_set( + furi_string_set( app->m_currentAccesspointDescription.m_accessPointName, chunksArray[EChunkArrayData_SSID]); - string_set( + furi_string_set( app->m_currentAccesspointDescription.m_secType, chunksArray[EChunkArrayData_EncryptionType]); app->m_currentAccesspointDescription.m_rssi = - atoi(string_get_cstr(chunksArray[EChunkArrayData_RSSI])); - string_set( + atoi(furi_string_get_cstr(chunksArray[EChunkArrayData_RSSI])); + furi_string_set( app->m_currentAccesspointDescription.m_bssid, chunksArray[EChunkArrayData_BSSID]); app->m_currentAccesspointDescription.m_channel = - atoi(string_get_cstr(chunksArray[EChunkArrayData_Channel])); + atoi(furi_string_get_cstr(chunksArray[EChunkArrayData_Channel])); app->m_currentAccesspointDescription.m_isHidden = - atoi(string_get_cstr(chunksArray[EChunkArrayData_IsHidden])); + atoi(furi_string_get_cstr(chunksArray[EChunkArrayData_IsHidden])); - app->m_currentIndexAccessPoint = - atoi(string_get_cstr(chunksArray[EChunkArrayData_CurrentAPIndex])); + app->m_currentIndexAccessPoint = atoi( + furi_string_get_cstr(chunksArray[EChunkArrayData_CurrentAPIndex])); app->m_totalAccessPoints = - atoi(string_get_cstr(chunksArray[EChunkArrayData_TotalAps])); + atoi(furi_string_get_cstr(chunksArray[EChunkArrayData_TotalAps])); } } @@ -590,10 +590,10 @@ static int32_t uart_worker(void* context) { // Clear string array for(index = 0; index < EChunkArrayData_ENUM_MAX; ++index) { - string_clear(chunksArray[index]); + furi_string_free(chunksArray[index]); } } - string_clear(receivedString); + furi_string_free(receivedString); } } diff --git a/applications/services/cli/cli_commands.c b/applications/services/cli/cli_commands.c index cfd29e27e..cee2ca98c 100644 --- a/applications/services/cli/cli_commands.c +++ b/applications/services/cli/cli_commands.c @@ -143,34 +143,34 @@ void cli_command_log_tx_callback(const uint8_t* buffer, size_t size, void* conte xStreamBufferSend(context, buffer, size, 0); } -void cli_command_log_level_set_from_string(string_t level) { - if(string_cmpi_str(level, "default") == 0) { +void cli_command_log_level_set_from_string(FuriString* level) { + if(furi_string_cmpi_str(level, "default") == 0) { furi_log_set_level(FuriLogLevelDefault); - } else if(string_cmpi_str(level, "none") == 0) { + } else if(furi_string_cmpi_str(level, "none") == 0) { furi_log_set_level(FuriLogLevelNone); - } else if(string_cmpi_str(level, "error") == 0) { + } else if(furi_string_cmpi_str(level, "error") == 0) { furi_log_set_level(FuriLogLevelError); - } else if(string_cmpi_str(level, "warn") == 0) { + } else if(furi_string_cmpi_str(level, "warn") == 0) { furi_log_set_level(FuriLogLevelWarn); - } else if(string_cmpi_str(level, "info") == 0) { + } else if(furi_string_cmpi_str(level, "info") == 0) { furi_log_set_level(FuriLogLevelInfo); - } else if(string_cmpi_str(level, "debug") == 0) { + } else if(furi_string_cmpi_str(level, "debug") == 0) { furi_log_set_level(FuriLogLevelDebug); - } else if(string_cmpi_str(level, "trace") == 0) { + } else if(furi_string_cmpi_str(level, "trace") == 0) { furi_log_set_level(FuriLogLevelTrace); } else { printf("Unknown log level\r\n"); } } -void cli_command_log(Cli* cli, string_t args, void* context) { +void cli_command_log(Cli* cli, FuriString* args, void* context) { UNUSED(context); StreamBufferHandle_t ring = xStreamBufferCreate(CLI_COMMAND_LOG_RING_SIZE, 1); uint8_t buffer[CLI_COMMAND_LOG_BUFFER_SIZE]; FuriLogLevel previous_level = furi_log_get_level(); bool restore_log_level = false; - if(string_size(args) > 0) { + if(furi_string_size(args) > 0) { cli_command_log_level_set_from_string(args); restore_log_level = true; } diff --git a/applications/services/gui/modules/file_browser_worker.c b/applications/services/gui/modules/file_browser_worker.c index 2d29d58f5..c1d4158f2 100644 --- a/applications/services/gui/modules/file_browser_worker.c +++ b/applications/services/gui/modules/file_browser_worker.c @@ -79,9 +79,9 @@ static bool browser_filter_by_name(BrowserWorker* browser, FuriString* name, boo if(is_folder) { // Skip assets folders (if enabled) if(browser->skip_assets) { - return ((string_cmp_str(name, ASSETS_DIR) == 0) ? (false) : (true)) && - ((string_cmp_str(name, BADUSB_LAYOUTS_DIR) == 0) ? (false) : (true)) && - ((string_cmp_str(name, SUBGHZ_TEMP_DIR) == 0) ? (false) : (true)); + return ((furi_string_cmp_str(name, ASSETS_DIR) == 0) ? (false) : (true)) && + ((furi_string_cmp_str(name, BADUSB_LAYOUTS_DIR) == 0) ? (false) : (true)) && + ((furi_string_cmp_str(name, SUBGHZ_TEMP_DIR) == 0) ? (false) : (true)); } else { return true; } diff --git a/firmware/targets/f7/api_symbols.csv b/firmware/targets/f7/api_symbols.csv index c4dd4e9a9..76e2f9418 100644 --- a/firmware/targets/f7/api_symbols.csv +++ b/firmware/targets/f7/api_symbols.csv @@ -1848,8 +1848,8 @@ Function,-,protocol_dict_get_name,const char*,"ProtocolDict*, size_t" Function,+,protocol_dict_get_protocol_by_name,ProtocolId,"ProtocolDict*, const char*" Function,-,protocol_dict_get_validate_count,uint32_t,"ProtocolDict*, size_t" Function,-,protocol_dict_get_write_data,_Bool,"ProtocolDict*, size_t, void*" -Function,-,protocol_dict_render_brief_data,void,"ProtocolDict*, string_t, size_t" -Function,-,protocol_dict_render_data,void,"ProtocolDict*, string_t, size_t" +Function,+,protocol_dict_render_brief_data,void,"ProtocolDict*, FuriString*, size_t" +Function,+,protocol_dict_render_data,void,"ProtocolDict*, FuriString*, size_t" Function,+,protocol_dict_set_data,void,"ProtocolDict*, size_t, const uint8_t*, size_t" Function,-,pselect,int,"int, fd_set*, fd_set*, fd_set*, const timespec*, const sigset_t*" Function,-,putc,int,"int, FILE*" @@ -2304,7 +2304,7 @@ Function,-,subghz_protocol_decoder_bett_deserialize,_Bool,"void*, FlipperFormat* Function,-,subghz_protocol_decoder_bett_feed,void,"void*, _Bool, uint32_t" Function,-,subghz_protocol_decoder_bett_free,void,void* Function,-,subghz_protocol_decoder_bett_get_hash_data,uint8_t,void* -Function,-,subghz_protocol_decoder_bett_get_string,void,"void*, string_t" +Function,-,subghz_protocol_decoder_bett_get_string,void,"void*, FuriString*" Function,-,subghz_protocol_decoder_bett_reset,void,void* Function,-,subghz_protocol_decoder_bett_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_came_alloc,void*,SubGhzEnvironment* @@ -2313,14 +2313,14 @@ Function,-,subghz_protocol_decoder_came_atomo_deserialize,_Bool,"void*, FlipperF Function,-,subghz_protocol_decoder_came_atomo_feed,void,"void*, _Bool, uint32_t" Function,-,subghz_protocol_decoder_came_atomo_free,void,void* Function,-,subghz_protocol_decoder_came_atomo_get_hash_data,uint8_t,void* -Function,-,subghz_protocol_decoder_came_atomo_get_string,void,"void*, string_t" +Function,-,subghz_protocol_decoder_came_atomo_get_string,void,"void*, FuriString*" Function,-,subghz_protocol_decoder_came_atomo_reset,void,void* Function,-,subghz_protocol_decoder_came_atomo_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_came_deserialize,_Bool,"void*, FlipperFormat*" Function,-,subghz_protocol_decoder_came_feed,void,"void*, _Bool, uint32_t" Function,-,subghz_protocol_decoder_came_free,void,void* Function,-,subghz_protocol_decoder_came_get_hash_data,uint8_t,void* -Function,-,subghz_protocol_decoder_came_get_string,void,"void*, string_t" +Function,-,subghz_protocol_decoder_came_get_string,void,"void*, FuriString*" Function,-,subghz_protocol_decoder_came_reset,void,void* Function,-,subghz_protocol_decoder_came_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_came_twee_alloc,void*,SubGhzEnvironment* @@ -2328,7 +2328,7 @@ Function,-,subghz_protocol_decoder_came_twee_deserialize,_Bool,"void*, FlipperFo Function,-,subghz_protocol_decoder_came_twee_feed,void,"void*, _Bool, uint32_t" Function,-,subghz_protocol_decoder_came_twee_free,void,void* Function,-,subghz_protocol_decoder_came_twee_get_hash_data,uint8_t,void* -Function,-,subghz_protocol_decoder_came_twee_get_string,void,"void*, string_t" +Function,-,subghz_protocol_decoder_came_twee_get_string,void,"void*, FuriString*" Function,-,subghz_protocol_decoder_came_twee_reset,void,void* Function,-,subghz_protocol_decoder_came_twee_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_chamb_code_alloc,void*,SubGhzEnvironment* @@ -2336,7 +2336,7 @@ Function,-,subghz_protocol_decoder_chamb_code_deserialize,_Bool,"void*, FlipperF Function,-,subghz_protocol_decoder_chamb_code_feed,void,"void*, _Bool, uint32_t" Function,-,subghz_protocol_decoder_chamb_code_free,void,void* Function,-,subghz_protocol_decoder_chamb_code_get_hash_data,uint8_t,void* -Function,-,subghz_protocol_decoder_chamb_code_get_string,void,"void*, string_t" +Function,-,subghz_protocol_decoder_chamb_code_get_string,void,"void*, FuriString*" Function,-,subghz_protocol_decoder_chamb_code_reset,void,void* Function,-,subghz_protocol_decoder_chamb_code_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_clemsa_alloc,void*,SubGhzEnvironment* @@ -2344,7 +2344,7 @@ Function,-,subghz_protocol_decoder_clemsa_deserialize,_Bool,"void*, FlipperForma Function,-,subghz_protocol_decoder_clemsa_feed,void,"void*, _Bool, uint32_t" Function,-,subghz_protocol_decoder_clemsa_free,void,void* Function,-,subghz_protocol_decoder_clemsa_get_hash_data,uint8_t,void* -Function,-,subghz_protocol_decoder_clemsa_get_string,void,"void*, string_t" +Function,-,subghz_protocol_decoder_clemsa_get_string,void,"void*, FuriString*" Function,-,subghz_protocol_decoder_clemsa_reset,void,void* Function,-,subghz_protocol_decoder_clemsa_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_doitrand_alloc,void*,SubGhzEnvironment* @@ -2352,7 +2352,7 @@ Function,-,subghz_protocol_decoder_doitrand_deserialize,_Bool,"void*, FlipperFor Function,-,subghz_protocol_decoder_doitrand_feed,void,"void*, _Bool, uint32_t" Function,-,subghz_protocol_decoder_doitrand_free,void,void* Function,-,subghz_protocol_decoder_doitrand_get_hash_data,uint8_t,void* -Function,-,subghz_protocol_decoder_doitrand_get_string,void,"void*, string_t" +Function,-,subghz_protocol_decoder_doitrand_get_string,void,"void*, FuriString*" Function,-,subghz_protocol_decoder_doitrand_reset,void,void* Function,-,subghz_protocol_decoder_doitrand_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_faac_slh_alloc,void*,SubGhzEnvironment* @@ -2360,7 +2360,7 @@ Function,-,subghz_protocol_decoder_faac_slh_deserialize,_Bool,"void*, FlipperFor Function,-,subghz_protocol_decoder_faac_slh_feed,void,"void*, _Bool, uint32_t" Function,-,subghz_protocol_decoder_faac_slh_free,void,void* Function,-,subghz_protocol_decoder_faac_slh_get_hash_data,uint8_t,void* -Function,-,subghz_protocol_decoder_faac_slh_get_string,void,"void*, string_t" +Function,-,subghz_protocol_decoder_faac_slh_get_string,void,"void*, FuriString*" Function,-,subghz_protocol_decoder_faac_slh_reset,void,void* Function,-,subghz_protocol_decoder_faac_slh_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_gate_tx_alloc,void*,SubGhzEnvironment* @@ -2368,7 +2368,7 @@ Function,-,subghz_protocol_decoder_gate_tx_deserialize,_Bool,"void*, FlipperForm Function,-,subghz_protocol_decoder_gate_tx_feed,void,"void*, _Bool, uint32_t" Function,-,subghz_protocol_decoder_gate_tx_free,void,void* Function,-,subghz_protocol_decoder_gate_tx_get_hash_data,uint8_t,void* -Function,-,subghz_protocol_decoder_gate_tx_get_string,void,"void*, string_t" +Function,-,subghz_protocol_decoder_gate_tx_get_string,void,"void*, FuriString*" Function,-,subghz_protocol_decoder_gate_tx_reset,void,void* Function,-,subghz_protocol_decoder_gate_tx_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_holtek_alloc,void*,SubGhzEnvironment* @@ -2376,7 +2376,7 @@ Function,-,subghz_protocol_decoder_holtek_deserialize,_Bool,"void*, FlipperForma Function,-,subghz_protocol_decoder_holtek_feed,void,"void*, _Bool, uint32_t" Function,-,subghz_protocol_decoder_holtek_free,void,void* Function,-,subghz_protocol_decoder_holtek_get_hash_data,uint8_t,void* -Function,-,subghz_protocol_decoder_holtek_get_string,void,"void*, string_t" +Function,-,subghz_protocol_decoder_holtek_get_string,void,"void*, FuriString*" Function,-,subghz_protocol_decoder_holtek_reset,void,void* Function,-,subghz_protocol_decoder_holtek_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_honeywell_wdb_alloc,void*,SubGhzEnvironment* @@ -2384,7 +2384,7 @@ Function,-,subghz_protocol_decoder_honeywell_wdb_deserialize,_Bool,"void*, Flipp Function,-,subghz_protocol_decoder_honeywell_wdb_feed,void,"void*, _Bool, uint32_t" Function,-,subghz_protocol_decoder_honeywell_wdb_free,void,void* Function,-,subghz_protocol_decoder_honeywell_wdb_get_hash_data,uint8_t,void* -Function,-,subghz_protocol_decoder_honeywell_wdb_get_string,void,"void*, string_t" +Function,-,subghz_protocol_decoder_honeywell_wdb_get_string,void,"void*, FuriString*" Function,-,subghz_protocol_decoder_honeywell_wdb_reset,void,void* Function,-,subghz_protocol_decoder_honeywell_wdb_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_hormann_alloc,void*,SubGhzEnvironment* @@ -2392,7 +2392,7 @@ Function,-,subghz_protocol_decoder_hormann_deserialize,_Bool,"void*, FlipperForm Function,-,subghz_protocol_decoder_hormann_feed,void,"void*, _Bool, uint32_t" Function,-,subghz_protocol_decoder_hormann_free,void,void* Function,-,subghz_protocol_decoder_hormann_get_hash_data,uint8_t,void* -Function,-,subghz_protocol_decoder_hormann_get_string,void,"void*, string_t" +Function,-,subghz_protocol_decoder_hormann_get_string,void,"void*, FuriString*" Function,-,subghz_protocol_decoder_hormann_reset,void,void* Function,-,subghz_protocol_decoder_hormann_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_ido_alloc,void*,SubGhzEnvironment* @@ -2400,7 +2400,7 @@ Function,-,subghz_protocol_decoder_ido_deserialize,_Bool,"void*, FlipperFormat*" Function,-,subghz_protocol_decoder_ido_feed,void,"void*, _Bool, uint32_t" Function,-,subghz_protocol_decoder_ido_free,void,void* Function,-,subghz_protocol_decoder_ido_get_hash_data,uint8_t,void* -Function,-,subghz_protocol_decoder_ido_get_string,void,"void*, string_t" +Function,-,subghz_protocol_decoder_ido_get_string,void,"void*, FuriString*" Function,-,subghz_protocol_decoder_ido_reset,void,void* Function,-,subghz_protocol_decoder_ido_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_intertechno_v3_alloc,void*,SubGhzEnvironment* @@ -2408,7 +2408,7 @@ Function,-,subghz_protocol_decoder_intertechno_v3_deserialize,_Bool,"void*, Flip Function,-,subghz_protocol_decoder_intertechno_v3_feed,void,"void*, _Bool, uint32_t" Function,-,subghz_protocol_decoder_intertechno_v3_free,void,void* Function,-,subghz_protocol_decoder_intertechno_v3_get_hash_data,uint8_t,void* -Function,-,subghz_protocol_decoder_intertechno_v3_get_string,void,"void*, string_t" +Function,-,subghz_protocol_decoder_intertechno_v3_get_string,void,"void*, FuriString*" Function,-,subghz_protocol_decoder_intertechno_v3_reset,void,void* Function,-,subghz_protocol_decoder_intertechno_v3_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_keeloq_alloc,void*,SubGhzEnvironment* @@ -2416,7 +2416,7 @@ Function,-,subghz_protocol_decoder_keeloq_deserialize,_Bool,"void*, FlipperForma Function,-,subghz_protocol_decoder_keeloq_feed,void,"void*, _Bool, uint32_t" Function,-,subghz_protocol_decoder_keeloq_free,void,void* Function,-,subghz_protocol_decoder_keeloq_get_hash_data,uint8_t,void* -Function,-,subghz_protocol_decoder_keeloq_get_string,void,"void*, string_t" +Function,-,subghz_protocol_decoder_keeloq_get_string,void,"void*, FuriString*" Function,-,subghz_protocol_decoder_keeloq_reset,void,void* Function,-,subghz_protocol_decoder_keeloq_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_kia_alloc,void*,SubGhzEnvironment* @@ -2424,7 +2424,7 @@ Function,-,subghz_protocol_decoder_kia_deserialize,_Bool,"void*, FlipperFormat*" Function,-,subghz_protocol_decoder_kia_feed,void,"void*, _Bool, uint32_t" Function,-,subghz_protocol_decoder_kia_free,void,void* Function,-,subghz_protocol_decoder_kia_get_hash_data,uint8_t,void* -Function,-,subghz_protocol_decoder_kia_get_string,void,"void*, string_t" +Function,-,subghz_protocol_decoder_kia_get_string,void,"void*, FuriString*" Function,-,subghz_protocol_decoder_kia_reset,void,void* Function,-,subghz_protocol_decoder_kia_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_linear_alloc,void*,SubGhzEnvironment* @@ -2432,7 +2432,7 @@ Function,-,subghz_protocol_decoder_linear_deserialize,_Bool,"void*, FlipperForma Function,-,subghz_protocol_decoder_linear_feed,void,"void*, _Bool, uint32_t" Function,-,subghz_protocol_decoder_linear_free,void,void* Function,-,subghz_protocol_decoder_linear_get_hash_data,uint8_t,void* -Function,-,subghz_protocol_decoder_linear_get_string,void,"void*, string_t" +Function,-,subghz_protocol_decoder_linear_get_string,void,"void*, FuriString*" Function,-,subghz_protocol_decoder_linear_reset,void,void* Function,-,subghz_protocol_decoder_linear_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_magellen_alloc,void*,SubGhzEnvironment* @@ -2440,7 +2440,7 @@ Function,-,subghz_protocol_decoder_magellen_deserialize,_Bool,"void*, FlipperFor Function,-,subghz_protocol_decoder_magellen_feed,void,"void*, _Bool, uint32_t" Function,-,subghz_protocol_decoder_magellen_free,void,void* Function,-,subghz_protocol_decoder_magellen_get_hash_data,uint8_t,void* -Function,-,subghz_protocol_decoder_magellen_get_string,void,"void*, string_t" +Function,-,subghz_protocol_decoder_magellen_get_string,void,"void*, FuriString*" Function,-,subghz_protocol_decoder_magellen_reset,void,void* Function,-,subghz_protocol_decoder_magellen_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_marantec_alloc,void*,SubGhzEnvironment* @@ -2448,7 +2448,7 @@ Function,-,subghz_protocol_decoder_marantec_deserialize,_Bool,"void*, FlipperFor Function,-,subghz_protocol_decoder_marantec_feed,void,"void*, _Bool, uint32_t" Function,-,subghz_protocol_decoder_marantec_free,void,void* Function,-,subghz_protocol_decoder_marantec_get_hash_data,uint8_t,void* -Function,-,subghz_protocol_decoder_marantec_get_string,void,"void*, string_t" +Function,-,subghz_protocol_decoder_marantec_get_string,void,"void*, FuriString*" Function,-,subghz_protocol_decoder_marantec_reset,void,void* Function,-,subghz_protocol_decoder_marantec_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_megacode_alloc,void*,SubGhzEnvironment* @@ -2456,7 +2456,7 @@ Function,-,subghz_protocol_decoder_megacode_deserialize,_Bool,"void*, FlipperFor Function,-,subghz_protocol_decoder_megacode_feed,void,"void*, _Bool, uint32_t" Function,-,subghz_protocol_decoder_megacode_free,void,void* Function,-,subghz_protocol_decoder_megacode_get_hash_data,uint8_t,void* -Function,-,subghz_protocol_decoder_megacode_get_string,void,"void*, string_t" +Function,-,subghz_protocol_decoder_megacode_get_string,void,"void*, FuriString*" Function,-,subghz_protocol_decoder_megacode_reset,void,void* Function,-,subghz_protocol_decoder_megacode_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_nero_radio_alloc,void*,SubGhzEnvironment* @@ -2464,7 +2464,7 @@ Function,-,subghz_protocol_decoder_nero_radio_deserialize,_Bool,"void*, FlipperF Function,-,subghz_protocol_decoder_nero_radio_feed,void,"void*, _Bool, uint32_t" Function,-,subghz_protocol_decoder_nero_radio_free,void,void* Function,-,subghz_protocol_decoder_nero_radio_get_hash_data,uint8_t,void* -Function,-,subghz_protocol_decoder_nero_radio_get_string,void,"void*, string_t" +Function,-,subghz_protocol_decoder_nero_radio_get_string,void,"void*, FuriString*" Function,-,subghz_protocol_decoder_nero_radio_reset,void,void* Function,-,subghz_protocol_decoder_nero_radio_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_nero_sketch_alloc,void*,SubGhzEnvironment* @@ -2472,7 +2472,7 @@ Function,-,subghz_protocol_decoder_nero_sketch_deserialize,_Bool,"void*, Flipper Function,-,subghz_protocol_decoder_nero_sketch_feed,void,"void*, _Bool, uint32_t" Function,-,subghz_protocol_decoder_nero_sketch_free,void,void* Function,-,subghz_protocol_decoder_nero_sketch_get_hash_data,uint8_t,void* -Function,-,subghz_protocol_decoder_nero_sketch_get_string,void,"void*, string_t" +Function,-,subghz_protocol_decoder_nero_sketch_get_string,void,"void*, FuriString*" Function,-,subghz_protocol_decoder_nero_sketch_reset,void,void* Function,-,subghz_protocol_decoder_nero_sketch_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_nice_flo_alloc,void*,SubGhzEnvironment* @@ -2480,7 +2480,7 @@ Function,-,subghz_protocol_decoder_nice_flo_deserialize,_Bool,"void*, FlipperFor Function,-,subghz_protocol_decoder_nice_flo_feed,void,"void*, _Bool, uint32_t" Function,-,subghz_protocol_decoder_nice_flo_free,void,void* Function,-,subghz_protocol_decoder_nice_flo_get_hash_data,uint8_t,void* -Function,-,subghz_protocol_decoder_nice_flo_get_string,void,"void*, string_t" +Function,-,subghz_protocol_decoder_nice_flo_get_string,void,"void*, FuriString*" Function,-,subghz_protocol_decoder_nice_flo_reset,void,void* Function,-,subghz_protocol_decoder_nice_flo_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_nice_flor_s_alloc,void*,SubGhzEnvironment* @@ -2488,7 +2488,7 @@ Function,-,subghz_protocol_decoder_nice_flor_s_deserialize,_Bool,"void*, Flipper Function,-,subghz_protocol_decoder_nice_flor_s_feed,void,"void*, _Bool, uint32_t" Function,-,subghz_protocol_decoder_nice_flor_s_free,void,void* Function,-,subghz_protocol_decoder_nice_flor_s_get_hash_data,uint8_t,void* -Function,-,subghz_protocol_decoder_nice_flor_s_get_string,void,"void*, string_t" +Function,-,subghz_protocol_decoder_nice_flor_s_get_string,void,"void*, FuriString*" Function,-,subghz_protocol_decoder_nice_flor_s_reset,void,void* Function,-,subghz_protocol_decoder_nice_flor_s_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_phoenix_v2_alloc,void*,SubGhzEnvironment* @@ -2496,7 +2496,7 @@ Function,-,subghz_protocol_decoder_phoenix_v2_deserialize,_Bool,"void*, FlipperF Function,-,subghz_protocol_decoder_phoenix_v2_feed,void,"void*, _Bool, uint32_t" Function,-,subghz_protocol_decoder_phoenix_v2_free,void,void* Function,-,subghz_protocol_decoder_phoenix_v2_get_hash_data,uint8_t,void* -Function,-,subghz_protocol_decoder_phoenix_v2_get_string,void,"void*, string_t" +Function,-,subghz_protocol_decoder_phoenix_v2_get_string,void,"void*, FuriString*" Function,-,subghz_protocol_decoder_phoenix_v2_reset,void,void* Function,-,subghz_protocol_decoder_phoenix_v2_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_power_smart_alloc,void*,SubGhzEnvironment* @@ -2504,7 +2504,7 @@ Function,-,subghz_protocol_decoder_power_smart_deserialize,_Bool,"void*, Flipper Function,-,subghz_protocol_decoder_power_smart_feed,void,"void*, _Bool, uint32_t" Function,-,subghz_protocol_decoder_power_smart_free,void,void* Function,-,subghz_protocol_decoder_power_smart_get_hash_data,uint8_t,void* -Function,-,subghz_protocol_decoder_power_smart_get_string,void,"void*, string_t" +Function,-,subghz_protocol_decoder_power_smart_get_string,void,"void*, FuriString*" Function,-,subghz_protocol_decoder_power_smart_reset,void,void* Function,-,subghz_protocol_decoder_power_smart_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_princeton_alloc,void*,SubGhzEnvironment* @@ -2512,7 +2512,7 @@ Function,-,subghz_protocol_decoder_princeton_deserialize,_Bool,"void*, FlipperFo Function,-,subghz_protocol_decoder_princeton_feed,void,"void*, _Bool, uint32_t" Function,-,subghz_protocol_decoder_princeton_free,void,void* Function,-,subghz_protocol_decoder_princeton_get_hash_data,uint8_t,void* -Function,-,subghz_protocol_decoder_princeton_get_string,void,"void*, string_t" +Function,-,subghz_protocol_decoder_princeton_get_string,void,"void*, FuriString*" Function,-,subghz_protocol_decoder_princeton_reset,void,void* Function,-,subghz_protocol_decoder_princeton_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_raw_alloc,void*,SubGhzEnvironment* @@ -2520,7 +2520,7 @@ Function,-,subghz_protocol_decoder_raw_deserialize,_Bool,"void*, FlipperFormat*" Function,-,subghz_protocol_decoder_raw_feed,void,"void*, _Bool, uint32_t" Function,-,subghz_protocol_decoder_raw_free,void,void* Function,-,subghz_protocol_decoder_raw_get_hash_data,uint8_t,void* -Function,-,subghz_protocol_decoder_raw_get_string,void,"void*, string_t" +Function,-,subghz_protocol_decoder_raw_get_string,void,"void*, FuriString*" Function,-,subghz_protocol_decoder_raw_reset,void,void* Function,-,subghz_protocol_decoder_raw_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_raw_set_auto_mode,void,"void*, _Bool" @@ -2531,7 +2531,7 @@ Function,-,subghz_protocol_decoder_scher_khan_deserialize,_Bool,"void*, FlipperF Function,-,subghz_protocol_decoder_scher_khan_feed,void,"void*, _Bool, uint32_t" Function,-,subghz_protocol_decoder_scher_khan_free,void,void* Function,-,subghz_protocol_decoder_scher_khan_get_hash_data,uint8_t,void* -Function,-,subghz_protocol_decoder_scher_khan_get_string,void,"void*, string_t" +Function,-,subghz_protocol_decoder_scher_khan_get_string,void,"void*, FuriString*" Function,-,subghz_protocol_decoder_scher_khan_reset,void,void* Function,-,subghz_protocol_decoder_scher_khan_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_secplus_v1_alloc,void*,SubGhzEnvironment* @@ -2539,7 +2539,7 @@ Function,-,subghz_protocol_decoder_secplus_v1_deserialize,_Bool,"void*, FlipperF Function,-,subghz_protocol_decoder_secplus_v1_feed,void,"void*, _Bool, uint32_t" Function,-,subghz_protocol_decoder_secplus_v1_free,void,void* Function,-,subghz_protocol_decoder_secplus_v1_get_hash_data,uint8_t,void* -Function,-,subghz_protocol_decoder_secplus_v1_get_string,void,"void*, string_t" +Function,-,subghz_protocol_decoder_secplus_v1_get_string,void,"void*, FuriString*" Function,-,subghz_protocol_decoder_secplus_v1_reset,void,void* Function,-,subghz_protocol_decoder_secplus_v1_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_secplus_v2_alloc,void*,SubGhzEnvironment* @@ -2547,7 +2547,7 @@ Function,-,subghz_protocol_decoder_secplus_v2_deserialize,_Bool,"void*, FlipperF Function,-,subghz_protocol_decoder_secplus_v2_feed,void,"void*, _Bool, uint32_t" Function,-,subghz_protocol_decoder_secplus_v2_free,void,void* Function,-,subghz_protocol_decoder_secplus_v2_get_hash_data,uint8_t,void* -Function,-,subghz_protocol_decoder_secplus_v2_get_string,void,"void*, string_t" +Function,-,subghz_protocol_decoder_secplus_v2_get_string,void,"void*, FuriString*" Function,-,subghz_protocol_decoder_secplus_v2_reset,void,void* Function,-,subghz_protocol_decoder_secplus_v2_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_somfy_keytis_alloc,void*,SubGhzEnvironment* @@ -2555,7 +2555,7 @@ Function,-,subghz_protocol_decoder_somfy_keytis_deserialize,_Bool,"void*, Flippe Function,-,subghz_protocol_decoder_somfy_keytis_feed,void,"void*, _Bool, uint32_t" Function,-,subghz_protocol_decoder_somfy_keytis_free,void,void* Function,-,subghz_protocol_decoder_somfy_keytis_get_hash_data,uint8_t,void* -Function,-,subghz_protocol_decoder_somfy_keytis_get_string,void,"void*, string_t" +Function,-,subghz_protocol_decoder_somfy_keytis_get_string,void,"void*, FuriString*" Function,-,subghz_protocol_decoder_somfy_keytis_reset,void,void* Function,-,subghz_protocol_decoder_somfy_keytis_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_somfy_telis_alloc,void*,SubGhzEnvironment* @@ -2563,7 +2563,7 @@ Function,-,subghz_protocol_decoder_somfy_telis_deserialize,_Bool,"void*, Flipper Function,-,subghz_protocol_decoder_somfy_telis_feed,void,"void*, _Bool, uint32_t" Function,-,subghz_protocol_decoder_somfy_telis_free,void,void* Function,-,subghz_protocol_decoder_somfy_telis_get_hash_data,uint8_t,void* -Function,-,subghz_protocol_decoder_somfy_telis_get_string,void,"void*, string_t" +Function,-,subghz_protocol_decoder_somfy_telis_get_string,void,"void*, FuriString*" Function,-,subghz_protocol_decoder_somfy_telis_reset,void,void* Function,-,subghz_protocol_decoder_somfy_telis_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_star_line_alloc,void*,SubGhzEnvironment* @@ -2571,7 +2571,7 @@ Function,-,subghz_protocol_decoder_star_line_deserialize,_Bool,"void*, FlipperFo Function,-,subghz_protocol_decoder_star_line_feed,void,"void*, _Bool, uint32_t" Function,-,subghz_protocol_decoder_star_line_free,void,void* Function,-,subghz_protocol_decoder_star_line_get_hash_data,uint8_t,void* -Function,-,subghz_protocol_decoder_star_line_get_string,void,"void*, string_t" +Function,-,subghz_protocol_decoder_star_line_get_string,void,"void*, FuriString*" Function,-,subghz_protocol_decoder_star_line_reset,void,void* Function,-,subghz_protocol_decoder_star_line_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_encoder_bett_alloc,void*,SubGhzEnvironment* diff --git a/lib/flipper_format/flipper_format_stream.c b/lib/flipper_format/flipper_format_stream.c index 9acde4f6f..41934a3b1 100644 --- a/lib/flipper_format/flipper_format_stream.c +++ b/lib/flipper_format/flipper_format_stream.c @@ -121,14 +121,14 @@ bool flipper_format_stream_seek_to_key(Stream* stream, const char* key, bool str return found; } -static bool flipper_format_stream_read_value(Stream* stream, string_t value, bool* last) { +static bool flipper_format_stream_read_value(Stream* stream, FuriString* value, bool* last) { enum { LeadingSpace, ReadValue, TrailingSpace } state = LeadingSpace; const size_t buffer_size = 32; uint8_t buffer[buffer_size]; bool result = false; bool error = false; - string_reset(value); + furi_string_reset(value); while(true) { size_t was_read = stream_read(stream, buffer, buffer_size); @@ -154,7 +154,7 @@ static bool flipper_format_stream_read_value(Stream* stream, string_t value, boo break; } else { state = ReadValue; - string_push_back(value, data); + furi_string_push_back(value, data); } } else if(state == ReadValue) { if(flipper_format_stream_is_space(data)) { @@ -168,7 +168,7 @@ static bool flipper_format_stream_read_value(Stream* stream, string_t value, boo } break; } else { - string_push_back(value, data); + furi_string_push_back(value, data); } } else if(state == TrailingSpace) { if(flipper_format_stream_is_space(data)) { diff --git a/lib/nfc/helpers/mf_classic_dict.h b/lib/nfc/helpers/mf_classic_dict.h index 5b0ee312a..97d125249 100644 --- a/lib/nfc/helpers/mf_classic_dict.h +++ b/lib/nfc/helpers/mf_classic_dict.h @@ -64,7 +64,7 @@ bool mf_classic_dict_get_next_key_str(MfClassicDict* dict, FuriString* key); */ bool mf_classic_dict_get_key_at_index(MfClassicDict* dict, uint64_t* key, uint32_t target); -/** Get key at target offset as string_t +/** Get key at target offset as FuriString* * * @param dict MfClassicDict instance * @param[out] key Found key destination buffer diff --git a/lib/nfc/helpers/mfkey32.c b/lib/nfc/helpers/mfkey32.c index 790ddc07c..265248d5e 100644 --- a/lib/nfc/helpers/mfkey32.c +++ b/lib/nfc/helpers/mfkey32.c @@ -91,9 +91,9 @@ void mfkey32_set_callback(Mfkey32* instance, Mfkey32ParseDataCallback callback, } static bool mfkey32_write_params(Mfkey32* instance, Mfkey32Params* params) { - string_t str; - string_init_printf( - str, + FuriString* str; + + str = furi_string_alloc_printf( "Sec %d key %c cuid %08x nt0 %08x nr0 %08x ar0 %08x nt1 %08x nr1 %08x ar1 %08x\n", params->sector, params->key == MfClassicKeyA ? 'A' : 'B', diff --git a/lib/nfc/nfc_device.c b/lib/nfc/nfc_device.c index 6418abac9..419ef0f20 100644 --- a/lib/nfc/nfc_device.c +++ b/lib/nfc/nfc_device.c @@ -950,9 +950,9 @@ static bool nfc_device_save_mifare_classic_keys(NfcDevice* dev) { } if(!key_save_success) break; if(FURI_BIT(data->key_b_mask, i)) { - string_printf(temp_str, "Key B sector %d", i); - key_save_success = - flipper_format_write_hex(file, string_get_cstr(temp_str), sec_tr->key_b, 6); + furi_string_printf(temp_str, "Key B sector %d", i); + key_save_success = flipper_format_write_hex( + file, furi_string_get_cstr(temp_str), sec_tr->key_b, 6); } } save_success = key_save_success; diff --git a/lib/subghz/environment.c b/lib/subghz/environment.c index 46d0d368c..dffe10377 100644 --- a/lib/subghz/environment.c +++ b/lib/subghz/environment.c @@ -19,6 +19,8 @@ SubGhzEnvironment* subghz_environment_alloc() { void subghz_environment_free(SubGhzEnvironment* instance) { furi_assert(instance); + instance->came_atomo_rainbow_table_file_name = NULL; + instance->nice_flor_s_rainbow_table_file_name = NULL; subghz_keystore_free(instance->keystore); free(instance); diff --git a/lib/subghz/protocols/faac_slh.c b/lib/subghz/protocols/faac_slh.c index 5b5cbdfcd..09fb60e26 100644 --- a/lib/subghz/protocols/faac_slh.c +++ b/lib/subghz/protocols/faac_slh.c @@ -1,6 +1,5 @@ #include "faac_slh.h" #include "../subghz_keystore.h" -#include #include #include "keeloq_common.h" #include "../blocks/const.h" @@ -131,7 +130,7 @@ static bool subghz_protocol_faac_slh_gen_data(SubGhzProtocolEncoderFaacSLH* inst } for M_EACH(manufacture_code, *subghz_keystore_get_data(instance->keystore), SubGhzKeyArray_t) { - res = strcmp(string_get_cstr(manufacture_code->name), instance->manufacture_name); + res = strcmp(furi_string_get_cstr(manufacture_code->name), instance->manufacture_name); if(res == 0) { switch(manufacture_code->type) { case KEELOQ_LEARNING_FAAC: @@ -409,7 +408,7 @@ static void subghz_protocol_faac_slh_check_remote_controller( man = subghz_protocol_keeloq_common_faac_learning( instance->seed, manufacture_code->key); decrypt = subghz_protocol_keeloq_common_decrypt(code_hop, man); - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); break; } } diff --git a/lib/subghz/protocols/keeloq.c b/lib/subghz/protocols/keeloq.c index f174bec57..1ce4af3fa 100644 --- a/lib/subghz/protocols/keeloq.c +++ b/lib/subghz/protocols/keeloq.c @@ -579,7 +579,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector( // Simple Learning decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key); if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; return 1; } @@ -590,7 +590,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector( man = subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; return 1; } @@ -600,7 +600,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector( fix, instance->seed, manufacture_code->key); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; return 1; } @@ -610,7 +610,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector( fix, manufacture_code->key); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; return 1; } @@ -620,7 +620,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector( fix, manufacture_code->key); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; return 1; } @@ -629,7 +629,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector( // Simple Learning decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key); if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; kl_type = 1; return 1; @@ -645,7 +645,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector( decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_rev); if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; kl_type = 1; return 1; @@ -657,7 +657,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector( man = subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; kl_type = 2; return 1; @@ -667,7 +667,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector( man = subghz_protocol_keeloq_common_normal_learning(fix, man_rev); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; kl_type = 2; return 1; @@ -678,7 +678,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector( fix, instance->seed, manufacture_code->key); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; kl_type = 3; return 1; @@ -688,7 +688,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector( man = subghz_protocol_keeloq_common_secure_learning(fix, instance->seed, man_rev); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; kl_type = 3; return 1; @@ -699,7 +699,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector( fix, manufacture_code->key); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; kl_type = 4; return 1; @@ -709,7 +709,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector( man = subghz_protocol_keeloq_common_magic_xor_type1_learning(fix, man_rev); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; kl_type = 4; return 1; @@ -723,14 +723,14 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector( } else { for M_EACH(manufacture_code, *subghz_keystore_get_data(keystore), SubGhzKeyArray_t) { - res = strcmp(string_get_cstr(manufacture_code->name), mfname); + res = strcmp(furi_string_get_cstr(manufacture_code->name), mfname); if(res == 0) { switch(manufacture_code->type) { case KEELOQ_LEARNING_SIMPLE: // Simple Learning decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key); if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; return 1; } @@ -742,7 +742,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector( subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; return 1; } @@ -752,7 +752,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector( fix, instance->seed, manufacture_code->key); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; return 1; } @@ -762,7 +762,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector( fix, manufacture_code->key); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; return 1; } @@ -772,7 +772,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector( fix, manufacture_code->key); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; return 1; } @@ -781,7 +781,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector( // Simple Learning decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key); if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; kl_type = 1; return 1; @@ -795,7 +795,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector( } decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_rev); if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; kl_type = 1; return 1; @@ -807,7 +807,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector( subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; kl_type = 2; return 1; @@ -817,7 +817,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector( man = subghz_protocol_keeloq_common_normal_learning(fix, man_rev); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; kl_type = 2; return 1; @@ -828,7 +828,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector( fix, instance->seed, manufacture_code->key); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; kl_type = 3; return 1; @@ -839,7 +839,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector( fix, instance->seed, man_rev); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; kl_type = 3; return 1; @@ -850,7 +850,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector( fix, manufacture_code->key); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; kl_type = 4; return 1; @@ -860,7 +860,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector( man = subghz_protocol_keeloq_common_magic_xor_type1_learning(fix, man_rev); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; kl_type = 4; return 1; @@ -981,7 +981,7 @@ void subghz_protocol_decoder_keeloq_get_string(void* context, FuriString* output uint32_t code_found_reverse_lo = code_found_reverse & 0x00000000ffffffff; if(strcmp(instance->manufacture_name, "BFT") == 0) { - string_cat_printf( + furi_string_cat_printf( output, "%s %dbit\r\n" "Key:%08lX%08lX\r\n" @@ -999,7 +999,7 @@ void subghz_protocol_decoder_keeloq_get_string(void* context, FuriString* output instance->manufacture_name, instance->generic.seed); } else { - string_cat_printf( + furi_string_cat_printf( output, "%s %dbit\r\n" "Key:%08lX%08lX\r\n" diff --git a/lib/subghz/protocols/raw.c b/lib/subghz/protocols/raw.c index 2bfaa18b6..3af924ddc 100644 --- a/lib/subghz/protocols/raw.c +++ b/lib/subghz/protocols/raw.c @@ -254,7 +254,7 @@ void* subghz_protocol_decoder_raw_alloc(SubGhzEnvironment* environment) { instance->file_is_open = RAWFileIsOpenClose; instance->postroll_frames = 0; instance->rssi_threshold = SUBGHZ_AUTO_DETECT_RAW_THRESHOLD; - string_init(instance->file_name); + instance->file_name = furi_string_alloc(); return instance; } @@ -262,7 +262,7 @@ void* subghz_protocol_decoder_raw_alloc(SubGhzEnvironment* environment) { void subghz_protocol_decoder_raw_free(void* context) { furi_assert(context); SubGhzProtocolDecoderRAW* instance = context; - string_clear(instance->file_name); + furi_string_free(instance->file_name); if(instance->upload_raw != NULL) { free(instance->upload_raw); instance->upload_raw = NULL; @@ -352,12 +352,12 @@ uint8_t subghz_protocol_decoder_raw_get_hash_data(void* context) { &instance->decoder, (instance->decoder.decode_count_bit / 8) + 1); } -void subghz_protocol_decoder_raw_get_string(void* context, string_t output) { +void subghz_protocol_decoder_raw_get_string(void* context, FuriString* output) { furi_assert(context); //SubGhzProtocolDecoderRAW* instance = context; UNUSED(context); //ToDo no use - string_cat_printf(output, "RAW Data"); + furi_string_cat_printf(output, "RAW Data"); } void* subghz_protocol_encoder_raw_alloc(SubGhzEnvironment* environment) { @@ -443,8 +443,8 @@ bool subghz_protocol_decoder_raw_serialize( if(instance->auto_mode) { furi_assert(instance); bool res = false; - string_t temp_str; - string_init(temp_str); + FuriString* temp_str; + temp_str = furi_string_alloc(); do { stream_clean(flipper_format_get_raw_stream(flipper_format)); @@ -458,13 +458,13 @@ bool subghz_protocol_decoder_raw_serialize( FURI_LOG_E(TAG, "Unable to add Frequency"); break; } - subghz_block_generic_get_preset_name(string_get_cstr(preset->name), temp_str); + subghz_block_generic_get_preset_name(furi_string_get_cstr(preset->name), temp_str); if(!flipper_format_write_string_cstr( - flipper_format, "Preset", string_get_cstr(temp_str))) { + flipper_format, "Preset", furi_string_get_cstr(temp_str))) { FURI_LOG_E(TAG, "Unable to add Preset"); break; } - if(!strcmp(string_get_cstr(temp_str), "FuriHalSubGhzPresetCustom")) { + if(!strcmp(furi_string_get_cstr(temp_str), "FuriHalSubGhzPresetCustom")) { if(!flipper_format_write_string_cstr( flipper_format, "Custom_preset_module", "CC1101")) { FURI_LOG_E(TAG, "Unable to add Custom_preset_module"); @@ -491,7 +491,7 @@ bool subghz_protocol_decoder_raw_serialize( } res = true; } while(false); - string_clear(temp_str); + furi_string_free(temp_str); return res; } else { return false; diff --git a/lib/subghz/protocols/star_line.c b/lib/subghz/protocols/star_line.c index 7c69956bd..afb47cf0d 100644 --- a/lib/subghz/protocols/star_line.c +++ b/lib/subghz/protocols/star_line.c @@ -149,7 +149,7 @@ static bool } else { for M_EACH(manufacture_code, *subghz_keystore_get_data(instance->keystore), SubGhzKeyArray_t) { - res = strcmp(string_get_cstr(manufacture_code->name), instance->manufacture_name); + res = strcmp(furi_string_get_cstr(manufacture_code->name), instance->manufacture_name); if(res == 0) { switch(manufacture_code->type) { case KEELOQ_LEARNING_SIMPLE: @@ -487,7 +487,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector( // Simple Learning decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key); if(subghz_protocol_star_line_check_decrypt(instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; return 1; } @@ -499,7 +499,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector( subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning); if(subghz_protocol_star_line_check_decrypt(instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; return 1; } @@ -508,7 +508,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector( // Simple Learning decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key); if(subghz_protocol_star_line_check_decrypt(instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; kl_type = 1; return 1; @@ -522,7 +522,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector( } decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_rev); if(subghz_protocol_star_line_check_decrypt(instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; kl_type = 1; return 1; @@ -534,7 +534,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector( subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning); if(subghz_protocol_star_line_check_decrypt(instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; kl_type = 2; return 1; @@ -543,7 +543,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector( man_normal_learning = subghz_protocol_keeloq_common_normal_learning(fix, man_rev); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning); if(subghz_protocol_star_line_check_decrypt(instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; kl_type = 2; return 1; @@ -556,7 +556,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector( } else { for M_EACH(manufacture_code, *subghz_keystore_get_data(keystore), SubGhzKeyArray_t) { - res = strcmp(string_get_cstr(manufacture_code->name), mfname); + res = strcmp(furi_string_get_cstr(manufacture_code->name), mfname); if(res == 0) { switch(manufacture_code->type) { case KEELOQ_LEARNING_SIMPLE: @@ -564,7 +564,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector( decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key); if(subghz_protocol_star_line_check_decrypt( instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; return 1; } @@ -577,7 +577,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector( decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning); if(subghz_protocol_star_line_check_decrypt( instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; return 1; } @@ -587,7 +587,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector( decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key); if(subghz_protocol_star_line_check_decrypt( instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; kl_type = 1; return 1; @@ -602,7 +602,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector( decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_rev); if(subghz_protocol_star_line_check_decrypt( instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; kl_type = 1; return 1; @@ -615,7 +615,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector( decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning); if(subghz_protocol_star_line_check_decrypt( instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; kl_type = 2; return 1; @@ -627,7 +627,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector( decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning); if(subghz_protocol_star_line_check_decrypt( instance, decrypt, btn, end_serial)) { - *manufacture_name = string_get_cstr(manufacture_code->name); + *manufacture_name = furi_string_get_cstr(manufacture_code->name); mfname = *manufacture_name; kl_type = 2; return 1; diff --git a/lib/subghz/subghz_file_encoder_worker.c b/lib/subghz/subghz_file_encoder_worker.c index 84483272a..58545ea62 100644 --- a/lib/subghz/subghz_file_encoder_worker.c +++ b/lib/subghz/subghz_file_encoder_worker.c @@ -81,14 +81,14 @@ bool subghz_file_encoder_worker_data_parse(SubGhzFileEncoderWorker* instance, co void subghz_file_encoder_worker_get_text_progress( SubGhzFileEncoderWorker* instance, - string_t output) { + FuriString* output) { UNUSED(output); Stream* stream = flipper_format_get_raw_stream(instance->flipper_format); size_t total_size = stream_size(stream); size_t current_offset = stream_tell(stream); size_t buffer_avail = xStreamBufferBytesAvailable(instance->stream); - string_printf(output, "%03u%%", 100 * (current_offset - buffer_avail) / total_size); + furi_string_printf(output, "%03u%%", 100 * (current_offset - buffer_avail) / total_size); } LevelDuration subghz_file_encoder_worker_get_level_duration(void* context) { diff --git a/lib/subghz/subghz_file_encoder_worker.h b/lib/subghz/subghz_file_encoder_worker.h index e7280a636..19a46f1e6 100644 --- a/lib/subghz/subghz_file_encoder_worker.h +++ b/lib/subghz/subghz_file_encoder_worker.h @@ -35,7 +35,7 @@ void subghz_file_encoder_worker_free(SubGhzFileEncoderWorker* instance); */ void subghz_file_encoder_worker_get_text_progress( SubGhzFileEncoderWorker* instance, - string_t output); + FuriString* output); /** * Getting the level and duration of the upload to be loaded into DMA.