This repository has been archived by the owner on Jul 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This reverts commit ec136a9.
- Loading branch information
Showing
7 changed files
with
136 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#include "../nfc_rfid_detector_app_i.h" | ||
|
||
void nfc_rfid_detector_scene_about_widget_callback( | ||
GuiButtonType result, | ||
InputType type, | ||
void* context) { | ||
NfcRfidDetectorApp* app = context; | ||
if(type == InputTypeShort) { | ||
view_dispatcher_send_custom_event(app->view_dispatcher, result); | ||
} | ||
} | ||
|
||
void nfc_rfid_detector_scene_about_on_enter(void* context) { | ||
NfcRfidDetectorApp* app = context; | ||
|
||
FuriString* temp_str; | ||
temp_str = furi_string_alloc(); | ||
furi_string_printf(temp_str, "\e#%s\n", "Information"); | ||
|
||
furi_string_cat_printf(temp_str, "Version: %s\n", NFC_RFID_DETECTOR_VERSION_APP); | ||
furi_string_cat_printf(temp_str, "Developed by: %s\n", NFC_RFID_DETECTOR_DEVELOPED); | ||
furi_string_cat_printf(temp_str, "Github: %s\n\n", NFC_RFID_DETECTOR_GITHUB); | ||
|
||
furi_string_cat_printf(temp_str, "\e#%s\n", "Description"); | ||
furi_string_cat_printf( | ||
temp_str, | ||
"This application allows\nyou to determine what\ntype of electromagnetic\nfield the reader is using.\nFor LF RFID you can also\nsee the carrier frequency\n\n"); | ||
|
||
widget_add_text_box_element( | ||
app->widget, | ||
0, | ||
0, | ||
128, | ||
14, | ||
AlignCenter, | ||
AlignBottom, | ||
"\e#\e! \e!\n", | ||
false); | ||
widget_add_text_box_element( | ||
app->widget, | ||
0, | ||
2, | ||
128, | ||
14, | ||
AlignCenter, | ||
AlignBottom, | ||
"\e#\e! NFC/RFID detector \e!\n", | ||
false); | ||
widget_add_text_scroll_element(app->widget, 0, 16, 128, 50, furi_string_get_cstr(temp_str)); | ||
furi_string_free(temp_str); | ||
|
||
view_dispatcher_switch_to_view(app->view_dispatcher, NfcRfidDetectorViewWidget); | ||
} | ||
|
||
bool nfc_rfid_detector_scene_about_on_event(void* context, SceneManagerEvent event) { | ||
NfcRfidDetectorApp* app = context; | ||
bool consumed = false; | ||
UNUSED(app); | ||
UNUSED(event); | ||
|
||
return consumed; | ||
} | ||
|
||
void nfc_rfid_detector_scene_about_on_exit(void* context) { | ||
NfcRfidDetectorApp* app = context; | ||
|
||
// Clear views | ||
widget_reset(app->widget); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
ADD_SCENE(nfc_rfid_detector, start, Start) | ||
ADD_SCENE(nfc_rfid_detector, about, About) | ||
ADD_SCENE(nfc_rfid_detector, field_presence, FieldPresence) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#include "../nfc_rfid_detector_app_i.h" | ||
|
||
typedef enum { | ||
SubmenuIndexNfcRfidDetectorFieldPresence, | ||
SubmenuIndexNfcRfidDetectorAbout, | ||
} SubmenuIndex; | ||
|
||
void nfc_rfid_detector_scene_start_submenu_callback(void* context, uint32_t index) { | ||
NfcRfidDetectorApp* app = context; | ||
view_dispatcher_send_custom_event(app->view_dispatcher, index); | ||
} | ||
|
||
void nfc_rfid_detector_scene_start_on_enter(void* context) { | ||
UNUSED(context); | ||
NfcRfidDetectorApp* app = context; | ||
Submenu* submenu = app->submenu; | ||
|
||
submenu_add_item( | ||
submenu, | ||
"Detect field type", | ||
SubmenuIndexNfcRfidDetectorFieldPresence, | ||
nfc_rfid_detector_scene_start_submenu_callback, | ||
app); | ||
submenu_add_item( | ||
submenu, | ||
"About", | ||
SubmenuIndexNfcRfidDetectorAbout, | ||
nfc_rfid_detector_scene_start_submenu_callback, | ||
app); | ||
|
||
submenu_set_selected_item( | ||
submenu, scene_manager_get_scene_state(app->scene_manager, NfcRfidDetectorSceneStart)); | ||
|
||
view_dispatcher_switch_to_view(app->view_dispatcher, NfcRfidDetectorViewSubmenu); | ||
} | ||
|
||
bool nfc_rfid_detector_scene_start_on_event(void* context, SceneManagerEvent event) { | ||
NfcRfidDetectorApp* app = context; | ||
bool consumed = false; | ||
|
||
if(event.type == SceneManagerEventTypeCustom) { | ||
if(event.event == SubmenuIndexNfcRfidDetectorAbout) { | ||
scene_manager_next_scene(app->scene_manager, NfcRfidDetectorSceneAbout); | ||
consumed = true; | ||
} else if(event.event == SubmenuIndexNfcRfidDetectorFieldPresence) { | ||
scene_manager_next_scene(app->scene_manager, NfcRfidDetectorSceneFieldPresence); | ||
consumed = true; | ||
} | ||
scene_manager_set_scene_state(app->scene_manager, NfcRfidDetectorSceneStart, event.event); | ||
} | ||
|
||
return consumed; | ||
} | ||
|
||
void nfc_rfid_detector_scene_start_on_exit(void* context) { | ||
NfcRfidDetectorApp* app = context; | ||
submenu_reset(app->submenu); | ||
} |