Skip to content

Commit eaa76b6

Browse files
committed
Squashed 'nfc_rfid_detector/' changes from 30603d7..764e63f
764e63f Revert "upd rfid freq detector" 18ff6c6 upd rfid freq detector e6cc06d update ofw plugins, add new plugins bce0224 move base pack here REVERT: 30603d7 New random file name API fix (#40) REVERT: 0c411f1 RFID detector: rename app NFC/RFID Detector -> RFID detector , delete "about" scene (#38) REVERT: d73f0e5 Clock, music player, snake game from firmware repo (#19) REVERT: 255059c Added fap_version field to all apps (#15) REVERT: 72317a8 Add descriptions for all the faps (#13) REVERT: 5647725 Manifest cleanup REVERT: 24c39f0 Added app descriptions (#8) REVERT: ccc6e20 Prepare nfc_rfid for fap catalog (#2) REVERT: b7c727e Move apps from flipperzero firmware into separate repository git-subtree-dir: nfc_rfid_detector git-subtree-split: 764e63f
1 parent 30603d7 commit eaa76b6

12 files changed

+133
-15
lines changed

.catalog/README.md

-7
This file was deleted.

.catalog/changelog.md

-4
This file was deleted.
-1.76 KB
Binary file not shown.
-1.61 KB
Binary file not shown.
-1.44 KB
Binary file not shown.
-1.48 KB
Binary file not shown.

application.fam

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
App(
22
appid="nfc_rfid_detector",
3-
name="RFID detector",
3+
name="NFC/RFID detector",
44
apptype=FlipperAppType.EXTERNAL,
55
targets=["f7"],
66
entry_point="nfc_rfid_detector_app",
77
requires=["gui"],
88
stack_size=4 * 1024,
99
fap_description="Identify the reader type: NFC (13 MHz) and/or RFID (125 KHz).",
10-
fap_version="1.1",
10+
fap_version="1.0",
1111
fap_icon="nfc_rfid_detector_10px.png",
1212
fap_category="Tools",
1313
fap_icon_assets="images",

helpers/nfc_rfid_detector_types.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#define NFC_RFID_DETECTOR_VERSION_APP "0.1"
77
#define NFC_RFID_DETECTOR_DEVELOPED "SkorP"
8-
#define NFC_RFID_DETECTOR_GITHUB "https://github.com/flipperdevices/flipperzero-good-faps"
8+
#define NFC_RFID_DETECTOR_GITHUB "https://github.com/flipperdevices/flipperzero-firmware"
99

1010
typedef enum {
1111
NfcRfidDetectorViewVariableItemList,

nfc_rfid_detector_app.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ NfcRfidDetectorApp* nfc_rfid_detector_app_alloc() {
6262
NfcRfidDetectorViewFieldPresence,
6363
nfc_rfid_detector_view_field_presence_get_view(app->nfc_rfid_detector_field_presence));
6464

65-
scene_manager_next_scene(app->scene_manager, NfcRfidDetectorSceneFieldPresence);
65+
scene_manager_next_scene(app->scene_manager, NfcRfidDetectorSceneStart);
6666

6767
return app;
6868
}
+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#include "../nfc_rfid_detector_app_i.h"
2+
3+
void nfc_rfid_detector_scene_about_widget_callback(
4+
GuiButtonType result,
5+
InputType type,
6+
void* context) {
7+
NfcRfidDetectorApp* app = context;
8+
if(type == InputTypeShort) {
9+
view_dispatcher_send_custom_event(app->view_dispatcher, result);
10+
}
11+
}
12+
13+
void nfc_rfid_detector_scene_about_on_enter(void* context) {
14+
NfcRfidDetectorApp* app = context;
15+
16+
FuriString* temp_str;
17+
temp_str = furi_string_alloc();
18+
furi_string_printf(temp_str, "\e#%s\n", "Information");
19+
20+
furi_string_cat_printf(temp_str, "Version: %s\n", NFC_RFID_DETECTOR_VERSION_APP);
21+
furi_string_cat_printf(temp_str, "Developed by: %s\n", NFC_RFID_DETECTOR_DEVELOPED);
22+
furi_string_cat_printf(temp_str, "Github: %s\n\n", NFC_RFID_DETECTOR_GITHUB);
23+
24+
furi_string_cat_printf(temp_str, "\e#%s\n", "Description");
25+
furi_string_cat_printf(
26+
temp_str,
27+
"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");
28+
29+
widget_add_text_box_element(
30+
app->widget,
31+
0,
32+
0,
33+
128,
34+
14,
35+
AlignCenter,
36+
AlignBottom,
37+
"\e#\e! \e!\n",
38+
false);
39+
widget_add_text_box_element(
40+
app->widget,
41+
0,
42+
2,
43+
128,
44+
14,
45+
AlignCenter,
46+
AlignBottom,
47+
"\e#\e! NFC/RFID detector \e!\n",
48+
false);
49+
widget_add_text_scroll_element(app->widget, 0, 16, 128, 50, furi_string_get_cstr(temp_str));
50+
furi_string_free(temp_str);
51+
52+
view_dispatcher_switch_to_view(app->view_dispatcher, NfcRfidDetectorViewWidget);
53+
}
54+
55+
bool nfc_rfid_detector_scene_about_on_event(void* context, SceneManagerEvent event) {
56+
NfcRfidDetectorApp* app = context;
57+
bool consumed = false;
58+
UNUSED(app);
59+
UNUSED(event);
60+
61+
return consumed;
62+
}
63+
64+
void nfc_rfid_detector_scene_about_on_exit(void* context) {
65+
NfcRfidDetectorApp* app = context;
66+
67+
// Clear views
68+
widget_reset(app->widget);
69+
}
+2
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
ADD_SCENE(nfc_rfid_detector, start, Start)
2+
ADD_SCENE(nfc_rfid_detector, about, About)
13
ADD_SCENE(nfc_rfid_detector, field_presence, FieldPresence)
+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#include "../nfc_rfid_detector_app_i.h"
2+
3+
typedef enum {
4+
SubmenuIndexNfcRfidDetectorFieldPresence,
5+
SubmenuIndexNfcRfidDetectorAbout,
6+
} SubmenuIndex;
7+
8+
void nfc_rfid_detector_scene_start_submenu_callback(void* context, uint32_t index) {
9+
NfcRfidDetectorApp* app = context;
10+
view_dispatcher_send_custom_event(app->view_dispatcher, index);
11+
}
12+
13+
void nfc_rfid_detector_scene_start_on_enter(void* context) {
14+
UNUSED(context);
15+
NfcRfidDetectorApp* app = context;
16+
Submenu* submenu = app->submenu;
17+
18+
submenu_add_item(
19+
submenu,
20+
"Detect field type",
21+
SubmenuIndexNfcRfidDetectorFieldPresence,
22+
nfc_rfid_detector_scene_start_submenu_callback,
23+
app);
24+
submenu_add_item(
25+
submenu,
26+
"About",
27+
SubmenuIndexNfcRfidDetectorAbout,
28+
nfc_rfid_detector_scene_start_submenu_callback,
29+
app);
30+
31+
submenu_set_selected_item(
32+
submenu, scene_manager_get_scene_state(app->scene_manager, NfcRfidDetectorSceneStart));
33+
34+
view_dispatcher_switch_to_view(app->view_dispatcher, NfcRfidDetectorViewSubmenu);
35+
}
36+
37+
bool nfc_rfid_detector_scene_start_on_event(void* context, SceneManagerEvent event) {
38+
NfcRfidDetectorApp* app = context;
39+
bool consumed = false;
40+
41+
if(event.type == SceneManagerEventTypeCustom) {
42+
if(event.event == SubmenuIndexNfcRfidDetectorAbout) {
43+
scene_manager_next_scene(app->scene_manager, NfcRfidDetectorSceneAbout);
44+
consumed = true;
45+
} else if(event.event == SubmenuIndexNfcRfidDetectorFieldPresence) {
46+
scene_manager_next_scene(app->scene_manager, NfcRfidDetectorSceneFieldPresence);
47+
consumed = true;
48+
}
49+
scene_manager_set_scene_state(app->scene_manager, NfcRfidDetectorSceneStart, event.event);
50+
}
51+
52+
return consumed;
53+
}
54+
55+
void nfc_rfid_detector_scene_start_on_exit(void* context) {
56+
NfcRfidDetectorApp* app = context;
57+
submenu_reset(app->submenu);
58+
}

0 commit comments

Comments
 (0)