mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-14 23:48:35 -07:00
Dynamic default rfid naming
This commit is contained in:
@@ -35,7 +35,6 @@
|
|||||||
|
|
||||||
#include <lfrfid/scenes/lfrfid_scene.h>
|
#include <lfrfid/scenes/lfrfid_scene.h>
|
||||||
|
|
||||||
#define LFRFID_KEY_NAME_SIZE 22
|
|
||||||
#define LFRFID_TEXT_STORE_SIZE 40
|
#define LFRFID_TEXT_STORE_SIZE 40
|
||||||
|
|
||||||
#define LFRFID_APP_FOLDER ANY_PATH("lfrfid")
|
#define LFRFID_APP_FOLDER ANY_PATH("lfrfid")
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ void lfrfid_scene_raw_name_on_enter(void* context) {
|
|||||||
lfrfid_text_input_callback,
|
lfrfid_text_input_callback,
|
||||||
app,
|
app,
|
||||||
app->text_store,
|
app->text_store,
|
||||||
LFRFID_KEY_NAME_SIZE,
|
LFRFID_TEXT_STORE_SIZE,
|
||||||
key_name_is_empty);
|
key_name_is_empty);
|
||||||
|
|
||||||
ValidatorIsFile* validator_is_file =
|
ValidatorIsFile* validator_is_file =
|
||||||
|
|||||||
@@ -12,8 +12,14 @@ void lfrfid_scene_save_name_on_enter(void* context) {
|
|||||||
if(key_name_is_empty) {
|
if(key_name_is_empty) {
|
||||||
furi_string_set(app->file_path, LFRFID_APP_FOLDER);
|
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(
|
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);
|
furi_string_set(folder_path, LFRFID_APP_FOLDER);
|
||||||
} else {
|
} else {
|
||||||
@@ -27,7 +33,7 @@ void lfrfid_scene_save_name_on_enter(void* context) {
|
|||||||
lfrfid_text_input_callback,
|
lfrfid_text_input_callback,
|
||||||
app,
|
app,
|
||||||
app->text_store,
|
app->text_store,
|
||||||
LFRFID_KEY_NAME_SIZE,
|
LFRFID_TEXT_STORE_SIZE,
|
||||||
key_name_is_empty);
|
key_name_is_empty);
|
||||||
|
|
||||||
FURI_LOG_I("", "%s %s", furi_string_get_cstr(folder_path), app->text_store);
|
FURI_LOG_I("", "%s %s", furi_string_get_cstr(folder_path), app->text_store);
|
||||||
|
|||||||
Reference in New Issue
Block a user