Dynamic default ibutton naming

This commit is contained in:
Willy-JL
2023-09-02 23:48:12 +02:00
parent 113c895d9a
commit 2742b2faf8
2 changed files with 5 additions and 2 deletions

View File

@@ -32,7 +32,7 @@
#define IBUTTON_APP_FILENAME_PREFIX "iBtn"
#define IBUTTON_APP_FILENAME_EXTENSION ".ibtn"
#define IBUTTON_KEY_NAME_SIZE 22
#define IBUTTON_KEY_NAME_SIZE 29
typedef enum {
iButtonWriteModeInvalid,

View File

@@ -18,7 +18,10 @@ void ibutton_scene_save_name_on_enter(void* context) {
if(is_new_file) {
name_generator_make_auto(
ibutton->key_name, IBUTTON_KEY_NAME_SIZE, IBUTTON_APP_FILENAME_PREFIX);
ibutton->key_name,
IBUTTON_KEY_NAME_SIZE,
ibutton_protocols_get_name(
ibutton->protocols, ibutton_key_get_protocol_id(ibutton->key)));
}
text_input_set_header_text(text_input, "Name the key");