Dynamic default rfid naming

This commit is contained in:
Willy-JL
2023-09-02 23:05:53 +02:00
parent 8443fc53f2
commit 113c895d9a
3 changed files with 9 additions and 4 deletions

View File

@@ -35,7 +35,6 @@
#include <lfrfid/scenes/lfrfid_scene.h>
#define LFRFID_KEY_NAME_SIZE 22
#define LFRFID_TEXT_STORE_SIZE 40
#define LFRFID_APP_FOLDER ANY_PATH("lfrfid")

View File

@@ -20,7 +20,7 @@ void lfrfid_scene_raw_name_on_enter(void* context) {
lfrfid_text_input_callback,
app,
app->text_store,
LFRFID_KEY_NAME_SIZE,
LFRFID_TEXT_STORE_SIZE,
key_name_is_empty);
ValidatorIsFile* validator_is_file =

View File

@@ -12,8 +12,14 @@ void lfrfid_scene_save_name_on_enter(void* context) {
if(key_name_is_empty) {
furi_string_set(app->file_path, LFRFID_APP_FOLDER);
FuriString* prefix =
furi_string_alloc_set(protocol_dict_get_name(app->dict, app->protocol_id));
furi_string_replace_all(prefix, "/", "_");
furi_string_replace_all(prefix, " ", "_");
furi_string_left(prefix, 11);
name_generator_make_auto(
app->text_store, LFRFID_TEXT_STORE_SIZE, LFRFID_APP_FILENAME_PREFIX);
app->text_store, LFRFID_TEXT_STORE_SIZE, furi_string_get_cstr(prefix));
furi_string_free(prefix);
furi_string_set(folder_path, LFRFID_APP_FOLDER);
} else {
@@ -27,7 +33,7 @@ void lfrfid_scene_save_name_on_enter(void* context) {
lfrfid_text_input_callback,
app,
app->text_store,
LFRFID_KEY_NAME_SIZE,
LFRFID_TEXT_STORE_SIZE,
key_name_is_empty);
FURI_LOG_I("", "%s %s", furi_string_get_cstr(folder_path), app->text_store);