M*LIB: non-inlined strings, FuriString primitive (#1795)
* Quicksave 1 * Header stage complete * Source stage complete * Lint & merge fixes * Includes * Documentation step 1 * FBT: output free size considering BT STACK * Documentation step 2 * py lint * Fix music player plugin * unit test stage 1: string allocator, mem, getters, setters, appends, compare, search. * unit test: string equality * unit test: string replace * unit test: string start_with, end_with * unit test: string trim * unit test: utf-8 * Rename * Revert fw_size changes * Simplify CLI backspace handling * Simplify CLI character insert * Merge fixes * Furi: correct filenaming and spelling * Bt: remove furi string include Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
@@ -54,20 +54,21 @@ static bool flipper_update_init() {
|
||||
return flipper_update_mount_sd();
|
||||
}
|
||||
|
||||
static bool flipper_update_load_stage(const string_t work_dir, UpdateManifest* manifest) {
|
||||
static bool flipper_update_load_stage(const FuriString* work_dir, UpdateManifest* manifest) {
|
||||
FIL file;
|
||||
FILINFO stat;
|
||||
|
||||
string_t loader_img_path;
|
||||
string_init_set(loader_img_path, work_dir);
|
||||
path_append(loader_img_path, string_get_cstr(manifest->staged_loader_file));
|
||||
FuriString* loader_img_path;
|
||||
loader_img_path = furi_string_alloc_set(work_dir);
|
||||
path_append(loader_img_path, furi_string_get_cstr(manifest->staged_loader_file));
|
||||
|
||||
if((f_stat(string_get_cstr(loader_img_path), &stat) != FR_OK) ||
|
||||
(f_open(&file, string_get_cstr(loader_img_path), FA_OPEN_EXISTING | FA_READ) != FR_OK)) {
|
||||
string_clear(loader_img_path);
|
||||
if((f_stat(furi_string_get_cstr(loader_img_path), &stat) != FR_OK) ||
|
||||
(f_open(&file, furi_string_get_cstr(loader_img_path), FA_OPEN_EXISTING | FA_READ) !=
|
||||
FR_OK)) {
|
||||
furi_string_free(loader_img_path);
|
||||
return false;
|
||||
}
|
||||
string_clear(loader_img_path);
|
||||
furi_string_free(loader_img_path);
|
||||
|
||||
void* img = malloc(stat.fsize);
|
||||
uint32_t bytes_read = 0;
|
||||
@@ -110,13 +111,13 @@ static bool flipper_update_load_stage(const string_t work_dir, UpdateManifest* m
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool flipper_update_get_manifest_path(string_t out_path) {
|
||||
static bool flipper_update_get_manifest_path(FuriString* out_path) {
|
||||
FIL file;
|
||||
FILINFO stat;
|
||||
uint16_t size_read = 0;
|
||||
char manifest_name_buf[UPDATE_OPERATION_MAX_MANIFEST_PATH_LEN] = {0};
|
||||
|
||||
string_reset(out_path);
|
||||
furi_string_reset(out_path);
|
||||
CHECK_FRESULT(f_stat(UPDATE_POINTER_FILE_PATH, &stat));
|
||||
CHECK_FRESULT(f_open(&file, UPDATE_POINTER_FILE_PATH, FA_OPEN_EXISTING | FA_READ));
|
||||
do {
|
||||
@@ -128,19 +129,19 @@ static bool flipper_update_get_manifest_path(string_t out_path) {
|
||||
if((size_read == 0) || (size_read == UPDATE_OPERATION_MAX_MANIFEST_PATH_LEN)) {
|
||||
break;
|
||||
}
|
||||
string_set_str(out_path, manifest_name_buf);
|
||||
string_right(out_path, strlen(STORAGE_EXT_PATH_PREFIX));
|
||||
furi_string_set(out_path, manifest_name_buf);
|
||||
furi_string_right(out_path, strlen(STORAGE_EXT_PATH_PREFIX));
|
||||
} while(0);
|
||||
f_close(&file);
|
||||
return !string_empty_p(out_path);
|
||||
return !furi_string_empty(out_path);
|
||||
}
|
||||
|
||||
static UpdateManifest* flipper_update_process_manifest(const string_t manifest_path) {
|
||||
static UpdateManifest* flipper_update_process_manifest(const FuriString* manifest_path) {
|
||||
FIL file;
|
||||
FILINFO stat;
|
||||
|
||||
CHECK_FRESULT(f_stat(string_get_cstr(manifest_path), &stat));
|
||||
CHECK_FRESULT(f_open(&file, string_get_cstr(manifest_path), FA_OPEN_EXISTING | FA_READ));
|
||||
CHECK_FRESULT(f_stat(furi_string_get_cstr(manifest_path), &stat));
|
||||
CHECK_FRESULT(f_open(&file, furi_string_get_cstr(manifest_path), FA_OPEN_EXISTING | FA_READ));
|
||||
|
||||
uint8_t* manifest_data = malloc(stat.fsize);
|
||||
uint32_t bytes_read = 0;
|
||||
@@ -177,9 +178,9 @@ void flipper_boot_update_exec() {
|
||||
return;
|
||||
}
|
||||
|
||||
string_t work_dir, manifest_path;
|
||||
string_init(work_dir);
|
||||
string_init(manifest_path);
|
||||
FuriString* work_dir = furi_string_alloc();
|
||||
FuriString* manifest_path = furi_string_alloc();
|
||||
|
||||
do {
|
||||
if(!flipper_update_get_manifest_path(manifest_path)) {
|
||||
break;
|
||||
@@ -190,12 +191,12 @@ void flipper_boot_update_exec() {
|
||||
break;
|
||||
}
|
||||
|
||||
path_extract_dirname(string_get_cstr(manifest_path), work_dir);
|
||||
path_extract_dirname(furi_string_get_cstr(manifest_path), work_dir);
|
||||
if(!flipper_update_load_stage(work_dir, manifest)) {
|
||||
update_manifest_free(manifest);
|
||||
}
|
||||
} while(false);
|
||||
string_clear(manifest_path);
|
||||
string_clear(work_dir);
|
||||
furi_string_free(manifest_path);
|
||||
furi_string_free(work_dir);
|
||||
free(pfs);
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
entry,status,name,type,params
|
||||
Version,+,1.13,,
|
||||
Version,+,2.0,,
|
||||
Header,+,applications/services/bt/bt_service/bt.h,,
|
||||
Header,+,applications/services/cli/cli.h,,
|
||||
Header,+,applications/services/cli/cli_vcp.h,,
|
||||
@@ -440,12 +440,12 @@ Function,-,arc4random,__uint32_t,
|
||||
Function,-,arc4random_buf,void,"void*, size_t"
|
||||
Function,-,arc4random_uniform,__uint32_t,__uint32_t
|
||||
Function,+,args_char_to_hex,_Bool,"char, char, uint8_t*"
|
||||
Function,+,args_get_first_word_length,size_t,string_t
|
||||
Function,+,args_length,size_t,string_t
|
||||
Function,+,args_read_hex_bytes,_Bool,"string_t, uint8_t*, size_t"
|
||||
Function,+,args_read_int_and_trim,_Bool,"string_t, int*"
|
||||
Function,+,args_read_probably_quoted_string_and_trim,_Bool,"string_t, string_t"
|
||||
Function,+,args_read_string_and_trim,_Bool,"string_t, string_t"
|
||||
Function,+,args_get_first_word_length,size_t,FuriString*
|
||||
Function,+,args_length,size_t,FuriString*
|
||||
Function,+,args_read_hex_bytes,_Bool,"FuriString*, uint8_t*, size_t"
|
||||
Function,+,args_read_int_and_trim,_Bool,"FuriString*, int*"
|
||||
Function,+,args_read_probably_quoted_string_and_trim,_Bool,"FuriString*, FuriString*"
|
||||
Function,+,args_read_string_and_trim,_Bool,"FuriString*, FuriString*"
|
||||
Function,-,asin,double,double
|
||||
Function,-,asinf,float,float
|
||||
Function,-,asinh,double,double
|
||||
@@ -642,7 +642,7 @@ Function,+,dialog_ex_set_result_callback,void,"DialogEx*, DialogExResultCallback
|
||||
Function,+,dialog_ex_set_right_button_text,void,"DialogEx*, const char*"
|
||||
Function,+,dialog_ex_set_text,void,"DialogEx*, const char*, uint8_t, uint8_t, Align, Align"
|
||||
Function,+,dialog_file_browser_set_basic_options,void,"DialogsFileBrowserOptions*, const char*, const Icon*"
|
||||
Function,+,dialog_file_browser_show,_Bool,"DialogsApp*, string_ptr, string_ptr, const DialogsFileBrowserOptions*"
|
||||
Function,+,dialog_file_browser_show,_Bool,"DialogsApp*, FuriString*, FuriString*, const DialogsFileBrowserOptions*"
|
||||
Function,+,dialog_message_alloc,DialogMessage*,
|
||||
Function,+,dialog_message_free,void,DialogMessage*
|
||||
Function,+,dialog_message_set_buttons,void,"DialogMessage*, const char*, const char*, const char*"
|
||||
@@ -665,7 +665,7 @@ Function,+,dir_walk_close,void,DirWalk*
|
||||
Function,+,dir_walk_free,void,DirWalk*
|
||||
Function,+,dir_walk_get_error,FS_Error,DirWalk*
|
||||
Function,+,dir_walk_open,_Bool,"DirWalk*, const char*"
|
||||
Function,+,dir_walk_read,DirWalkResult,"DirWalk*, string_t, FileInfo*"
|
||||
Function,+,dir_walk_read,DirWalkResult,"DirWalk*, FuriString*, FileInfo*"
|
||||
Function,+,dir_walk_set_filter_cb,void,"DirWalk*, DirWalkFilterCb, void*"
|
||||
Function,+,dir_walk_set_recursive,void,"DirWalk*, _Bool"
|
||||
Function,-,div,div_t,"int, int"
|
||||
@@ -698,7 +698,7 @@ Function,+,elements_scrollbar,void,"Canvas*, uint16_t, uint16_t"
|
||||
Function,+,elements_scrollbar_pos,void,"Canvas*, uint8_t, uint8_t, uint8_t, uint16_t, uint16_t"
|
||||
Function,+,elements_slightly_rounded_box,void,"Canvas*, uint8_t, uint8_t, uint8_t, uint8_t"
|
||||
Function,+,elements_slightly_rounded_frame,void,"Canvas*, uint8_t, uint8_t, uint8_t, uint8_t"
|
||||
Function,+,elements_string_fit_width,void,"Canvas*, string_t, uint8_t"
|
||||
Function,+,elements_string_fit_width,void,"Canvas*, FuriString*, uint8_t"
|
||||
Function,+,elements_text_box,void,"Canvas*, uint8_t, uint8_t, uint8_t, uint8_t, Align, Align, const char*, _Bool"
|
||||
Function,+,empty_screen_alloc,EmptyScreen*,
|
||||
Function,+,empty_screen_free,void,EmptyScreen*
|
||||
@@ -746,22 +746,22 @@ Function,-,fgetc_unlocked,int,FILE*
|
||||
Function,-,fgetpos,int,"FILE*, fpos_t*"
|
||||
Function,-,fgets,char*,"char*, int, FILE*"
|
||||
Function,-,fgets_unlocked,char*,"char*, int, FILE*"
|
||||
Function,+,file_browser_alloc,FileBrowser*,string_ptr
|
||||
Function,+,file_browser_alloc,FileBrowser*,FuriString*
|
||||
Function,+,file_browser_configure,void,"FileBrowser*, const char*, _Bool, const Icon*, _Bool"
|
||||
Function,+,file_browser_free,void,FileBrowser*
|
||||
Function,+,file_browser_get_view,View*,FileBrowser*
|
||||
Function,+,file_browser_set_callback,void,"FileBrowser*, FileBrowserCallback, void*"
|
||||
Function,+,file_browser_set_item_callback,void,"FileBrowser*, FileBrowserLoadItemCallback, void*"
|
||||
Function,+,file_browser_start,void,"FileBrowser*, string_t"
|
||||
Function,+,file_browser_start,void,"FileBrowser*, FuriString*"
|
||||
Function,+,file_browser_stop,void,FileBrowser*
|
||||
Function,+,file_browser_worker_alloc,BrowserWorker*,"string_t, const char*, _Bool"
|
||||
Function,+,file_browser_worker_folder_enter,void,"BrowserWorker*, string_t, int32_t"
|
||||
Function,+,file_browser_worker_alloc,BrowserWorker*,"FuriString*, const char*, _Bool"
|
||||
Function,+,file_browser_worker_folder_enter,void,"BrowserWorker*, FuriString*, int32_t"
|
||||
Function,+,file_browser_worker_folder_exit,void,BrowserWorker*
|
||||
Function,+,file_browser_worker_folder_refresh,void,"BrowserWorker*, int32_t"
|
||||
Function,+,file_browser_worker_free,void,BrowserWorker*
|
||||
Function,+,file_browser_worker_load,void,"BrowserWorker*, uint32_t, uint32_t"
|
||||
Function,+,file_browser_worker_set_callback_context,void,"BrowserWorker*, void*"
|
||||
Function,+,file_browser_worker_set_config,void,"BrowserWorker*, string_t, const char*, _Bool"
|
||||
Function,+,file_browser_worker_set_config,void,"BrowserWorker*, FuriString*, const char*, _Bool"
|
||||
Function,+,file_browser_worker_set_folder_callback,void,"BrowserWorker*, BrowserWorkerFolderOpenCallback"
|
||||
Function,+,file_browser_worker_set_item_callback,void,"BrowserWorker*, BrowserWorkerListItemCallback"
|
||||
Function,+,file_browser_worker_set_list_callback,void,"BrowserWorker*, BrowserWorkerListLoadCallback"
|
||||
@@ -806,17 +806,17 @@ Function,+,flipper_format_insert_or_update_bool,_Bool,"FlipperFormat*, const cha
|
||||
Function,+,flipper_format_insert_or_update_float,_Bool,"FlipperFormat*, const char*, const float*, const uint16_t"
|
||||
Function,+,flipper_format_insert_or_update_hex,_Bool,"FlipperFormat*, const char*, const uint8_t*, const uint16_t"
|
||||
Function,+,flipper_format_insert_or_update_int32,_Bool,"FlipperFormat*, const char*, const int32_t*, const uint16_t"
|
||||
Function,+,flipper_format_insert_or_update_string,_Bool,"FlipperFormat*, const char*, string_t"
|
||||
Function,+,flipper_format_insert_or_update_string,_Bool,"FlipperFormat*, const char*, FuriString*"
|
||||
Function,+,flipper_format_insert_or_update_string_cstr,_Bool,"FlipperFormat*, const char*, const char*"
|
||||
Function,+,flipper_format_insert_or_update_uint32,_Bool,"FlipperFormat*, const char*, const uint32_t*, const uint16_t"
|
||||
Function,+,flipper_format_key_exist,_Bool,"FlipperFormat*, const char*"
|
||||
Function,+,flipper_format_read_bool,_Bool,"FlipperFormat*, const char*, _Bool*, const uint16_t"
|
||||
Function,+,flipper_format_read_float,_Bool,"FlipperFormat*, const char*, float*, const uint16_t"
|
||||
Function,+,flipper_format_read_header,_Bool,"FlipperFormat*, string_t, uint32_t*"
|
||||
Function,+,flipper_format_read_header,_Bool,"FlipperFormat*, FuriString*, uint32_t*"
|
||||
Function,+,flipper_format_read_hex,_Bool,"FlipperFormat*, const char*, uint8_t*, const uint16_t"
|
||||
Function,+,flipper_format_read_hex_uint64,_Bool,"FlipperFormat*, const char*, uint64_t*, const uint16_t"
|
||||
Function,+,flipper_format_read_int32,_Bool,"FlipperFormat*, const char*, int32_t*, const uint16_t"
|
||||
Function,+,flipper_format_read_string,_Bool,"FlipperFormat*, const char*, string_t"
|
||||
Function,+,flipper_format_read_string,_Bool,"FlipperFormat*, const char*, FuriString*"
|
||||
Function,+,flipper_format_read_uint32,_Bool,"FlipperFormat*, const char*, uint32_t*, const uint16_t"
|
||||
Function,+,flipper_format_rewind,_Bool,FlipperFormat*
|
||||
Function,+,flipper_format_seek_to_end,_Bool,FlipperFormat*
|
||||
@@ -826,19 +826,19 @@ Function,+,flipper_format_update_bool,_Bool,"FlipperFormat*, const char*, const
|
||||
Function,+,flipper_format_update_float,_Bool,"FlipperFormat*, const char*, const float*, const uint16_t"
|
||||
Function,+,flipper_format_update_hex,_Bool,"FlipperFormat*, const char*, const uint8_t*, const uint16_t"
|
||||
Function,+,flipper_format_update_int32,_Bool,"FlipperFormat*, const char*, const int32_t*, const uint16_t"
|
||||
Function,+,flipper_format_update_string,_Bool,"FlipperFormat*, const char*, string_t"
|
||||
Function,+,flipper_format_update_string,_Bool,"FlipperFormat*, const char*, FuriString*"
|
||||
Function,+,flipper_format_update_string_cstr,_Bool,"FlipperFormat*, const char*, const char*"
|
||||
Function,+,flipper_format_update_uint32,_Bool,"FlipperFormat*, const char*, const uint32_t*, const uint16_t"
|
||||
Function,+,flipper_format_write_bool,_Bool,"FlipperFormat*, const char*, const _Bool*, const uint16_t"
|
||||
Function,+,flipper_format_write_comment,_Bool,"FlipperFormat*, string_t"
|
||||
Function,+,flipper_format_write_comment,_Bool,"FlipperFormat*, FuriString*"
|
||||
Function,+,flipper_format_write_comment_cstr,_Bool,"FlipperFormat*, const char*"
|
||||
Function,+,flipper_format_write_float,_Bool,"FlipperFormat*, const char*, const float*, const uint16_t"
|
||||
Function,+,flipper_format_write_header,_Bool,"FlipperFormat*, string_t, const uint32_t"
|
||||
Function,+,flipper_format_write_header,_Bool,"FlipperFormat*, FuriString*, const uint32_t"
|
||||
Function,+,flipper_format_write_header_cstr,_Bool,"FlipperFormat*, const char*, const uint32_t"
|
||||
Function,+,flipper_format_write_hex,_Bool,"FlipperFormat*, const char*, const uint8_t*, const uint16_t"
|
||||
Function,+,flipper_format_write_hex_uint64,_Bool,"FlipperFormat*, const char*, const uint64_t*, const uint16_t"
|
||||
Function,+,flipper_format_write_int32,_Bool,"FlipperFormat*, const char*, const int32_t*, const uint16_t"
|
||||
Function,+,flipper_format_write_string,_Bool,"FlipperFormat*, const char*, string_t"
|
||||
Function,+,flipper_format_write_string,_Bool,"FlipperFormat*, const char*, FuriString*"
|
||||
Function,+,flipper_format_write_string_cstr,_Bool,"FlipperFormat*, const char*, const char*"
|
||||
Function,+,flipper_format_write_uint32,_Bool,"FlipperFormat*, const char*, const uint32_t*, const uint16_t"
|
||||
Function,-,flockfile,void,FILE*
|
||||
@@ -899,7 +899,7 @@ Function,+,furi_event_flag_wait,uint32_t,"FuriEventFlag*, uint32_t, uint32_t, ui
|
||||
Function,+,furi_get_tick,uint32_t,
|
||||
Function,+,furi_hal_bt_change_app,_Bool,"FuriHalBtProfile, GapEventCallback, void*"
|
||||
Function,+,furi_hal_bt_clear_white_list,_Bool,
|
||||
Function,+,furi_hal_bt_dump_state,void,string_t
|
||||
Function,+,furi_hal_bt_dump_state,void,FuriString*
|
||||
Function,+,furi_hal_bt_ensure_c2_mode,_Bool,BleGlueC2Mode
|
||||
Function,+,furi_hal_bt_get_key_storage_buff,void,"uint8_t**, uint16_t*"
|
||||
Function,+,furi_hal_bt_get_radio_stack,FuriHalBtStack,
|
||||
@@ -1342,6 +1342,60 @@ Function,+,furi_semaphore_alloc,FuriSemaphore*,"uint32_t, uint32_t"
|
||||
Function,+,furi_semaphore_free,void,FuriSemaphore*
|
||||
Function,+,furi_semaphore_get_count,uint32_t,FuriSemaphore*
|
||||
Function,+,furi_semaphore_release,FuriStatus,FuriSemaphore*
|
||||
Function,+,furi_string_alloc,FuriString*,
|
||||
Function,+,furi_string_alloc_move,FuriString*,FuriString*
|
||||
Function,+,furi_string_alloc_printf,FuriString*,"const char[], ..."
|
||||
Function,+,furi_string_alloc_set,FuriString*,const FuriString*
|
||||
Function,+,furi_string_alloc_set_str,FuriString*,const char[]
|
||||
Function,+,furi_string_alloc_vprintf,FuriString*,"const char[], va_list"
|
||||
Function,+,furi_string_cat,void,"FuriString*, const FuriString*"
|
||||
Function,+,furi_string_cat_printf,int,"FuriString*, const char[], ..."
|
||||
Function,+,furi_string_cat_str,void,"FuriString*, const char[]"
|
||||
Function,+,furi_string_cat_vprintf,int,"FuriString*, const char[], va_list"
|
||||
Function,+,furi_string_cmp,int,"const FuriString*, const FuriString*"
|
||||
Function,+,furi_string_cmp_str,int,"const FuriString*, const char[]"
|
||||
Function,+,furi_string_cmpi,int,"const FuriString*, const FuriString*"
|
||||
Function,+,furi_string_cmpi_str,int,"const FuriString*, const char[]"
|
||||
Function,+,furi_string_empty,_Bool,const FuriString*
|
||||
Function,+,furi_string_end_with,_Bool,"const FuriString*, const FuriString*"
|
||||
Function,+,furi_string_end_with_str,_Bool,"const FuriString*, const char[]"
|
||||
Function,+,furi_string_equal,_Bool,"const FuriString*, const FuriString*"
|
||||
Function,+,furi_string_equal_str,_Bool,"const FuriString*, const char[]"
|
||||
Function,+,furi_string_free,void,FuriString*
|
||||
Function,+,furi_string_get_char,char,"const FuriString*, size_t"
|
||||
Function,+,furi_string_get_cstr,const char*,const FuriString*
|
||||
Function,+,furi_string_hash,size_t,const FuriString*
|
||||
Function,+,furi_string_left,void,"FuriString*, size_t"
|
||||
Function,+,furi_string_mid,void,"FuriString*, size_t, size_t"
|
||||
Function,+,furi_string_move,void,"FuriString*, FuriString*"
|
||||
Function,+,furi_string_printf,int,"FuriString*, const char[], ..."
|
||||
Function,+,furi_string_push_back,void,"FuriString*, char"
|
||||
Function,+,furi_string_replace,size_t,"FuriString*, FuriString*, FuriString*, size_t"
|
||||
Function,+,furi_string_replace_all,void,"FuriString*, const FuriString*, const FuriString*"
|
||||
Function,+,furi_string_replace_all_str,void,"FuriString*, const char[], const char[]"
|
||||
Function,+,furi_string_replace_at,void,"FuriString*, size_t, size_t, const char[]"
|
||||
Function,+,furi_string_replace_str,size_t,"FuriString*, const char[], const char[], size_t"
|
||||
Function,+,furi_string_reserve,void,"FuriString*, size_t"
|
||||
Function,+,furi_string_reset,void,FuriString*
|
||||
Function,+,furi_string_right,void,"FuriString*, size_t"
|
||||
Function,+,furi_string_search,size_t,"const FuriString*, const FuriString*, size_t"
|
||||
Function,+,furi_string_search_char,size_t,"const FuriString*, char, size_t"
|
||||
Function,+,furi_string_search_rchar,size_t,"const FuriString*, char, size_t"
|
||||
Function,+,furi_string_search_str,size_t,"const FuriString*, const char[], size_t"
|
||||
Function,+,furi_string_set,void,"FuriString*, FuriString*"
|
||||
Function,+,furi_string_set_char,void,"FuriString*, size_t, const char"
|
||||
Function,+,furi_string_set_n,void,"FuriString*, const FuriString*, size_t, size_t"
|
||||
Function,+,furi_string_set_str,void,"FuriString*, const char[]"
|
||||
Function,+,furi_string_set_strn,void,"FuriString*, const char[], size_t"
|
||||
Function,+,furi_string_size,size_t,const FuriString*
|
||||
Function,+,furi_string_start_with,_Bool,"const FuriString*, const FuriString*"
|
||||
Function,+,furi_string_start_with_str,_Bool,"const FuriString*, const char[]"
|
||||
Function,+,furi_string_swap,void,"FuriString*, FuriString*"
|
||||
Function,+,furi_string_trim,void,"FuriString*, const char[]"
|
||||
Function,+,furi_string_utf8_decode,void,"char, FuriStringUTF8State*, FuriStringUnicodeValue*"
|
||||
Function,+,furi_string_utf8_length,size_t,FuriString*
|
||||
Function,+,furi_string_utf8_push,void,"FuriString*, FuriStringUnicodeValue"
|
||||
Function,+,furi_string_vprintf,int,"FuriString*, const char[], va_list"
|
||||
Function,+,furi_thread_alloc,FuriThread*,
|
||||
Function,+,furi_thread_catch,void,
|
||||
Function,-,furi_thread_disable_heap_trace,void,FuriThread*
|
||||
@@ -1684,14 +1738,14 @@ Function,+,onewire_slave_set_result_callback,void,"OneWireSlave*, OneWireSlaveRe
|
||||
Function,+,onewire_slave_start,void,OneWireSlave*
|
||||
Function,+,onewire_slave_stop,void,OneWireSlave*
|
||||
Function,-,open_memstream,FILE*,"char**, size_t*"
|
||||
Function,+,path_append,void,"string_t, const char*"
|
||||
Function,+,path_concat,void,"const char*, const char*, string_t"
|
||||
Function,+,path_append,void,"FuriString*, const char*"
|
||||
Function,+,path_concat,void,"const char*, const char*, FuriString*"
|
||||
Function,+,path_contains_only_ascii,_Bool,const char*
|
||||
Function,+,path_extract_basename,void,"const char*, string_t"
|
||||
Function,+,path_extract_dirname,void,"const char*, string_t"
|
||||
Function,+,path_extract_extension,void,"string_t, char*, size_t"
|
||||
Function,+,path_extract_filename,void,"string_t, string_t, _Bool"
|
||||
Function,+,path_extract_filename_no_ext,void,"const char*, string_t"
|
||||
Function,+,path_extract_basename,void,"const char*, FuriString*"
|
||||
Function,+,path_extract_dirname,void,"const char*, FuriString*"
|
||||
Function,+,path_extract_extension,void,"FuriString*, char*, size_t"
|
||||
Function,+,path_extract_filename,void,"FuriString*, FuriString*, _Bool"
|
||||
Function,+,path_extract_filename_no_ext,void,"const char*, FuriString*"
|
||||
Function,-,pcTaskGetName,char*,TaskHandle_t
|
||||
Function,-,pcTimerGetName,const char*,TimerHandle_t
|
||||
Function,-,pclose,int,FILE*
|
||||
@@ -1745,8 +1799,8 @@ Function,+,protocol_dict_get_name,const char*,"ProtocolDict*, size_t"
|
||||
Function,+,protocol_dict_get_protocol_by_name,ProtocolId,"ProtocolDict*, const char*"
|
||||
Function,+,protocol_dict_get_validate_count,uint32_t,"ProtocolDict*, size_t"
|
||||
Function,+,protocol_dict_get_write_data,_Bool,"ProtocolDict*, size_t, void*"
|
||||
Function,+,protocol_dict_render_brief_data,void,"ProtocolDict*, string_t, size_t"
|
||||
Function,+,protocol_dict_render_data,void,"ProtocolDict*, string_t, size_t"
|
||||
Function,+,protocol_dict_render_brief_data,void,"ProtocolDict*, FuriString*, size_t"
|
||||
Function,+,protocol_dict_render_data,void,"ProtocolDict*, FuriString*, size_t"
|
||||
Function,+,protocol_dict_set_data,void,"ProtocolDict*, size_t, const uint8_t*, size_t"
|
||||
Function,-,pselect,int,"int, fd_set*, fd_set*, fd_set*, const timespec*, const sigset_t*"
|
||||
Function,-,putc,int,"int, FILE*"
|
||||
@@ -2073,7 +2127,7 @@ Function,-,storage_file_sync,_Bool,File*
|
||||
Function,+,storage_file_tell,uint64_t,File*
|
||||
Function,+,storage_file_truncate,_Bool,File*
|
||||
Function,+,storage_file_write,uint16_t,"File*, const void*, uint16_t"
|
||||
Function,+,storage_get_next_filename,void,"Storage*, const char*, const char*, const char*, string_t, uint8_t"
|
||||
Function,+,storage_get_next_filename,void,"Storage*, const char*, const char*, const char*, FuriString*, uint8_t"
|
||||
Function,+,storage_get_pubsub,FuriPubSub*,Storage*
|
||||
Function,+,storage_int_backup,FS_Error,"Storage*, const char*"
|
||||
Function,+,storage_int_restore,FS_Error,"Storage*, const char*, Storage_name_converter"
|
||||
@@ -2106,7 +2160,7 @@ Function,+,stream_delete_and_insert,_Bool,"Stream*, size_t, StreamWriteCB, const
|
||||
Function,+,stream_delete_and_insert_char,_Bool,"Stream*, size_t, char"
|
||||
Function,+,stream_delete_and_insert_cstring,_Bool,"Stream*, size_t, const char*"
|
||||
Function,+,stream_delete_and_insert_format,_Bool,"Stream*, size_t, const char*, ..."
|
||||
Function,+,stream_delete_and_insert_string,_Bool,"Stream*, size_t, string_t"
|
||||
Function,+,stream_delete_and_insert_string,_Bool,"Stream*, size_t, FuriString*"
|
||||
Function,+,stream_delete_and_insert_vaformat,_Bool,"Stream*, size_t, const char*, va_list"
|
||||
Function,+,stream_dump_data,void,Stream*
|
||||
Function,+,stream_eof,_Bool,Stream*
|
||||
@@ -2115,11 +2169,11 @@ Function,+,stream_insert,_Bool,"Stream*, const uint8_t*, size_t"
|
||||
Function,+,stream_insert_char,_Bool,"Stream*, char"
|
||||
Function,+,stream_insert_cstring,_Bool,"Stream*, const char*"
|
||||
Function,+,stream_insert_format,_Bool,"Stream*, const char*, ..."
|
||||
Function,+,stream_insert_string,_Bool,"Stream*, string_t"
|
||||
Function,+,stream_insert_string,_Bool,"Stream*, FuriString*"
|
||||
Function,+,stream_insert_vaformat,_Bool,"Stream*, const char*, va_list"
|
||||
Function,+,stream_load_from_file,size_t,"Stream*, Storage*, const char*"
|
||||
Function,+,stream_read,size_t,"Stream*, uint8_t*, size_t"
|
||||
Function,+,stream_read_line,_Bool,"Stream*, string_t"
|
||||
Function,+,stream_read_line,_Bool,"Stream*, FuriString*"
|
||||
Function,+,stream_rewind,_Bool,Stream*
|
||||
Function,+,stream_save_to_file,size_t,"Stream*, Storage*, const char*, FS_OpenMode"
|
||||
Function,+,stream_seek,_Bool,"Stream*, int32_t, StreamOffset"
|
||||
@@ -2130,7 +2184,7 @@ Function,+,stream_write,size_t,"Stream*, const uint8_t*, size_t"
|
||||
Function,+,stream_write_char,size_t,"Stream*, char"
|
||||
Function,+,stream_write_cstring,size_t,"Stream*, const char*"
|
||||
Function,+,stream_write_format,size_t,"Stream*, const char*, ..."
|
||||
Function,+,stream_write_string,size_t,"Stream*, string_t"
|
||||
Function,+,stream_write_string,size_t,"Stream*, FuriString*"
|
||||
Function,+,stream_write_vaformat,size_t,"Stream*, const char*, va_list"
|
||||
Function,-,strerror,char*,int
|
||||
Function,-,strerror_l,char*,"int, locale_t"
|
||||
@@ -2191,14 +2245,14 @@ Function,-,subghz_keystore_raw_get_data,_Bool,"const char*, size_t, uint8_t*, si
|
||||
Function,-,subghz_keystore_save,_Bool,"SubGhzKeystore*, const char*, uint8_t*"
|
||||
Function,-,subghz_protocol_decoder_base_deserialize,_Bool,"SubGhzProtocolDecoderBase*, FlipperFormat*"
|
||||
Function,-,subghz_protocol_decoder_base_get_hash_data,uint8_t,SubGhzProtocolDecoderBase*
|
||||
Function,-,subghz_protocol_decoder_base_get_string,_Bool,"SubGhzProtocolDecoderBase*, string_t"
|
||||
Function,-,subghz_protocol_decoder_base_get_string,_Bool,"SubGhzProtocolDecoderBase*, FuriString*"
|
||||
Function,+,subghz_protocol_decoder_base_serialize,_Bool,"SubGhzProtocolDecoderBase*, FlipperFormat*, SubGhzPresetDefinition*"
|
||||
Function,-,subghz_protocol_decoder_base_set_decoder_callback,void,"SubGhzProtocolDecoderBase*, SubGhzProtocolDecoderBaseRxCallback, void*"
|
||||
Function,+,subghz_protocol_decoder_raw_alloc,void*,SubGhzEnvironment*
|
||||
Function,+,subghz_protocol_decoder_raw_deserialize,_Bool,"void*, FlipperFormat*"
|
||||
Function,+,subghz_protocol_decoder_raw_feed,void,"void*, _Bool, uint32_t"
|
||||
Function,+,subghz_protocol_decoder_raw_free,void,void*
|
||||
Function,+,subghz_protocol_decoder_raw_get_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_encoder_raw_alloc,void*,SubGhzEnvironment*
|
||||
Function,+,subghz_protocol_encoder_raw_deserialize,_Bool,"void*, FlipperFormat*"
|
||||
@@ -2389,7 +2443,7 @@ Function,-,vTimerSetReloadMode,void,"TimerHandle_t, const UBaseType_t"
|
||||
Function,-,vTimerSetTimerID,void,"TimerHandle_t, void*"
|
||||
Function,-,vTimerSetTimerNumber,void,"TimerHandle_t, UBaseType_t"
|
||||
Function,+,validator_is_file_alloc_init,ValidatorIsFile*,"const char*, const char*, const char*"
|
||||
Function,+,validator_is_file_callback,_Bool,"const char*, string_t, void*"
|
||||
Function,+,validator_is_file_callback,_Bool,"const char*, FuriString*, void*"
|
||||
Function,+,validator_is_file_free,void,ValidatorIsFile*
|
||||
Function,+,variable_item_get_context,void*,VariableItem*
|
||||
Function,+,variable_item_get_current_value_index,uint8_t,VariableItem*
|
||||
|
|
@@ -3,7 +3,6 @@
|
||||
#include <ble/ble.h>
|
||||
|
||||
#include <furi.h>
|
||||
#include <m-string.h>
|
||||
#include <protobuf_version.h>
|
||||
#include <lib/toolbox/version.h>
|
||||
|
||||
@@ -16,7 +15,7 @@ typedef struct {
|
||||
uint16_t firmware_rev_char_handle;
|
||||
uint16_t software_rev_char_handle;
|
||||
uint16_t rpc_version_char_handle;
|
||||
string_t version_string;
|
||||
FuriString* version_string;
|
||||
char hardware_revision[4];
|
||||
} DevInfoSvc;
|
||||
|
||||
@@ -31,8 +30,7 @@ static const uint8_t dev_info_rpc_version_uuid[] =
|
||||
|
||||
void dev_info_svc_start() {
|
||||
dev_info_svc = malloc(sizeof(DevInfoSvc));
|
||||
string_init_printf(
|
||||
dev_info_svc->version_string,
|
||||
dev_info_svc->version_string = furi_string_alloc_printf(
|
||||
"%s %s %s %s",
|
||||
version_get_githash(NULL),
|
||||
version_get_gitbranch(NULL),
|
||||
@@ -104,7 +102,7 @@ void dev_info_svc_start() {
|
||||
dev_info_svc->service_handle,
|
||||
UUID_TYPE_16,
|
||||
(Char_UUID_t*)&uuid,
|
||||
string_size(dev_info_svc->version_string),
|
||||
furi_string_size(dev_info_svc->version_string),
|
||||
CHAR_PROP_READ,
|
||||
ATTR_PERMISSION_AUTHEN_READ,
|
||||
GATT_DONT_NOTIFY_EVENTS,
|
||||
@@ -161,8 +159,8 @@ void dev_info_svc_start() {
|
||||
dev_info_svc->service_handle,
|
||||
dev_info_svc->software_rev_char_handle,
|
||||
0,
|
||||
string_size(dev_info_svc->version_string),
|
||||
(uint8_t*)string_get_cstr(dev_info_svc->version_string));
|
||||
furi_string_size(dev_info_svc->version_string),
|
||||
(uint8_t*)furi_string_get_cstr(dev_info_svc->version_string));
|
||||
if(status) {
|
||||
FURI_LOG_E(TAG, "Failed to update software revision char: %d", status);
|
||||
}
|
||||
@@ -180,7 +178,7 @@ void dev_info_svc_start() {
|
||||
void dev_info_svc_stop() {
|
||||
tBleStatus status;
|
||||
if(dev_info_svc) {
|
||||
string_clear(dev_info_svc->version_string);
|
||||
furi_string_free(dev_info_svc->version_string);
|
||||
// Delete service characteristics
|
||||
status =
|
||||
aci_gatt_del_char(dev_info_svc->service_handle, dev_info_svc->man_name_char_handle);
|
||||
|
@@ -340,7 +340,7 @@ bool furi_hal_bt_clear_white_list() {
|
||||
return status != BLE_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
void furi_hal_bt_dump_state(string_t buffer) {
|
||||
void furi_hal_bt_dump_state(FuriString* buffer) {
|
||||
if(furi_hal_bt_is_alive()) {
|
||||
uint8_t HCI_Version;
|
||||
uint16_t HCI_Revision;
|
||||
@@ -351,7 +351,7 @@ void furi_hal_bt_dump_state(string_t buffer) {
|
||||
tBleStatus ret = hci_read_local_version_information(
|
||||
&HCI_Version, &HCI_Revision, &LMP_PAL_Version, &Manufacturer_Name, &LMP_PAL_Subversion);
|
||||
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
buffer,
|
||||
"Ret: %d, HCI_Version: %d, HCI_Revision: %d, LMP_PAL_Version: %d, Manufacturer_Name: %d, LMP_PAL_Subversion: %d",
|
||||
ret,
|
||||
@@ -361,7 +361,7 @@ void furi_hal_bt_dump_state(string_t buffer) {
|
||||
Manufacturer_Name,
|
||||
LMP_PAL_Subversion);
|
||||
} else {
|
||||
string_cat_printf(buffer, "BLE not ready");
|
||||
furi_string_cat_printf(buffer, "BLE not ready");
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -4,7 +4,6 @@
|
||||
#include <stdbool.h>
|
||||
#include <stm32wbxx_ll_gpio.h>
|
||||
#include <stm32wbxx_ll_usart.h>
|
||||
#include <m-string.h>
|
||||
|
||||
#include <utilities_conf.h>
|
||||
|
||||
@@ -88,13 +87,13 @@ void furi_hal_console_tx_with_new_line(const uint8_t* buffer, size_t buffer_size
|
||||
}
|
||||
|
||||
void furi_hal_console_printf(const char format[], ...) {
|
||||
string_t string;
|
||||
FuriString* string;
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
string_init_vprintf(string, format, args);
|
||||
string = furi_string_alloc_vprintf(format, args);
|
||||
va_end(args);
|
||||
furi_hal_console_tx((const uint8_t*)string_get_cstr(string), string_size(string));
|
||||
string_clear(string);
|
||||
furi_hal_console_tx((const uint8_t*)furi_string_get_cstr(string), furi_string_size(string));
|
||||
furi_string_free(string);
|
||||
}
|
||||
|
||||
void furi_hal_console_puts(const char* data) {
|
||||
|
@@ -5,12 +5,12 @@
|
||||
#include <furi_hal_crypto.h>
|
||||
|
||||
#include <interface/patterns/ble_thread/shci/shci.h>
|
||||
#include <m-string.h>
|
||||
#include <furi.h>
|
||||
#include <protobuf_version.h>
|
||||
|
||||
void furi_hal_info_get(FuriHalInfoValueCallback out, void* context) {
|
||||
string_t value;
|
||||
string_init(value);
|
||||
FuriString* value;
|
||||
value = furi_string_alloc();
|
||||
|
||||
// Device Info version
|
||||
out("device_info_major", "2", false, context);
|
||||
@@ -20,36 +20,36 @@ void furi_hal_info_get(FuriHalInfoValueCallback out, void* context) {
|
||||
out("hardware_model", furi_hal_version_get_model_name(), false, context);
|
||||
|
||||
// Unique ID
|
||||
string_reset(value);
|
||||
furi_string_reset(value);
|
||||
const uint8_t* uid = furi_hal_version_uid();
|
||||
for(size_t i = 0; i < furi_hal_version_uid_size(); i++) {
|
||||
string_cat_printf(value, "%02X", uid[i]);
|
||||
furi_string_cat_printf(value, "%02X", uid[i]);
|
||||
}
|
||||
out("hardware_uid", string_get_cstr(value), false, context);
|
||||
out("hardware_uid", furi_string_get_cstr(value), false, context);
|
||||
|
||||
// OTP Revision
|
||||
string_printf(value, "%d", furi_hal_version_get_otp_version());
|
||||
out("hardware_otp_ver", string_get_cstr(value), false, context);
|
||||
string_printf(value, "%lu", furi_hal_version_get_hw_timestamp());
|
||||
out("hardware_timestamp", string_get_cstr(value), false, context);
|
||||
furi_string_printf(value, "%d", furi_hal_version_get_otp_version());
|
||||
out("hardware_otp_ver", furi_string_get_cstr(value), false, context);
|
||||
furi_string_printf(value, "%lu", furi_hal_version_get_hw_timestamp());
|
||||
out("hardware_timestamp", furi_string_get_cstr(value), false, context);
|
||||
|
||||
// Board Revision
|
||||
string_printf(value, "%d", furi_hal_version_get_hw_version());
|
||||
out("hardware_ver", string_get_cstr(value), false, context);
|
||||
string_printf(value, "%d", furi_hal_version_get_hw_target());
|
||||
out("hardware_target", string_get_cstr(value), false, context);
|
||||
string_printf(value, "%d", furi_hal_version_get_hw_body());
|
||||
out("hardware_body", string_get_cstr(value), false, context);
|
||||
string_printf(value, "%d", furi_hal_version_get_hw_connect());
|
||||
out("hardware_connect", string_get_cstr(value), false, context);
|
||||
string_printf(value, "%d", furi_hal_version_get_hw_display());
|
||||
out("hardware_display", string_get_cstr(value), false, context);
|
||||
furi_string_printf(value, "%d", furi_hal_version_get_hw_version());
|
||||
out("hardware_ver", furi_string_get_cstr(value), false, context);
|
||||
furi_string_printf(value, "%d", furi_hal_version_get_hw_target());
|
||||
out("hardware_target", furi_string_get_cstr(value), false, context);
|
||||
furi_string_printf(value, "%d", furi_hal_version_get_hw_body());
|
||||
out("hardware_body", furi_string_get_cstr(value), false, context);
|
||||
furi_string_printf(value, "%d", furi_hal_version_get_hw_connect());
|
||||
out("hardware_connect", furi_string_get_cstr(value), false, context);
|
||||
furi_string_printf(value, "%d", furi_hal_version_get_hw_display());
|
||||
out("hardware_display", furi_string_get_cstr(value), false, context);
|
||||
|
||||
// Board Personification
|
||||
string_printf(value, "%d", furi_hal_version_get_hw_color());
|
||||
out("hardware_color", string_get_cstr(value), false, context);
|
||||
string_printf(value, "%d", furi_hal_version_get_hw_region());
|
||||
out("hardware_region", string_get_cstr(value), false, context);
|
||||
furi_string_printf(value, "%d", furi_hal_version_get_hw_color());
|
||||
out("hardware_color", furi_string_get_cstr(value), false, context);
|
||||
furi_string_printf(value, "%d", furi_hal_version_get_hw_region());
|
||||
out("hardware_region", furi_string_get_cstr(value), false, context);
|
||||
out("hardware_region_provisioned", furi_hal_region_get_name(), false, context);
|
||||
const char* name = furi_hal_version_get_name_ptr();
|
||||
if(name) {
|
||||
@@ -68,8 +68,8 @@ void furi_hal_info_get(FuriHalInfoValueCallback out, void* context) {
|
||||
out("firmware_branch_num", version_get_gitbranchnum(firmware_version), false, context);
|
||||
out("firmware_version", version_get_version(firmware_version), false, context);
|
||||
out("firmware_build_date", version_get_builddate(firmware_version), false, context);
|
||||
string_printf(value, "%d", version_get_target(firmware_version));
|
||||
out("firmware_target", string_get_cstr(value), false, context);
|
||||
furi_string_printf(value, "%d", version_get_target(firmware_version));
|
||||
out("firmware_target", furi_string_get_cstr(value), false, context);
|
||||
}
|
||||
|
||||
if(furi_hal_bt_is_alive()) {
|
||||
@@ -78,64 +78,64 @@ void furi_hal_info_get(FuriHalInfoValueCallback out, void* context) {
|
||||
out("radio_mode", ble_c2_info->mode == BleGlueC2ModeFUS ? "FUS" : "Stack", false, context);
|
||||
|
||||
// FUS Info
|
||||
string_printf(value, "%d", ble_c2_info->FusVersionMajor);
|
||||
out("radio_fus_major", string_get_cstr(value), false, context);
|
||||
string_printf(value, "%d", ble_c2_info->FusVersionMinor);
|
||||
out("radio_fus_minor", string_get_cstr(value), false, context);
|
||||
string_printf(value, "%d", ble_c2_info->FusVersionSub);
|
||||
out("radio_fus_sub", string_get_cstr(value), false, context);
|
||||
string_printf(value, "%dK", ble_c2_info->FusMemorySizeSram2B);
|
||||
out("radio_fus_sram2b", string_get_cstr(value), false, context);
|
||||
string_printf(value, "%dK", ble_c2_info->FusMemorySizeSram2A);
|
||||
out("radio_fus_sram2a", string_get_cstr(value), false, context);
|
||||
string_printf(value, "%dK", ble_c2_info->FusMemorySizeFlash * 4);
|
||||
out("radio_fus_flash", string_get_cstr(value), false, context);
|
||||
furi_string_printf(value, "%d", ble_c2_info->FusVersionMajor);
|
||||
out("radio_fus_major", furi_string_get_cstr(value), false, context);
|
||||
furi_string_printf(value, "%d", ble_c2_info->FusVersionMinor);
|
||||
out("radio_fus_minor", furi_string_get_cstr(value), false, context);
|
||||
furi_string_printf(value, "%d", ble_c2_info->FusVersionSub);
|
||||
out("radio_fus_sub", furi_string_get_cstr(value), false, context);
|
||||
furi_string_printf(value, "%dK", ble_c2_info->FusMemorySizeSram2B);
|
||||
out("radio_fus_sram2b", furi_string_get_cstr(value), false, context);
|
||||
furi_string_printf(value, "%dK", ble_c2_info->FusMemorySizeSram2A);
|
||||
out("radio_fus_sram2a", furi_string_get_cstr(value), false, context);
|
||||
furi_string_printf(value, "%dK", ble_c2_info->FusMemorySizeFlash * 4);
|
||||
out("radio_fus_flash", furi_string_get_cstr(value), false, context);
|
||||
|
||||
// Stack Info
|
||||
string_printf(value, "%d", ble_c2_info->StackType);
|
||||
out("radio_stack_type", string_get_cstr(value), false, context);
|
||||
string_printf(value, "%d", ble_c2_info->VersionMajor);
|
||||
out("radio_stack_major", string_get_cstr(value), false, context);
|
||||
string_printf(value, "%d", ble_c2_info->VersionMinor);
|
||||
out("radio_stack_minor", string_get_cstr(value), false, context);
|
||||
string_printf(value, "%d", ble_c2_info->VersionSub);
|
||||
out("radio_stack_sub", string_get_cstr(value), false, context);
|
||||
string_printf(value, "%d", ble_c2_info->VersionBranch);
|
||||
out("radio_stack_branch", string_get_cstr(value), false, context);
|
||||
string_printf(value, "%d", ble_c2_info->VersionReleaseType);
|
||||
out("radio_stack_release", string_get_cstr(value), false, context);
|
||||
string_printf(value, "%dK", ble_c2_info->MemorySizeSram2B);
|
||||
out("radio_stack_sram2b", string_get_cstr(value), false, context);
|
||||
string_printf(value, "%dK", ble_c2_info->MemorySizeSram2A);
|
||||
out("radio_stack_sram2a", string_get_cstr(value), false, context);
|
||||
string_printf(value, "%dK", ble_c2_info->MemorySizeSram1);
|
||||
out("radio_stack_sram1", string_get_cstr(value), false, context);
|
||||
string_printf(value, "%dK", ble_c2_info->MemorySizeFlash * 4);
|
||||
out("radio_stack_flash", string_get_cstr(value), false, context);
|
||||
furi_string_printf(value, "%d", ble_c2_info->StackType);
|
||||
out("radio_stack_type", furi_string_get_cstr(value), false, context);
|
||||
furi_string_printf(value, "%d", ble_c2_info->VersionMajor);
|
||||
out("radio_stack_major", furi_string_get_cstr(value), false, context);
|
||||
furi_string_printf(value, "%d", ble_c2_info->VersionMinor);
|
||||
out("radio_stack_minor", furi_string_get_cstr(value), false, context);
|
||||
furi_string_printf(value, "%d", ble_c2_info->VersionSub);
|
||||
out("radio_stack_sub", furi_string_get_cstr(value), false, context);
|
||||
furi_string_printf(value, "%d", ble_c2_info->VersionBranch);
|
||||
out("radio_stack_branch", furi_string_get_cstr(value), false, context);
|
||||
furi_string_printf(value, "%d", ble_c2_info->VersionReleaseType);
|
||||
out("radio_stack_release", furi_string_get_cstr(value), false, context);
|
||||
furi_string_printf(value, "%dK", ble_c2_info->MemorySizeSram2B);
|
||||
out("radio_stack_sram2b", furi_string_get_cstr(value), false, context);
|
||||
furi_string_printf(value, "%dK", ble_c2_info->MemorySizeSram2A);
|
||||
out("radio_stack_sram2a", furi_string_get_cstr(value), false, context);
|
||||
furi_string_printf(value, "%dK", ble_c2_info->MemorySizeSram1);
|
||||
out("radio_stack_sram1", furi_string_get_cstr(value), false, context);
|
||||
furi_string_printf(value, "%dK", ble_c2_info->MemorySizeFlash * 4);
|
||||
out("radio_stack_flash", furi_string_get_cstr(value), false, context);
|
||||
|
||||
// Mac address
|
||||
string_reset(value);
|
||||
furi_string_reset(value);
|
||||
const uint8_t* ble_mac = furi_hal_version_get_ble_mac();
|
||||
for(size_t i = 0; i < 6; i++) {
|
||||
string_cat_printf(value, "%02X", ble_mac[i]);
|
||||
furi_string_cat_printf(value, "%02X", ble_mac[i]);
|
||||
}
|
||||
out("radio_ble_mac", string_get_cstr(value), false, context);
|
||||
out("radio_ble_mac", furi_string_get_cstr(value), false, context);
|
||||
|
||||
// Signature verification
|
||||
uint8_t enclave_keys = 0;
|
||||
uint8_t enclave_valid_keys = 0;
|
||||
bool enclave_valid = furi_hal_crypto_verify_enclave(&enclave_keys, &enclave_valid_keys);
|
||||
string_printf(value, "%d", enclave_valid_keys);
|
||||
out("enclave_valid_keys", string_get_cstr(value), false, context);
|
||||
furi_string_printf(value, "%d", enclave_valid_keys);
|
||||
out("enclave_valid_keys", furi_string_get_cstr(value), false, context);
|
||||
out("enclave_valid", enclave_valid ? "true" : "false", false, context);
|
||||
} else {
|
||||
out("radio_alive", "false", false, context);
|
||||
}
|
||||
|
||||
string_printf(value, "%u", PROTOBUF_MAJOR_VERSION);
|
||||
out("protobuf_version_major", string_get_cstr(value), false, context);
|
||||
string_printf(value, "%u", PROTOBUF_MINOR_VERSION);
|
||||
out("protobuf_version_minor", string_get_cstr(value), true, context);
|
||||
furi_string_printf(value, "%u", PROTOBUF_MAJOR_VERSION);
|
||||
out("protobuf_version_major", furi_string_get_cstr(value), false, context);
|
||||
furi_string_printf(value, "%u", PROTOBUF_MINOR_VERSION);
|
||||
out("protobuf_version_minor", furi_string_get_cstr(value), true, context);
|
||||
|
||||
string_clear(value);
|
||||
furi_string_free(value);
|
||||
}
|
||||
|
@@ -4,7 +4,6 @@
|
||||
#include <st25r3916_irq.h>
|
||||
#include <rfal_rf.h>
|
||||
#include <furi.h>
|
||||
#include <m-string.h>
|
||||
|
||||
#include <lib/digital_signal/digital_signal.h>
|
||||
#include <furi_hal_spi.h>
|
||||
@@ -743,7 +742,8 @@ void furi_hal_nfc_sleep() {
|
||||
rfalLowPowerModeStart();
|
||||
}
|
||||
|
||||
FuriHalNfcReturn furi_hal_nfc_ll_set_mode(FuriHalNfcMode mode, FuriHalNfcBitrate txBR, FuriHalNfcBitrate rxBR) {
|
||||
FuriHalNfcReturn
|
||||
furi_hal_nfc_ll_set_mode(FuriHalNfcMode mode, FuriHalNfcBitrate txBR, FuriHalNfcBitrate rxBR) {
|
||||
return rfalSetMode((rfalMode)mode, (rfalBitRate)txBR, (rfalBitRate)rxBR);
|
||||
}
|
||||
|
||||
|
@@ -529,8 +529,8 @@ void furi_hal_power_suppress_charge_exit() {
|
||||
void furi_hal_power_info_get(FuriHalPowerInfoCallback out, void* context) {
|
||||
furi_assert(out);
|
||||
|
||||
string_t value;
|
||||
string_init(value);
|
||||
FuriString* value;
|
||||
value = furi_string_alloc();
|
||||
|
||||
// Power Info version
|
||||
out("power_info_major", "1", false, context);
|
||||
@@ -538,45 +538,45 @@ void furi_hal_power_info_get(FuriHalPowerInfoCallback out, void* context) {
|
||||
|
||||
uint8_t charge = furi_hal_power_get_pct();
|
||||
|
||||
string_printf(value, "%u", charge);
|
||||
out("charge_level", string_get_cstr(value), false, context);
|
||||
furi_string_printf(value, "%u", charge);
|
||||
out("charge_level", furi_string_get_cstr(value), false, context);
|
||||
|
||||
if(furi_hal_power_is_charging()) {
|
||||
if(charge < 100) {
|
||||
string_printf(value, "charging");
|
||||
furi_string_printf(value, "charging");
|
||||
} else {
|
||||
string_printf(value, "charged");
|
||||
furi_string_printf(value, "charged");
|
||||
}
|
||||
} else {
|
||||
string_printf(value, "discharging");
|
||||
furi_string_printf(value, "discharging");
|
||||
}
|
||||
out("charge_state", string_get_cstr(value), false, context);
|
||||
out("charge_state", furi_string_get_cstr(value), false, context);
|
||||
|
||||
uint16_t voltage =
|
||||
(uint16_t)(furi_hal_power_get_battery_voltage(FuriHalPowerICFuelGauge) * 1000.f);
|
||||
string_printf(value, "%u", voltage);
|
||||
out("battery_voltage", string_get_cstr(value), false, context);
|
||||
furi_string_printf(value, "%u", voltage);
|
||||
out("battery_voltage", furi_string_get_cstr(value), false, context);
|
||||
|
||||
int16_t current =
|
||||
(int16_t)(furi_hal_power_get_battery_current(FuriHalPowerICFuelGauge) * 1000.f);
|
||||
string_printf(value, "%d", current);
|
||||
out("battery_current", string_get_cstr(value), false, context);
|
||||
furi_string_printf(value, "%d", current);
|
||||
out("battery_current", furi_string_get_cstr(value), false, context);
|
||||
|
||||
int16_t temperature = (int16_t)furi_hal_power_get_battery_temperature(FuriHalPowerICFuelGauge);
|
||||
string_printf(value, "%d", temperature);
|
||||
out("gauge_temp", string_get_cstr(value), false, context);
|
||||
furi_string_printf(value, "%d", temperature);
|
||||
out("gauge_temp", furi_string_get_cstr(value), false, context);
|
||||
|
||||
string_printf(value, "%u", furi_hal_power_get_bat_health_pct());
|
||||
out("battery_health", string_get_cstr(value), false, context);
|
||||
furi_string_printf(value, "%u", furi_hal_power_get_bat_health_pct());
|
||||
out("battery_health", furi_string_get_cstr(value), false, context);
|
||||
|
||||
string_printf(value, "%u", furi_hal_power_get_battery_remaining_capacity());
|
||||
out("capacity_remain", string_get_cstr(value), false, context);
|
||||
furi_string_printf(value, "%u", furi_hal_power_get_battery_remaining_capacity());
|
||||
out("capacity_remain", furi_string_get_cstr(value), false, context);
|
||||
|
||||
string_printf(value, "%u", furi_hal_power_get_battery_full_capacity());
|
||||
out("capacity_full", string_get_cstr(value), false, context);
|
||||
furi_string_printf(value, "%u", furi_hal_power_get_battery_full_capacity());
|
||||
out("capacity_full", furi_string_get_cstr(value), false, context);
|
||||
|
||||
string_printf(value, "%u", furi_hal_power_get_battery_design_capacity());
|
||||
out("capacity_design", string_get_cstr(value), true, context);
|
||||
furi_string_printf(value, "%u", furi_hal_power_get_battery_design_capacity());
|
||||
out("capacity_design", furi_string_get_cstr(value), true, context);
|
||||
|
||||
string_clear(value);
|
||||
furi_string_free(value);
|
||||
}
|
||||
|
@@ -5,7 +5,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <m-string.h>
|
||||
#include <furi.h>
|
||||
#include <stdbool.h>
|
||||
#include <gap.h>
|
||||
#include <serial_service.h>
|
||||
@@ -122,9 +122,9 @@ void furi_hal_bt_stop_advertising();
|
||||
|
||||
/** Get BT/BLE system component state
|
||||
*
|
||||
* @param[in] buffer string_t buffer to write to
|
||||
* @param[in] buffer FuriString* buffer to write to
|
||||
*/
|
||||
void furi_hal_bt_dump_state(string_t buffer);
|
||||
void furi_hal_bt_dump_state(FuriString* buffer);
|
||||
|
||||
/** Get BT/BLE system component state
|
||||
*
|
||||
|
@@ -7,7 +7,6 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <m-string.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
Reference in New Issue
Block a user