1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-13 13:09:49 +04:00
This commit is contained in:
MX
2022-10-05 21:27:13 +03:00
parent 0796263e81
commit c60bfbf271
75 changed files with 936 additions and 917 deletions

View File

@@ -21,7 +21,7 @@ static void archive_tick_event_callback(void* context) {
static ArchiveApp* archive_alloc() { static ArchiveApp* archive_alloc() {
ArchiveApp* archive = malloc(sizeof(ArchiveApp)); 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->scene_manager = scene_manager_alloc(&archive_scene_handlers, archive);
archive->view_dispatcher = view_dispatcher_alloc(); archive->view_dispatcher = view_dispatcher_alloc();

View File

@@ -36,7 +36,7 @@ struct ArchiveApp {
Loading* loading; Loading* loading;
FuriPubSubSubscription* loader_stop_subscription; FuriPubSubSubscription* loader_stop_subscription;
string_t fav_move_str; FuriString* fav_move_str;
char text_store[MAX_NAME_LEN]; char text_store[MAX_NAME_LEN];
char file_extension[MAX_EXT_LEN + 1]; char file_extension[MAX_EXT_LEN + 1];
}; };

View File

@@ -1,34 +1,33 @@
#pragma once #pragma once
#include <m-array.h> #include <m-array.h>
#include <m-string.h>
typedef struct { typedef struct {
string_t text; FuriString* text;
uint32_t event; uint32_t event;
} ArchiveContextMenuItem_t; } ArchiveContextMenuItem_t;
static void ArchiveContextMenuItem_t_init(ArchiveContextMenuItem_t* obj) { static void ArchiveContextMenuItem_t_init(ArchiveContextMenuItem_t* obj) {
string_init(obj->text); obj->text = furi_string_alloc();
obj->event = 0; // ArchiveBrowserEventFileMenuNone obj->event = 0; // ArchiveBrowserEventFileMenuNone
} }
static void ArchiveContextMenuItem_t_init_set( static void ArchiveContextMenuItem_t_init_set(
ArchiveContextMenuItem_t* obj, ArchiveContextMenuItem_t* obj,
const ArchiveContextMenuItem_t* src) { const ArchiveContextMenuItem_t* src) {
string_init_set(obj->text, src->text); obj->text = furi_string_alloc_set(src->text);
obj->event = src->event; obj->event = src->event;
} }
static void ArchiveContextMenuItem_t_set( static void ArchiveContextMenuItem_t_set(
ArchiveContextMenuItem_t* obj, ArchiveContextMenuItem_t* obj,
const ArchiveContextMenuItem_t* src) { const ArchiveContextMenuItem_t* src) {
string_init_set(obj->text, src->text); obj->text = furi_string_alloc_set(src->text);
obj->event = src->event; obj->event = src->event;
} }
static void ArchiveContextMenuItem_t_clear(ArchiveContextMenuItem_t* obj) { static void ArchiveContextMenuItem_t_clear(ArchiveContextMenuItem_t* obj) {
string_clear(obj->text); furi_string_free(obj->text);
} }
ARRAY_DEF( ARRAY_DEF(
@@ -42,8 +41,9 @@ ARRAY_DEF(
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function" #pragma GCC diagnostic ignored "-Wunused-function"
// Using in applications/archive/views/archive_browser_view.c // Using in applications/archive/views/archive_browser_view.c
static void archive_menu_add_item(ArchiveContextMenuItem_t* obj, string_t text, uint32_t event) { static void
string_init_move(obj->text, text); archive_menu_add_item(ArchiveContextMenuItem_t* obj, FuriString* text, uint32_t event) {
obj->text = furi_string_alloc_move(text);
obj->event = event; obj->event = event;
} }
#pragma GCC diagnostic pop #pragma GCC diagnostic pop

View File

@@ -18,12 +18,12 @@ void archive_scene_info_on_enter(void* context) {
widget_add_button_element( widget_add_button_element(
instance->widget, GuiButtonTypeLeft, "Back", archive_scene_info_widget_callback, instance); instance->widget, GuiButtonTypeLeft, "Back", archive_scene_info_widget_callback, instance);
string_t filename; FuriString* filename;
string_t dirname; FuriString* dirname;
string_t str_size; FuriString* str_size;
string_init(filename); filename = furi_string_alloc();
string_init(dirname); dirname = furi_string_alloc();
string_init(str_size); str_size = furi_string_alloc();
ArchiveFile_t* current = archive_get_current_file(instance->browser); ArchiveFile_t* current = archive_get_current_file(instance->browser);
char file_info_message[128]; char file_info_message[128];
@@ -31,48 +31,49 @@ void archive_scene_info_on_enter(void* context) {
// Filename // Filename
path_extract_filename(current->path, filename, false); 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( widget_add_text_box_element(
instance->widget, 0, 0, 128, 25, AlignLeft, AlignCenter, file_info_message, false); instance->widget, 0, 0, 128, 25, AlignLeft, AlignCenter, file_info_message, false);
// Directory path // Directory path
path_extract_dirname(string_get_cstr(current->path), dirname); path_extract_dirname(furi_string_get_cstr(current->path), dirname);
if(strcmp(string_get_cstr(dirname), "/any") == 0) { if(strcmp(furi_string_get_cstr(dirname), "/any") == 0) {
string_replace_str(dirname, STORAGE_ANY_PATH_PREFIX, "/"); furi_string_replace(dirname, STORAGE_ANY_PATH_PREFIX, "/");
} else { } else {
string_replace_str(dirname, STORAGE_ANY_PATH_PREFIX, ""); furi_string_replace(dirname, STORAGE_ANY_PATH_PREFIX, "");
} }
// File size // File size
FileInfo fileinfo; 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) { if(fileinfo.size <= 1024) {
string_printf(str_size, "%d", fileinfo.size); furi_string_printf(str_size, "%d", fileinfo.size);
snprintf( snprintf(
file_info_message, file_info_message,
sizeof(file_info_message), sizeof(file_info_message),
"Size: \e#%s\e# bytes\n%s", "Size: \e#%s\e# bytes\n%s",
string_get_cstr(str_size), furi_string_get_cstr(str_size),
string_get_cstr(dirname)); furi_string_get_cstr(dirname));
} else { } else {
string_printf(str_size, "%d", fileinfo.size / 1024); furi_string_printf(str_size, "%d", fileinfo.size / 1024);
snprintf( snprintf(
file_info_message, file_info_message,
sizeof(file_info_message), sizeof(file_info_message),
"Size: \e#%s\e# Kb.\n%s", "Size: \e#%s\e# Kb.\n%s",
string_get_cstr(str_size), furi_string_get_cstr(str_size),
string_get_cstr(dirname)); furi_string_get_cstr(dirname));
} }
widget_add_text_box_element( widget_add_text_box_element(
instance->widget, 0, 25, 128, 25, AlignLeft, AlignCenter, file_info_message, true); instance->widget, 0, 25, 128, 25, AlignLeft, AlignCenter, file_info_message, true);
// This one to return and cursor select this file // This one to return and cursor select this file
path_extract_filename_no_ext(string_get_cstr(current->path), filename); path_extract_filename_no_ext(furi_string_get_cstr(current->path), filename);
strlcpy(instance->text_store, string_get_cstr(filename), MAX_NAME_LEN); strlcpy(instance->text_store, furi_string_get_cstr(filename), MAX_NAME_LEN);
string_clear(filename); furi_string_free(filename);
string_clear(dirname); furi_string_free(dirname);
string_clear(str_size); furi_string_free(str_size);
view_dispatcher_switch_to_view(instance->view_dispatcher, ArchiveViewWidget); view_dispatcher_switch_to_view(instance->view_dispatcher, ArchiveViewWidget);
} }

View File

@@ -22,22 +22,22 @@ void archive_scene_rename_on_enter(void* context) {
TextInput* text_input = archive->text_input; TextInput* text_input = archive->text_input;
ArchiveFile_t* current = archive_get_current_file(archive->browser); ArchiveFile_t* current = archive_get_current_file(archive->browser);
string_t path_name; FuriString* path_name;
string_init(path_name); path_name = furi_string_alloc();
if(current->type == ArchiveFileTypeFolder) { if(current->type == ArchiveFileTypeFolder) {
path_extract_basename(string_get_cstr(current->path), path_name); path_extract_basename(furi_string_get_cstr(current->path), path_name);
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 directory:"); text_input_set_header_text(text_input, "Rename directory:");
} else /*if(current->type != ArchiveFileTypeUnknown) */ { } else /*if(current->type != ArchiveFileTypeUnknown) */ {
path_extract_filename(current->path, path_name, true); 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); path_extract_extension(current->path, archive->file_extension, MAX_EXT_LEN);
text_input_set_header_text(text_input, "Rename file:"); text_input_set_header_text(text_input, "Rename file:");
} /*else { } /*else {
path_extract_filename(current->path, path_name, false); 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:"); 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, MAX_TEXT_INPUT_LEN,
false); false);
string_clear(path_name); furi_string_free(path_name);
view_dispatcher_switch_to_view(archive->view_dispatcher, ArchiveViewTextInput); 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); const char* path_src = archive_get_name(archive->browser);
ArchiveFile_t* file = archive_get_current_file(archive->browser); ArchiveFile_t* file = archive_get_current_file(archive->browser);
string_t path_dst; FuriString* path_dst;
string_init(path_dst); path_dst = furi_string_alloc();
if(file->type == ArchiveFileTypeFolder) { if(file->type == ArchiveFileTypeFolder) {
// Rename folder/dir // Rename folder/dir
path_extract_dirname(path_src, path_dst); 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) { } else if(file->type != ArchiveFileTypeUnknown) {
// Rename known type // Rename known type
path_extract_dirname(path_src, path_dst); 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 { } else {
// Rename unknown type // Rename unknown type
path_extract_dirname(path_src, path_dst); 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 // Long time process if this is directory
view_dispatcher_switch_to_view(archive->view_dispatcher, ArchiveViewStack); view_dispatcher_switch_to_view(archive->view_dispatcher, ArchiveViewStack);
archive_show_loading_popup(archive, true); archive_show_loading_popup(archive, true);
FS_Error error = FS_Error error = archive_rename_file_or_dir(
archive_rename_file_or_dir(archive->browser, path_src, string_get_cstr(path_dst)); archive->browser, path_src, furi_string_get_cstr(path_dst));
archive_show_loading_popup(archive, false); archive_show_loading_popup(archive, false);
archive_show_file_menu(archive->browser, 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) { if(error == FSE_OK || error == FSE_EXIST) {
scene_manager_next_scene(archive->scene_manager, ArchiveAppSceneBrowser); scene_manager_next_scene(archive->scene_manager, ArchiveAppSceneBrowser);
} else { } else {
string_t dialog_msg; FuriString* dialog_msg;
string_init(dialog_msg); dialog_msg = furi_string_alloc();
string_cat_printf(dialog_msg, "Cannot rename\nCode: %d", error); furi_string_cat_printf(dialog_msg, "Cannot rename\nCode: %d", error);
dialog_message_show_storage_error(archive->dialogs, string_get_cstr(dialog_msg)); dialog_message_show_storage_error(
string_clear(dialog_msg); archive->dialogs, furi_string_get_cstr(dialog_msg));
furi_string_free(dialog_msg);
} }
consumed = true; consumed = true;
} }

View File

@@ -48,24 +48,24 @@ void archive_browser_set_callback(
static void render_item_menu(Canvas* canvas, ArchiveBrowserViewModel* model) { static void render_item_menu(Canvas* canvas, ArchiveBrowserViewModel* model) {
if(menu_array_size(model->context_menu) == 0) { if(menu_array_size(model->context_menu) == 0) {
// Context menu is empty, init array // Context menu is empty, init array
string_t item_run; FuriString* item_run;
string_t item_pin; FuriString* item_pin;
string_t item_info; FuriString* item_info;
string_t item_rename; FuriString* item_rename;
string_t item_delete; FuriString* item_delete;
string_init_set_str(item_run, "Run In App"); item_run = furi_string_alloc_set("Run In App");
string_init_set_str(item_pin, "Pin"); item_pin = furi_string_alloc_set("Pin");
string_init_set_str(item_info, "Info"); item_info = furi_string_alloc_set("Info");
string_init_set_str(item_rename, "Rename"); item_rename = furi_string_alloc_set("Rename");
string_init_set_str(item_delete, "Delete"); item_delete = furi_string_alloc_set("Delete");
// Need init context menu // Need init context menu
ArchiveFile_t* selected = ArchiveFile_t* selected =
files_array_get(model->files, model->item_idx - model->array_offset); files_array_get(model->files, model->item_idx - model->array_offset);
if((selected->fav) || (model->tab_idx == ArchiveTabFavorites)) { if((selected->fav) || (model->tab_idx == ArchiveTabFavorites)) {
string_set_str(item_pin, "Unpin"); furi_string_set(item_pin, "Unpin");
} }
if(selected->type == ArchiveFileTypeFolder) { if(selected->type == ArchiveFileTypeFolder) {
@@ -96,7 +96,7 @@ static void render_item_menu(Canvas* canvas, ArchiveBrowserViewModel* model) {
} else if(model->tab_idx == ArchiveTabFavorites) { } else if(model->tab_idx == ArchiveTabFavorites) {
//FURI_LOG_D(TAG, "ArchiveTabFavorites"); //FURI_LOG_D(TAG, "ArchiveTabFavorites");
string_set_str(item_rename, "Move"); furi_string_set(item_rename, "Move");
archive_menu_add_item( archive_menu_add_item(
menu_array_push_raw(model->context_menu), menu_array_push_raw(model->context_menu),
@@ -152,11 +152,11 @@ static void render_item_menu(Canvas* canvas, ArchiveBrowserViewModel* model) {
ArchiveBrowserEventFileMenuDelete); ArchiveBrowserEventFileMenuDelete);
} }
string_clear(item_run); furi_string_free(item_run);
string_clear(item_pin); furi_string_free(item_pin);
string_clear(item_info); furi_string_free(item_info);
string_clear(item_rename); furi_string_free(item_rename);
string_clear(item_delete); furi_string_free(item_delete);
} /*else { } /*else {
FURI_LOG_D(TAG, "menu_array_size already set: %d", menu_array_size(model->context_menu)); 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);*/ model->menu_idx);*/
for(size_t i = 0; i < size_menu; i++) { for(size_t i = 0; i < size_menu; i++) {
ArchiveContextMenuItem_t* current = menu_array_get(model->context_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); canvas_draw_icon(canvas, 74, 14 + model->menu_idx * line_height, &I_ButtonRight_4x7);

View File

@@ -1,6 +1,5 @@
#include "bad_usb_app_i.h" #include "bad_usb_app_i.h"
#include "bad_usb_settings_filename.h" #include "bad_usb_settings_filename.h"
#include "m-string.h"
#include <furi.h> #include <furi.h>
#include <furi_hal.h> #include <furi_hal.h>
#include <storage/storage.h> #include <storage/storage.h>
@@ -32,7 +31,7 @@ static void bad_usb_load_settings(BadUsbApp* app) {
char chr; char chr;
while((storage_file_read(settings_file, &chr, 1) == 1) && while((storage_file_read(settings_file, &chr, 1) == 1) &&
!storage_file_eof(settings_file) && !isspace(chr)) { !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); 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)) { if(storage_file_open(settings_file, BAD_USB_SETTINGS_PATH, FSAM_WRITE, FSOM_OPEN_ALWAYS)) {
storage_file_write( storage_file_write(
settings_file, settings_file,
string_get_cstr(app->keyboard_layout), furi_string_get_cstr(app->keyboard_layout),
string_size(app->keyboard_layout)); furi_string_size(app->keyboard_layout));
storage_file_write(settings_file, "\n", 1); storage_file_write(settings_file, "\n", 1);
} }
storage_file_close(settings_file); storage_file_close(settings_file);
@@ -57,8 +56,8 @@ BadUsbApp* bad_usb_app_alloc(char* arg) {
app->bad_usb_script = NULL; app->bad_usb_script = NULL;
string_init(app->file_path); app->file_path = furi_string_alloc();
string_init(app->keyboard_layout); app->keyboard_layout = furi_string_alloc();
if(arg && strlen(arg)) { if(arg && strlen(arg)) {
furi_string_set(app->file_path, arg); furi_string_set(app->file_path, arg);
} }
@@ -101,12 +100,12 @@ BadUsbApp* bad_usb_app_alloc(char* arg) {
app->error = BadUsbAppErrorCloseRpc; app->error = BadUsbAppErrorCloseRpc;
scene_manager_next_scene(app->scene_manager, BadUsbSceneError); scene_manager_next_scene(app->scene_manager, BadUsbSceneError);
} else { } 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); app->bad_usb_script = bad_usb_script_open(app->file_path);
bad_usb_script_set_keyboard_layout(app->bad_usb_script, app->keyboard_layout); bad_usb_script_set_keyboard_layout(app->bad_usb_script, app->keyboard_layout);
scene_manager_next_scene(app->scene_manager, BadUsbSceneWork); scene_manager_next_scene(app->scene_manager, BadUsbSceneWork);
} else { } 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); scene_manager_next_scene(app->scene_manager, BadUsbSceneFileSelect);
} }
} }
@@ -145,8 +144,8 @@ void bad_usb_app_free(BadUsbApp* app) {
bad_usb_save_settings(app); bad_usb_save_settings(app);
string_clear(app->file_path); furi_string_free(app->file_path);
string_clear(app->keyboard_layout); furi_string_free(app->keyboard_layout);
free(app); free(app);
} }

View File

@@ -34,8 +34,8 @@ struct BadUsbApp {
Submenu* submenu; Submenu* submenu;
BadUsbAppError error; BadUsbAppError error;
string_t file_path; FuriString* file_path;
string_t keyboard_layout; FuriString* keyboard_layout;
BadUsb* bad_usb_view; BadUsb* bad_usb_view;
BadUsbScript* bad_usb_script; BadUsbScript* bad_usb_script;
}; };

View File

@@ -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))); 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); furi_assert(file_path);
BadUsbScript* bad_usb = malloc(sizeof(BadUsbScript)); BadUsbScript* bad_usb = malloc(sizeof(BadUsbScript));
string_init(bad_usb->file_path); bad_usb->file_path = furi_string_alloc();
string_set(bad_usb->file_path, file_path); furi_string_set(bad_usb->file_path, file_path);
bad_usb_script_set_default_keyboard_layout(bad_usb); bad_usb_script_set_default_keyboard_layout(bad_usb);
bad_usb->st.state = BadUsbStateInit; bad_usb->st.state = BadUsbStateInit;
@@ -629,7 +629,7 @@ void bad_usb_script_close(BadUsbScript* bad_usb) {
free(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); furi_assert(bad_usb);
if((bad_usb->st.state == BadUsbStateRunning) || (bad_usb->st.state == BadUsbStateDelay)) { 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)); 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( 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]; uint16_t layout[128];
if(storage_file_read(layout_file, layout, sizeof(layout)) == sizeof(layout)) { if(storage_file_read(layout_file, layout, sizeof(layout)) == sizeof(layout)) {
memcpy(bad_usb->layout, layout, sizeof(layout)); memcpy(bad_usb->layout, layout, sizeof(layout));

View File

@@ -31,7 +31,7 @@ BadUsbScript* bad_usb_script_open(FuriString* file_path);
void bad_usb_script_close(BadUsbScript* bad_usb); 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); void bad_usb_script_start(BadUsbScript* bad_usb);

View File

@@ -6,12 +6,12 @@
static bool bad_usb_layout_select(BadUsbApp* bad_usb) { static bool bad_usb_layout_select(BadUsbApp* bad_usb) {
furi_assert(bad_usb); furi_assert(bad_usb);
string_t predefined_path; FuriString* predefined_path;
string_init(predefined_path); predefined_path = furi_string_alloc();
if(!string_empty_p(bad_usb->keyboard_layout)) { if(!furi_string_empty(bad_usb->keyboard_layout)) {
string_set(predefined_path, bad_usb->keyboard_layout); furi_string_set(predefined_path, bad_usb->keyboard_layout);
} else { } 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; DialogsFileBrowserOptions browser_options;
@@ -22,7 +22,7 @@ static bool bad_usb_layout_select(BadUsbApp* bad_usb) {
bool res = dialog_file_browser_show( bool res = dialog_file_browser_show(
bad_usb->dialogs, bad_usb->keyboard_layout, predefined_path, &browser_options); bad_usb->dialogs, bad_usb->keyboard_layout, predefined_path, &browser_options);
string_clear(predefined_path); furi_string_free(predefined_path);
return res; return res;
} }

View File

@@ -31,17 +31,17 @@ bool bad_usb_scene_work_on_event(void* context, SceneManagerEvent event) {
void bad_usb_scene_work_on_enter(void* context) { void bad_usb_scene_work_on_enter(void* context) {
BadUsbApp* app = context; BadUsbApp* app = context;
string_t file_name; FuriString* file_name;
string_init(file_name); file_name = furi_string_alloc();
path_extract_filename(app->file_path, file_name, true); path_extract_filename(app->file_path, file_name, true);
bad_usb_set_file_name(app->bad_usb_view, string_get_cstr(file_name)); bad_usb_set_file_name(app->bad_usb_view, furi_string_get_cstr(file_name));
string_clear(file_name); furi_string_free(file_name);
string_t layout; FuriString* layout;
string_init(layout); layout = furi_string_alloc();
path_extract_filename(app->keyboard_layout, layout, true); path_extract_filename(app->keyboard_layout, layout, true);
bad_usb_set_layout(app->bad_usb_view, string_get_cstr(layout)); bad_usb_set_layout(app->bad_usb_view, furi_string_get_cstr(layout));
string_clear(layout); furi_string_free(layout);
bad_usb_set_state(app->bad_usb_view, bad_usb_script_get_state(app->bad_usb_script)); bad_usb_set_state(app->bad_usb_view, bad_usb_script_get_state(app->bad_usb_script));

View File

@@ -25,21 +25,22 @@ static void bad_usb_draw_callback(Canvas* canvas, void* _model) {
disp_str = furi_string_alloc_set(model->file_name); disp_str = furi_string_alloc_set(model->file_name);
elements_string_fit_width(canvas, disp_str, 128 - 2); elements_string_fit_width(canvas, disp_str, 128 - 2);
canvas_set_font(canvas, FontSecondary); 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) { if(strlen(model->layout) == 0) {
string_set(disp_str, "(default)"); furi_string_set(disp_str, "(default)");
} else { } else {
string_reset(disp_str); furi_string_reset(disp_str);
string_push_back(disp_str, '('); furi_string_push_back(disp_str, '(');
for(size_t i = 0; i < strlen(model->layout); i++) for(size_t i = 0; i < strlen(model->layout); i++)
string_push_back(disp_str, model->layout[i]); furi_string_push_back(disp_str, model->layout[i]);
string_push_back(disp_str, ')'); furi_string_push_back(disp_str, ')');
} }
elements_string_fit_width(canvas, disp_str, 128 - 2); 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); 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( furi_string_printf(
disp_str, "%u", ((model->state.line_cur - 1) * 100) / model->state.line_nb); disp_str, "%u", ((model->state.line_cur - 1) * 100) / model->state.line_nb);
canvas_draw_str_aligned( canvas_draw_str_aligned(
canvas, 114, 40, AlignRight, AlignBottom, string_get_cstr(disp_str)); canvas, 114, 40, AlignRight, AlignBottom, furi_string_get_cstr(disp_str));
string_reset(disp_str); furi_string_reset(disp_str);
canvas_draw_icon(canvas, 117, 26, &I_Percent_10x14); canvas_draw_icon(canvas, 117, 26, &I_Percent_10x14);
} else if(model->state.state == BadUsbStateDone) { } else if(model->state.state == BadUsbStateDone) {
canvas_draw_icon(canvas, 4, 23, &I_EviSmile1_18x21); canvas_draw_icon(canvas, 4, 23, &I_EviSmile1_18x21);
canvas_set_font(canvas, FontBigNumbers); canvas_set_font(canvas, FontBigNumbers);
canvas_draw_str_aligned(canvas, 114, 40, AlignRight, AlignBottom, "100"); 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); canvas_draw_icon(canvas, 117, 26, &I_Percent_10x14);
} else if(model->state.state == BadUsbStateDelay) { } else if(model->state.state == BadUsbStateDelay) {
if(model->anim_frame == 0) { if(model->anim_frame == 0) {
@@ -107,14 +108,14 @@ static void bad_usb_draw_callback(Canvas* canvas, void* _model) {
furi_string_printf( furi_string_printf(
disp_str, "%u", ((model->state.line_cur - 1) * 100) / model->state.line_nb); disp_str, "%u", ((model->state.line_cur - 1) * 100) / model->state.line_nb);
canvas_draw_str_aligned( canvas_draw_str_aligned(
canvas, 114, 40, AlignRight, AlignBottom, string_get_cstr(disp_str)); canvas, 114, 40, AlignRight, AlignBottom, furi_string_get_cstr(disp_str));
string_reset(disp_str); furi_string_reset(disp_str);
canvas_draw_icon(canvas, 117, 26, &I_Percent_10x14); canvas_draw_icon(canvas, 117, 26, &I_Percent_10x14);
canvas_set_font(canvas, FontSecondary); canvas_set_font(canvas, FontSecondary);
furi_string_printf(disp_str, "delay %us", model->state.delay_remain); furi_string_printf(disp_str, "delay %us", model->state.delay_remain);
canvas_draw_str_aligned( canvas_draw_str_aligned(
canvas, 127, 50, AlignRight, AlignBottom, string_get_cstr(disp_str)); canvas, 127, 50, AlignRight, AlignBottom, furi_string_get_cstr(disp_str));
string_reset(disp_str); furi_string_reset(disp_str);
} else { } else {
canvas_draw_icon(canvas, 4, 26, &I_Clock_18x18); canvas_draw_icon(canvas, 4, 26, &I_Clock_18x18);
} }

View File

@@ -34,7 +34,7 @@ void lfrfid_scene_raw_info_on_enter(void* context) {
} }
view_dispatcher_switch_to_view(app->view_dispatcher, LfRfidViewWidget); 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) { bool lfrfid_scene_raw_info_on_event(void* context, SceneManagerEvent event) {

View File

@@ -17,7 +17,7 @@ void lfrfid_scene_read_success_on_enter(void* context) {
protocol_dict_get_manufacturer(app->dict, app->protocol_id)); protocol_dict_get_manufacturer(app->dict, app->protocol_id));
widget_add_string_element( 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); furi_string_reset(tmp_string);
size_t size = protocol_dict_get_data_size(app->dict, app->protocol_id); 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; break;
} else { } else {
if(i != 0) { if(i != 0) {
string_cat_printf(tmp_string, ":"); furi_string_cat_printf(tmp_string, ":");
} }
furi_string_cat_printf(tmp_string, "%02X", data[i]); furi_string_cat_printf(tmp_string, "%02X", data[i]);
} }

View File

@@ -21,8 +21,7 @@ void lfrfid_scene_save_type_on_enter(void* context) {
protocol_dict_get_manufacturer(app->dict, i), protocol_dict_get_manufacturer(app->dict, i),
protocol_dict_get_name(app->dict, i)) != 0) && protocol_dict_get_name(app->dict, i)) != 0) &&
(strcmp(protocol_dict_get_manufacturer(app->dict, i), "N/A") != 0)) { (strcmp(protocol_dict_get_manufacturer(app->dict, i), "N/A") != 0)) {
string_init_printf( state->menu_item_name[i] = furi_string_alloc_printf(
state->menu_item_name[i],
"%s %s", "%s %s",
protocol_dict_get_manufacturer(app->dict, i), protocol_dict_get_manufacturer(app->dict, i),
protocol_dict_get_name(app->dict, i)); protocol_dict_get_name(app->dict, i));

View File

@@ -18,7 +18,7 @@ void lfrfid_scene_saved_info_on_enter(void* context) {
protocol_dict_get_data(app->dict, app->protocol_id, data, size); protocol_dict_get_data(app->dict, app->protocol_id, data, size);
for(uint8_t i = 0; i < size; i++) { for(uint8_t i = 0; i < size; i++) {
if(i != 0) { if(i != 0) {
string_cat_printf(tmp_string, ":"); furi_string_cat_printf(tmp_string, ":");
} }
furi_string_cat_printf(tmp_string, "%02X", data[i]); furi_string_cat_printf(tmp_string, "%02X", data[i]);

View File

@@ -15,8 +15,8 @@ void nfc_scene_mfkey_nonces_info_on_enter(void* context) {
temp_str = furi_string_alloc(); temp_str = furi_string_alloc();
uint16_t nonces_saved = mfkey32_get_auth_sectors(temp_str); 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)); widget_add_text_scroll_element(nfc->widget, 0, 22, 128, 42, furi_string_get_cstr(temp_str));
string_printf(temp_str, "Nonce pairs saved %d", nonces_saved); furi_string_printf(temp_str, "Nonce pairs saved %d", nonces_saved);
widget_add_string_element( widget_add_string_element(
nfc->widget, 0, 0, AlignLeft, AlignTop, FontPrimary, furi_string_get_cstr(temp_str)); nfc->widget, 0, 0, AlignLeft, AlignTop, FontPrimary, furi_string_get_cstr(temp_str));
widget_add_string_element( widget_add_string_element(

View File

@@ -33,30 +33,30 @@ SubGhzFileEncoderWorker* file_worker_encoder;
static void subghz_scene_receiver_update_statusbar(void* context) { static void subghz_scene_receiver_update_statusbar(void* context) {
SubGhz* subghz = context; SubGhz* subghz = context;
string_t history_stat_str; FuriString* history_stat_str;
string_init(history_stat_str); history_stat_str = furi_string_alloc();
if(!subghz_history_get_text_space_left(subghz->txrx->history, history_stat_str)) { if(!subghz_history_get_text_space_left(subghz->txrx->history, history_stat_str)) {
string_t frequency_str; FuriString* frequency_str;
string_t modulation_str; FuriString* modulation_str;
string_init(frequency_str); frequency_str = furi_string_alloc();
string_init(modulation_str); modulation_str = furi_string_alloc();
subghz_get_frequency_modulation(subghz, frequency_str, modulation_str); subghz_get_frequency_modulation(subghz, frequency_str, modulation_str);
subghz_view_receiver_add_data_statusbar( subghz_view_receiver_add_data_statusbar(
subghz->subghz_receiver, subghz->subghz_receiver,
string_get_cstr(frequency_str), furi_string_get_cstr(frequency_str),
string_get_cstr(modulation_str), furi_string_get_cstr(modulation_str),
string_get_cstr(history_stat_str)); furi_string_get_cstr(history_stat_str));
string_clear(frequency_str); furi_string_free(frequency_str);
string_clear(modulation_str); furi_string_free(modulation_str);
} else { } else {
subghz_view_receiver_add_data_statusbar( 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) { void subghz_scene_decode_raw_callback(SubGhzCustomEvent event, void* context) {
@@ -71,11 +71,11 @@ static void subghz_scene_add_to_history_callback(
void* context) { void* context) {
furi_assert(context); furi_assert(context);
SubGhz* subghz = context; SubGhz* subghz = context;
string_t str_buff; FuriString* str_buff;
string_init(str_buff); str_buff = furi_string_alloc();
if(subghz_history_add_to_history(subghz->txrx->history, decoder_base, subghz->txrx->preset)) { 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; 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->txrx->history, str_buff, subghz_history_get_item(subghz->txrx->history) - 1);
subghz_view_receiver_add_item_to_menu( subghz_view_receiver_add_item_to_menu(
subghz->subghz_receiver, subghz->subghz_receiver,
string_get_cstr(str_buff), furi_string_get_cstr(str_buff),
subghz_history_get_type_protocol( subghz_history_get_type_protocol(
subghz->txrx->history, subghz_history_get_item(subghz->txrx->history) - 1)); subghz->txrx->history, subghz_history_get_item(subghz->txrx->history) - 1));
subghz_scene_receiver_update_statusbar(subghz); subghz_scene_receiver_update_statusbar(subghz);
} }
subghz_receiver_reset(receiver); subghz_receiver_reset(receiver);
string_clear(str_buff); furi_string_free(str_buff);
} }
bool subghz_scene_decode_raw_start(SubGhz* subghz) { bool subghz_scene_decode_raw_start(SubGhz* subghz) {
string_t file_name; FuriString* file_name;
string_init(file_name); file_name = furi_string_alloc();
bool success = false; bool success = false;
do { do {
if(!flipper_format_rewind(subghz->txrx->fff_data)) { if(!flipper_format_rewind(subghz->txrx->fff_data)) {
@@ -112,10 +112,10 @@ bool subghz_scene_decode_raw_start(SubGhz* subghz) {
} while(false); } while(false);
if(success) { 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(); 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 //the worker needs a file in order to open and read part of the file
furi_delay_ms(100); furi_delay_ms(100);
} else { } else {
@@ -127,7 +127,7 @@ bool subghz_scene_decode_raw_start(SubGhz* subghz) {
} }
} }
string_clear(file_name); furi_string_free(file_name);
return success; return success;
} }
@@ -150,13 +150,14 @@ bool subghz_scene_decode_raw_next(SubGhz* subghz) {
} }
// Update progress info // Update progress info
string_t progress_str; FuriString* progress_str;
string_init(progress_str); progress_str = furi_string_alloc();
subghz_file_encoder_worker_get_text_progress(file_worker_encoder, progress_str); 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 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) { void subghz_scene_decode_raw_on_enter(void* context) {
SubGhz* subghz = context; SubGhz* subghz = context;
string_t str_buff; FuriString* str_buff;
string_init(str_buff); str_buff = furi_string_alloc();
subghz_view_receiver_set_lock(subghz->subghz_receiver, subghz->lock); subghz_view_receiver_set_lock(subghz->subghz_receiver, subghz->lock);
subghz_view_receiver_set_mode(subghz->subghz_receiver, SubGhzViewReceiverModeFile); 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 //Load history to receiver
subghz_view_receiver_exit(subghz->subghz_receiver); subghz_view_receiver_exit(subghz->subghz_receiver);
for(uint8_t i = 0; i < subghz_history_get_item(subghz->txrx->history); i++) { 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_history_get_text_item_menu(subghz->txrx->history, str_buff, i);
subghz_view_receiver_add_item_to_menu( subghz_view_receiver_add_item_to_menu(
subghz->subghz_receiver, subghz->subghz_receiver,
string_get_cstr(str_buff), furi_string_get_cstr(str_buff),
subghz_history_get_type_protocol(subghz->txrx->history, i)); 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); subghz_view_receiver_set_idx_menu(subghz->subghz_receiver, subghz->txrx->idx_menu_chosen);
} }

View File

@@ -160,7 +160,7 @@ bool subghz_scene_receiver_info_on_event(void* context, SceneManagerEvent event)
subghz_begin( subghz_begin(
subghz, subghz,
subghz_setting_get_preset_data_by_name( 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); subghz_rx(subghz, subghz->txrx->preset->frequency);
} }
if(subghz->txrx->hopper_state == SubGhzHopperStatePause) { if(subghz->txrx->hopper_state == SubGhzHopperStatePause) {

View File

@@ -13,10 +13,10 @@ void subghz_scene_save_name_text_input_callback(void* context) {
view_dispatcher_send_custom_event(subghz->view_dispatcher, SubGhzCustomEventSceneSaveName); 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}; FuriHalRtcDateTime datetime = {0};
furi_hal_rtc_get_datetime(&datetime); furi_hal_rtc_get_datetime(&datetime);
string_printf( furi_string_printf(
name, name,
"RAW_%.4d.%.2d.%.2d-%.2d.%.2d.%.2d-%d.%.2dMHz", "RAW_%.4d.%.2d.%.2d-%.2d.%.2d.%.2d-%d.%.2dMHz",
datetime.year, datetime.year,

View File

@@ -75,7 +75,7 @@ bool subghz_scene_set_seed_bft_on_event(void* context, SceneManagerEvent event)
subghz_transmitter_free(subghz->txrx->transmitter); subghz_transmitter_free(subghz->txrx->transmitter);
if(!generated_protocol) { if(!generated_protocol) {
string_set_str( furi_string_set(
subghz->error_str, "Function requires\nan SD card with\nfresh databases."); subghz->error_str, "Function requires\nan SD card with\nfresh databases.");
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneShowError); scene_manager_next_scene(subghz->scene_manager, SubGhzSceneShowError);
} }

View File

@@ -75,7 +75,7 @@ bool subghz_scene_set_seed_faac_433_on_event(void* context, SceneManagerEvent ev
subghz_transmitter_free(subghz->txrx->transmitter); subghz_transmitter_free(subghz->txrx->transmitter);
if(!generated_protocol) { if(!generated_protocol) {
string_set_str( furi_string_set(
subghz->error_str, "Function requires\nan SD card with\nfresh databases."); subghz->error_str, "Function requires\nan SD card with\nfresh databases.");
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneShowError); scene_manager_next_scene(subghz->scene_manager, SubGhzSceneShowError);
} }

View File

@@ -75,7 +75,7 @@ bool subghz_scene_set_seed_faac_868_on_event(void* context, SceneManagerEvent ev
subghz_transmitter_free(subghz->txrx->transmitter); subghz_transmitter_free(subghz->txrx->transmitter);
if(!generated_protocol) { if(!generated_protocol) {
string_set_str( furi_string_set(
subghz->error_str, "Function requires\nan SD card with\nfresh databases."); subghz->error_str, "Function requires\nan SD card with\nfresh databases.");
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneShowError); scene_manager_next_scene(subghz->scene_manager, SubGhzSceneShowError);
} }

View File

@@ -1,6 +1,5 @@
/* Abandon hope, all ye who enter here. */ /* Abandon hope, all ye who enter here. */
#include <m-string.h>
#include <subghz/types.h> #include <subghz/types.h>
#include <lib/toolbox/path.h> #include <lib/toolbox/path.h>
#include "subghz_i.h" #include "subghz_i.h"
@@ -214,7 +213,7 @@ SubGhz* subghz_alloc(bool alloc_for_tx_only) {
subghz->lock = SubGhzLockOff; subghz->lock = SubGhzLockOff;
subghz->txrx = malloc(sizeof(SubGhzTxRx)); subghz->txrx = malloc(sizeof(SubGhzTxRx));
subghz->txrx->preset = malloc(sizeof(SubGhzPresetDefinition)); subghz->txrx->preset = malloc(sizeof(SubGhzPresetDefinition));
string_init(subghz->txrx->preset->name); subghz->txrx->preset->name = furi_string_alloc();
if(!alloc_for_tx_only) { if(!alloc_for_tx_only) {
subghz_preset_init( subghz_preset_init(
subghz, subghz,
@@ -358,7 +357,7 @@ void subghz_free(SubGhz* subghz, bool alloc_for_tx_only) {
if(!alloc_for_tx_only) { if(!alloc_for_tx_only) {
subghz_history_free(subghz->txrx->history); 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->preset);
free(subghz->txrx->secure_data); free(subghz->txrx->secure_data);
free(subghz->txrx); free(subghz->txrx);

View File

@@ -19,7 +19,7 @@
#define SUBGHZ_FREQUENCY_RANGE_STR \ #define SUBGHZ_FREQUENCY_RANGE_STR \
"299999755...348000000 or 386999938...464000000 or 778999847...928000000" "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); UNUSED(context);
uint32_t frequency = 433920000; uint32_t frequency = 433920000;

View File

@@ -21,7 +21,7 @@
typedef struct { typedef struct {
FuriString* item_str; FuriString* item_str;
FlipperFormat* flipper_string; FlipperFormat* flipper_string;
string_t protocol_name; FuriString* protocol_name;
bool is_file; bool is_file;
uint8_t type; uint8_t type;
SubGhzPresetDefinition* preset; SubGhzPresetDefinition* preset;
@@ -39,7 +39,7 @@ struct SubGhzHistory {
uint32_t last_update_timestamp; uint32_t last_update_timestamp;
uint16_t last_index_write; uint16_t last_index_write;
uint8_t code_last_hash_data; uint8_t code_last_hash_data;
string_t tmp_string; FuriString* tmp_string;
bool write_tmp_files; bool write_tmp_files;
Storage* storage; Storage* storage;
SubGhzHistoryStruct* history; SubGhzHistoryStruct* history;
@@ -49,10 +49,11 @@ struct SubGhzHistory {
#define LOG_DELAY 0 #define LOG_DELAY 0
#endif #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}; FuriHalRtcDateTime datetime = {0};
furi_hal_rtc_get_datetime(&datetime); 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) { 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) { void subghz_history_item_free(void* current_item) {
furi_assert(current_item); furi_assert(current_item);
SubGhzHistoryItem* item = (SubGhzHistoryItem*)current_item; SubGhzHistoryItem* item = (SubGhzHistoryItem*)current_item;
string_clear(item->item_str); furi_string_free(item->item_str);
string_clear(item->preset->name); furi_string_free(item->preset->name);
string_clear(item->protocol_name); furi_string_free(item->protocol_name);
free(item->preset); free(item->preset);
item->type = 0; item->type = 0;
@@ -166,7 +167,7 @@ void subghz_history_clean_item_array(SubGhzHistory* instance) {
void subghz_history_free(SubGhzHistory* instance) { void subghz_history_free(SubGhzHistory* instance) {
furi_assert(instance); furi_assert(instance);
string_clear(instance->tmp_string); furi_string_free(instance->tmp_string);
subghz_history_clean_item_array(instance); subghz_history_clean_item_array(instance);
SubGhzHistoryItemArray_clear(instance->history->data); 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) { void subghz_history_reset(SubGhzHistory* instance) {
furi_assert(instance); furi_assert(instance);
string_reset(instance->tmp_string); furi_string_reset(instance->tmp_string);
subghz_history_clean_item_array(instance); 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); furi_assert(instance);
SubGhzHistoryItem* item = SubGhzHistoryItemArray_get(instance->history->data, idx); 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) { 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; bool result_ok = false;
if(instance->write_tmp_files && item->is_file) { if(instance->write_tmp_files && item->is_file) {
// We have files! // We have files!
string_t filename; FuriString* filename;
string_t dir_path; FuriString* dir_path;
string_init(filename); filename = furi_string_alloc();
string_init(dir_path); dir_path = furi_string_alloc();
subghz_history_generate_temp_filename(filename, idx); filename = subghz_history_generate_temp_filename(idx);
string_init_printf( dir_path = furi_string_alloc_printf(
dir_path, "%s/%s", SUBGHZ_HISTORY_TMP_DIR, string_get_cstr(filename)); "%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 #ifdef FURI_DEBUG
FURI_LOG_D(TAG, "Exist: %s", dir_path); FURI_LOG_D(TAG, "Exist: %s", dir_path);
furi_delay_ms(LOG_DELAY); furi_delay_ms(LOG_DELAY);
@@ -255,7 +256,7 @@ FlipperFormat* subghz_history_get_raw_data(SubGhzHistory* instance, uint16_t idx
stream_clean(dst_stream); stream_clean(dst_stream);
size_t size = stream_load_from_file( 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) { if(size > 0) {
#ifdef FURI_DEBUG #ifdef FURI_DEBUG
FURI_LOG_I(TAG, "Save ok!"); 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"); FURI_LOG_E(TAG, "Can't convert filename to file");
} }
string_clear(filename); furi_string_free(filename);
string_clear(dir_path); furi_string_free(dir_path);
} else { } else {
#ifdef FURI_DEBUG #ifdef FURI_DEBUG
FURI_LOG_W(TAG, "Write TMP files failed!"); 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); furi_assert(instance);
if(instance->last_index_write == SUBGHZ_HISTORY_MAX) { if(instance->last_index_write == SUBGHZ_HISTORY_MAX) {
if(output != NULL) furi_string_printf(output, "Memory is FULL"); if(output != NULL) furi_string_printf(output, "Memory is FULL");
return true; return true;
} }
if(output != NULL) { 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; 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->code_last_hash_data = subghz_protocol_decoder_base_get_hash_data(decoder_base);
instance->last_update_timestamp = furi_get_tick(); instance->last_update_timestamp = furi_get_tick();
string_t text; FuriString* text;
string_init(text); text = furi_string_alloc();
SubGhzHistoryItem* item = SubGhzHistoryItemArray_push_raw(instance->history->data); SubGhzHistoryItem* item = SubGhzHistoryItemArray_push_raw(instance->history->data);
item->preset = malloc(sizeof(SubGhzPresetDefinition)); item->preset = malloc(sizeof(SubGhzPresetDefinition));
item->type = decoder_base->protocol->type; item->type = decoder_base->protocol->type;
@@ -334,8 +335,8 @@ bool subghz_history_add_to_history(
item->preset->data = preset->data; item->preset->data = preset->data;
item->preset->data_size = preset->data_size; item->preset->data_size = preset->data_size;
string_init(item->item_str); item->item_str = furi_string_alloc();
string_init(item->protocol_name); item->protocol_name = furi_string_alloc();
bool tmp_file_for_raw = false; bool tmp_file_for_raw = false;
@@ -352,10 +353,11 @@ bool subghz_history_add_to_history(
FURI_LOG_E(TAG, "Missing Protocol"); FURI_LOG_E(TAG, "Missing Protocol");
break; break;
} else { } 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")) { if(!strcmp(furi_string_get_cstr(instance->tmp_string), "RAW")) {
string_printf( furi_string_printf(
item->item_str, item->item_str,
"RAW %03ld.%02ld", "RAW %03ld.%02ld",
preset->frequency / 1000000 % 1000, preset->frequency / 1000000 % 1000,
@@ -366,8 +368,8 @@ bool subghz_history_add_to_history(
} }
tmp_file_for_raw = true; tmp_file_for_raw = true;
break; break;
} else if(!strcmp(string_get_cstr(instance->tmp_string), "KeeLoq")) { } else if(!strcmp(furi_string_get_cstr(instance->tmp_string), "KeeLoq")) {
string_set_str(instance->tmp_string, "KL "); furi_string_set(instance->tmp_string, "KL ");
if(!flipper_format_read_string(item->flipper_string, "Manufacture", text)) { if(!flipper_format_read_string(item->flipper_string, "Manufacture", text)) {
FURI_LOG_E(TAG, "Missing Protocol"); FURI_LOG_E(TAG, "Missing Protocol");
break; break;
@@ -412,22 +414,23 @@ bool subghz_history_add_to_history(
// If we can write to files // If we can write to files
if(instance->write_tmp_files && tmp_file_for_raw) { if(instance->write_tmp_files && tmp_file_for_raw) {
string_t filename; FuriString* filename;
string_t dir_path; FuriString* dir_path;
string_init(filename); filename = furi_string_alloc();
string_init(dir_path); dir_path = furi_string_alloc();
subghz_history_generate_temp_filename(filename, instance->last_index_write); filename = subghz_history_generate_temp_filename(instance->last_index_write);
string_cat_printf(dir_path, "%s/%s", SUBGHZ_HISTORY_TMP_DIR, string_get_cstr(filename)); furi_string_cat_printf(
dir_path, "%s/%s", SUBGHZ_HISTORY_TMP_DIR, furi_string_get_cstr(filename));
#ifdef FURI_DEBUG #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 #endif
if(!subghz_history_tmp_write_file_split(instance, item, dir_path)) { if(!subghz_history_tmp_write_file_split(instance, item, dir_path)) {
// Plan B! // Plan B!
subghz_history_tmp_write_file_full(instance, item, dir_path); subghz_history_tmp_write_file_full(instance, item, dir_path);
} }
string_clear(filename); furi_string_free(filename);
string_clear(dir_path); furi_string_free(dir_path);
} else { } else {
#ifdef FURI_DEBUG #ifdef FURI_DEBUG
@@ -435,7 +438,7 @@ bool subghz_history_add_to_history(
#endif #endif
} }
string_clear(text); furi_string_free(text);
instance->last_index_write++; instance->last_index_write++;
return true; return true;
@@ -444,7 +447,7 @@ bool subghz_history_add_to_history(
bool subghz_history_tmp_write_file_split( bool subghz_history_tmp_write_file_split(
SubGhzHistory* instance, SubGhzHistory* instance,
void* current_item, void* current_item,
string_t dir_path) { FuriString* dir_path) {
UNUSED(instance); UNUSED(instance);
UNUSED(current_item); UNUSED(current_item);
UNUSED(dir_path); UNUSED(dir_path);
@@ -459,15 +462,15 @@ bool subghz_history_tmp_write_file_split(
void subghz_history_tmp_write_file_full( void subghz_history_tmp_write_file_full(
SubGhzHistory* instance, SubGhzHistory* instance,
void* current_item, void* current_item,
string_t dir_path) { FuriString* dir_path) {
SubGhzHistoryItem* item = (SubGhzHistoryItem*)current_item; SubGhzHistoryItem* item = (SubGhzHistoryItem*)current_item;
#ifdef FURI_DEBUG #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 #endif
Stream* dst = flipper_format_get_raw_stream(item->flipper_string); Stream* dst = flipper_format_get_raw_stream(item->flipper_string);
stream_rewind(dst); stream_rewind(dst);
if(stream_save_to_file(dst, instance->storage, string_get_cstr(dir_path), FSOM_CREATE_ALWAYS) > if(stream_save_to_file(
0) { dst, instance->storage, furi_string_get_cstr(dir_path), FSOM_CREATE_ALWAYS) > 0) {
flipper_format_free(item->flipper_string); flipper_format_free(item->flipper_string);
item->flipper_string = NULL; item->flipper_string = NULL;
#ifdef FURI_DEBUG #ifdef FURI_DEBUG

View File

@@ -5,10 +5,9 @@
/** /**
* @brief Generate filename like 000.tmp * @brief Generate filename like 000.tmp
* *
* @param filename - input parameter
* @param index - index of file, timestamp doesn't accepted! * @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 * @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( void subghz_history_tmp_write_file_full(
SubGhzHistory* instance, SubGhzHistory* instance,
void* current_item, void* current_item,
string_t dir_path); FuriString* dir_path);
/** /**
* @brief Write temp splited to lines * @brief Write temp splited to lines
@@ -76,4 +75,4 @@ void subghz_history_tmp_write_file_full(
bool subghz_history_tmp_write_file_split( bool subghz_history_tmp_write_file_split(
SubGhzHistory* instance, SubGhzHistory* instance,
void* current_item, void* current_item,
string_t dir_path); FuriString* dir_path);

View File

@@ -103,7 +103,7 @@ struct SubGhz {
SubGhzTestStatic* subghz_test_static; SubGhzTestStatic* subghz_test_static;
SubGhzTestPacket* subghz_test_packet; SubGhzTestPacket* subghz_test_packet;
#endif #endif
string_t error_str; FuriString* error_str;
SubGhzSetting* setting; SubGhzSetting* setting;
SubGhzLastSettings* last_settings; SubGhzLastSettings* last_settings;
SubGhzLock lock; SubGhzLock lock;

View File

@@ -52,10 +52,10 @@ struct SubGhzViewReceiver {
}; };
typedef struct { typedef struct {
string_t frequency_str; FuriString* frequency_str;
string_t preset_str; FuriString* preset_str;
string_t history_stat_str; FuriString* history_stat_str;
string_t progress_str; FuriString* progress_str;
SubGhzReceiverHistory* history; SubGhzReceiverHistory* history;
uint16_t idx; uint16_t idx;
uint16_t list_offset; uint16_t list_offset;
@@ -168,7 +168,7 @@ void subghz_view_receiver_add_data_progress(
furi_assert(subghz_receiver); furi_assert(subghz_receiver);
with_view_model( with_view_model(
subghz_receiver->view, (SubGhzViewReceiverModel * model) { subghz_receiver->view, (SubGhzViewReceiverModel * model) {
string_set_str(model->progress_str, progress_str); furi_string_set(model->progress_str, progress_str);
return true; return true;
}); });
} }
@@ -196,7 +196,7 @@ void subghz_view_receiver_draw(Canvas* canvas, SubGhzViewReceiverModel* model) {
elements_button_left(canvas, "Config"); elements_button_left(canvas, "Config");
canvas_draw_line(canvas, 46, 51, 125, 51); canvas_draw_line(canvas, 46, 51, 125, 51);
} else { } 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; bool scrollbar = model->history_item > 4;
@@ -365,9 +365,9 @@ void subghz_view_receiver_exit(void* context) {
SubGhzViewReceiver* subghz_receiver = context; SubGhzViewReceiver* subghz_receiver = context;
with_view_model( with_view_model(
subghz_receiver->view, (SubGhzViewReceiverModel * model) { subghz_receiver->view, (SubGhzViewReceiverModel * model) {
string_reset(model->frequency_str); furi_string_reset(model->frequency_str);
string_reset(model->preset_str); furi_string_reset(model->preset_str);
string_reset(model->history_stat_str); furi_string_reset(model->history_stat_str);
for for
M_EACH(item_menu, model->history->data, SubGhzReceiverMenuItemArray_t) { M_EACH(item_menu, model->history->data, SubGhzReceiverMenuItemArray_t) {
@@ -401,10 +401,10 @@ SubGhzViewReceiver* subghz_view_receiver_alloc() {
with_view_model( with_view_model(
subghz_receiver->view, (SubGhzViewReceiverModel * model) { subghz_receiver->view, (SubGhzViewReceiverModel * model) {
string_init(model->frequency_str); model->frequency_str = furi_string_alloc();
string_init(model->preset_str); model->preset_str = furi_string_alloc();
string_init(model->history_stat_str); model->history_stat_str = furi_string_alloc();
string_init(model->progress_str); model->progress_str = furi_string_alloc();
model->bar_show = SubGhzViewReceiverBarShowDefault; model->bar_show = SubGhzViewReceiverBarShowDefault;
model->history = malloc(sizeof(SubGhzReceiverHistory)); model->history = malloc(sizeof(SubGhzReceiverHistory));
SubGhzReceiverMenuItemArray_init(model->history->data); SubGhzReceiverMenuItemArray_init(model->history->data);
@@ -420,10 +420,10 @@ void subghz_view_receiver_free(SubGhzViewReceiver* subghz_receiver) {
with_view_model( with_view_model(
subghz_receiver->view, (SubGhzViewReceiverModel * model) { subghz_receiver->view, (SubGhzViewReceiverModel * model) {
string_clear(model->frequency_str); furi_string_free(model->frequency_str);
string_clear(model->preset_str); furi_string_free(model->preset_str);
string_clear(model->history_stat_str); furi_string_free(model->history_stat_str);
string_clear(model->progress_str); furi_string_free(model->progress_str);
for for
M_EACH(item_menu, model->history->data, SubGhzReceiverMenuItemArray_t) { M_EACH(item_menu, model->history->data, SubGhzReceiverMenuItemArray_t) {
furi_string_free(item_menu->item_str); furi_string_free(item_menu->item_str);

View File

@@ -376,8 +376,8 @@ bool subghz_read_raw_input(InputEvent* event, void* context) {
model->status = SubGhzReadRAWStatusStart; model->status = SubGhzReadRAWStatusStart;
model->rssi_history_end = false; model->rssi_history_end = false;
model->ind_write = 0; model->ind_write = 0;
string_set_str(model->sample_write, "0 spl."); furi_string_set(model->sample_write, "0 spl.");
string_reset(model->file_name); furi_string_reset(model->file_name);
instance->callback(SubGhzCustomEventViewReadRAWErase, instance->context); instance->callback(SubGhzCustomEventViewReadRAWErase, instance->context);
} }
} }
@@ -508,10 +508,10 @@ SubGhzReadRAW* subghz_read_raw_alloc(bool raw_send_only) {
with_view_model( with_view_model(
instance->view, (SubGhzReadRAWModel * model) { instance->view, (SubGhzReadRAWModel * model) {
string_init(model->frequency_str); model->frequency_str = furi_string_alloc();
string_init(model->preset_str); model->preset_str = furi_string_alloc();
string_init(model->sample_write); model->sample_write = furi_string_alloc();
string_init(model->file_name); model->file_name = furi_string_alloc();
model->raw_send_only = raw_send_only; model->raw_send_only = raw_send_only;
model->rssi_history = malloc(SUBGHZ_READ_RAW_RSSI_HISTORY_SIZE * sizeof(uint8_t)); model->rssi_history = malloc(SUBGHZ_READ_RAW_RSSI_HISTORY_SIZE * sizeof(uint8_t));
return true; return true;

View File

@@ -82,9 +82,9 @@ void subghz_view_transmitter_draw(Canvas* canvas, SubGhzViewTransmitterModel* mo
canvas_clear(canvas); canvas_clear(canvas);
canvas_set_color(canvas, ColorBlack); canvas_set_color(canvas, ColorBlack);
canvas_set_font(canvas, FontSecondary); canvas_set_font(canvas, FontSecondary);
elements_multiline_text(canvas, 0, 7, string_get_cstr(model->key_str)); elements_multiline_text(canvas, 0, 7, furi_string_get_cstr(model->key_str));
canvas_draw_str(canvas, 78, 7, string_get_cstr(model->frequency_str)); canvas_draw_str(canvas, 78, 7, furi_string_get_cstr(model->frequency_str));
canvas_draw_str(canvas, 113, 7, string_get_cstr(model->preset_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"); if(model->show_button) subghz_view_transmitter_button_right(canvas, "Send");
} }

View File

@@ -27,9 +27,9 @@
typedef struct { typedef struct {
uint32_t frequency; uint32_t frequency;
string_t name; FuriString* name;
string_t protocol; FuriString* protocol;
uint32_t repeat; uint32_t repeat;
uint8_t* data; uint8_t* data;
@@ -52,20 +52,20 @@ typedef struct {
NotificationApp* notification; NotificationApp* notification;
UniRFPreset* txpreset; UniRFPreset* txpreset;
string_t up_file; FuriString* up_file;
string_t down_file; FuriString* down_file;
string_t left_file; FuriString* left_file;
string_t right_file; FuriString* right_file;
string_t ok_file; FuriString* ok_file;
string_t empty; FuriString* empty;
string_t up_l; FuriString* up_l;
string_t left_l; FuriString* left_l;
string_t right_l; FuriString* right_l;
string_t down_l; FuriString* down_l;
string_t ok_l; FuriString* ok_l;
string_t file_path; FuriString* file_path;
char* up_label; char* up_label;
char* down_label; char* down_label;
@@ -92,20 +92,20 @@ typedef struct {
bool tx_not_allowed; bool tx_not_allowed;
int file_blank; int file_blank;
string_t signal; FuriString* signal;
} UniRFRemix; } UniRFRemix;
UniRFPreset* unirfremix_preset_alloc(void) { UniRFPreset* unirfremix_preset_alloc(void) {
UniRFPreset* preset = malloc(sizeof(UniRFPreset)); UniRFPreset* preset = malloc(sizeof(UniRFPreset));
string_init(preset->name); preset->name = furi_string_alloc();
string_init(preset->protocol); preset->protocol = furi_string_alloc();
preset->repeat = 200; preset->repeat = 200;
return preset; return preset;
} }
void unirfremix_preset_free(UniRFPreset* preset) { void unirfremix_preset_free(UniRFPreset* preset) {
string_clear(preset->name); furi_string_free(preset->name);
string_clear(preset->protocol); furi_string_free(preset->protocol);
free(preset); free(preset);
} }
@@ -147,13 +147,13 @@ static const char* int_to_char(int number) {
*/ */
//get filename without path //get filename without path
static char* extract_filename(const char* name, int len) { static char* extract_filename(const char* name, int len) {
string_t tmp; FuriString* tmp;
string_init(tmp); tmp = furi_string_alloc();
//remove path //remove path
path_extract_filename_no_ext(name, tmp); 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 * 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); Storage* storage = furi_record_open(RECORD_STORAGE);
FlipperFormat* fff_data_file = flipper_format_file_alloc(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; int label_len = 16;
//check that map file exists //check that map file exists
if(!flipper_format_file_open_existing(fff_data_file, 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", string_get_cstr(file_name)); FURI_LOG_E(TAG, "Could not open MAP file %s", furi_string_get_cstr(file_name));
} else { } else {
//Filename Assignment/Check Start //Filename Assignment/Check Start
@@ -199,8 +199,8 @@ void unirfremix_cfg_set_check(UniRFRemix* app, string_t file_name) {
} else { } else {
//check name length for proper screen fit //check name length for proper screen fit
//then set filename as label. Might be replaced with defined label later on below. //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); app->up_label = extract_filename(furi_string_get_cstr(app->up_file), label_len);
FURI_LOG_I(TAG, "UP file: %s", string_get_cstr(app->up_file)); FURI_LOG_I(TAG, "UP file: %s", furi_string_get_cstr(app->up_file));
} }
//Repeat process for Down //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_label = "N/A";
app->down_enabled = 0; app->down_enabled = 0;
} else { } else {
app->down_label = extract_filename(string_get_cstr(app->down_file), label_len); app->down_label = extract_filename(furi_string_get_cstr(app->down_file), label_len);
FURI_LOG_I(TAG, "DOWN file: %s", string_get_cstr(app->down_file)); FURI_LOG_I(TAG, "DOWN file: %s", furi_string_get_cstr(app->down_file));
} }
//Repeat process for Left //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_label = "N/A";
app->left_enabled = 0; app->left_enabled = 0;
} else { } else {
app->left_label = extract_filename(string_get_cstr(app->left_file), label_len); app->left_label = extract_filename(furi_string_get_cstr(app->left_file), label_len);
FURI_LOG_I(TAG, "LEFT file: %s", string_get_cstr(app->left_file)); FURI_LOG_I(TAG, "LEFT file: %s", furi_string_get_cstr(app->left_file));
} }
//Repeat process for Right //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_label = "N/A";
app->right_enabled = 0; app->right_enabled = 0;
} else { } else {
app->right_label = extract_filename(string_get_cstr(app->right_file), label_len); app->right_label = extract_filename(furi_string_get_cstr(app->right_file), label_len);
FURI_LOG_I(TAG, "RIGHT file: %s", string_get_cstr(app->right_file)); FURI_LOG_I(TAG, "RIGHT file: %s", furi_string_get_cstr(app->right_file));
} }
//Repeat process for Ok //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_label = "N/A";
app->ok_enabled = 0; app->ok_enabled = 0;
} else { } else {
app->ok_label = extract_filename(string_get_cstr(app->ok_file), label_len); app->ok_label = extract_filename(furi_string_get_cstr(app->ok_file), label_len);
FURI_LOG_I(TAG, "OK file: %s", string_get_cstr(app->ok_file)); FURI_LOG_I(TAG, "OK file: %s", furi_string_get_cstr(app->ok_file));
} }
//File definitions are done. //File definitions are done.
@@ -265,7 +265,7 @@ void unirfremix_cfg_set_check(UniRFRemix* app, string_t file_name) {
app->up_label = "N/A"; app->up_label = "N/A";
} else { } else {
//set label from map to variable and shrink to fit screen //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); 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) { if(app->down_enabled == 0) {
app->down_label = "N/A"; app->down_label = "N/A";
} else { } 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); 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) { if(app->left_enabled == 0) {
app->left_label = "N/A"; app->left_label = "N/A";
} else { } 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); 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) { if(app->right_enabled == 0) {
app->right_label = "N/A"; app->right_label = "N/A";
} else { } 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); 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) { if(app->ok_enabled == 0) {
app->ok_label = "N/A"; app->ok_label = "N/A";
} else { } 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); 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 button is still enabled, check that file exists
if(app->up_enabled == 1) { 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); fff_data_file = flipper_format_file_alloc(storage);
if(!flipper_format_file_open_existing(fff_data_file, 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", 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" //disable button, and set label to "N/A"
app->up_enabled = 0; app->up_enabled = 0;
@@ -369,11 +370,11 @@ void unirfremix_cfg_set_check(UniRFRemix* app, string_t file_name) {
} }
if(app->down_enabled == 1) { 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); fff_data_file = flipper_format_file_alloc(storage);
if(!flipper_format_file_open_existing(fff_data_file, 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", 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_enabled = 0;
app->down_label = "N/A"; 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) { 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); fff_data_file = flipper_format_file_alloc(storage);
if(!flipper_format_file_open_existing(fff_data_file, 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", 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_enabled = 0;
app->left_label = "N/A"; 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) { 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); fff_data_file = flipper_format_file_alloc(storage);
if(!flipper_format_file_open_existing(fff_data_file, 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", 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_enabled = 0;
app->right_label = "N/A"; 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) { 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); fff_data_file = flipper_format_file_alloc(storage);
if(!flipper_format_file_open_existing(fff_data_file, 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", 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_enabled = 0;
app->ok_label = "N/A"; 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) { bool unirfremix_set_preset(UniRFPreset* p, const char* preset) {
if(!strcmp(preset, "FuriHalSubGhzPresetOok270Async")) { if(!strcmp(preset, "FuriHalSubGhzPresetOok270Async")) {
string_set(p->name, "AM270"); furi_string_set(p->name, "AM270");
} else if(!strcmp(preset, "FuriHalSubGhzPresetOok650Async")) { } else if(!strcmp(preset, "FuriHalSubGhzPresetOok650Async")) {
string_set(p->name, "AM650"); furi_string_set(p->name, "AM650");
} else if(!strcmp(preset, "FuriHalSubGhzPreset2FSKDev238Async")) { } else if(!strcmp(preset, "FuriHalSubGhzPreset2FSKDev238Async")) {
string_set(p->name, "FM238"); furi_string_set(p->name, "FM238");
} else if(!strcmp(preset, "FuriHalSubGhzPreset2FSKDev476Async")) { } else if(!strcmp(preset, "FuriHalSubGhzPreset2FSKDev476Async")) {
string_set(p->name, "FM476"); furi_string_set(p->name, "FM476");
} else if(!strcmp(preset, "FuriHalSubGhzPresetCustom")) { } else if(!strcmp(preset, "FuriHalSubGhzPresetCustom")) {
FURI_LOG_E(TAG, "Custom preset unsupported now"); FURI_LOG_E(TAG, "Custom preset unsupported now");
return false; return false;
// string_set(p->name, "CUSTOM"); // furi_string_set(p->name, "CUSTOM");
} else { } else {
FURI_LOG_E(TAG, "Unsupported preset"); FURI_LOG_E(TAG, "Unsupported preset");
return false; return false;
@@ -479,8 +480,8 @@ bool unirfremix_key_load(
return false; return false;
} }
string_t temp_str; FuriString* temp_str;
string_init(temp_str); temp_str = furi_string_alloc();
bool res = false; bool res = false;
@@ -494,19 +495,19 @@ bool unirfremix_key_load(
// load preset from file // load preset from file
if(!flipper_format_read_string(fff_file, "Preset", temp_str)) { if(!flipper_format_read_string(fff_file, "Preset", temp_str)) {
FURI_LOG_W(TAG, "Could not read Preset. Defaulting to Ook650Async"); 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"); FURI_LOG_E(TAG, "Could not set preset");
break; break;
} }
if(!strcmp(string_get_cstr(temp_str), "FuriHalSubGhzPresetCustom")) { if(!strcmp(furi_string_get_cstr(temp_str), "FuriHalSubGhzPresetCustom")) {
// TODO: check if preset is custom // TODO: check if preset is custom
FURI_LOG_E(TAG, "Could not use custom preset"); FURI_LOG_E(TAG, "Could not use custom preset");
break; break;
} }
size_t preset_index = 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 = subghz_setting_get_preset_data(setting, preset_index);
preset->data_size = subghz_setting_get_preset_data_size(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."); FURI_LOG_E(TAG, "Could not read Protocol.");
break; 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); subghz_protocol_raw_gen_fff_data(fff_data, path);
} else { } else {
stream_copy_full( stream_copy_full(
@@ -529,19 +530,19 @@ bool unirfremix_key_load(
} }
preset->decoder = subghz_receiver_search_decoder_base_by_name( 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(preset->decoder) {
if(!subghz_protocol_decoder_base_deserialize(preset->decoder, fff_data)) { if(!subghz_protocol_decoder_base_deserialize(preset->decoder, fff_data)) {
break; break;
} }
} else { } 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; res = true;
} while(0); } while(0);
string_clear(temp_str); furi_string_free(temp_str);
return res; 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); Stream* flipper_format_stream = flipper_format_get_raw_stream(fff_file);
bool saved = false; bool saved = false;
string_t file_dir; FuriString* file_dir;
string_init(file_dir); file_dir = furi_string_alloc();
path_extract_dirname(dev_file_name, file_dir); path_extract_dirname(dev_file_name, file_dir);
do { do {
flipper_format_delete_key(fff_file, "Repeat"); flipper_format_delete_key(fff_file, "Repeat");
flipper_format_delete_key(fff_file, "Manufacture"); 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"); FURI_LOG_E(TAG, "(save) Cannot mkdir");
break; break;
} }
@@ -580,7 +581,7 @@ bool unirfremix_save_protocol_to_file(FlipperFormat* fff_file, const char* dev_f
saved = true; saved = true;
FURI_LOG_D(TAG, "(save) OK Save"); FURI_LOG_D(TAG, "(save) OK Save");
} while(0); } while(0);
string_clear(file_dir); furi_string_free(file_dir);
furi_record_close(RECORD_STORAGE); furi_record_close(RECORD_STORAGE);
return saved; return saved;
} }
@@ -590,7 +591,7 @@ void unirfremix_tx_stop(UniRFRemix* app) {
return; 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()) { while(!furi_hal_subghz_is_async_tx_complete()) {
furi_delay_ms(15); furi_delay_ms(15);
} }
@@ -603,7 +604,7 @@ void unirfremix_tx_stop(UniRFRemix* app) {
FURI_LOG_D(TAG, "Checking if protocol is dynamic"); FURI_LOG_D(TAG, "Checking if protocol is dynamic");
const SubGhzProtocol* registry = 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); FURI_LOG_D(TAG, "Protocol-TYPE %d", registry->type);
if(registry && registry->type == SubGhzProtocolTypeDynamic) { if(registry && registry->type == SubGhzProtocolTypeDynamic) {
FURI_LOG_D(TAG, "Protocol is dynamic. Saving key"); 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->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) { if(!app->tx_transmitter) {
break; break;
} }
@@ -713,16 +714,16 @@ static void unirfremix_send_signal(UniRFRemix* app, Storage* storage, const char
unirfremix_send_sub(app, app->tx_fff_data); 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); 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); 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); 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); unirfremix_end_send(app);
} }
} }
@@ -867,21 +868,21 @@ UniRFRemix* unirfremix_alloc(void) {
void unirfremix_free(UniRFRemix* app, bool with_subghz) { void unirfremix_free(UniRFRemix* app, bool with_subghz) {
furi_hal_power_suppress_charge_exit(); furi_hal_power_suppress_charge_exit();
string_clear(app->up_file); furi_string_free(app->up_file);
string_clear(app->down_file); furi_string_free(app->down_file);
string_clear(app->left_file); furi_string_free(app->left_file);
string_clear(app->right_file); furi_string_free(app->right_file);
string_clear(app->ok_file); furi_string_free(app->ok_file);
string_clear(app->empty); furi_string_free(app->empty);
string_clear(app->up_l); furi_string_free(app->up_l);
string_clear(app->down_l); furi_string_free(app->down_l);
string_clear(app->left_l); furi_string_free(app->left_l);
string_clear(app->right_l); furi_string_free(app->right_l);
string_clear(app->ok_l); furi_string_free(app->ok_l);
string_clear(app->file_path); furi_string_free(app->file_path);
string_clear(app->signal); furi_string_free(app->signal);
gui_remove_view_port(app->gui, app->view_port); gui_remove_view_port(app->gui, app->view_port);
furi_record_close(RECORD_GUI); furi_record_close(RECORD_GUI);
@@ -909,21 +910,21 @@ int32_t unirfremix_app(void* p) {
UNUSED(p); UNUSED(p);
UniRFRemix* app = unirfremix_alloc(); UniRFRemix* app = unirfremix_alloc();
string_init(app->file_path); app->file_path = furi_string_alloc();
//setup variables before population //setup variables before population
string_init(app->up_file); app->up_file = furi_string_alloc();
string_init(app->down_file); app->down_file = furi_string_alloc();
string_init(app->left_file); app->left_file = furi_string_alloc();
string_init(app->right_file); app->right_file = furi_string_alloc();
string_init(app->ok_file); app->ok_file = furi_string_alloc();
string_init(app->empty); app->empty = furi_string_alloc();
string_init(app->up_l); app->up_l = furi_string_alloc();
string_init(app->down_l); app->down_l = furi_string_alloc();
string_init(app->left_l); app->left_l = furi_string_alloc();
string_init(app->right_l); app->right_l = furi_string_alloc();
string_init(app->ok_l); app->ok_l = furi_string_alloc();
app->file_result = 3; app->file_result = 3;
@@ -933,7 +934,7 @@ int32_t unirfremix_app(void* p) {
} }
furi_record_close(RECORD_STORAGE); 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); DialogsApp* dialogs = furi_record_open(RECORD_DIALOGS);
@@ -961,11 +962,11 @@ int32_t unirfremix_app(void* p) {
FURI_LOG_D( FURI_LOG_D(
TAG, TAG,
"U: %s - D: %s - L: %s - R: %s - O: %s ", "U: %s - D: %s - L: %s - R: %s - O: %s ",
string_get_cstr(app->up_file), furi_string_get_cstr(app->up_file),
string_get_cstr(app->down_file), furi_string_get_cstr(app->down_file),
string_get_cstr(app->left_file), furi_string_get_cstr(app->left_file),
string_get_cstr(app->right_file), furi_string_get_cstr(app->right_file),
string_get_cstr(app->ok_file)); furi_string_get_cstr(app->ok_file));
//variables to control multiple button presses and status updates //variables to control multiple button presses and status updates
app->send_status = "Idle"; app->send_status = "Idle";
@@ -994,8 +995,8 @@ int32_t unirfremix_app(void* p) {
if(input.type == InputTypePress) { if(input.type == InputTypePress) {
if(app->up_enabled) { if(app->up_enabled) {
if(app->processing == 0) { if(app->processing == 0) {
*app->signal = *app->empty; app->signal = app->empty;
*app->signal = *app->up_file; app->signal = app->up_file;
app->button = 1; app->button = 1;
app->processing = 1; app->processing = 1;
} }
@@ -1012,8 +1013,8 @@ int32_t unirfremix_app(void* p) {
if(input.type == InputTypePress) { if(input.type == InputTypePress) {
if(app->down_enabled) { if(app->down_enabled) {
if(app->processing == 0) { if(app->processing == 0) {
*app->signal = *app->empty; app->signal = app->empty;
*app->signal = *app->down_file; app->signal = app->down_file;
app->button = 2; app->button = 2;
app->processing = 1; app->processing = 1;
} }
@@ -1030,8 +1031,8 @@ int32_t unirfremix_app(void* p) {
if(input.type == InputTypePress) { if(input.type == InputTypePress) {
if(app->right_enabled) { if(app->right_enabled) {
if(app->processing == 0) { if(app->processing == 0) {
*app->signal = *app->empty; app->signal = app->empty;
*app->signal = *app->right_file; app->signal = app->right_file;
app->button = 3; app->button = 3;
app->processing = 1; app->processing = 1;
} }
@@ -1048,8 +1049,8 @@ int32_t unirfremix_app(void* p) {
if(input.type == InputTypePress) { if(input.type == InputTypePress) {
if(app->left_enabled) { if(app->left_enabled) {
if(app->processing == 0) { if(app->processing == 0) {
*app->signal = *app->empty; app->signal = app->empty;
*app->signal = *app->left_file; app->signal = app->left_file;
app->button = 4; app->button = 4;
app->processing = 1; app->processing = 1;
} }
@@ -1066,8 +1067,8 @@ int32_t unirfremix_app(void* p) {
if(input.type == InputTypePress) { if(input.type == InputTypePress) {
if(app->ok_enabled) { if(app->ok_enabled) {
if(app->processing == 0) { if(app->processing == 0) {
*app->signal = *app->empty; app->signal = app->empty;
*app->signal = *app->ok_file; app->signal = app->ok_file;
app->button = 5; app->button = 5;
app->processing = 1; app->processing = 1;
} }

View File

@@ -326,8 +326,8 @@ bool music_player_worker_load_fmf_from_file(MusicPlayerWorker* instance, const c
furi_assert(file_path); furi_assert(file_path);
bool result = false; bool result = false;
string_t temp_str; FuriString* temp_str;
string_init(temp_str); temp_str = furi_string_alloc();
Storage* storage = furi_record_open(RECORD_STORAGE); Storage* storage = furi_record_open(RECORD_STORAGE);
FlipperFormat* file = flipper_format_file_alloc(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; uint32_t version = 0;
if(!flipper_format_read_header(file, temp_str, &version)) break; 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"); FURI_LOG_E(TAG, "Incorrect file format or version");
break; break;
} }
@@ -360,7 +361,7 @@ bool music_player_worker_load_fmf_from_file(MusicPlayerWorker* instance, const c
break; 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; break;
} }
@@ -369,7 +370,7 @@ bool music_player_worker_load_fmf_from_file(MusicPlayerWorker* instance, const c
furi_record_close(RECORD_STORAGE); furi_record_close(RECORD_STORAGE);
flipper_format_free(file); flipper_format_free(file);
string_clear(temp_str); furi_string_free(temp_str);
return result; return result;
} }
@@ -379,8 +380,8 @@ bool music_player_worker_load_rtttl_from_file(MusicPlayerWorker* instance, const
furi_assert(file_path); furi_assert(file_path);
bool result = false; bool result = false;
string_t content; FuriString* content;
string_init(content); content = furi_string_alloc();
Storage* storage = furi_record_open(RECORD_STORAGE); Storage* storage = furi_record_open(RECORD_STORAGE);
File* file = storage_file_alloc(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}; uint8_t buffer[65] = {0};
ret = storage_file_read(file, buffer, sizeof(buffer) - 1); ret = storage_file_read(file, buffer, sizeof(buffer) - 1);
for(size_t i = 0; i < ret; i++) { for(size_t i = 0; i < ret; i++) {
string_push_back(content, buffer[i]); furi_string_push_back(content, buffer[i]);
} }
} while(ret > 0); } while(ret > 0);
string_strim(content); furi_string_trim(content);
if(!string_size(content)) { if(!furi_string_size(content)) {
FURI_LOG_E(TAG, "Empty file"); FURI_LOG_E(TAG, "Empty file");
break; 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"); FURI_LOG_E(TAG, "Invalid file content");
break; break;
} }
@@ -415,7 +416,7 @@ bool music_player_worker_load_rtttl_from_file(MusicPlayerWorker* instance, const
storage_file_free(file); storage_file_free(file);
furi_record_close(RECORD_STORAGE); furi_record_close(RECORD_STORAGE);
string_clear(content); furi_string_free(content);
return result; return result;
} }

View File

@@ -1,6 +1,5 @@
#ifndef sound_h #ifndef sound_h
#define sound_h #define sound_h
#include <m-string.h>
#include <furi.h> #include <furi.h>
#include <furi_hal.h> #include <furi_hal.h>
#include <stdint.h> #include <stdint.h>

View File

@@ -6,7 +6,6 @@
#include <gui/canvas_i.h> #include <gui/canvas_i.h>
#include <gui/gui.h> #include <gui/gui.h>
#include <input/input.h> #include <input/input.h>
//#include <m-string.h>
//#include <math.h> //#include <math.h>
//#include <notification/notification.h> //#include <notification/notification.h>
//#include <notification/notification_messages.h> //#include <notification/notification_messages.h>
@@ -250,8 +249,8 @@ static int32_t uart_worker(void* context) {
#if ENABLE_MODULE_POWER #if ENABLE_MODULE_POWER
bool initialized = false; bool initialized = false;
string_t receivedString; FuriString* receivedString;
string_init(receivedString); receivedString = furi_string_alloc();
#endif // ENABLE_MODULE_POWER #endif // ENABLE_MODULE_POWER
while(true) { while(true) {
@@ -280,7 +279,7 @@ static int32_t uart_worker(void* context) {
if(!(dataReceivedLength > strlen(MODULE_CONTEXT_INITIALIZATION))) { if(!(dataReceivedLength > strlen(MODULE_CONTEXT_INITIALIZATION))) {
DEAUTH_APP_LOG_I("[UART] Found possible init candidate"); DEAUTH_APP_LOG_I("[UART] Found possible init candidate");
for(uint16_t i = 0; i < dataReceivedLength; i++) { for(uint16_t i = 0; i < dataReceivedLength; i++) {
string_push_back(receivedString, dataBuffer[i]); furi_string_push_back(receivedString, dataBuffer[i]);
} }
} }
} else } else
@@ -297,15 +296,15 @@ static int32_t uart_worker(void* context) {
#if ENABLE_MODULE_POWER #if ENABLE_MODULE_POWER
if(!app->m_wifiDeauthModuleInitialized) { 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"); DEAUTH_APP_LOG_I("[UART] Initialized");
initialized = true; initialized = true;
app->m_wifiDeauthModuleInitialized = true; app->m_wifiDeauthModuleInitialized = true;
app->m_context = ModuleActive; app->m_context = ModuleActive;
string_clear(receivedString); furi_string_free(receivedString);
} else { } else {
DEAUTH_APP_LOG_I("[UART] Not an initialization command"); DEAUTH_APP_LOG_I("[UART] Not an initialization command");
string_reset(receivedString); furi_string_reset(receivedString);
} }
} }
#endif // ENABLE_MODULE_POWER #endif // ENABLE_MODULE_POWER

View File

@@ -55,8 +55,8 @@ static void flipfrid_timer_callback(FuriMessageQueue* event_queue) {
FlipFridState* flipfrid_alloc() { FlipFridState* flipfrid_alloc() {
FlipFridState* flipfrid = malloc(sizeof(FlipFridState)); FlipFridState* flipfrid = malloc(sizeof(FlipFridState));
string_init(flipfrid->notification_msg); flipfrid->notification_msg = furi_string_alloc();
string_init(flipfrid->attack_name); flipfrid->attack_name = furi_string_alloc();
flipfrid->previous_scene = NoneScene; flipfrid->previous_scene = NoneScene;
flipfrid->current_scene = SceneEntryPoint; flipfrid->current_scene = SceneEntryPoint;
@@ -95,8 +95,8 @@ void flipfrid_free(FlipFridState* flipfrid) {
notification_message(flipfrid->notify, &sequence_blink_stop); notification_message(flipfrid->notify, &sequence_blink_stop);
// Strings // Strings
string_clear(flipfrid->notification_msg); furi_string_free(flipfrid->notification_msg);
string_clear(flipfrid->attack_name); furi_string_free(flipfrid->attack_name);
free(flipfrid->data); free(flipfrid->data);
free(flipfrid->payload); free(flipfrid->payload);

View File

@@ -4,7 +4,6 @@
#include <input/input.h> #include <input/input.h>
#include <gui/gui.h> #include <gui/gui.h>
#include <gui/modules/submenu.h> #include <gui/modules/submenu.h>
#include <m-string.h>
#include <dialogs/dialogs.h> #include <dialogs/dialogs.h>
#include <notification/notification.h> #include <notification/notification.h>
#include <notification/notification_messages.h> #include <notification/notification_messages.h>
@@ -65,17 +64,17 @@ typedef struct {
u_int8_t menu_index; u_int8_t menu_index;
u_int8_t menu_proto_index; u_int8_t menu_proto_index;
string_t data_str; FuriString* data_str;
uint8_t data[6]; uint8_t data[6];
uint8_t payload[6]; uint8_t payload[6];
uint8_t attack_step; uint8_t attack_step;
FlipFridAttacks attack; FlipFridAttacks attack;
FlipFridProtos proto; FlipFridProtos proto;
string_t attack_name; FuriString* attack_name;
string_t proto_name; FuriString* proto_name;
DialogsApp* dialogs; DialogsApp* dialogs;
string_t notification_msg; FuriString* notification_msg;
uint8_t key_index; uint8_t key_index;
LFRFIDWorker* worker; LFRFIDWorker* worker;
ProtocolDict* dict; ProtocolDict* dict;

View File

@@ -1,7 +1,7 @@
#include "flipfrid_scene_entrypoint.h" #include "flipfrid_scene_entrypoint.h"
string_t menu_items[4]; FuriString* menu_items[4];
string_t menu_proto_items[4]; FuriString* menu_proto_items[4];
void flipfrid_scene_entrypoint_menu_callback( void flipfrid_scene_entrypoint_menu_callback(
FlipFridState* context, FlipFridState* context,
@@ -11,22 +11,22 @@ void flipfrid_scene_entrypoint_menu_callback(
case FlipFridAttackDefaultValues: case FlipFridAttackDefaultValues:
context->attack = FlipFridAttackDefaultValues; context->attack = FlipFridAttackDefaultValues;
context->current_scene = SceneAttack; context->current_scene = SceneAttack;
string_set_str(context->attack_name, "Default Values"); furi_string_set(context->attack_name, "Default Values");
break; break;
case FlipFridAttackBfCustomerId: case FlipFridAttackBfCustomerId:
context->attack = FlipFridAttackBfCustomerId; context->attack = FlipFridAttackBfCustomerId;
context->current_scene = SceneAttack; context->current_scene = SceneAttack;
string_set_str(context->attack_name, "Bad Customer ID"); furi_string_set(context->attack_name, "Bad Customer ID");
break; break;
case FlipFridAttackLoadFile: case FlipFridAttackLoadFile:
context->attack = FlipFridAttackLoadFile; context->attack = FlipFridAttackLoadFile;
context->current_scene = SceneSelectFile; context->current_scene = SceneSelectFile;
string_set_str(context->attack_name, "Load File"); furi_string_set(context->attack_name, "Load File");
break; break;
case FlipFridAttackLoadFileCustomUids: case FlipFridAttackLoadFileCustomUids:
context->attack = FlipFridAttackLoadFileCustomUids; context->attack = FlipFridAttackLoadFileCustomUids;
context->current_scene = SceneLoadCustomUids; context->current_scene = SceneLoadCustomUids;
string_set_str(context->attack_name, "Load Custom UIDs"); furi_string_set(context->attack_name, "Load Custom UIDs");
break; break;
default: default:
break; break;
@@ -35,19 +35,19 @@ void flipfrid_scene_entrypoint_menu_callback(
switch(proto_index) { switch(proto_index) {
case EM4100: case EM4100:
context->proto = EM4100; context->proto = EM4100;
string_set_str(context->proto_name, "EM4100"); furi_string_set(context->proto_name, "EM4100");
break; break;
case HIDProx: case HIDProx:
context->proto = HIDProx; context->proto = HIDProx;
string_set_str(context->proto_name, "HIDProx"); furi_string_set(context->proto_name, "HIDProx");
break; break;
case PAC: case PAC:
context->proto = PAC; context->proto = PAC;
string_set_str(context->proto_name, "PAC/Stanley"); furi_string_set(context->proto_name, "PAC/Stanley");
break; break;
case H10301: case H10301:
context->proto = H10301; context->proto = H10301;
string_set_str(context->proto_name, "H10301"); furi_string_set(context->proto_name, "H10301");
break; break;
default: default:
break; break;
@@ -65,33 +65,33 @@ void flipfrid_scene_entrypoint_on_enter(FlipFridState* context) {
context->menu_index = 0; context->menu_index = 0;
for(uint32_t i = 0; i < 4; i++) { 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"); furi_string_set(menu_items[0], "Default Values");
string_set(menu_items[1], "BF Customer ID"); furi_string_set(menu_items[1], "BF Customer ID");
string_set(menu_items[2], "Load File"); furi_string_set(menu_items[2], "Load File");
string_set(menu_items[3], "Load uids from file"); furi_string_set(menu_items[3], "Load uids from file");
context->menu_proto_index = 0; context->menu_proto_index = 0;
for(uint32_t i = 0; i < 4; i++) { 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"); furi_string_set(menu_proto_items[0], "EM4100");
string_set(menu_proto_items[1], "HIDProx"); furi_string_set(menu_proto_items[1], "HIDProx");
string_set(menu_proto_items[2], "PAC/Stanley"); furi_string_set(menu_proto_items[2], "PAC/Stanley");
string_set(menu_proto_items[3], "H10301"); furi_string_set(menu_proto_items[3], "H10301");
} }
void flipfrid_scene_entrypoint_on_exit(FlipFridState* context) { void flipfrid_scene_entrypoint_on_exit(FlipFridState* context) {
UNUSED(context); UNUSED(context);
for(uint32_t i = 0; i < 4; i++) { 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++) { 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, 24,
AlignCenter, AlignCenter,
AlignTop, 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_set_font(canvas, FontPrimary);
canvas_draw_str_aligned( 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) { if(context->menu_index < FlipFridAttackLoadFileCustomUids) {
canvas_set_font(canvas, FontSecondary); canvas_set_font(canvas, FontSecondary);
@@ -166,7 +171,7 @@ void flipfrid_scene_entrypoint_on_draw(Canvas* canvas, FlipFridState* context) {
48, 48,
AlignCenter, AlignCenter,
AlignTop, 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) { if(context->menu_proto_index > EM4100) {
@@ -177,7 +182,7 @@ void flipfrid_scene_entrypoint_on_draw(Canvas* canvas, FlipFridState* context) {
-12, -12,
AlignCenter, AlignCenter,
AlignTop, 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); canvas_set_font(canvas, FontPrimary);
@@ -190,7 +195,7 @@ void flipfrid_scene_entrypoint_on_draw(Canvas* canvas, FlipFridState* context) {
4, 4,
AlignCenter, AlignCenter,
AlignTop, 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_set_font(canvas, FontPrimary);
canvas_draw_str_aligned(canvas, 101, 4, AlignCenter, AlignTop, ">"); canvas_draw_str_aligned(canvas, 101, 4, AlignCenter, AlignTop, ">");
@@ -203,6 +208,6 @@ void flipfrid_scene_entrypoint_on_draw(Canvas* canvas, FlipFridState* context) {
-12, -12,
AlignCenter, AlignCenter,
AlignTop, AlignTop,
string_get_cstr(menu_proto_items[context->menu_proto_index + 1])); furi_string_get_cstr(menu_proto_items[context->menu_proto_index + 1]));
} }
} }

View File

@@ -21,9 +21,9 @@ bool flipfrid_load_uids(FlipFridState* context, const char* file_path) {
bool flipfrid_load_custom_uids_from_file(FlipFridState* context) { bool flipfrid_load_custom_uids_from_file(FlipFridState* context) {
// Input events and views are managed by file_select // Input events and views are managed by file_select
string_t uid_path; FuriString* uid_path;
string_init(uid_path); uid_path = furi_string_alloc();
string_set_str(uid_path, RFIDFUZZER_APP_PATH_FOLDER); furi_string_set(uid_path, RFIDFUZZER_APP_PATH_FOLDER);
DialogsFileBrowserOptions browser_options; DialogsFileBrowserOptions browser_options;
dialog_file_browser_set_basic_options(&browser_options, LFRFID_UIDS_EXTENSION, &I_125_10px); 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); bool res = dialog_file_browser_show(context->dialogs, uid_path, uid_path, &browser_options);
if(res) { 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; return res;
} }

View File

@@ -8,61 +8,61 @@ bool flipfrid_load(FlipFridState* context, const char* file_path) {
bool result = false; bool result = false;
Storage* storage = furi_record_open(RECORD_STORAGE); Storage* storage = furi_record_open(RECORD_STORAGE);
FlipperFormat* fff_data_file = flipper_format_file_alloc(storage); FlipperFormat* fff_data_file = flipper_format_file_alloc(storage);
string_t temp_str; FuriString* temp_str;
string_init(temp_str); temp_str = furi_string_alloc();
do { do {
if(!flipper_format_file_open_existing(fff_data_file, file_path)) { if(!flipper_format_file_open_existing(fff_data_file, file_path)) {
FURI_LOG_E(TAG, "Error open file %s", file_path); FURI_LOG_E(TAG, "Error open file %s", file_path);
string_reset(context->notification_msg); furi_string_reset(context->notification_msg);
string_set_str(context->notification_msg, "Error open file"); furi_string_set(context->notification_msg, "Error open file");
break; break;
} }
// FileType // FileType
if(!flipper_format_read_string(fff_data_file, "Filetype", temp_str)) { if(!flipper_format_read_string(fff_data_file, "Filetype", temp_str)) {
FURI_LOG_E(TAG, "Missing or incorrect Filetype"); FURI_LOG_E(TAG, "Missing or incorrect Filetype");
string_reset(context->notification_msg); furi_string_reset(context->notification_msg);
string_set_str(context->notification_msg, "Missing or incorrect Filetypes"); furi_string_set(context->notification_msg, "Missing or incorrect Filetypes");
break; break;
} else { } 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 // Key type
if(!flipper_format_read_string(fff_data_file, "Key type", temp_str)) { if(!flipper_format_read_string(fff_data_file, "Key type", temp_str)) {
FURI_LOG_E(TAG, "Missing or incorrect Key type"); FURI_LOG_E(TAG, "Missing or incorrect Key type");
string_reset(context->notification_msg); furi_string_reset(context->notification_msg);
string_set_str(context->notification_msg, "Missing or incorrect Key type"); furi_string_set(context->notification_msg, "Missing or incorrect Key type");
break; break;
} else { } 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(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"); FURI_LOG_E(TAG, "Unsupported Key type");
string_reset(context->notification_msg); furi_string_reset(context->notification_msg);
string_set_str(context->notification_msg, "Unsupported Key type"); furi_string_set(context->notification_msg, "Unsupported Key type");
break; break;
} }
} else if(context->proto == PAC) { } 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"); FURI_LOG_E(TAG, "Unsupported Key type");
string_reset(context->notification_msg); furi_string_reset(context->notification_msg);
string_set_str(context->notification_msg, "Unsupported Key type"); furi_string_set(context->notification_msg, "Unsupported Key type");
break; break;
} }
} else if(context->proto == H10301) { } 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"); FURI_LOG_E(TAG, "Unsupported Key type");
string_reset(context->notification_msg); furi_string_reset(context->notification_msg);
string_set_str(context->notification_msg, "Unsupported Key type"); furi_string_set(context->notification_msg, "Unsupported Key type");
break; break;
} }
} else { } 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"); FURI_LOG_E(TAG, "Unsupported Key type");
string_reset(context->notification_msg); furi_string_reset(context->notification_msg);
string_set_str(context->notification_msg, "Unsupported Key type"); furi_string_set(context->notification_msg, "Unsupported Key type");
break; break;
} }
} }
@@ -71,38 +71,38 @@ bool flipfrid_load(FlipFridState* context, const char* file_path) {
// Data // Data
if(!flipper_format_read_string(fff_data_file, "Data", context->data_str)) { if(!flipper_format_read_string(fff_data_file, "Data", context->data_str)) {
FURI_LOG_E(TAG, "Missing or incorrect Data"); FURI_LOG_E(TAG, "Missing or incorrect Data");
string_reset(context->notification_msg); furi_string_reset(context->notification_msg);
string_set_str(context->notification_msg, "Missing or incorrect Key"); furi_string_set(context->notification_msg, "Missing or incorrect Key");
break; break;
} else { } 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(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"); FURI_LOG_E(TAG, "Incorrect Key length");
string_reset(context->notification_msg); furi_string_reset(context->notification_msg);
string_set_str(context->notification_msg, "Incorrect Key length"); furi_string_set(context->notification_msg, "Incorrect Key length");
break; break;
} }
} else if(context->proto == PAC) { } 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"); FURI_LOG_E(TAG, "Incorrect Key length");
string_reset(context->notification_msg); furi_string_reset(context->notification_msg);
string_set_str(context->notification_msg, "Incorrect Key length"); furi_string_set(context->notification_msg, "Incorrect Key length");
break; break;
} }
} else if(context->proto == H10301) { } 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"); FURI_LOG_E(TAG, "Incorrect Key length");
string_reset(context->notification_msg); furi_string_reset(context->notification_msg);
string_set_str(context->notification_msg, "Incorrect Key length"); furi_string_set(context->notification_msg, "Incorrect Key length");
break; break;
} }
} else { } else {
if(string_size(context->data_str) != 17) { if(furi_string_size(context->data_str) != 17) {
FURI_LOG_E(TAG, "Incorrect Key length"); FURI_LOG_E(TAG, "Incorrect Key length");
string_reset(context->notification_msg); furi_string_reset(context->notification_msg);
string_set_str(context->notification_msg, "Incorrect Key length"); furi_string_set(context->notification_msg, "Incorrect Key length");
break; break;
} }
} }
@@ -110,8 +110,8 @@ bool flipfrid_load(FlipFridState* context, const char* file_path) {
// String to uint8_t // String to uint8_t
for(uint8_t i = 0; i < 6; i++) { for(uint8_t i = 0; i < 6; i++) {
char temp_str2[3]; char temp_str2[3];
temp_str2[0] = string_get_cstr(context->data_str)[i * 3]; temp_str2[0] = furi_string_get_cstr(context->data_str)[i * 3];
temp_str2[1] = string_get_cstr(context->data_str)[i * 3 + 1]; temp_str2[1] = furi_string_get_cstr(context->data_str)[i * 3 + 1];
temp_str2[2] = '\0'; temp_str2[2] = '\0';
context->data[i] = (uint8_t)strtol(temp_str2, NULL, 16); 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; result = true;
} while(0); } while(0);
string_clear(temp_str); furi_string_free(temp_str);
flipper_format_free(fff_data_file); flipper_format_free(fff_data_file);
if(result) { if(result) {
FURI_LOG_I(TAG, "Loaded successfully"); FURI_LOG_I(TAG, "Loaded successfully");
string_reset(context->notification_msg); furi_string_reset(context->notification_msg);
string_set_str(context->notification_msg, "Source loaded."); furi_string_set(context->notification_msg, "Source loaded.");
} }
return result; 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) { bool flipfrid_load_protocol_from_file(FlipFridState* context) {
string_t user_file_path; FuriString* user_file_path;
string_init(user_file_path); user_file_path = furi_string_alloc();
string_set_str(user_file_path, LFRFID_APP_PATH_FOLDER); furi_string_set(user_file_path, LFRFID_APP_PATH_FOLDER);
DialogsFileBrowserOptions browser_options; DialogsFileBrowserOptions browser_options;
dialog_file_browser_set_basic_options(&browser_options, LFRFID_APP_EXTENSION, &I_125_10px); 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); context->dialogs, user_file_path, user_file_path, &browser_options);
if(res) { 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; return res;
} }

View File

@@ -337,7 +337,7 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) {
if(context->proto == EM4100) { if(context->proto == EM4100) {
bool end_of_list = false; bool end_of_list = false;
while(true) { while(true) {
string_reset(context->data_str); furi_string_reset(context->data_str);
if(!stream_read_line(context->uids_stream, context->data_str)) { if(!stream_read_line(context->uids_stream, context->data_str)) {
context->attack_step = 0; context->attack_step = 0;
counter = 0; counter = 0;
@@ -348,13 +348,13 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) {
end_of_list = true; end_of_list = true;
break; break;
}; };
if(string_get_char(context->data_str, 0) == '#') continue; if(furi_string_get_char(context->data_str, 0) == '#') continue;
if(string_size(context->data_str) != 11) break; if(furi_string_size(context->data_str) != 11) break;
break; break;
} }
if(end_of_list) break; if(end_of_list) break;
FURI_LOG_D(TAG, string_get_cstr(context->data_str)); FURI_LOG_D(TAG, furi_string_get_cstr(context->data_str));
if(string_size(context->data_str) != 11) { if(furi_string_size(context->data_str) != 11) {
context->attack_step = 0; context->attack_step = 0;
counter = 0; counter = 0;
context->is_attacking = false; 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 // string is valid, parse it in context->payload
for(uint8_t i = 0; i < 5; i++) { for(uint8_t i = 0; i < 5; i++) {
char temp_str[3]; char temp_str[3];
temp_str[0] = string_get_cstr(context->data_str)[i * 2]; temp_str[0] = furi_string_get_cstr(context->data_str)[i * 2];
temp_str[1] = string_get_cstr(context->data_str)[i * 2 + 1]; temp_str[1] = furi_string_get_cstr(context->data_str)[i * 2 + 1];
temp_str[2] = '\0'; temp_str[2] = '\0';
context->payload[i] = (uint8_t)strtol(temp_str, NULL, 16); 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) { } else if(context->proto == PAC) {
bool end_of_list = false; bool end_of_list = false;
while(true) { while(true) {
string_reset(context->data_str); furi_string_reset(context->data_str);
if(!stream_read_line(context->uids_stream, context->data_str)) { if(!stream_read_line(context->uids_stream, context->data_str)) {
context->attack_step = 0; context->attack_step = 0;
counter = 0; counter = 0;
@@ -386,13 +386,13 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) {
end_of_list = true; end_of_list = true;
break; break;
}; };
if(string_get_char(context->data_str, 0) == '#') continue; if(furi_string_get_char(context->data_str, 0) == '#') continue;
if(string_size(context->data_str) != 9) break; if(furi_string_size(context->data_str) != 9) break;
break; break;
} }
if(end_of_list) break; if(end_of_list) break;
FURI_LOG_D(TAG, string_get_cstr(context->data_str)); FURI_LOG_D(TAG, furi_string_get_cstr(context->data_str));
if(string_size(context->data_str) != 9) { if(furi_string_size(context->data_str) != 9) {
context->attack_step = 0; context->attack_step = 0;
counter = 0; counter = 0;
context->is_attacking = false; 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 // string is valid, parse it in context->payload
for(uint8_t i = 0; i < 4; i++) { for(uint8_t i = 0; i < 4; i++) {
char temp_str[3]; char temp_str[3];
temp_str[0] = string_get_cstr(context->data_str)[i * 2]; temp_str[0] = furi_string_get_cstr(context->data_str)[i * 2];
temp_str[1] = string_get_cstr(context->data_str)[i * 2 + 1]; temp_str[1] = furi_string_get_cstr(context->data_str)[i * 2 + 1];
temp_str[2] = '\0'; temp_str[2] = '\0';
context->payload[i] = (uint8_t)strtol(temp_str, NULL, 16); 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) { } else if(context->proto == H10301) {
bool end_of_list = false; bool end_of_list = false;
while(true) { while(true) {
string_reset(context->data_str); furi_string_reset(context->data_str);
if(!stream_read_line(context->uids_stream, context->data_str)) { if(!stream_read_line(context->uids_stream, context->data_str)) {
context->attack_step = 0; context->attack_step = 0;
counter = 0; counter = 0;
@@ -424,13 +424,13 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) {
end_of_list = true; end_of_list = true;
break; break;
}; };
if(string_get_char(context->data_str, 0) == '#') continue; if(furi_string_get_char(context->data_str, 0) == '#') continue;
if(string_size(context->data_str) != 7) break; if(furi_string_size(context->data_str) != 7) break;
break; break;
} }
if(end_of_list) break; if(end_of_list) break;
FURI_LOG_D(TAG, string_get_cstr(context->data_str)); FURI_LOG_D(TAG, furi_string_get_cstr(context->data_str));
if(string_size(context->data_str) != 7) { if(furi_string_size(context->data_str) != 7) {
context->attack_step = 0; context->attack_step = 0;
counter = 0; counter = 0;
context->is_attacking = false; 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 // string is valid, parse it in context->payload
for(uint8_t i = 0; i < 3; i++) { for(uint8_t i = 0; i < 3; i++) {
char temp_str[3]; char temp_str[3];
temp_str[0] = string_get_cstr(context->data_str)[i * 2]; temp_str[0] = furi_string_get_cstr(context->data_str)[i * 2];
temp_str[1] = string_get_cstr(context->data_str)[i * 2 + 1]; temp_str[1] = furi_string_get_cstr(context->data_str)[i * 2 + 1];
temp_str[2] = '\0'; temp_str[2] = '\0';
context->payload[i] = (uint8_t)strtol(temp_str, NULL, 16); context->payload[i] = (uint8_t)strtol(temp_str, NULL, 16);
} }
@@ -451,7 +451,7 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) {
} else { } else {
bool end_of_list = false; bool end_of_list = false;
while(true) { while(true) {
string_reset(context->data_str); furi_string_reset(context->data_str);
if(!stream_read_line(context->uids_stream, context->data_str)) { if(!stream_read_line(context->uids_stream, context->data_str)) {
context->attack_step = 0; context->attack_step = 0;
counter = 0; counter = 0;
@@ -462,13 +462,13 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) {
end_of_list = true; end_of_list = true;
break; break;
}; };
if(string_get_char(context->data_str, 0) == '#') continue; if(furi_string_get_char(context->data_str, 0) == '#') continue;
if(string_size(context->data_str) != 13) break; if(furi_string_size(context->data_str) != 13) break;
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(end_of_list) break;
if(string_size(context->data_str) != 13) { if(furi_string_size(context->data_str) != 13) {
context->attack_step = 0; context->attack_step = 0;
counter = 0; counter = 0;
context->is_attacking = false; 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 // string is valid, parse it in context->payload
for(uint8_t i = 0; i < 6; i++) { for(uint8_t i = 0; i < 6; i++) {
char temp_str[3]; char temp_str[3];
temp_str[0] = string_get_cstr(context->data_str)[i * 2]; temp_str[0] = furi_string_get_cstr(context->data_str)[i * 2];
temp_str[1] = string_get_cstr(context->data_str)[i * 2 + 1]; temp_str[1] = furi_string_get_cstr(context->data_str)[i * 2 + 1];
temp_str[2] = '\0'; temp_str[2] = '\0';
context->payload[i] = (uint8_t)strtol(temp_str, NULL, 16); 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->attack_step = 0;
context->is_attacking = false; context->is_attacking = false;
string_reset(context->notification_msg); furi_string_reset(context->notification_msg);
context->current_scene = SceneEntryPoint; context->current_scene = SceneEntryPoint;
notification_message(context->notify, &sequence_blink_stop); notification_message(context->notify, &sequence_blink_stop);
break; break;
@@ -557,7 +557,7 @@ void flipfrid_scene_run_attack_on_draw(Canvas* canvas, FlipFridState* context) {
// Title // Title
canvas_set_font(canvas, FontPrimary); canvas_set_font(canvas, FontPrimary);
canvas_draw_str_aligned( 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 uid[18];
char speed[16]; char speed[16];
@@ -606,7 +606,7 @@ void flipfrid_scene_run_attack_on_draw(Canvas* canvas, FlipFridState* context) {
canvas_set_font(canvas, FontSecondary); canvas_set_font(canvas, FontSecondary);
canvas_draw_str_aligned( 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); snprintf(speed, sizeof(speed), "Time delay: %d", context->time_between_cards);

View File

@@ -65,12 +65,12 @@ void flipfrid_center_displayed_key(FlipFridState* context, uint8_t index) {
display_menu[15] = ' '; display_menu[15] = ' ';
} }
string_reset(context->notification_msg); furi_string_reset(context->notification_msg);
string_set_str(context->notification_msg, display_menu); furi_string_set(context->notification_msg, display_menu);
} }
void flipfrid_scene_select_field_on_enter(FlipFridState* context) { 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) { 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) { void flipfrid_scene_select_field_on_event(FlipFridEvent event, FlipFridState* context) {
if(event.evt_type == EventTypeKey) { if(event.evt_type == EventTypeKey) {
if(event.input_type == InputTypeShort) { 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]); int data_len = sizeof(context->data) / sizeof(context->data[0]);
// don't look, it's ugly but I'm a python dev so... // 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; break;
case InputKeyOk: case InputKeyOk:
string_reset(context->notification_msg); furi_string_reset(context->notification_msg);
context->current_scene = SceneAttack; context->current_scene = SceneAttack;
break; break;
case InputKeyBack: case InputKeyBack:
context->key_index = 0; context->key_index = 0;
string_reset(context->notification_msg); furi_string_reset(context->notification_msg);
context->current_scene = SceneSelectFile; context->current_scene = SceneSelectFile;
break; break;
} }
@@ -154,5 +154,5 @@ void flipfrid_scene_select_field_on_draw(Canvas* canvas, FlipFridState* context)
flipfrid_center_displayed_key(context, context->key_index); flipfrid_center_displayed_key(context, context->key_index);
canvas_set_font(canvas, FontSecondary); canvas_set_font(canvas, FontSecondary);
canvas_draw_str_aligned( 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));
} }

View File

@@ -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) { static bool open_ducky_script(Stream* stream, PluginState* plugin_state) {
DialogsApp* dialogs = furi_record_open("dialogs"); DialogsApp* dialogs = furi_record_open("dialogs");
bool result = false; bool result = false;
string_t path; FuriString* path;
string_init(path); path = furi_string_alloc();
string_set_str(path, MOUSEJACKER_APP_PATH_FOLDER); furi_string_set(path, MOUSEJACKER_APP_PATH_FOLDER);
DialogsFileBrowserOptions browser_options; DialogsFileBrowserOptions browser_options;
dialog_file_browser_set_basic_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"); furi_record_close("dialogs");
if(ret) { 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)); FURI_LOG_D(TAG, "Cannot open file \"%s\"", (path));
} else { } else {
result = true; result = true;
} }
} }
string_clear(path); furi_string_free(path);
plugin_state->is_ducky_running = true; 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) { static bool open_addrs_file(Stream* stream) {
DialogsApp* dialogs = furi_record_open("dialogs"); DialogsApp* dialogs = furi_record_open("dialogs");
bool result = false; bool result = false;
string_t path; FuriString* path;
string_init(path); path = furi_string_alloc();
string_set_str(path, NRFSNIFF_APP_PATH_FOLDER); furi_string_set(path, NRFSNIFF_APP_PATH_FOLDER);
DialogsFileBrowserOptions browser_options; DialogsFileBrowserOptions browser_options;
dialog_file_browser_set_basic_options( dialog_file_browser_set_basic_options(
@@ -146,13 +146,13 @@ static bool open_addrs_file(Stream* stream) {
furi_record_close("dialogs"); furi_record_close("dialogs");
if(ret) { 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)); FURI_LOG_D(TAG, "Cannot open file \"%s\"", (path));
} else { } else {
result = true; result = true;
} }
} }
string_clear(path); furi_string_free(path);
return result; return result;
} }

View File

@@ -39,10 +39,10 @@ typedef struct {
int current_playlist_repetition; // current playlist repetition int current_playlist_repetition; // current playlist repetition
// last 3 files // last 3 files
string_t prev_0_path; // current file FuriString* prev_0_path; // current file
string_t prev_1_path; // previous file FuriString* prev_1_path; // previous file
string_t prev_2_path; // previous previous file FuriString* prev_2_path; // previous previous file
string_t prev_3_path; // you get the idea FuriString* prev_3_path; // you get the idea
int state; // current state int state; // current state
@@ -56,7 +56,7 @@ typedef struct {
DisplayMeta* meta; 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_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 bool ctl_pause; // can be set to true if the worker should pause
@@ -73,7 +73,7 @@ typedef struct {
DisplayMeta* meta; DisplayMeta* meta;
PlaylistWorker* worker; PlaylistWorker* worker;
string_t file_path; // Path to the playlist file FuriString* file_path; // Path to the playlist file
} Playlist; } Playlist;
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@@ -83,23 +83,23 @@ void meta_set_state(DisplayMeta* meta, int state) {
view_port_update(meta->view_port); view_port_update(meta->view_port);
} }
static FuriHalSubGhzPreset str_to_preset(string_t preset) { static FuriHalSubGhzPreset str_to_preset(FuriString* preset) {
if(string_cmp_str(preset, "FuriHalSubGhzPresetOok270Async") == 0) { if(furi_string_cmp_str(preset, "FuriHalSubGhzPresetOok270Async") == 0) {
return FuriHalSubGhzPresetOok270Async; return FuriHalSubGhzPresetOok270Async;
} }
if(string_cmp_str(preset, "FuriHalSubGhzPresetOok650Async") == 0) { if(furi_string_cmp_str(preset, "FuriHalSubGhzPresetOok650Async") == 0) {
return FuriHalSubGhzPresetOok650Async; return FuriHalSubGhzPresetOok650Async;
} }
if(string_cmp_str(preset, "FuriHalSubGhzPreset2FSKDev238Async") == 0) { if(furi_string_cmp_str(preset, "FuriHalSubGhzPreset2FSKDev238Async") == 0) {
return FuriHalSubGhzPreset2FSKDev238Async; return FuriHalSubGhzPreset2FSKDev238Async;
} }
if(string_cmp_str(preset, "FuriHalSubGhzPreset2FSKDev476Async") == 0) { if(furi_string_cmp_str(preset, "FuriHalSubGhzPreset2FSKDev476Async") == 0) {
return FuriHalSubGhzPreset2FSKDev476Async; return FuriHalSubGhzPreset2FSKDev476Async;
} }
if(string_cmp_str(preset, "FuriHalSubGhzPresetMSK99_97KbAsync") == 0) { if(furi_string_cmp_str(preset, "FuriHalSubGhzPresetMSK99_97KbAsync") == 0) {
return FuriHalSubGhzPresetMSK99_97KbAsync; return FuriHalSubGhzPresetMSK99_97KbAsync;
} }
if(string_cmp_str(preset, "FuriHalSubGhzPresetMSK99_97KbAsync") == 0) { if(furi_string_cmp_str(preset, "FuriHalSubGhzPresetMSK99_97KbAsync") == 0) {
return FuriHalSubGhzPresetMSK99_97KbAsync; return FuriHalSubGhzPresetMSK99_97KbAsync;
} }
return FuriHalSubGhzPresetCustom; return FuriHalSubGhzPresetCustom;
@@ -117,8 +117,8 @@ static int playlist_worker_process(
FlipperFormat* fff_file, FlipperFormat* fff_file,
FlipperFormat* fff_data, FlipperFormat* fff_data,
const char* path, const char* path,
string_t preset, FuriString* preset,
string_t protocol) { FuriString* protocol) {
// actual sending of .sub file // actual sending of .sub file
if(!flipper_format_file_open_existing(fff_file, path)) { if(!flipper_format_file_open_existing(fff_file, path)) {
@@ -148,7 +148,7 @@ static int playlist_worker_process(
return -4; return -4;
} }
if(!string_cmp_str(protocol, "RAW")) { if(!furi_string_cmp_str(protocol, "RAW")) {
subghz_protocol_raw_gen_fff_data(fff_data, path); subghz_protocol_raw_gen_fff_data(fff_data, path);
} else { } else {
stream_copy_full( stream_copy_full(
@@ -159,7 +159,7 @@ static int playlist_worker_process(
// (try to) send file // (try to) send file
SubGhzEnvironment* environment = subghz_environment_alloc(); SubGhzEnvironment* environment = subghz_environment_alloc();
SubGhzTransmitter* transmitter = 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); subghz_transmitter_deserialize(transmitter, fff_data);
@@ -216,9 +216,9 @@ static bool playlist_worker_play_playlist_once(
Storage* storage, Storage* storage,
FlipperFormat* fff_head, FlipperFormat* fff_head,
FlipperFormat* fff_data, FlipperFormat* fff_data,
string_t data, FuriString* data,
string_t preset, FuriString* preset,
string_t protocol) { FuriString* protocol) {
// //
if(!flipper_format_rewind(fff_head)) { if(!flipper_format_rewind(fff_head)) {
FURI_LOG_E(TAG, "Failed to rewind file"); 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); meta_set_state(worker->meta, STATE_SENDING);
++worker->meta->current_count; ++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 :) // it's not fancy, but it works for now :)
string_reset(worker->meta->prev_3_path); furi_string_reset(worker->meta->prev_3_path);
string_set_str(worker->meta->prev_3_path, string_get_cstr(worker->meta->prev_2_path)); furi_string_set(
string_reset(worker->meta->prev_2_path); worker->meta->prev_3_path, furi_string_get_cstr(worker->meta->prev_2_path));
string_set_str(worker->meta->prev_2_path, string_get_cstr(worker->meta->prev_1_path)); furi_string_reset(worker->meta->prev_2_path);
string_reset(worker->meta->prev_1_path); furi_string_set(
string_set_str(worker->meta->prev_1_path, string_get_cstr(worker->meta->prev_0_path)); worker->meta->prev_2_path, furi_string_get_cstr(worker->meta->prev_1_path));
string_reset(worker->meta->prev_0_path); furi_string_reset(worker->meta->prev_1_path);
string_set_str(worker->meta->prev_0_path, str); 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); view_port_update(worker->meta->view_port);
for(int i = 0; i < 1; i++) { 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); FlipperFormat* fff_head = flipper_format_file_alloc(storage);
PlaylistWorker* worker = ctx; PlaylistWorker* worker = ctx;
if(!flipper_format_file_open_existing(fff_head, 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", 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; worker->is_running = false;
furi_record_close(RECORD_STORAGE); furi_record_close(RECORD_STORAGE);
@@ -297,10 +300,12 @@ static int32_t playlist_worker_thread(void* ctx) {
playlist_worker_wait_pause(worker); playlist_worker_wait_pause(worker);
FlipperFormat* fff_data = flipper_format_string_alloc(); FlipperFormat* fff_data = flipper_format_string_alloc();
string_t data, preset, protocol; FuriString* data;
string_init(data); FuriString* preset;
string_init(preset); FuriString* protocol;
string_init(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++) { for(int i = 0; i < MAX(1, worker->meta->playlist_repetitions); i++) {
// infinite repetitions if playlist_repetitions is 0 // infinite repetitions if playlist_repetitions is 0
@@ -330,9 +335,9 @@ static int32_t playlist_worker_thread(void* ctx) {
furi_record_close(RECORD_STORAGE); furi_record_close(RECORD_STORAGE);
flipper_format_free(fff_head); flipper_format_free(fff_head);
string_clear(data); furi_string_free(data);
string_clear(preset); furi_string_free(preset);
string_clear(protocol); furi_string_free(protocol);
flipper_format_free(fff_data); flipper_format_free(fff_data);
@@ -351,18 +356,18 @@ void playlist_meta_reset(DisplayMeta* instance) {
instance->current_count = 0; instance->current_count = 0;
instance->current_playlist_repetition = 0; instance->current_playlist_repetition = 0;
string_reset(instance->prev_0_path); furi_string_reset(instance->prev_0_path);
string_reset(instance->prev_1_path); furi_string_reset(instance->prev_1_path);
string_reset(instance->prev_2_path); furi_string_reset(instance->prev_2_path);
string_reset(instance->prev_3_path); furi_string_reset(instance->prev_3_path);
} }
DisplayMeta* playlist_meta_alloc() { DisplayMeta* playlist_meta_alloc() {
DisplayMeta* instance = malloc(sizeof(DisplayMeta)); DisplayMeta* instance = malloc(sizeof(DisplayMeta));
string_init(instance->prev_0_path); instance->prev_0_path = furi_string_alloc();
string_init(instance->prev_1_path); instance->prev_1_path = furi_string_alloc();
string_init(instance->prev_2_path); instance->prev_2_path = furi_string_alloc();
string_init(instance->prev_3_path); instance->prev_3_path = furi_string_alloc();
playlist_meta_reset(instance); playlist_meta_reset(instance);
instance->state = STATE_NONE; instance->state = STATE_NONE;
instance->playlist_repetitions = 1; instance->playlist_repetitions = 1;
@@ -370,10 +375,10 @@ DisplayMeta* playlist_meta_alloc() {
} }
void playlist_meta_free(DisplayMeta* instance) { void playlist_meta_free(DisplayMeta* instance) {
string_clear(instance->prev_0_path); furi_string_free(instance->prev_0_path);
string_clear(instance->prev_1_path); furi_string_free(instance->prev_1_path);
string_clear(instance->prev_2_path); furi_string_free(instance->prev_2_path);
string_clear(instance->prev_3_path); furi_string_free(instance->prev_3_path);
free(instance); free(instance);
} }
@@ -391,7 +396,7 @@ PlaylistWorker* playlist_worker_alloc(DisplayMeta* meta) {
instance->meta = meta; instance->meta = meta;
instance->ctl_pause = true; // require the user to manually start the worker 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; return instance;
} }
@@ -399,7 +404,7 @@ PlaylistWorker* playlist_worker_alloc(DisplayMeta* meta) {
void playlist_worker_free(PlaylistWorker* instance) { void playlist_worker_free(PlaylistWorker* instance) {
furi_assert(instance); furi_assert(instance);
furi_thread_free(instance->thread); furi_thread_free(instance->thread);
string_clear(instance->file_path); furi_string_free(instance->file_path);
free(instance); free(instance);
} }
@@ -420,7 +425,7 @@ void playlist_worker_start(PlaylistWorker* instance, const char* file_path) {
furi_assert(instance); furi_assert(instance);
furi_assert(!instance->is_running); 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; instance->is_running = true;
// reset meta (current/total) // reset meta (current/total)
@@ -440,8 +445,8 @@ static void render_callback(Canvas* canvas, void* ctx) {
canvas_set_color(canvas, ColorBlack); canvas_set_color(canvas, ColorBlack);
canvas_set_font(canvas, FontSecondary); canvas_set_font(canvas, FontSecondary);
string_t temp_str; FuriString* temp_str;
string_init(temp_str); temp_str = furi_string_alloc();
switch(app->meta->state) { switch(app->meta->state) {
case STATE_NONE: case STATE_NONE:
@@ -456,24 +461,26 @@ static void render_callback(Canvas* canvas, void* ctx) {
path_extract_filename(app->file_path, temp_str, true); path_extract_filename(app->file_path, temp_str, true);
canvas_set_font(canvas, FontPrimary); 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); canvas_set_font(canvas, FontSecondary);
// draw loaded count // draw loaded count
{ {
string_printf(temp_str, "%d Items in playlist", app->meta->total_count); furi_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)); canvas_draw_str_aligned(
canvas, 1, 19, AlignLeft, AlignTop, furi_string_get_cstr(temp_str));
if(app->meta->playlist_repetitions <= 0) { 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) { } 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 { } 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 // draw buttons
@@ -511,11 +518,12 @@ static void render_callback(Canvas* canvas, void* ctx) {
// draw progress text // draw progress text
{ {
canvas_set_font(canvas, FontSecondary); 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_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 xs = 11 + h + 2;
int w = WIDTH - xs - 1; int w = WIDTH - xs - 1;
canvas_draw_box(canvas, xs, HEIGHT - 5, w, 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) { 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 { } else {
string_printf( furi_string_printf(
temp_str, temp_str,
"[%d/%d]", "[%d/%d]",
app->meta->current_playlist_repetition, app->meta->current_playlist_repetition,
app->meta->playlist_repetitions); app->meta->playlist_repetitions);
} }
canvas_set_color(canvas, ColorBlack); 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); draw_corner_aligned(canvas, w + 6, 13, AlignRight, AlignTop);
canvas_set_color(canvas, ColorWhite); canvas_set_color(canvas, ColorWhite);
canvas_draw_str_aligned( 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 // draw last and current file
@@ -549,41 +557,41 @@ static void render_callback(Canvas* canvas, void* ctx) {
canvas_set_font(canvas, FontSecondary); canvas_set_font(canvas, FontSecondary);
// current // 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); 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_set_color(canvas, ColorBlack);
canvas_draw_rbox(canvas, 1, 1, w + 4, 12, 2); canvas_draw_rbox(canvas, 1, 1, w + 4, 12, 2);
canvas_set_color(canvas, ColorWhite); canvas_set_color(canvas, ColorWhite);
canvas_draw_str_aligned( 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 // last 3
canvas_set_color(canvas, ColorBlack); 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); path_extract_filename(app->meta->prev_1_path, temp_str, true);
canvas_draw_str_aligned( 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); path_extract_filename(app->meta->prev_2_path, temp_str, true);
canvas_draw_str_aligned( 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); path_extract_filename(app->meta->prev_3_path, temp_str, true);
canvas_draw_str_aligned( 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; break;
} }
string_clear(temp_str); furi_string_free(temp_str);
furi_mutex_release(app->mutex); furi_mutex_release(app->mutex);
} }
@@ -596,8 +604,8 @@ static void input_callback(InputEvent* event, void* ctx) {
Playlist* playlist_alloc(DisplayMeta* meta) { Playlist* playlist_alloc(DisplayMeta* meta) {
Playlist* app = malloc(sizeof(Playlist)); Playlist* app = malloc(sizeof(Playlist));
string_init(app->file_path); app->file_path = furi_string_alloc();
string_set_str(app->file_path, PLAYLIST_FOLDER); furi_string_set(app->file_path, PLAYLIST_FOLDER);
app->meta = meta; app->meta = meta;
app->worker = NULL; app->worker = NULL;
@@ -623,15 +631,15 @@ void playlist_start_worker(Playlist* app, DisplayMeta* meta) {
// count playlist items // count playlist items
Storage* storage = furi_record_open(RECORD_STORAGE); Storage* storage = furi_record_open(RECORD_STORAGE);
app->meta->total_count = 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); furi_record_close(RECORD_STORAGE);
// start thread // 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) { 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); gui_remove_view_port(app->gui, app->view_port);
furi_record_close(RECORD_GUI); furi_record_close(RECORD_GUI);
@@ -715,7 +723,7 @@ int32_t playlist_app(void* p) {
if(!app->worker->is_running) { if(!app->worker->is_running) {
app->worker->ctl_pause = false; app->worker->ctl_pause = false;
app->worker->ctl_request_exit = 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 { } else {
app->worker->ctl_pause = !app->worker->ctl_pause; app->worker->ctl_pause = !app->worker->ctl_pause;
} }

View File

@@ -9,13 +9,13 @@ int playlist_count_playlist_items(Storage* storage, const char* file_path) {
return -1; return -1;
} }
int count = 0; int count = 0;
string_t data; FuriString* data;
string_init(data); data = furi_string_alloc();
while(flipper_format_read_string(format, "sub", data)) { while(flipper_format_read_string(format, "sub", data)) {
++count; ++count;
} }
flipper_format_file_close(format); flipper_format_file_close(format);
flipper_format_free(format); flipper_format_free(format);
string_clear(data); furi_string_free(data);
return count; return count;
} }

View File

@@ -23,7 +23,7 @@ struct SubBruteWorker {
// Preset and frequency needed // Preset and frequency needed
FuriHalSubGhzPreset preset; FuriHalSubGhzPreset preset;
uint32_t frequency; uint32_t frequency;
string_t protocol_name; FuriString* protocol_name;
//SubBruteWorkerCallback callback; //SubBruteWorkerCallback callback;
//void* context; //void* context;
@@ -47,7 +47,7 @@ SubBruteWorker* subbrute_worker_alloc() {
instance->transmitter = NULL; instance->transmitter = NULL;
instance->flipper_format = flipper_format_string_alloc(); instance->flipper_format = flipper_format_string_alloc();
string_init(instance->protocol_name); instance->protocol_name = furi_string_alloc();
// SubGhzTxRxWorker // SubGhzTxRxWorker
instance->subghz_txrx = subghz_tx_rx_worker_alloc(); instance->subghz_txrx = subghz_tx_rx_worker_alloc();
@@ -71,7 +71,7 @@ void subbrute_worker_free(SubBruteWorker* instance) {
flipper_format_free(instance->flipper_format); flipper_format_free(instance->flipper_format);
string_clear(instance->protocol_name); furi_string_free(instance->protocol_name);
// SubGhzTxRxWorker // SubGhzTxRxWorker
subghz_tx_rx_worker_free(instance->subghz_txrx); subghz_tx_rx_worker_free(instance->subghz_txrx);
@@ -94,8 +94,8 @@ bool subbrute_worker_start(
instance->frequency = frequency; instance->frequency = frequency;
instance->preset = preset; instance->preset = preset;
string_clear(instance->protocol_name); furi_string_free(instance->protocol_name);
string_init_printf(instance->protocol_name, "%s", protocol_name); instance->protocol_name = furi_string_alloc_printf("%s", protocol_name);
bool res = false; bool res = false;
@@ -235,8 +235,8 @@ bool subbrute_worker_init_manual_transmit(
instance->preset = preset; instance->preset = preset;
instance->frequency = frequency; instance->frequency = frequency;
string_clear(instance->protocol_name); furi_string_free(instance->protocol_name);
string_init_printf(instance->protocol_name, "%s", protocol_name); instance->protocol_name = furi_string_alloc_printf("%s", protocol_name);
furi_hal_subghz_reset(); furi_hal_subghz_reset();
furi_hal_subghz_idle(); furi_hal_subghz_idle();
@@ -258,7 +258,7 @@ bool subbrute_worker_init_manual_transmit(
#endif #endif
instance->transmitter = subghz_transmitter_alloc_init( 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_reset();
furi_hal_subghz_load_preset(instance->preset); 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); stream_write_cstring(stream, payload);
instance->transmitter = subghz_transmitter_alloc_init( 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); subghz_transmitter_deserialize(instance->transmitter, instance->flipper_format);
furi_hal_subghz_reset(); furi_hal_subghz_reset();
furi_hal_subghz_load_preset(instance->preset); furi_hal_subghz_load_preset(instance->preset);

View File

@@ -16,10 +16,10 @@ void subbrute_scene_load_file_on_enter(void* context) {
SubBruteState* instance = (SubBruteState*)context; SubBruteState* instance = (SubBruteState*)context;
// Input events and views are managed by file_browser // Input events and views are managed by file_browser
string_t app_folder; FuriString* app_folder;
string_t load_path; FuriString* load_path;
string_init(load_path); load_path = furi_string_alloc();
string_init_set_str(app_folder, SUBBRUTE_PATH); app_folder = furi_string_alloc_set(SUBBRUTE_PATH);
DialogsFileBrowserOptions browser_options; DialogsFileBrowserOptions browser_options;
dialog_file_browser_set_basic_options(&browser_options, SUBBRUTE_FILE_EXT, &I_sub1_10px); 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( FURI_LOG_D(
TAG, TAG,
"load_path: %s, app_folder: %s", "load_path: %s, app_folder: %s",
string_get_cstr(load_path), furi_string_get_cstr(load_path),
string_get_cstr(app_folder)); furi_string_get_cstr(app_folder));
#endif #endif
if(res) { if(res) {
load_result = subbrute_device_load_from_file(instance->device, load_path); 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 { } else {
FURI_LOG_E(TAG, "Returned error: %d", load_result); FURI_LOG_E(TAG, "Returned error: %d", load_result);
string_t dialog_msg; FuriString* dialog_msg;
string_init(dialog_msg); dialog_msg = furi_string_alloc();
string_cat_printf( furi_string_cat_printf(
dialog_msg, "Cannot parse\nfile: %s", subbrute_device_error_get_desc(load_result)); 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)); dialog_message_show_storage_error(instance->dialogs, furi_string_get_cstr(dialog_msg));
string_clear(dialog_msg); furi_string_free(dialog_msg);
scene_manager_search_and_switch_to_previous_scene( scene_manager_search_and_switch_to_previous_scene(
instance->scene_manager, SubBruteSceneStart); instance->scene_manager, SubBruteSceneStart);
} }
@@ -65,8 +65,8 @@ void subbrute_scene_load_file_on_enter(void* context) {
instance->scene_manager, SubBruteSceneStart); instance->scene_manager, SubBruteSceneStart);
} }
string_clear(app_folder); furi_string_free(app_folder);
string_clear(load_path); furi_string_free(load_path);
} }
void subbrute_scene_load_file_on_exit(void* context) { void subbrute_scene_load_file_on_exit(void* context) {

View File

@@ -92,7 +92,7 @@ void subbrute_scene_run_attack_on_enter(void* context) {
instance->worker, instance->worker,
instance->device->frequency, instance->device->frequency,
instance->device->preset, 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!"); FURI_LOG_W(TAG, "Worker Continuous init failed!");
} }
} else { } else {
@@ -101,7 +101,7 @@ void subbrute_scene_run_attack_on_enter(void* context) {
instance->worker, instance->worker,
instance->device->frequency, instance->device->frequency,
instance->device->preset, 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!"); FURI_LOG_W(TAG, "Worker init failed!");
} }

View File

@@ -1,4 +1,3 @@
#include <m-string.h>
#include <subghz/types.h> #include <subghz/types.h>
#include <lib/toolbox/random_name.h> #include <lib/toolbox/random_name.h>
#include <gui/modules/validators.h> #include <gui/modules/validators.h>
@@ -26,10 +25,10 @@ void subbrute_scene_save_name_on_enter(void* context) {
SUBBRUTE_MAX_LEN_NAME, SUBBRUTE_MAX_LEN_NAME,
true); true);
string_set_str(device->load_path, SUBBRUTE_PATH); furi_string_set(device->load_path, SUBBRUTE_PATH);
ValidatorIsFile* validator_is_file = ValidatorIsFile* validator_is_file = validator_is_file_alloc_init(
validator_is_file_alloc_init(string_get_cstr(device->load_path), SUBBRUTE_FILE_EXT, ""); furi_string_get_cstr(device->load_path), SUBBRUTE_FILE_EXT, "");
text_input_set_validator(text_input, validator_is_file_callback, validator_is_file); text_input_set_validator(text_input, validator_is_file_callback, validator_is_file);
view_dispatcher_switch_to_view(instance->view_dispatcher, SubBruteViewTextInput); 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 #endif
bool success = false; bool success = false;
if(strcmp(instance->device->text_store, "")) { if(strcmp(instance->device->text_store, "")) {
string_cat_printf( furi_string_cat_printf(
instance->device->load_path, instance->device->load_path,
"/%s%s", "/%s%s",
instance->device->text_store, instance->device->text_store,
SUBBRUTE_FILE_EXT); SUBBRUTE_FILE_EXT);
if(subbrute_device_save_file( 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); scene_manager_next_scene(instance->scene_manager, SubBruteSceneSaveSuccess);
success = true; success = true;
consumed = true; consumed = true;
@@ -83,5 +82,5 @@ void subbrute_scene_save_name_on_exit(void* context) {
text_input_reset(instance->text_input); text_input_reset(instance->text_input);
string_reset(instance->device->load_path); furi_string_reset(instance->device->load_path);
} }

View File

@@ -31,7 +31,7 @@ void subbrute_scene_setup_attack_on_enter(void* context) {
instance->worker, instance->worker,
instance->device->frequency, instance->device->frequency,
instance->device->preset, 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!"); FURI_LOG_W(TAG, "Worker init failed!");
} }
@@ -144,7 +144,7 @@ bool subbrute_scene_setup_attack_on_event(void* context, SceneManagerEvent event
// view, // view,
// instance->device->frequency, // instance->device->frequency,
// instance->device->preset, // instance->device->preset,
// string_get_cstr(instance->device->protocol_name)); // furi_string_get_cstr(instance->device->protocol_name));
// } // }
subbrute_device_create_packet_parsed( subbrute_device_create_packet_parsed(
instance->device, instance->device->key_index, false); instance->device, instance->device->key_index, false);

View File

@@ -1,7 +1,6 @@
#include <furi.h> #include <furi.h>
#include <furi_hal.h> #include <furi_hal.h>
#include <input/input.h> #include <input/input.h>
#include <m-string.h>
#include <gui/gui.h> #include <gui/gui.h>
#include <gui/view_dispatcher.h> #include <gui/view_dispatcher.h>

View File

@@ -54,9 +54,9 @@ SubBruteDevice* subbrute_device_alloc() {
instance->state = SubBruteDeviceStateIDLE; instance->state = SubBruteDeviceStateIDLE;
instance->key_index = 0; instance->key_index = 0;
string_init(instance->load_path); instance->load_path = furi_string_alloc();
string_init(instance->preset_name); instance->preset_name = furi_string_alloc();
string_init(instance->protocol_name); instance->protocol_name = furi_string_alloc();
instance->decoder_result = NULL; instance->decoder_result = NULL;
instance->receiver = NULL; instance->receiver = NULL;
@@ -91,9 +91,9 @@ void subbrute_device_free(SubBruteDevice* instance) {
FURI_LOG_D(TAG, "before free"); FURI_LOG_D(TAG, "before free");
#endif #endif
string_clear(instance->load_path); furi_string_free(instance->load_path);
string_clear(instance->preset_name); furi_string_free(instance->preset_name);
string_clear(instance->protocol_name); furi_string_free(instance->protocol_name);
free(instance); free(instance);
} }
@@ -194,41 +194,41 @@ bool subbrute_device_create_packet_parsed(SubBruteDevice* instance, uint64_t ste
//char step_payload[32]; //char step_payload[32];
//memset(step_payload, '0', sizeof(step_payload)); //memset(step_payload, '0', sizeof(step_payload));
memset(instance->payload, 0, sizeof(instance->payload)); memset(instance->payload, 0, sizeof(instance->payload));
string_t candidate; FuriString* candidate;
string_init(candidate); candidate = furi_string_alloc();
if(instance->attack == SubBruteAttackLoadFile) { if(instance->attack == SubBruteAttackLoadFile) {
if(step >= sizeof(instance->file_key)) { if(step >= sizeof(instance->file_key)) {
return false; return false;
} }
char subbrute_payload_byte[4]; 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); 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]); //snprintf(step_payload, sizeof(step_payload), "%02X", (uint8_t)instance->file_key[step]);
} else { } else {
//snprintf(step_payload, sizeof(step_payload), "%16X", step); //snprintf(step_payload, sizeof(step_payload), "%16X", step);
//snprintf(step_payload, sizeof(step_payload), "%016llX", step); //snprintf(step_payload, sizeof(step_payload), "%016llX", step);
string_t buffer; FuriString* buffer;
string_init(buffer); buffer = furi_string_alloc();
string_init_printf(buffer, "%16X", step); buffer = furi_string_alloc_printf("%16X", step);
int j = 0; int j = 0;
string_set_str(candidate, " "); furi_string_set(candidate, " ");
for(uint8_t i = 0; i < 16; i++) { for(uint8_t i = 0; i < 16; i++) {
if(string_get_char(buffer, i) != ' ') { if(furi_string_get_char(buffer, i) != ' ') {
string_set_char(candidate, i + j, string_get_char(buffer, i)); furi_string_set_char(candidate, i + j, furi_string_get_char(buffer, i));
} else { } else {
string_set_char(candidate, i + j, '0'); furi_string_set_char(candidate, i + j, '0');
} }
if(i % 2 != 0) { if(i % 2 != 0) {
j++; j++;
} }
} }
string_clear(buffer); furi_string_free(buffer);
} }
#ifdef FURI_DEBUG #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 #endif
if(small) { if(small) {
@@ -238,7 +238,7 @@ bool subbrute_device_create_packet_parsed(SubBruteDevice* instance, uint64_t ste
sizeof(instance->payload), sizeof(instance->payload),
subbrute_key_small_with_tail, subbrute_key_small_with_tail,
instance->bit, instance->bit,
string_get_cstr(candidate), furi_string_get_cstr(candidate),
instance->te); instance->te);
} else { } else {
snprintf( snprintf(
@@ -246,7 +246,7 @@ bool subbrute_device_create_packet_parsed(SubBruteDevice* instance, uint64_t ste
sizeof(instance->payload), sizeof(instance->payload),
subbrute_key_small_no_tail, subbrute_key_small_no_tail,
instance->bit, instance->bit,
string_get_cstr(candidate)); furi_string_get_cstr(candidate));
} }
} else { } else {
if(instance->has_tail) { if(instance->has_tail) {
@@ -255,7 +255,7 @@ bool subbrute_device_create_packet_parsed(SubBruteDevice* instance, uint64_t ste
sizeof(instance->payload), sizeof(instance->payload),
subbrute_key_file_princeton_end, subbrute_key_file_princeton_end,
instance->file_template, instance->file_template,
string_get_cstr(candidate), furi_string_get_cstr(candidate),
instance->te); instance->te);
} else { } else {
snprintf( snprintf(
@@ -263,7 +263,7 @@ bool subbrute_device_create_packet_parsed(SubBruteDevice* instance, uint64_t ste
sizeof(instance->payload), sizeof(instance->payload),
subbrute_key_file_key, subbrute_key_file_key,
instance->file_template, 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); //FURI_LOG_D(TAG, "payload: %s", instance->payload);
#endif #endif
string_clear(candidate); furi_string_free(candidate);
return true; return true;
} }
@@ -286,7 +286,7 @@ SubBruteFileResult subbrute_device_attack_set(SubBruteDevice* instance, SubBrute
case SubBruteAttackLoadFile: case SubBruteAttackLoadFile:
// In this case values must be already set // In this case values must be already set
// file_result = // 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) { // if(file_result != SubBruteFileResultOk) {
// // Failed load file so failed to set attack type // // Failed load file so failed to set attack type
// return file_result; // RETURN // return file_result; // RETURN
@@ -306,8 +306,8 @@ SubBruteFileResult subbrute_device_attack_set(SubBruteDevice* instance, SubBrute
instance->frequency = 868350000; instance->frequency = 868350000;
} }
instance->bit = 12; instance->bit = 12;
string_set_str(instance->protocol_name, protocol_came); furi_string_set(instance->protocol_name, protocol_came);
string_set_str(instance->preset_name, preset_ook650_async); furi_string_set(instance->preset_name, preset_ook650_async);
break; break;
case SubBruteAttackChamberlain9bit300: case SubBruteAttackChamberlain9bit300:
case SubBruteAttackChamberlain9bit315: case SubBruteAttackChamberlain9bit315:
@@ -320,32 +320,32 @@ SubBruteFileResult subbrute_device_attack_set(SubBruteDevice* instance, SubBrute
instance->frequency = 390000000; instance->frequency = 390000000;
} }
instance->bit = 9; instance->bit = 9;
string_set_str(instance->protocol_name, protocol_cham_code); furi_string_set(instance->protocol_name, protocol_cham_code);
string_set_str(instance->preset_name, preset_ook650_async); furi_string_set(instance->preset_name, preset_ook650_async);
break; break;
case SubBruteAttackLinear10bit300: case SubBruteAttackLinear10bit300:
instance->frequency = 300000000; instance->frequency = 300000000;
instance->bit = 10; instance->bit = 10;
string_set_str(instance->protocol_name, protocol_linear); furi_string_set(instance->protocol_name, protocol_linear);
string_set_str(instance->preset_name, preset_ook650_async); furi_string_set(instance->preset_name, preset_ook650_async);
break; break;
case SubBruteAttackLinear10bit310: case SubBruteAttackLinear10bit310:
instance->frequency = 310000000; instance->frequency = 310000000;
instance->bit = 10; instance->bit = 10;
string_set_str(instance->protocol_name, protocol_linear); furi_string_set(instance->protocol_name, protocol_linear);
string_set_str(instance->preset_name, preset_ook650_async); furi_string_set(instance->preset_name, preset_ook650_async);
break; break;
case SubBruteAttackNICE12bit433: case SubBruteAttackNICE12bit433:
instance->frequency = 433920000; instance->frequency = 433920000;
instance->bit = 12; instance->bit = 12;
string_set_str(instance->protocol_name, protocol_nice_flo); furi_string_set(instance->protocol_name, protocol_nice_flo);
string_set_str(instance->preset_name, preset_ook650_async); furi_string_set(instance->preset_name, preset_ook650_async);
break; break;
case SubBruteAttackNICE12bit868: case SubBruteAttackNICE12bit868:
instance->frequency = 868350000; instance->frequency = 868350000;
instance->bit = 12; instance->bit = 12;
string_set_str(instance->protocol_name, protocol_nice_flo); furi_string_set(instance->protocol_name, protocol_nice_flo);
string_set_str(instance->preset_name, preset_ook650_async); furi_string_set(instance->preset_name, preset_ook650_async);
break; break;
default: default:
FURI_LOG_E(TAG, "Unknown attack type: %d", type); 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; uint8_t protocol_check_result = SubBruteFileResultProtocolNotFound;
if(type != SubBruteAttackLoadFile) { if(type != SubBruteAttackLoadFile) {
instance->decoder_result = subghz_receiver_search_decoder_base_by_name( 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 || if(!instance->decoder_result ||
instance->decoder_result->protocol->type == SubGhzProtocolTypeDynamic) { instance->decoder_result->protocol->type == SubGhzProtocolTypeDynamic) {
@@ -375,7 +375,8 @@ SubBruteFileResult subbrute_device_attack_set(SubBruteDevice* instance, SubBrute
} }
} else { } else {
// And here we need to set preset enum // 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; protocol_check_result = SubBruteFileResultOk;
} }
@@ -387,19 +388,19 @@ SubBruteFileResult subbrute_device_attack_set(SubBruteDevice* instance, SubBrute
} }
instance->has_tail = 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 // Calc max value
if(instance->attack == SubBruteAttackLoadFile) { if(instance->attack == SubBruteAttackLoadFile) {
instance->max_value = 0xFF; instance->max_value = 0xFF;
} else { } else {
string_t max_value_s; FuriString* max_value_s;
string_init(max_value_s); max_value_s = furi_string_alloc();
for(uint8_t i = 0; i < instance->bit; i++) { 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); instance->max_value = (uint64_t)strtol(furi_string_get_cstr(max_value_s), NULL, 2);
string_clear(max_value_s); furi_string_free(max_value_s);
} }
// Now we are ready to set file template for using in the future with snprintf // 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), sizeof(instance->file_template),
subbrute_key_file_start, subbrute_key_file_start,
instance->frequency, instance->frequency,
string_get_cstr(instance->preset_name), furi_string_get_cstr(instance->preset_name),
string_get_cstr(instance->protocol_name), furi_string_get_cstr(instance->protocol_name),
instance->bit); instance->bit);
// strncat(instance->file_template, "\n", sizeof(instance->file_template)); // strncat(instance->file_template, "\n", sizeof(instance->file_template));
// strncat(instance->file_template, subbrute_key_file_key, 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; 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); furi_assert(instance);
#ifdef FURI_DEBUG #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 #endif
SubBruteFileResult result = SubBruteFileResultUnknown; SubBruteFileResult result = SubBruteFileResultUnknown;
Storage* storage = furi_record_open(RECORD_STORAGE); Storage* storage = furi_record_open(RECORD_STORAGE);
FlipperFormat* fff_data_file = flipper_format_file_alloc(storage); FlipperFormat* fff_data_file = flipper_format_file_alloc(storage);
string_t temp_str; FuriString* temp_str;
string_init(temp_str); temp_str = furi_string_alloc();
uint32_t temp_data32; uint32_t temp_data32;
instance->receiver = subghz_receiver_alloc_init(instance->environment); 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(); furi_hal_subghz_reset();
do { do {
if(!flipper_format_file_open_existing(fff_data_file, 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", string_get_cstr(file_path)); FURI_LOG_E(TAG, "Error open file %s", furi_string_get_cstr(file_path));
result = SubBruteFileResultErrorOpenFile; result = SubBruteFileResultErrorOpenFile;
break; break;
} }
@@ -477,7 +478,7 @@ uint8_t subbrute_device_load_from_file(SubBruteDevice* instance, string_t file_p
FURI_LOG_E(TAG, "Preset FAIL"); FURI_LOG_E(TAG, "Preset FAIL");
result = SubBruteFileResultPresetInvalid; result = SubBruteFileResultPresetInvalid;
} else { } 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 // Protocol
@@ -486,17 +487,17 @@ uint8_t subbrute_device_load_from_file(SubBruteDevice* instance, string_t file_p
result = SubBruteFileResultMissingProtocol; result = SubBruteFileResultMissingProtocol;
break; break;
} else { } 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 #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 #endif
} }
instance->decoder_result = subghz_receiver_search_decoder_base_by_name( 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 || 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"); FURI_LOG_E(TAG, "RAW unsupported");
result = SubBruteFileResultProtocolNotSupported; result = SubBruteFileResultProtocolNotSupported;
break; break;
@@ -514,7 +515,7 @@ uint8_t subbrute_device_load_from_file(SubBruteDevice* instance, string_t file_p
#endif #endif
// instance->decoder_result = subghz_receiver_search_decoder_base_by_name( // 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) { // if(!instance->decoder_result) {
// FURI_LOG_E(TAG, "Protocol not found"); // 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; break;
} else { } else {
snprintf( 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 #ifdef FURI_DEBUG
FURI_LOG_D(TAG, "Key: %s", instance->file_key); FURI_LOG_D(TAG, "Key: %s", instance->file_key);
#endif #endif
@@ -573,7 +577,7 @@ uint8_t subbrute_device_load_from_file(SubBruteDevice* instance, string_t file_p
result = SubBruteFileResultOk; result = SubBruteFileResultOk;
} while(0); } while(0);
string_clear(temp_str); furi_string_free(temp_str);
flipper_format_file_close(fff_data_file); flipper_format_file_close(fff_data_file);
flipper_format_free(fff_data_file); flipper_format_free(fff_data_file);
furi_record_close(RECORD_STORAGE); furi_record_close(RECORD_STORAGE);
@@ -612,14 +616,14 @@ void subbrute_device_attack_set_default_values(
instance->max_value = (uint64_t)0x00; instance->max_value = (uint64_t)0x00;
string_clear(instance->protocol_name); furi_string_free(instance->protocol_name);
string_clear(instance->preset_name); furi_string_free(instance->preset_name);
string_clear(instance->load_path); furi_string_free(instance->load_path);
string_init(instance->load_path); instance->load_path = furi_string_alloc();
string_init_set_str(instance->protocol_name, protocol_raw); instance->protocol_name = furi_string_alloc_set(protocol_raw);
string_init_set_str(instance->preset_name, preset_ook650_async); instance->preset_name = furi_string_alloc_set(preset_ook650_async);
instance->preset = FuriHalSubGhzPresetOok650Async; instance->preset = FuriHalSubGhzPresetOok650Async;
instance->repeat = 5; instance->repeat = 5;
@@ -634,25 +638,25 @@ void subbrute_device_attack_set_default_values(
} }
FuriHalSubGhzPreset subbrute_device_convert_preset(const char* preset_name) { FuriHalSubGhzPreset subbrute_device_convert_preset(const char* preset_name) {
string_t preset; FuriString* preset;
string_init_set_str(preset, preset_name); preset = furi_string_alloc_set(preset_name);
FuriHalSubGhzPreset preset_value; 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; 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; 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; 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; 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; 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; preset_value = FuriHalSubGhzPresetMSK99_97KbAsync;
} else { } else {
preset_value = FuriHalSubGhzPresetCustom; preset_value = FuriHalSubGhzPresetCustom;
} }
string_clear(preset); furi_string_free(preset);
return preset_value; return preset_value;
} }

View File

@@ -61,7 +61,7 @@ typedef struct {
// Current step // Current step
uint64_t key_index; uint64_t key_index;
string_t load_path; FuriString* load_path;
// Index of group to bruteforce in loaded file // Index of group to bruteforce in loaded file
uint8_t load_index; uint8_t load_index;
@@ -78,8 +78,8 @@ typedef struct {
// Loaded info for attack type // Loaded info for attack type
FuriHalSubGhzPreset preset; FuriHalSubGhzPreset preset;
string_t preset_name; FuriString* preset_name;
string_t protocol_name; FuriString* protocol_name;
uint32_t frequency; uint32_t frequency;
uint32_t repeat; uint32_t repeat;
uint32_t bit; 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); const char* subbrute_device_error_get_desc(SubBruteFileResult error_id);
bool subbrute_device_create_packet_parsed(SubBruteDevice* context, uint64_t step, bool small); bool subbrute_device_create_packet_parsed(SubBruteDevice* context, uint64_t step, bool small);
SubBruteFileResult subbrute_device_attack_set(SubBruteDevice* context, SubBruteAttacks type); 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); FuriHalSubGhzPreset subbrute_device_convert_preset(const char* preset);
void subbrute_device_attack_set_default_values( void subbrute_device_attack_set_default_values(
SubBruteDevice* context, SubBruteDevice* context,

View File

@@ -7,7 +7,6 @@
#include "lib/toolbox/path.h" #include "lib/toolbox/path.h"
#include <notification/notification.h> #include <notification/notification.h>
#include <notification/notification_messages.h> #include <notification/notification_messages.h>
#include <m-string.h>
#include <lib/toolbox/stream/stream.h> #include <lib/toolbox/stream/stream.h>
#include <stream_buffer.h> #include <stream_buffer.h>

View File

@@ -33,7 +33,7 @@ void subbrute_main_view_set_callback(
instance->context = context; 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); uint8_t str_index = (index * 3);
char display_menu[] = { char display_menu[] = {
@@ -75,7 +75,7 @@ void center_displayed_key(string_t result, const char* key_cstr, uint8_t index)
display_menu[15] = ' '; 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) { 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); snprintf(msg_index, sizeof(msg_index), "Field index : %d", m->index);
canvas_draw_str_aligned(canvas, 64, 26, AlignCenter, AlignTop, msg_index); canvas_draw_str_aligned(canvas, 64, 26, AlignCenter, AlignTop, msg_index);
string_t menu_items; FuriString* menu_items;
string_init(menu_items); menu_items = furi_string_alloc();
center_displayed_key(menu_items, m->key_field, m->index); center_displayed_key(menu_items, m->key_field, m->index);
canvas_set_font(canvas, FontSecondary); canvas_set_font(canvas, FontSecondary);
canvas_draw_str_aligned( 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_center(canvas, "Select");
elements_button_left(canvas, "<"); elements_button_left(canvas, "<");
elements_button_right(canvas, ">"); elements_button_right(canvas, ">");
string_reset(menu_items); furi_string_reset(menu_items);
} else { } else {
// Menu // Menu
canvas_set_color(canvas, ColorBlack); canvas_set_color(canvas, ColorBlack);

View File

@@ -19,9 +19,9 @@
static bool open_wav_stream(Stream* stream) { static bool open_wav_stream(Stream* stream) {
DialogsApp* dialogs = furi_record_open("dialogs"); DialogsApp* dialogs = furi_record_open("dialogs");
bool result = false; bool result = false;
string_t path; FuriString* path;
string_init(path); path = furi_string_alloc();
string_set_str(path, WAVPLAYER_FOLDER); furi_string_set(path, WAVPLAYER_FOLDER);
DialogsFileBrowserOptions browser_options; DialogsFileBrowserOptions browser_options;
dialog_file_browser_set_basic_options(&browser_options, ".wav", &I_music_10px); 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"); furi_record_close("dialogs");
if(ret) { 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_E(TAG, "Cannot open file \"%s\"", string_get_cstr(path)); FURI_LOG_E(TAG, "Cannot open file \"%s\"", furi_string_get_cstr(path));
} else { } else {
result = true; result = true;
} }
} }
string_clear(path); furi_string_free(path);
return result; return result;
} }

View File

@@ -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 // If text box store gets too big, then truncate it
app->text_box_store_strlen += len; app->text_box_store_strlen += len;
if(app->text_box_store_strlen >= WIFI_MARAUDER_TEXT_BOX_STORE_SIZE - 1) { 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); furi_string_right(app->text_box_store, app->text_box_store_strlen / 2);
app->text_box_store_strlen = string_size(app->text_box_store) + len; app->text_box_store_strlen = furi_string_size(app->text_box_store) + len;
} }
// Null-terminate buf and append to text box store // Null-terminate buf and append to text box store
buf[len] = '\0'; 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); 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); text_box_set_focus(text_box, TextBoxFocusEnd);
} }
if(app->is_command) { if(app->is_command) {
string_reset(app->text_box_store); furi_string_reset(app->text_box_store);
app->text_box_store_strlen = 0; app->text_box_store_strlen = 0;
if(0 == strncmp("help", app->selected_tx_string, strlen("help"))) { if(0 == strncmp("help", app->selected_tx_string, strlen("help"))) {
const char* help_msg = 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 // 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); scene_manager_set_scene_state(app->scene_manager, WifiMarauderSceneConsoleOutput, 0);
view_dispatcher_switch_to_view(app->view_dispatcher, WifiMarauderAppViewConsoleOutput); 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; bool consumed = false;
if(event.type == SceneManagerEventTypeCustom) { 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; consumed = true;
} else if(event.type == SceneManagerEventTypeTick) { } else if(event.type == SceneManagerEventTypeTick) {
consumed = true; consumed = true;

View File

@@ -53,8 +53,8 @@ WifiMarauderApp* wifi_marauder_app_alloc() {
app->text_box = text_box_alloc(); app->text_box = text_box_alloc();
view_dispatcher_add_view( view_dispatcher_add_view(
app->view_dispatcher, WifiMarauderAppViewConsoleOutput, text_box_get_view(app->text_box)); app->view_dispatcher, WifiMarauderAppViewConsoleOutput, text_box_get_view(app->text_box));
string_init(app->text_box_store); app->text_box_store = furi_string_alloc();
string_reserve(app->text_box_store, WIFI_MARAUDER_TEXT_BOX_STORE_SIZE); furi_string_reserve(app->text_box_store, WIFI_MARAUDER_TEXT_BOX_STORE_SIZE);
app->text_input = text_input_alloc(); app->text_input = text_input_alloc();
view_dispatcher_add_view( 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, WifiMarauderAppViewConsoleOutput);
view_dispatcher_remove_view(app->view_dispatcher, WifiMarauderAppViewTextInput); view_dispatcher_remove_view(app->view_dispatcher, WifiMarauderAppViewTextInput);
text_box_free(app->text_box); 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); text_input_free(app->text_input);
// View dispatcher // View dispatcher

View File

@@ -23,7 +23,7 @@ struct WifiMarauderApp {
SceneManager* scene_manager; SceneManager* scene_manager;
char text_input_store[WIFI_MARAUDER_TEXT_INPUT_STORE_SIZE + 1]; 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; size_t text_box_store_strlen;
TextBox* text_box; TextBox* text_box;
TextInput* text_input; TextInput* text_input;

View File

@@ -6,7 +6,6 @@
#include <gui/canvas_i.h> #include <gui/canvas_i.h>
#include <gui/gui.h> #include <gui/gui.h>
#include <input/input.h> #include <input/input.h>
#include <m-string.h>
#include <math.h> #include <math.h>
#include <notification/notification.h> #include <notification/notification.h>
#include <notification/notification_messages.h> #include <notification/notification_messages.h>
@@ -59,10 +58,10 @@ typedef struct SPluginEvent {
} SPluginEvent; } SPluginEvent;
typedef struct EAccessPointDesc { typedef struct EAccessPointDesc {
string_t m_accessPointName; FuriString* m_accessPointName;
int16_t m_rssi; int16_t m_rssi;
string_t m_secType; FuriString* m_secType;
string_t m_bssid; FuriString* m_bssid;
unsigned short m_channel; unsigned short m_channel;
bool m_isHidden; bool m_isHidden;
} EAccessPointDesc; } EAccessPointDesc;
@@ -111,13 +110,13 @@ static void wifi_scanner_app_init(SWiFiScannerApp* const app) {
app->m_totalAccessPoints = 0; app->m_totalAccessPoints = 0;
app->m_currentIndexAccessPoint = 0; app->m_currentIndexAccessPoint = 0;
string_init(app->m_currentAccesspointDescription.m_accessPointName); app->m_currentAccesspointDescription.m_accessPointName = furi_string_alloc();
string_set_str(app->m_currentAccesspointDescription.m_accessPointName, "N/A\n"); furi_string_set(app->m_currentAccesspointDescription.m_accessPointName, "N/A\n");
app->m_currentAccesspointDescription.m_channel = 0; app->m_currentAccesspointDescription.m_channel = 0;
string_init(app->m_currentAccesspointDescription.m_bssid); app->m_currentAccesspointDescription.m_bssid = furi_string_alloc();
string_set_str(app->m_currentAccesspointDescription.m_bssid, "N/A\n"); furi_string_set(app->m_currentAccesspointDescription.m_bssid, "N/A\n");
string_init(app->m_currentAccesspointDescription.m_secType); app->m_currentAccesspointDescription.m_secType = furi_string_alloc();
string_set_str(app->m_currentAccesspointDescription.m_secType, "N/A\n"); furi_string_set(app->m_currentAccesspointDescription.m_secType, "N/A\n");
app->m_currentAccesspointDescription.m_rssi = 0; app->m_currentAccesspointDescription.m_rssi = 0;
app->m_currentAccesspointDescription.m_isHidden = false; app->m_currentAccesspointDescription.m_isHidden = false;
@@ -238,7 +237,7 @@ static void wifi_module_render_callback(Canvas* const canvas, void* ctx) {
offsetY, offsetY,
app->m_currentAccesspointDescription.m_isHidden ? app->m_currentAccesspointDescription.m_isHidden ?
"(Hidden SSID)" : "(Hidden SSID)" :
string_get_cstr(app->m_currentAccesspointDescription.m_accessPointName)); furi_string_get_cstr(app->m_currentAccesspointDescription.m_accessPointName));
offsetY += fontHeight; offsetY += fontHeight;
@@ -246,7 +245,7 @@ static void wifi_module_render_callback(Canvas* const canvas, void* ctx) {
canvas, canvas,
offsetX, offsetX,
offsetY, offsetY,
string_get_cstr(app->m_currentAccesspointDescription.m_bssid)); furi_string_get_cstr(app->m_currentAccesspointDescription.m_bssid));
canvas_set_font(canvas, FontSecondary); canvas_set_font(canvas, FontSecondary);
//u8g2_SetFont(&canvas->fb, u8g2_font_tinytim_tf); //u8g2_SetFont(&canvas->fb, u8g2_font_tinytim_tf);
@@ -271,7 +270,7 @@ static void wifi_module_render_callback(Canvas* const canvas, void* ctx) {
string, string,
sizeof(string), sizeof(string),
"ENCR: %s", "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); canvas_draw_str(canvas, offsetX, offsetY, string);
offsetY += fontHeight; offsetY += fontHeight;
@@ -346,7 +345,7 @@ static void wifi_module_render_callback(Canvas* const canvas, void* ctx) {
canvas, canvas,
offsetX, offsetX,
offsetY, offsetY,
string_get_cstr(app->m_currentAccesspointDescription.m_accessPointName)); furi_string_get_cstr(app->m_currentAccesspointDescription.m_accessPointName));
offsetY += fontHeight + 2; offsetY += fontHeight + 2;
@@ -354,7 +353,7 @@ static void wifi_module_render_callback(Canvas* const canvas, void* ctx) {
canvas, canvas,
offsetX, offsetX,
offsetY, offsetY,
string_get_cstr(app->m_currentAccesspointDescription.m_bssid)); furi_string_get_cstr(app->m_currentAccesspointDescription.m_bssid));
DrawSignalStrengthBar( DrawSignalStrengthBar(
canvas, app->m_currentAccesspointDescription.m_rssi, 5, 5, 12, 25); 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 & WorkerEventStop) break;
if(events & WorkerEventRx) { if(events & WorkerEventRx) {
size_t length = 0; size_t length = 0;
string_t receivedString; FuriString* receivedString;
string_init(receivedString); receivedString = furi_string_alloc();
do { do {
uint8_t data[64]; uint8_t data[64];
length = xStreamBufferReceive(rx_stream, data, 64, 25); 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); WIFI_APP_LOG_I("Received Data - length: %i", length);
for(uint16_t i = 0; i < length; i++) { 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); //notification_message(app->notification, &sequence_set_only_red_255);
} }
} while(length > 0); } while(length > 0);
if(string_size(receivedString) > 0) { if(furi_string_size(receivedString) > 0) {
string_t chunk; FuriString* chunk;
string_init(chunk); chunk = furi_string_alloc();
size_t begin = 0; size_t begin = 0;
size_t end = 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) { for(uint8_t i = 0; i < EChunkArrayData_ENUM_MAX; ++i) {
string_init(chunksArray[i]); chunksArray[i] = furi_string_alloc();
} }
uint8_t index = 0; uint8_t index = 0;
do { 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; end = stringSize;
} }
WIFI_APP_LOG_I("size: %i, begin: %i, end: %i", stringSize, begin, end); 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; begin = end + 1;
} while(end < stringSize); } while(end < stringSize);
string_clear(chunk); furi_string_free(chunk);
app = acquire_mutex((ValueMutex*)context, 25); app = acquire_mutex((ValueMutex*)context, 25);
if(app == NULL) { if(app == NULL) {
@@ -535,7 +535,7 @@ static int32_t uart_worker(void* context) {
} }
if(!app->m_wifiModuleInitialized) { if(!app->m_wifiModuleInitialized) {
if(string_cmp_str( if(furi_string_cmp_str(
chunksArray[EChunkArrayData_Context], MODULE_CONTEXT_INITIALIZATION) == chunksArray[EChunkArrayData_Context], MODULE_CONTEXT_INITIALIZATION) ==
0) { 0) {
app->m_wifiModuleInitialized = true; app->m_wifiModuleInitialized = true;
@@ -543,46 +543,46 @@ static int32_t uart_worker(void* context) {
} }
} else { } else {
if(string_cmp_str( if(furi_string_cmp_str(
chunksArray[EChunkArrayData_Context], MODULE_CONTEXT_MONITOR) == 0) { chunksArray[EChunkArrayData_Context], MODULE_CONTEXT_MONITOR) == 0) {
app->m_context = MonitorMode; app->m_context = MonitorMode;
} else if( } else if(
string_cmp_str( furi_string_cmp_str(
chunksArray[EChunkArrayData_Context], MODULE_CONTEXT_SCAN) == 0) { chunksArray[EChunkArrayData_Context], MODULE_CONTEXT_SCAN) == 0) {
app->m_context = ScanMode; app->m_context = ScanMode;
} else if( } else if(
string_cmp_str( furi_string_cmp_str(
chunksArray[EChunkArrayData_Context], MODULE_CONTEXT_SCAN_ANIMATION) == chunksArray[EChunkArrayData_Context], MODULE_CONTEXT_SCAN_ANIMATION) ==
0) { 0) {
app->m_context = ScanAnimation; app->m_context = ScanAnimation;
} else if( } else if(
string_cmp_str( furi_string_cmp_str(
chunksArray[EChunkArrayData_Context], chunksArray[EChunkArrayData_Context],
MODULE_CONTEXT_MONITOR_ANIMATION) == 0) { MODULE_CONTEXT_MONITOR_ANIMATION) == 0) {
app->m_context = MonitorAnimation; app->m_context = MonitorAnimation;
} }
if(app->m_context == MonitorMode || app->m_context == ScanMode) { if(app->m_context == MonitorMode || app->m_context == ScanMode) {
string_set( furi_string_set(
app->m_currentAccesspointDescription.m_accessPointName, app->m_currentAccesspointDescription.m_accessPointName,
chunksArray[EChunkArrayData_SSID]); chunksArray[EChunkArrayData_SSID]);
string_set( furi_string_set(
app->m_currentAccesspointDescription.m_secType, app->m_currentAccesspointDescription.m_secType,
chunksArray[EChunkArrayData_EncryptionType]); chunksArray[EChunkArrayData_EncryptionType]);
app->m_currentAccesspointDescription.m_rssi = app->m_currentAccesspointDescription.m_rssi =
atoi(string_get_cstr(chunksArray[EChunkArrayData_RSSI])); atoi(furi_string_get_cstr(chunksArray[EChunkArrayData_RSSI]));
string_set( furi_string_set(
app->m_currentAccesspointDescription.m_bssid, app->m_currentAccesspointDescription.m_bssid,
chunksArray[EChunkArrayData_BSSID]); chunksArray[EChunkArrayData_BSSID]);
app->m_currentAccesspointDescription.m_channel = 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 = app->m_currentAccesspointDescription.m_isHidden =
atoi(string_get_cstr(chunksArray[EChunkArrayData_IsHidden])); atoi(furi_string_get_cstr(chunksArray[EChunkArrayData_IsHidden]));
app->m_currentIndexAccessPoint = app->m_currentIndexAccessPoint = atoi(
atoi(string_get_cstr(chunksArray[EChunkArrayData_CurrentAPIndex])); furi_string_get_cstr(chunksArray[EChunkArrayData_CurrentAPIndex]));
app->m_totalAccessPoints = 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 // Clear string array
for(index = 0; index < EChunkArrayData_ENUM_MAX; ++index) { for(index = 0; index < EChunkArrayData_ENUM_MAX; ++index) {
string_clear(chunksArray[index]); furi_string_free(chunksArray[index]);
} }
} }
string_clear(receivedString); furi_string_free(receivedString);
} }
} }

View File

@@ -143,34 +143,34 @@ void cli_command_log_tx_callback(const uint8_t* buffer, size_t size, void* conte
xStreamBufferSend(context, buffer, size, 0); xStreamBufferSend(context, buffer, size, 0);
} }
void cli_command_log_level_set_from_string(string_t level) { void cli_command_log_level_set_from_string(FuriString* level) {
if(string_cmpi_str(level, "default") == 0) { if(furi_string_cmpi_str(level, "default") == 0) {
furi_log_set_level(FuriLogLevelDefault); 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); 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); 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); 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); 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); 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); furi_log_set_level(FuriLogLevelTrace);
} else { } else {
printf("Unknown log level\r\n"); 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); UNUSED(context);
StreamBufferHandle_t ring = xStreamBufferCreate(CLI_COMMAND_LOG_RING_SIZE, 1); StreamBufferHandle_t ring = xStreamBufferCreate(CLI_COMMAND_LOG_RING_SIZE, 1);
uint8_t buffer[CLI_COMMAND_LOG_BUFFER_SIZE]; uint8_t buffer[CLI_COMMAND_LOG_BUFFER_SIZE];
FuriLogLevel previous_level = furi_log_get_level(); FuriLogLevel previous_level = furi_log_get_level();
bool restore_log_level = false; bool restore_log_level = false;
if(string_size(args) > 0) { if(furi_string_size(args) > 0) {
cli_command_log_level_set_from_string(args); cli_command_log_level_set_from_string(args);
restore_log_level = true; restore_log_level = true;
} }

View File

@@ -79,9 +79,9 @@ static bool browser_filter_by_name(BrowserWorker* browser, FuriString* name, boo
if(is_folder) { if(is_folder) {
// Skip assets folders (if enabled) // Skip assets folders (if enabled)
if(browser->skip_assets) { if(browser->skip_assets) {
return ((string_cmp_str(name, ASSETS_DIR) == 0) ? (false) : (true)) && return ((furi_string_cmp_str(name, ASSETS_DIR) == 0) ? (false) : (true)) &&
((string_cmp_str(name, BADUSB_LAYOUTS_DIR) == 0) ? (false) : (true)) && ((furi_string_cmp_str(name, BADUSB_LAYOUTS_DIR) == 0) ? (false) : (true)) &&
((string_cmp_str(name, SUBGHZ_TEMP_DIR) == 0) ? (false) : (true)); ((furi_string_cmp_str(name, SUBGHZ_TEMP_DIR) == 0) ? (false) : (true));
} else { } else {
return true; return true;
} }

View File

@@ -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_protocol_by_name,ProtocolId,"ProtocolDict*, const char*"
Function,-,protocol_dict_get_validate_count,uint32_t,"ProtocolDict*, size_t" 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_get_write_data,_Bool,"ProtocolDict*, size_t, void*"
Function,-,protocol_dict_render_brief_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*, string_t, 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,+,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,-,pselect,int,"int, fd_set*, fd_set*, fd_set*, const timespec*, const sigset_t*"
Function,-,putc,int,"int, FILE*" 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_feed,void,"void*, _Bool, uint32_t"
Function,-,subghz_protocol_decoder_bett_free,void,void* 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_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_reset,void,void*
Function,-,subghz_protocol_decoder_bett_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_bett_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*"
Function,-,subghz_protocol_decoder_came_alloc,void*,SubGhzEnvironment* 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_feed,void,"void*, _Bool, uint32_t"
Function,-,subghz_protocol_decoder_came_atomo_free,void,void* 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_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_reset,void,void*
Function,-,subghz_protocol_decoder_came_atomo_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" 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_deserialize,_Bool,"void*, FlipperFormat*"
Function,-,subghz_protocol_decoder_came_feed,void,"void*, _Bool, uint32_t" Function,-,subghz_protocol_decoder_came_feed,void,"void*, _Bool, uint32_t"
Function,-,subghz_protocol_decoder_came_free,void,void* 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_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_reset,void,void*
Function,-,subghz_protocol_decoder_came_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_came_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*"
Function,-,subghz_protocol_decoder_came_twee_alloc,void*,SubGhzEnvironment* 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_feed,void,"void*, _Bool, uint32_t"
Function,-,subghz_protocol_decoder_came_twee_free,void,void* 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_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_reset,void,void*
Function,-,subghz_protocol_decoder_came_twee_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_came_twee_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*"
Function,-,subghz_protocol_decoder_chamb_code_alloc,void*,SubGhzEnvironment* 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_feed,void,"void*, _Bool, uint32_t"
Function,-,subghz_protocol_decoder_chamb_code_free,void,void* 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_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_reset,void,void*
Function,-,subghz_protocol_decoder_chamb_code_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_chamb_code_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*"
Function,-,subghz_protocol_decoder_clemsa_alloc,void*,SubGhzEnvironment* 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_feed,void,"void*, _Bool, uint32_t"
Function,-,subghz_protocol_decoder_clemsa_free,void,void* 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_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_reset,void,void*
Function,-,subghz_protocol_decoder_clemsa_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_clemsa_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*"
Function,-,subghz_protocol_decoder_doitrand_alloc,void*,SubGhzEnvironment* 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_feed,void,"void*, _Bool, uint32_t"
Function,-,subghz_protocol_decoder_doitrand_free,void,void* 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_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_reset,void,void*
Function,-,subghz_protocol_decoder_doitrand_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_doitrand_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*"
Function,-,subghz_protocol_decoder_faac_slh_alloc,void*,SubGhzEnvironment* 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_feed,void,"void*, _Bool, uint32_t"
Function,-,subghz_protocol_decoder_faac_slh_free,void,void* 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_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_reset,void,void*
Function,-,subghz_protocol_decoder_faac_slh_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_faac_slh_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*"
Function,-,subghz_protocol_decoder_gate_tx_alloc,void*,SubGhzEnvironment* 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_feed,void,"void*, _Bool, uint32_t"
Function,-,subghz_protocol_decoder_gate_tx_free,void,void* 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_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_reset,void,void*
Function,-,subghz_protocol_decoder_gate_tx_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_gate_tx_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*"
Function,-,subghz_protocol_decoder_holtek_alloc,void*,SubGhzEnvironment* 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_feed,void,"void*, _Bool, uint32_t"
Function,-,subghz_protocol_decoder_holtek_free,void,void* 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_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_reset,void,void*
Function,-,subghz_protocol_decoder_holtek_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_holtek_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*"
Function,-,subghz_protocol_decoder_honeywell_wdb_alloc,void*,SubGhzEnvironment* 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_feed,void,"void*, _Bool, uint32_t"
Function,-,subghz_protocol_decoder_honeywell_wdb_free,void,void* 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_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_reset,void,void*
Function,-,subghz_protocol_decoder_honeywell_wdb_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_honeywell_wdb_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*"
Function,-,subghz_protocol_decoder_hormann_alloc,void*,SubGhzEnvironment* 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_feed,void,"void*, _Bool, uint32_t"
Function,-,subghz_protocol_decoder_hormann_free,void,void* 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_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_reset,void,void*
Function,-,subghz_protocol_decoder_hormann_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_hormann_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*"
Function,-,subghz_protocol_decoder_ido_alloc,void*,SubGhzEnvironment* 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_feed,void,"void*, _Bool, uint32_t"
Function,-,subghz_protocol_decoder_ido_free,void,void* 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_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_reset,void,void*
Function,-,subghz_protocol_decoder_ido_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_ido_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*"
Function,-,subghz_protocol_decoder_intertechno_v3_alloc,void*,SubGhzEnvironment* 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_feed,void,"void*, _Bool, uint32_t"
Function,-,subghz_protocol_decoder_intertechno_v3_free,void,void* 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_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_reset,void,void*
Function,-,subghz_protocol_decoder_intertechno_v3_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_intertechno_v3_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*"
Function,-,subghz_protocol_decoder_keeloq_alloc,void*,SubGhzEnvironment* 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_feed,void,"void*, _Bool, uint32_t"
Function,-,subghz_protocol_decoder_keeloq_free,void,void* 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_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_reset,void,void*
Function,-,subghz_protocol_decoder_keeloq_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_keeloq_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*"
Function,-,subghz_protocol_decoder_kia_alloc,void*,SubGhzEnvironment* 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_feed,void,"void*, _Bool, uint32_t"
Function,-,subghz_protocol_decoder_kia_free,void,void* 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_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_reset,void,void*
Function,-,subghz_protocol_decoder_kia_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_kia_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*"
Function,-,subghz_protocol_decoder_linear_alloc,void*,SubGhzEnvironment* 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_feed,void,"void*, _Bool, uint32_t"
Function,-,subghz_protocol_decoder_linear_free,void,void* 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_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_reset,void,void*
Function,-,subghz_protocol_decoder_linear_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_linear_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*"
Function,-,subghz_protocol_decoder_magellen_alloc,void*,SubGhzEnvironment* 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_feed,void,"void*, _Bool, uint32_t"
Function,-,subghz_protocol_decoder_magellen_free,void,void* 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_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_reset,void,void*
Function,-,subghz_protocol_decoder_magellen_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_magellen_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*"
Function,-,subghz_protocol_decoder_marantec_alloc,void*,SubGhzEnvironment* 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_feed,void,"void*, _Bool, uint32_t"
Function,-,subghz_protocol_decoder_marantec_free,void,void* 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_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_reset,void,void*
Function,-,subghz_protocol_decoder_marantec_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_marantec_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*"
Function,-,subghz_protocol_decoder_megacode_alloc,void*,SubGhzEnvironment* 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_feed,void,"void*, _Bool, uint32_t"
Function,-,subghz_protocol_decoder_megacode_free,void,void* 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_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_reset,void,void*
Function,-,subghz_protocol_decoder_megacode_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_megacode_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*"
Function,-,subghz_protocol_decoder_nero_radio_alloc,void*,SubGhzEnvironment* 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_feed,void,"void*, _Bool, uint32_t"
Function,-,subghz_protocol_decoder_nero_radio_free,void,void* 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_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_reset,void,void*
Function,-,subghz_protocol_decoder_nero_radio_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_nero_radio_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*"
Function,-,subghz_protocol_decoder_nero_sketch_alloc,void*,SubGhzEnvironment* 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_feed,void,"void*, _Bool, uint32_t"
Function,-,subghz_protocol_decoder_nero_sketch_free,void,void* 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_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_reset,void,void*
Function,-,subghz_protocol_decoder_nero_sketch_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_nero_sketch_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*"
Function,-,subghz_protocol_decoder_nice_flo_alloc,void*,SubGhzEnvironment* 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_feed,void,"void*, _Bool, uint32_t"
Function,-,subghz_protocol_decoder_nice_flo_free,void,void* 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_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_reset,void,void*
Function,-,subghz_protocol_decoder_nice_flo_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_nice_flo_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*"
Function,-,subghz_protocol_decoder_nice_flor_s_alloc,void*,SubGhzEnvironment* 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_feed,void,"void*, _Bool, uint32_t"
Function,-,subghz_protocol_decoder_nice_flor_s_free,void,void* 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_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_reset,void,void*
Function,-,subghz_protocol_decoder_nice_flor_s_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_nice_flor_s_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*"
Function,-,subghz_protocol_decoder_phoenix_v2_alloc,void*,SubGhzEnvironment* 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_feed,void,"void*, _Bool, uint32_t"
Function,-,subghz_protocol_decoder_phoenix_v2_free,void,void* 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_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_reset,void,void*
Function,-,subghz_protocol_decoder_phoenix_v2_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_phoenix_v2_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*"
Function,-,subghz_protocol_decoder_power_smart_alloc,void*,SubGhzEnvironment* 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_feed,void,"void*, _Bool, uint32_t"
Function,-,subghz_protocol_decoder_power_smart_free,void,void* 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_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_reset,void,void*
Function,-,subghz_protocol_decoder_power_smart_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_power_smart_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*"
Function,-,subghz_protocol_decoder_princeton_alloc,void*,SubGhzEnvironment* 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_feed,void,"void*, _Bool, uint32_t"
Function,-,subghz_protocol_decoder_princeton_free,void,void* 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_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_reset,void,void*
Function,-,subghz_protocol_decoder_princeton_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_princeton_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*"
Function,-,subghz_protocol_decoder_raw_alloc,void*,SubGhzEnvironment* 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_feed,void,"void*, _Bool, uint32_t"
Function,-,subghz_protocol_decoder_raw_free,void,void* 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_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_reset,void,void*
Function,-,subghz_protocol_decoder_raw_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_raw_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*"
Function,-,subghz_protocol_decoder_raw_set_auto_mode,void,"void*, _Bool" 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_feed,void,"void*, _Bool, uint32_t"
Function,-,subghz_protocol_decoder_scher_khan_free,void,void* 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_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_reset,void,void*
Function,-,subghz_protocol_decoder_scher_khan_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_scher_khan_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*"
Function,-,subghz_protocol_decoder_secplus_v1_alloc,void*,SubGhzEnvironment* 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_feed,void,"void*, _Bool, uint32_t"
Function,-,subghz_protocol_decoder_secplus_v1_free,void,void* 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_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_reset,void,void*
Function,-,subghz_protocol_decoder_secplus_v1_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_secplus_v1_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*"
Function,-,subghz_protocol_decoder_secplus_v2_alloc,void*,SubGhzEnvironment* 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_feed,void,"void*, _Bool, uint32_t"
Function,-,subghz_protocol_decoder_secplus_v2_free,void,void* 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_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_reset,void,void*
Function,-,subghz_protocol_decoder_secplus_v2_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_secplus_v2_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*"
Function,-,subghz_protocol_decoder_somfy_keytis_alloc,void*,SubGhzEnvironment* 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_feed,void,"void*, _Bool, uint32_t"
Function,-,subghz_protocol_decoder_somfy_keytis_free,void,void* 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_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_reset,void,void*
Function,-,subghz_protocol_decoder_somfy_keytis_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_somfy_keytis_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*"
Function,-,subghz_protocol_decoder_somfy_telis_alloc,void*,SubGhzEnvironment* 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_feed,void,"void*, _Bool, uint32_t"
Function,-,subghz_protocol_decoder_somfy_telis_free,void,void* 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_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_reset,void,void*
Function,-,subghz_protocol_decoder_somfy_telis_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_somfy_telis_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*"
Function,-,subghz_protocol_decoder_star_line_alloc,void*,SubGhzEnvironment* 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_feed,void,"void*, _Bool, uint32_t"
Function,-,subghz_protocol_decoder_star_line_free,void,void* 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_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_reset,void,void*
Function,-,subghz_protocol_decoder_star_line_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*" Function,-,subghz_protocol_decoder_star_line_serialize,_Bool,"void*, FlipperFormat*, SubGhzPresetDefinition*"
Function,-,subghz_protocol_encoder_bett_alloc,void*,SubGhzEnvironment* Function,-,subghz_protocol_encoder_bett_alloc,void*,SubGhzEnvironment*
1 entry status name type params
1848 Function + protocol_dict_get_protocol_by_name ProtocolId ProtocolDict*, const char*
1849 Function - protocol_dict_get_validate_count uint32_t ProtocolDict*, size_t
1850 Function - protocol_dict_get_write_data _Bool ProtocolDict*, size_t, void*
1851 Function - + protocol_dict_render_brief_data void ProtocolDict*, string_t, size_t ProtocolDict*, FuriString*, size_t
1852 Function - + protocol_dict_render_data void ProtocolDict*, string_t, size_t ProtocolDict*, FuriString*, size_t
1853 Function + protocol_dict_set_data void ProtocolDict*, size_t, const uint8_t*, size_t
1854 Function - pselect int int, fd_set*, fd_set*, fd_set*, const timespec*, const sigset_t*
1855 Function - putc int int, FILE*
2304 Function - subghz_protocol_decoder_bett_feed void void*, _Bool, uint32_t
2305 Function - subghz_protocol_decoder_bett_free void void*
2306 Function - subghz_protocol_decoder_bett_get_hash_data uint8_t void*
2307 Function - subghz_protocol_decoder_bett_get_string void void*, string_t void*, FuriString*
2308 Function - subghz_protocol_decoder_bett_reset void void*
2309 Function - subghz_protocol_decoder_bett_serialize _Bool void*, FlipperFormat*, SubGhzPresetDefinition*
2310 Function - subghz_protocol_decoder_came_alloc void* SubGhzEnvironment*
2313 Function - subghz_protocol_decoder_came_atomo_feed void void*, _Bool, uint32_t
2314 Function - subghz_protocol_decoder_came_atomo_free void void*
2315 Function - subghz_protocol_decoder_came_atomo_get_hash_data uint8_t void*
2316 Function - subghz_protocol_decoder_came_atomo_get_string void void*, string_t void*, FuriString*
2317 Function - subghz_protocol_decoder_came_atomo_reset void void*
2318 Function - subghz_protocol_decoder_came_atomo_serialize _Bool void*, FlipperFormat*, SubGhzPresetDefinition*
2319 Function - subghz_protocol_decoder_came_deserialize _Bool void*, FlipperFormat*
2320 Function - subghz_protocol_decoder_came_feed void void*, _Bool, uint32_t
2321 Function - subghz_protocol_decoder_came_free void void*
2322 Function - subghz_protocol_decoder_came_get_hash_data uint8_t void*
2323 Function - subghz_protocol_decoder_came_get_string void void*, string_t void*, FuriString*
2324 Function - subghz_protocol_decoder_came_reset void void*
2325 Function - subghz_protocol_decoder_came_serialize _Bool void*, FlipperFormat*, SubGhzPresetDefinition*
2326 Function - subghz_protocol_decoder_came_twee_alloc void* SubGhzEnvironment*
2328 Function - subghz_protocol_decoder_came_twee_feed void void*, _Bool, uint32_t
2329 Function - subghz_protocol_decoder_came_twee_free void void*
2330 Function - subghz_protocol_decoder_came_twee_get_hash_data uint8_t void*
2331 Function - subghz_protocol_decoder_came_twee_get_string void void*, string_t void*, FuriString*
2332 Function - subghz_protocol_decoder_came_twee_reset void void*
2333 Function - subghz_protocol_decoder_came_twee_serialize _Bool void*, FlipperFormat*, SubGhzPresetDefinition*
2334 Function - subghz_protocol_decoder_chamb_code_alloc void* SubGhzEnvironment*
2336 Function - subghz_protocol_decoder_chamb_code_feed void void*, _Bool, uint32_t
2337 Function - subghz_protocol_decoder_chamb_code_free void void*
2338 Function - subghz_protocol_decoder_chamb_code_get_hash_data uint8_t void*
2339 Function - subghz_protocol_decoder_chamb_code_get_string void void*, string_t void*, FuriString*
2340 Function - subghz_protocol_decoder_chamb_code_reset void void*
2341 Function - subghz_protocol_decoder_chamb_code_serialize _Bool void*, FlipperFormat*, SubGhzPresetDefinition*
2342 Function - subghz_protocol_decoder_clemsa_alloc void* SubGhzEnvironment*
2344 Function - subghz_protocol_decoder_clemsa_feed void void*, _Bool, uint32_t
2345 Function - subghz_protocol_decoder_clemsa_free void void*
2346 Function - subghz_protocol_decoder_clemsa_get_hash_data uint8_t void*
2347 Function - subghz_protocol_decoder_clemsa_get_string void void*, string_t void*, FuriString*
2348 Function - subghz_protocol_decoder_clemsa_reset void void*
2349 Function - subghz_protocol_decoder_clemsa_serialize _Bool void*, FlipperFormat*, SubGhzPresetDefinition*
2350 Function - subghz_protocol_decoder_doitrand_alloc void* SubGhzEnvironment*
2352 Function - subghz_protocol_decoder_doitrand_feed void void*, _Bool, uint32_t
2353 Function - subghz_protocol_decoder_doitrand_free void void*
2354 Function - subghz_protocol_decoder_doitrand_get_hash_data uint8_t void*
2355 Function - subghz_protocol_decoder_doitrand_get_string void void*, string_t void*, FuriString*
2356 Function - subghz_protocol_decoder_doitrand_reset void void*
2357 Function - subghz_protocol_decoder_doitrand_serialize _Bool void*, FlipperFormat*, SubGhzPresetDefinition*
2358 Function - subghz_protocol_decoder_faac_slh_alloc void* SubGhzEnvironment*
2360 Function - subghz_protocol_decoder_faac_slh_feed void void*, _Bool, uint32_t
2361 Function - subghz_protocol_decoder_faac_slh_free void void*
2362 Function - subghz_protocol_decoder_faac_slh_get_hash_data uint8_t void*
2363 Function - subghz_protocol_decoder_faac_slh_get_string void void*, string_t void*, FuriString*
2364 Function - subghz_protocol_decoder_faac_slh_reset void void*
2365 Function - subghz_protocol_decoder_faac_slh_serialize _Bool void*, FlipperFormat*, SubGhzPresetDefinition*
2366 Function - subghz_protocol_decoder_gate_tx_alloc void* SubGhzEnvironment*
2368 Function - subghz_protocol_decoder_gate_tx_feed void void*, _Bool, uint32_t
2369 Function - subghz_protocol_decoder_gate_tx_free void void*
2370 Function - subghz_protocol_decoder_gate_tx_get_hash_data uint8_t void*
2371 Function - subghz_protocol_decoder_gate_tx_get_string void void*, string_t void*, FuriString*
2372 Function - subghz_protocol_decoder_gate_tx_reset void void*
2373 Function - subghz_protocol_decoder_gate_tx_serialize _Bool void*, FlipperFormat*, SubGhzPresetDefinition*
2374 Function - subghz_protocol_decoder_holtek_alloc void* SubGhzEnvironment*
2376 Function - subghz_protocol_decoder_holtek_feed void void*, _Bool, uint32_t
2377 Function - subghz_protocol_decoder_holtek_free void void*
2378 Function - subghz_protocol_decoder_holtek_get_hash_data uint8_t void*
2379 Function - subghz_protocol_decoder_holtek_get_string void void*, string_t void*, FuriString*
2380 Function - subghz_protocol_decoder_holtek_reset void void*
2381 Function - subghz_protocol_decoder_holtek_serialize _Bool void*, FlipperFormat*, SubGhzPresetDefinition*
2382 Function - subghz_protocol_decoder_honeywell_wdb_alloc void* SubGhzEnvironment*
2384 Function - subghz_protocol_decoder_honeywell_wdb_feed void void*, _Bool, uint32_t
2385 Function - subghz_protocol_decoder_honeywell_wdb_free void void*
2386 Function - subghz_protocol_decoder_honeywell_wdb_get_hash_data uint8_t void*
2387 Function - subghz_protocol_decoder_honeywell_wdb_get_string void void*, string_t void*, FuriString*
2388 Function - subghz_protocol_decoder_honeywell_wdb_reset void void*
2389 Function - subghz_protocol_decoder_honeywell_wdb_serialize _Bool void*, FlipperFormat*, SubGhzPresetDefinition*
2390 Function - subghz_protocol_decoder_hormann_alloc void* SubGhzEnvironment*
2392 Function - subghz_protocol_decoder_hormann_feed void void*, _Bool, uint32_t
2393 Function - subghz_protocol_decoder_hormann_free void void*
2394 Function - subghz_protocol_decoder_hormann_get_hash_data uint8_t void*
2395 Function - subghz_protocol_decoder_hormann_get_string void void*, string_t void*, FuriString*
2396 Function - subghz_protocol_decoder_hormann_reset void void*
2397 Function - subghz_protocol_decoder_hormann_serialize _Bool void*, FlipperFormat*, SubGhzPresetDefinition*
2398 Function - subghz_protocol_decoder_ido_alloc void* SubGhzEnvironment*
2400 Function - subghz_protocol_decoder_ido_feed void void*, _Bool, uint32_t
2401 Function - subghz_protocol_decoder_ido_free void void*
2402 Function - subghz_protocol_decoder_ido_get_hash_data uint8_t void*
2403 Function - subghz_protocol_decoder_ido_get_string void void*, string_t void*, FuriString*
2404 Function - subghz_protocol_decoder_ido_reset void void*
2405 Function - subghz_protocol_decoder_ido_serialize _Bool void*, FlipperFormat*, SubGhzPresetDefinition*
2406 Function - subghz_protocol_decoder_intertechno_v3_alloc void* SubGhzEnvironment*
2408 Function - subghz_protocol_decoder_intertechno_v3_feed void void*, _Bool, uint32_t
2409 Function - subghz_protocol_decoder_intertechno_v3_free void void*
2410 Function - subghz_protocol_decoder_intertechno_v3_get_hash_data uint8_t void*
2411 Function - subghz_protocol_decoder_intertechno_v3_get_string void void*, string_t void*, FuriString*
2412 Function - subghz_protocol_decoder_intertechno_v3_reset void void*
2413 Function - subghz_protocol_decoder_intertechno_v3_serialize _Bool void*, FlipperFormat*, SubGhzPresetDefinition*
2414 Function - subghz_protocol_decoder_keeloq_alloc void* SubGhzEnvironment*
2416 Function - subghz_protocol_decoder_keeloq_feed void void*, _Bool, uint32_t
2417 Function - subghz_protocol_decoder_keeloq_free void void*
2418 Function - subghz_protocol_decoder_keeloq_get_hash_data uint8_t void*
2419 Function - subghz_protocol_decoder_keeloq_get_string void void*, string_t void*, FuriString*
2420 Function - subghz_protocol_decoder_keeloq_reset void void*
2421 Function - subghz_protocol_decoder_keeloq_serialize _Bool void*, FlipperFormat*, SubGhzPresetDefinition*
2422 Function - subghz_protocol_decoder_kia_alloc void* SubGhzEnvironment*
2424 Function - subghz_protocol_decoder_kia_feed void void*, _Bool, uint32_t
2425 Function - subghz_protocol_decoder_kia_free void void*
2426 Function - subghz_protocol_decoder_kia_get_hash_data uint8_t void*
2427 Function - subghz_protocol_decoder_kia_get_string void void*, string_t void*, FuriString*
2428 Function - subghz_protocol_decoder_kia_reset void void*
2429 Function - subghz_protocol_decoder_kia_serialize _Bool void*, FlipperFormat*, SubGhzPresetDefinition*
2430 Function - subghz_protocol_decoder_linear_alloc void* SubGhzEnvironment*
2432 Function - subghz_protocol_decoder_linear_feed void void*, _Bool, uint32_t
2433 Function - subghz_protocol_decoder_linear_free void void*
2434 Function - subghz_protocol_decoder_linear_get_hash_data uint8_t void*
2435 Function - subghz_protocol_decoder_linear_get_string void void*, string_t void*, FuriString*
2436 Function - subghz_protocol_decoder_linear_reset void void*
2437 Function - subghz_protocol_decoder_linear_serialize _Bool void*, FlipperFormat*, SubGhzPresetDefinition*
2438 Function - subghz_protocol_decoder_magellen_alloc void* SubGhzEnvironment*
2440 Function - subghz_protocol_decoder_magellen_feed void void*, _Bool, uint32_t
2441 Function - subghz_protocol_decoder_magellen_free void void*
2442 Function - subghz_protocol_decoder_magellen_get_hash_data uint8_t void*
2443 Function - subghz_protocol_decoder_magellen_get_string void void*, string_t void*, FuriString*
2444 Function - subghz_protocol_decoder_magellen_reset void void*
2445 Function - subghz_protocol_decoder_magellen_serialize _Bool void*, FlipperFormat*, SubGhzPresetDefinition*
2446 Function - subghz_protocol_decoder_marantec_alloc void* SubGhzEnvironment*
2448 Function - subghz_protocol_decoder_marantec_feed void void*, _Bool, uint32_t
2449 Function - subghz_protocol_decoder_marantec_free void void*
2450 Function - subghz_protocol_decoder_marantec_get_hash_data uint8_t void*
2451 Function - subghz_protocol_decoder_marantec_get_string void void*, string_t void*, FuriString*
2452 Function - subghz_protocol_decoder_marantec_reset void void*
2453 Function - subghz_protocol_decoder_marantec_serialize _Bool void*, FlipperFormat*, SubGhzPresetDefinition*
2454 Function - subghz_protocol_decoder_megacode_alloc void* SubGhzEnvironment*
2456 Function - subghz_protocol_decoder_megacode_feed void void*, _Bool, uint32_t
2457 Function - subghz_protocol_decoder_megacode_free void void*
2458 Function - subghz_protocol_decoder_megacode_get_hash_data uint8_t void*
2459 Function - subghz_protocol_decoder_megacode_get_string void void*, string_t void*, FuriString*
2460 Function - subghz_protocol_decoder_megacode_reset void void*
2461 Function - subghz_protocol_decoder_megacode_serialize _Bool void*, FlipperFormat*, SubGhzPresetDefinition*
2462 Function - subghz_protocol_decoder_nero_radio_alloc void* SubGhzEnvironment*
2464 Function - subghz_protocol_decoder_nero_radio_feed void void*, _Bool, uint32_t
2465 Function - subghz_protocol_decoder_nero_radio_free void void*
2466 Function - subghz_protocol_decoder_nero_radio_get_hash_data uint8_t void*
2467 Function - subghz_protocol_decoder_nero_radio_get_string void void*, string_t void*, FuriString*
2468 Function - subghz_protocol_decoder_nero_radio_reset void void*
2469 Function - subghz_protocol_decoder_nero_radio_serialize _Bool void*, FlipperFormat*, SubGhzPresetDefinition*
2470 Function - subghz_protocol_decoder_nero_sketch_alloc void* SubGhzEnvironment*
2472 Function - subghz_protocol_decoder_nero_sketch_feed void void*, _Bool, uint32_t
2473 Function - subghz_protocol_decoder_nero_sketch_free void void*
2474 Function - subghz_protocol_decoder_nero_sketch_get_hash_data uint8_t void*
2475 Function - subghz_protocol_decoder_nero_sketch_get_string void void*, string_t void*, FuriString*
2476 Function - subghz_protocol_decoder_nero_sketch_reset void void*
2477 Function - subghz_protocol_decoder_nero_sketch_serialize _Bool void*, FlipperFormat*, SubGhzPresetDefinition*
2478 Function - subghz_protocol_decoder_nice_flo_alloc void* SubGhzEnvironment*
2480 Function - subghz_protocol_decoder_nice_flo_feed void void*, _Bool, uint32_t
2481 Function - subghz_protocol_decoder_nice_flo_free void void*
2482 Function - subghz_protocol_decoder_nice_flo_get_hash_data uint8_t void*
2483 Function - subghz_protocol_decoder_nice_flo_get_string void void*, string_t void*, FuriString*
2484 Function - subghz_protocol_decoder_nice_flo_reset void void*
2485 Function - subghz_protocol_decoder_nice_flo_serialize _Bool void*, FlipperFormat*, SubGhzPresetDefinition*
2486 Function - subghz_protocol_decoder_nice_flor_s_alloc void* SubGhzEnvironment*
2488 Function - subghz_protocol_decoder_nice_flor_s_feed void void*, _Bool, uint32_t
2489 Function - subghz_protocol_decoder_nice_flor_s_free void void*
2490 Function - subghz_protocol_decoder_nice_flor_s_get_hash_data uint8_t void*
2491 Function - subghz_protocol_decoder_nice_flor_s_get_string void void*, string_t void*, FuriString*
2492 Function - subghz_protocol_decoder_nice_flor_s_reset void void*
2493 Function - subghz_protocol_decoder_nice_flor_s_serialize _Bool void*, FlipperFormat*, SubGhzPresetDefinition*
2494 Function - subghz_protocol_decoder_phoenix_v2_alloc void* SubGhzEnvironment*
2496 Function - subghz_protocol_decoder_phoenix_v2_feed void void*, _Bool, uint32_t
2497 Function - subghz_protocol_decoder_phoenix_v2_free void void*
2498 Function - subghz_protocol_decoder_phoenix_v2_get_hash_data uint8_t void*
2499 Function - subghz_protocol_decoder_phoenix_v2_get_string void void*, string_t void*, FuriString*
2500 Function - subghz_protocol_decoder_phoenix_v2_reset void void*
2501 Function - subghz_protocol_decoder_phoenix_v2_serialize _Bool void*, FlipperFormat*, SubGhzPresetDefinition*
2502 Function - subghz_protocol_decoder_power_smart_alloc void* SubGhzEnvironment*
2504 Function - subghz_protocol_decoder_power_smart_feed void void*, _Bool, uint32_t
2505 Function - subghz_protocol_decoder_power_smart_free void void*
2506 Function - subghz_protocol_decoder_power_smart_get_hash_data uint8_t void*
2507 Function - subghz_protocol_decoder_power_smart_get_string void void*, string_t void*, FuriString*
2508 Function - subghz_protocol_decoder_power_smart_reset void void*
2509 Function - subghz_protocol_decoder_power_smart_serialize _Bool void*, FlipperFormat*, SubGhzPresetDefinition*
2510 Function - subghz_protocol_decoder_princeton_alloc void* SubGhzEnvironment*
2512 Function - subghz_protocol_decoder_princeton_feed void void*, _Bool, uint32_t
2513 Function - subghz_protocol_decoder_princeton_free void void*
2514 Function - subghz_protocol_decoder_princeton_get_hash_data uint8_t void*
2515 Function - subghz_protocol_decoder_princeton_get_string void void*, string_t void*, FuriString*
2516 Function - subghz_protocol_decoder_princeton_reset void void*
2517 Function - subghz_protocol_decoder_princeton_serialize _Bool void*, FlipperFormat*, SubGhzPresetDefinition*
2518 Function - subghz_protocol_decoder_raw_alloc void* SubGhzEnvironment*
2520 Function - subghz_protocol_decoder_raw_feed void void*, _Bool, uint32_t
2521 Function - subghz_protocol_decoder_raw_free void void*
2522 Function - subghz_protocol_decoder_raw_get_hash_data uint8_t void*
2523 Function - subghz_protocol_decoder_raw_get_string void void*, string_t void*, FuriString*
2524 Function - subghz_protocol_decoder_raw_reset void void*
2525 Function - subghz_protocol_decoder_raw_serialize _Bool void*, FlipperFormat*, SubGhzPresetDefinition*
2526 Function - subghz_protocol_decoder_raw_set_auto_mode void void*, _Bool
2531 Function - subghz_protocol_decoder_scher_khan_feed void void*, _Bool, uint32_t
2532 Function - subghz_protocol_decoder_scher_khan_free void void*
2533 Function - subghz_protocol_decoder_scher_khan_get_hash_data uint8_t void*
2534 Function - subghz_protocol_decoder_scher_khan_get_string void void*, string_t void*, FuriString*
2535 Function - subghz_protocol_decoder_scher_khan_reset void void*
2536 Function - subghz_protocol_decoder_scher_khan_serialize _Bool void*, FlipperFormat*, SubGhzPresetDefinition*
2537 Function - subghz_protocol_decoder_secplus_v1_alloc void* SubGhzEnvironment*
2539 Function - subghz_protocol_decoder_secplus_v1_feed void void*, _Bool, uint32_t
2540 Function - subghz_protocol_decoder_secplus_v1_free void void*
2541 Function - subghz_protocol_decoder_secplus_v1_get_hash_data uint8_t void*
2542 Function - subghz_protocol_decoder_secplus_v1_get_string void void*, string_t void*, FuriString*
2543 Function - subghz_protocol_decoder_secplus_v1_reset void void*
2544 Function - subghz_protocol_decoder_secplus_v1_serialize _Bool void*, FlipperFormat*, SubGhzPresetDefinition*
2545 Function - subghz_protocol_decoder_secplus_v2_alloc void* SubGhzEnvironment*
2547 Function - subghz_protocol_decoder_secplus_v2_feed void void*, _Bool, uint32_t
2548 Function - subghz_protocol_decoder_secplus_v2_free void void*
2549 Function - subghz_protocol_decoder_secplus_v2_get_hash_data uint8_t void*
2550 Function - subghz_protocol_decoder_secplus_v2_get_string void void*, string_t void*, FuriString*
2551 Function - subghz_protocol_decoder_secplus_v2_reset void void*
2552 Function - subghz_protocol_decoder_secplus_v2_serialize _Bool void*, FlipperFormat*, SubGhzPresetDefinition*
2553 Function - subghz_protocol_decoder_somfy_keytis_alloc void* SubGhzEnvironment*
2555 Function - subghz_protocol_decoder_somfy_keytis_feed void void*, _Bool, uint32_t
2556 Function - subghz_protocol_decoder_somfy_keytis_free void void*
2557 Function - subghz_protocol_decoder_somfy_keytis_get_hash_data uint8_t void*
2558 Function - subghz_protocol_decoder_somfy_keytis_get_string void void*, string_t void*, FuriString*
2559 Function - subghz_protocol_decoder_somfy_keytis_reset void void*
2560 Function - subghz_protocol_decoder_somfy_keytis_serialize _Bool void*, FlipperFormat*, SubGhzPresetDefinition*
2561 Function - subghz_protocol_decoder_somfy_telis_alloc void* SubGhzEnvironment*
2563 Function - subghz_protocol_decoder_somfy_telis_feed void void*, _Bool, uint32_t
2564 Function - subghz_protocol_decoder_somfy_telis_free void void*
2565 Function - subghz_protocol_decoder_somfy_telis_get_hash_data uint8_t void*
2566 Function - subghz_protocol_decoder_somfy_telis_get_string void void*, string_t void*, FuriString*
2567 Function - subghz_protocol_decoder_somfy_telis_reset void void*
2568 Function - subghz_protocol_decoder_somfy_telis_serialize _Bool void*, FlipperFormat*, SubGhzPresetDefinition*
2569 Function - subghz_protocol_decoder_star_line_alloc void* SubGhzEnvironment*
2571 Function - subghz_protocol_decoder_star_line_feed void void*, _Bool, uint32_t
2572 Function - subghz_protocol_decoder_star_line_free void void*
2573 Function - subghz_protocol_decoder_star_line_get_hash_data uint8_t void*
2574 Function - subghz_protocol_decoder_star_line_get_string void void*, string_t void*, FuriString*
2575 Function - subghz_protocol_decoder_star_line_reset void void*
2576 Function - subghz_protocol_decoder_star_line_serialize _Bool void*, FlipperFormat*, SubGhzPresetDefinition*
2577 Function - subghz_protocol_encoder_bett_alloc void* SubGhzEnvironment*

View File

@@ -121,14 +121,14 @@ bool flipper_format_stream_seek_to_key(Stream* stream, const char* key, bool str
return found; 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; enum { LeadingSpace, ReadValue, TrailingSpace } state = LeadingSpace;
const size_t buffer_size = 32; const size_t buffer_size = 32;
uint8_t buffer[buffer_size]; uint8_t buffer[buffer_size];
bool result = false; bool result = false;
bool error = false; bool error = false;
string_reset(value); furi_string_reset(value);
while(true) { while(true) {
size_t was_read = stream_read(stream, buffer, buffer_size); 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; break;
} else { } else {
state = ReadValue; state = ReadValue;
string_push_back(value, data); furi_string_push_back(value, data);
} }
} else if(state == ReadValue) { } else if(state == ReadValue) {
if(flipper_format_stream_is_space(data)) { 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; break;
} else { } else {
string_push_back(value, data); furi_string_push_back(value, data);
} }
} else if(state == TrailingSpace) { } else if(state == TrailingSpace) {
if(flipper_format_stream_is_space(data)) { if(flipper_format_stream_is_space(data)) {

View File

@@ -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); 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 dict MfClassicDict instance
* @param[out] key Found key destination buffer * @param[out] key Found key destination buffer

View File

@@ -91,9 +91,9 @@ void mfkey32_set_callback(Mfkey32* instance, Mfkey32ParseDataCallback callback,
} }
static bool mfkey32_write_params(Mfkey32* instance, Mfkey32Params* params) { static bool mfkey32_write_params(Mfkey32* instance, Mfkey32Params* params) {
string_t str; FuriString* str;
string_init_printf(
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", "Sec %d key %c cuid %08x nt0 %08x nr0 %08x ar0 %08x nt1 %08x nr1 %08x ar1 %08x\n",
params->sector, params->sector,
params->key == MfClassicKeyA ? 'A' : 'B', params->key == MfClassicKeyA ? 'A' : 'B',

View File

@@ -950,9 +950,9 @@ static bool nfc_device_save_mifare_classic_keys(NfcDevice* dev) {
} }
if(!key_save_success) break; if(!key_save_success) break;
if(FURI_BIT(data->key_b_mask, i)) { if(FURI_BIT(data->key_b_mask, i)) {
string_printf(temp_str, "Key B sector %d", i); furi_string_printf(temp_str, "Key B sector %d", i);
key_save_success = key_save_success = flipper_format_write_hex(
flipper_format_write_hex(file, string_get_cstr(temp_str), sec_tr->key_b, 6); file, furi_string_get_cstr(temp_str), sec_tr->key_b, 6);
} }
} }
save_success = key_save_success; save_success = key_save_success;

View File

@@ -19,6 +19,8 @@ SubGhzEnvironment* subghz_environment_alloc() {
void subghz_environment_free(SubGhzEnvironment* instance) { void subghz_environment_free(SubGhzEnvironment* instance) {
furi_assert(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); subghz_keystore_free(instance->keystore);
free(instance); free(instance);

View File

@@ -1,6 +1,5 @@
#include "faac_slh.h" #include "faac_slh.h"
#include "../subghz_keystore.h" #include "../subghz_keystore.h"
#include <m-string.h>
#include <m-array.h> #include <m-array.h>
#include "keeloq_common.h" #include "keeloq_common.h"
#include "../blocks/const.h" #include "../blocks/const.h"
@@ -131,7 +130,7 @@ static bool subghz_protocol_faac_slh_gen_data(SubGhzProtocolEncoderFaacSLH* inst
} }
for for
M_EACH(manufacture_code, *subghz_keystore_get_data(instance->keystore), SubGhzKeyArray_t) { 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) { if(res == 0) {
switch(manufacture_code->type) { switch(manufacture_code->type) {
case KEELOQ_LEARNING_FAAC: case KEELOQ_LEARNING_FAAC:
@@ -409,7 +408,7 @@ static void subghz_protocol_faac_slh_check_remote_controller(
man = subghz_protocol_keeloq_common_faac_learning( man = subghz_protocol_keeloq_common_faac_learning(
instance->seed, manufacture_code->key); instance->seed, manufacture_code->key);
decrypt = subghz_protocol_keeloq_common_decrypt(code_hop, man); 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; break;
} }
} }

View File

@@ -579,7 +579,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
// Simple Learning // Simple Learning
decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key); decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
return 1; 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); man = subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
return 1; return 1;
} }
@@ -600,7 +600,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
fix, instance->seed, manufacture_code->key); fix, instance->seed, manufacture_code->key);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
return 1; return 1;
} }
@@ -610,7 +610,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
fix, manufacture_code->key); fix, manufacture_code->key);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
return 1; return 1;
} }
@@ -620,7 +620,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
fix, manufacture_code->key); fix, manufacture_code->key);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
return 1; return 1;
} }
@@ -629,7 +629,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
// Simple Learning // Simple Learning
decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key); decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
kl_type = 1; kl_type = 1;
return 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); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_rev);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
kl_type = 1; kl_type = 1;
return 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); man = subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
kl_type = 2; kl_type = 2;
return 1; 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); man = subghz_protocol_keeloq_common_normal_learning(fix, man_rev);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
kl_type = 2; kl_type = 2;
return 1; return 1;
@@ -678,7 +678,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
fix, instance->seed, manufacture_code->key); fix, instance->seed, manufacture_code->key);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
kl_type = 3; kl_type = 3;
return 1; 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); man = subghz_protocol_keeloq_common_secure_learning(fix, instance->seed, man_rev);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
kl_type = 3; kl_type = 3;
return 1; return 1;
@@ -699,7 +699,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
fix, manufacture_code->key); fix, manufacture_code->key);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
kl_type = 4; kl_type = 4;
return 1; 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); man = subghz_protocol_keeloq_common_magic_xor_type1_learning(fix, man_rev);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
kl_type = 4; kl_type = 4;
return 1; return 1;
@@ -723,14 +723,14 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
} else { } else {
for for
M_EACH(manufacture_code, *subghz_keystore_get_data(keystore), SubGhzKeyArray_t) { 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) { if(res == 0) {
switch(manufacture_code->type) { switch(manufacture_code->type) {
case KEELOQ_LEARNING_SIMPLE: case KEELOQ_LEARNING_SIMPLE:
// Simple Learning // Simple Learning
decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key); decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
return 1; 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); subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
return 1; return 1;
} }
@@ -752,7 +752,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
fix, instance->seed, manufacture_code->key); fix, instance->seed, manufacture_code->key);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
return 1; return 1;
} }
@@ -762,7 +762,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
fix, manufacture_code->key); fix, manufacture_code->key);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
return 1; return 1;
} }
@@ -772,7 +772,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
fix, manufacture_code->key); fix, manufacture_code->key);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
return 1; return 1;
} }
@@ -781,7 +781,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
// Simple Learning // Simple Learning
decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key); decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
kl_type = 1; kl_type = 1;
return 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); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_rev);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
kl_type = 1; kl_type = 1;
return 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); subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
kl_type = 2; kl_type = 2;
return 1; 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); man = subghz_protocol_keeloq_common_normal_learning(fix, man_rev);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
kl_type = 2; kl_type = 2;
return 1; return 1;
@@ -828,7 +828,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
fix, instance->seed, manufacture_code->key); fix, instance->seed, manufacture_code->key);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
kl_type = 3; kl_type = 3;
return 1; return 1;
@@ -839,7 +839,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
fix, instance->seed, man_rev); fix, instance->seed, man_rev);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
kl_type = 3; kl_type = 3;
return 1; return 1;
@@ -850,7 +850,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
fix, manufacture_code->key); fix, manufacture_code->key);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
kl_type = 4; kl_type = 4;
return 1; 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); man = subghz_protocol_keeloq_common_magic_xor_type1_learning(fix, man_rev);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
kl_type = 4; kl_type = 4;
return 1; 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; uint32_t code_found_reverse_lo = code_found_reverse & 0x00000000ffffffff;
if(strcmp(instance->manufacture_name, "BFT") == 0) { if(strcmp(instance->manufacture_name, "BFT") == 0) {
string_cat_printf( furi_string_cat_printf(
output, output,
"%s %dbit\r\n" "%s %dbit\r\n"
"Key:%08lX%08lX\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->manufacture_name,
instance->generic.seed); instance->generic.seed);
} else { } else {
string_cat_printf( furi_string_cat_printf(
output, output,
"%s %dbit\r\n" "%s %dbit\r\n"
"Key:%08lX%08lX\r\n" "Key:%08lX%08lX\r\n"

View File

@@ -254,7 +254,7 @@ void* subghz_protocol_decoder_raw_alloc(SubGhzEnvironment* environment) {
instance->file_is_open = RAWFileIsOpenClose; instance->file_is_open = RAWFileIsOpenClose;
instance->postroll_frames = 0; instance->postroll_frames = 0;
instance->rssi_threshold = SUBGHZ_AUTO_DETECT_RAW_THRESHOLD; instance->rssi_threshold = SUBGHZ_AUTO_DETECT_RAW_THRESHOLD;
string_init(instance->file_name); instance->file_name = furi_string_alloc();
return instance; return instance;
} }
@@ -262,7 +262,7 @@ void* subghz_protocol_decoder_raw_alloc(SubGhzEnvironment* environment) {
void subghz_protocol_decoder_raw_free(void* context) { void subghz_protocol_decoder_raw_free(void* context) {
furi_assert(context); furi_assert(context);
SubGhzProtocolDecoderRAW* instance = context; SubGhzProtocolDecoderRAW* instance = context;
string_clear(instance->file_name); furi_string_free(instance->file_name);
if(instance->upload_raw != NULL) { if(instance->upload_raw != NULL) {
free(instance->upload_raw); free(instance->upload_raw);
instance->upload_raw = NULL; 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); &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); furi_assert(context);
//SubGhzProtocolDecoderRAW* instance = context; //SubGhzProtocolDecoderRAW* instance = context;
UNUSED(context); UNUSED(context);
//ToDo no use //ToDo no use
string_cat_printf(output, "RAW Data"); furi_string_cat_printf(output, "RAW Data");
} }
void* subghz_protocol_encoder_raw_alloc(SubGhzEnvironment* environment) { void* subghz_protocol_encoder_raw_alloc(SubGhzEnvironment* environment) {
@@ -443,8 +443,8 @@ bool subghz_protocol_decoder_raw_serialize(
if(instance->auto_mode) { if(instance->auto_mode) {
furi_assert(instance); furi_assert(instance);
bool res = false; bool res = false;
string_t temp_str; FuriString* temp_str;
string_init(temp_str); temp_str = furi_string_alloc();
do { do {
stream_clean(flipper_format_get_raw_stream(flipper_format)); 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"); FURI_LOG_E(TAG, "Unable to add Frequency");
break; 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( 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"); FURI_LOG_E(TAG, "Unable to add Preset");
break; break;
} }
if(!strcmp(string_get_cstr(temp_str), "FuriHalSubGhzPresetCustom")) { if(!strcmp(furi_string_get_cstr(temp_str), "FuriHalSubGhzPresetCustom")) {
if(!flipper_format_write_string_cstr( if(!flipper_format_write_string_cstr(
flipper_format, "Custom_preset_module", "CC1101")) { flipper_format, "Custom_preset_module", "CC1101")) {
FURI_LOG_E(TAG, "Unable to add Custom_preset_module"); FURI_LOG_E(TAG, "Unable to add Custom_preset_module");
@@ -491,7 +491,7 @@ bool subghz_protocol_decoder_raw_serialize(
} }
res = true; res = true;
} while(false); } while(false);
string_clear(temp_str); furi_string_free(temp_str);
return res; return res;
} else { } else {
return false; return false;

View File

@@ -149,7 +149,7 @@ static bool
} else { } else {
for for
M_EACH(manufacture_code, *subghz_keystore_get_data(instance->keystore), SubGhzKeyArray_t) { 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) { if(res == 0) {
switch(manufacture_code->type) { switch(manufacture_code->type) {
case KEELOQ_LEARNING_SIMPLE: case KEELOQ_LEARNING_SIMPLE:
@@ -487,7 +487,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector(
// Simple Learning // Simple Learning
decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key); decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key);
if(subghz_protocol_star_line_check_decrypt(instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
return 1; 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); subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning);
if(subghz_protocol_star_line_check_decrypt(instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
return 1; return 1;
} }
@@ -508,7 +508,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector(
// Simple Learning // Simple Learning
decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key); decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key);
if(subghz_protocol_star_line_check_decrypt(instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
kl_type = 1; kl_type = 1;
return 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); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_rev);
if(subghz_protocol_star_line_check_decrypt(instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
kl_type = 1; kl_type = 1;
return 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); subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning);
if(subghz_protocol_star_line_check_decrypt(instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
kl_type = 2; kl_type = 2;
return 1; 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); man_normal_learning = subghz_protocol_keeloq_common_normal_learning(fix, man_rev);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning);
if(subghz_protocol_star_line_check_decrypt(instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
kl_type = 2; kl_type = 2;
return 1; return 1;
@@ -556,7 +556,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector(
} else { } else {
for for
M_EACH(manufacture_code, *subghz_keystore_get_data(keystore), SubGhzKeyArray_t) { 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) { if(res == 0) {
switch(manufacture_code->type) { switch(manufacture_code->type) {
case KEELOQ_LEARNING_SIMPLE: 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); decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key);
if(subghz_protocol_star_line_check_decrypt( if(subghz_protocol_star_line_check_decrypt(
instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
return 1; 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); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning);
if(subghz_protocol_star_line_check_decrypt( if(subghz_protocol_star_line_check_decrypt(
instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
return 1; 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); decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key);
if(subghz_protocol_star_line_check_decrypt( if(subghz_protocol_star_line_check_decrypt(
instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
kl_type = 1; kl_type = 1;
return 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); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_rev);
if(subghz_protocol_star_line_check_decrypt( if(subghz_protocol_star_line_check_decrypt(
instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
kl_type = 1; kl_type = 1;
return 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); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning);
if(subghz_protocol_star_line_check_decrypt( if(subghz_protocol_star_line_check_decrypt(
instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
kl_type = 2; kl_type = 2;
return 1; 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); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning);
if(subghz_protocol_star_line_check_decrypt( if(subghz_protocol_star_line_check_decrypt(
instance, decrypt, btn, end_serial)) { 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; mfname = *manufacture_name;
kl_type = 2; kl_type = 2;
return 1; return 1;

View File

@@ -81,14 +81,14 @@ bool subghz_file_encoder_worker_data_parse(SubGhzFileEncoderWorker* instance, co
void subghz_file_encoder_worker_get_text_progress( void subghz_file_encoder_worker_get_text_progress(
SubGhzFileEncoderWorker* instance, SubGhzFileEncoderWorker* instance,
string_t output) { FuriString* output) {
UNUSED(output); UNUSED(output);
Stream* stream = flipper_format_get_raw_stream(instance->flipper_format); Stream* stream = flipper_format_get_raw_stream(instance->flipper_format);
size_t total_size = stream_size(stream); size_t total_size = stream_size(stream);
size_t current_offset = stream_tell(stream); size_t current_offset = stream_tell(stream);
size_t buffer_avail = xStreamBufferBytesAvailable(instance->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) { LevelDuration subghz_file_encoder_worker_get_level_duration(void* context) {

View File

@@ -35,7 +35,7 @@ void subghz_file_encoder_worker_free(SubGhzFileEncoderWorker* instance);
*/ */
void subghz_file_encoder_worker_get_text_progress( void subghz_file_encoder_worker_get_text_progress(
SubGhzFileEncoderWorker* instance, SubGhzFileEncoderWorker* instance,
string_t output); FuriString* output);
/** /**
* Getting the level and duration of the upload to be loaded into DMA. * Getting the level and duration of the upload to be loaded into DMA.