Skip to content

Commit 42b7ba9

Browse files
author
David Lee
committed
Finished Rename feature
1 parent 5feacfb commit 42b7ba9

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

application.fam

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ App(
77
requires=["gui"],
88
stack_size=1 * 1024,
99
order=90,
10+
fap_version=1.0,
11+
fap_author="bigbrodude6119",
12+
fap_description="Create an evil captive portal Wi-Fi access point",
1013
fap_icon="icons/evil_portal_10px.png",
1114
fap_category="GPIO",
1215
)

helpers/evil_portal_storage.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,16 @@ void evil_portal_read_ap_name(void *context) {
7979

8080
void evil_portal_write_ap_name(void *context) {
8181
Evil_PortalApp *app = context;
82-
UNUSED(app);
82+
Storage *storage = evil_portal_open_storage();
83+
84+
File *ap_name = storage_file_alloc(storage);
85+
if (storage_file_open(ap_name, EVIL_PORTAL_AP_SAVE_PATH, FSAM_WRITE,
86+
FSOM_CREATE_ALWAYS)) {
87+
storage_file_write(ap_name, app->text_store[0], strlen(app->text_store[0]));
88+
}
89+
storage_file_close(ap_name);
90+
storage_file_free(ap_name);
91+
evil_portal_close_storage();
8392
}
8493

8594
char *sequential_file_resolve_path(Storage *storage, const char *dir,

scenes/evil_portal_scene_rename.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ void evil_portal_scene_rename_on_enter(void *context) {
1919
evil_portal_text_input_callback,
2020
context,
2121
app->text_store[0],
22-
//(char *)app->ap_name,
2322
enter_name_length,
2423
false);
2524
view_dispatcher_switch_to_view(app->view_dispatcher, Evil_PortalAppViewTextInput);

0 commit comments

Comments
 (0)