mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-12 15:38:36 -07:00
Dynamic default nfc naming
This commit is contained in:
@@ -17,7 +17,16 @@ void nfc_scene_save_name_on_enter(void* context) {
|
||||
TextInput* text_input = nfc->text_input;
|
||||
bool dev_name_empty = false;
|
||||
if(!strcmp(nfc->dev->dev_name, "")) {
|
||||
name_generator_make_auto(nfc->text_store, NFC_DEV_NAME_MAX_LEN, NFC_APP_FILENAME_PREFIX);
|
||||
FuriString* prefix = furi_string_alloc();
|
||||
nfc_device_prepare_format_string(nfc->dev, prefix);
|
||||
furi_string_replace(prefix, "Mifare", "MF");
|
||||
furi_string_replace(prefix, "Ultralight", "UL");
|
||||
furi_string_replace(prefix, " Plus", "+");
|
||||
furi_string_replace_all(prefix, " ", "_");
|
||||
furi_string_left(prefix, 12);
|
||||
name_generator_make_auto(
|
||||
nfc->text_store, NFC_DEV_NAME_MAX_LEN, furi_string_get_cstr(prefix));
|
||||
furi_string_free(prefix);
|
||||
dev_name_empty = true;
|
||||
} else {
|
||||
nfc_text_store_set(nfc, nfc->dev->dev_name);
|
||||
|
||||
Reference in New Issue
Block a user