From 88db25b8ded5fcc26010cf284c38f10d42492b5f Mon Sep 17 00:00:00 2001 From: Derek Jamison Date: Wed, 13 Sep 2023 22:03:29 -0500 Subject: [PATCH] remove random_name API call --- gpio/wiegand/application.fam | 2 +- gpio/wiegand/scenes/wiegand_instructions.c | 2 +- gpio/wiegand/scenes/wiegand_save.c | 15 ++++++++++++++- gpio/wiegand/scenes/wiegand_scan.c | 1 - gpio/wiegand/wiegand.h | 3 ++- 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/gpio/wiegand/application.fam b/gpio/wiegand/application.fam index 79cfd75..21fdd42 100644 --- a/gpio/wiegand/application.fam +++ b/gpio/wiegand/application.fam @@ -5,7 +5,7 @@ App( entry_point="wiegand_app", requires=["gui"], stack_size=2 * 1024, - fap_version=(1, 1), + fap_version=(1, 2), fap_icon="wiegand.png", fap_category="GPIO", ) diff --git a/gpio/wiegand/scenes/wiegand_instructions.c b/gpio/wiegand/scenes/wiegand_instructions.c index ad9362d..5ce604b 100644 --- a/gpio/wiegand/scenes/wiegand_instructions.c +++ b/gpio/wiegand/scenes/wiegand_instructions.c @@ -10,7 +10,7 @@ void wiegand_instructions_scene_on_enter(void* context) { 15, 128, 40, - "Version 1.1\n" + "Version 1.2\n" "Only use on devices you own!\n" "Connect D0 (Green) to pin A4\n" "Connect D1 (White) to pin A7\n" diff --git a/gpio/wiegand/scenes/wiegand_save.c b/gpio/wiegand/scenes/wiegand_save.c index 9f2bdca..7bf5219 100644 --- a/gpio/wiegand/scenes/wiegand_save.c +++ b/gpio/wiegand/scenes/wiegand_save.c @@ -66,7 +66,20 @@ void wiegand_save(void* context) { void wiegand_save_scene_on_enter(void* context) { App* app = context; text_input_reset(app->text_input); - set_random_name(app->file_name, WIEGAND_KEY_NAME_SIZE); + + FuriHalRtcDateTime datetime; + furi_hal_rtc_get_datetime(&datetime); + snprintf( + app->file_name, + 25, + "%02d%02d%02d_%02d%02d%02d", + datetime.year, + datetime.month, + datetime.day, + datetime.hour, + datetime.minute, + datetime.second); + // set_random_name(app->file_name, WIEGAND_KEY_NAME_SIZE); text_input_set_header_text(app->text_input, "Name the key"); text_input_set_result_callback( diff --git a/gpio/wiegand/scenes/wiegand_scan.c b/gpio/wiegand/scenes/wiegand_scan.c index f77c532..62eb481 100644 --- a/gpio/wiegand/scenes/wiegand_scan.c +++ b/gpio/wiegand/scenes/wiegand_scan.c @@ -1,5 +1,4 @@ #include "../wiegand.h" -#include FuriTimer* timer = NULL; diff --git a/gpio/wiegand/wiegand.h b/gpio/wiegand/wiegand.h index 9274220..cdecab5 100644 --- a/gpio/wiegand/wiegand.h +++ b/gpio/wiegand/wiegand.h @@ -1,13 +1,14 @@ #pragma once #include +#include #include #include #include #include #include #include -#include +// #include #include #include #include