Skip to content

Commit 981c7de

Browse files
committed
new file extension check + error messages
- I changed the extension check to check for a value of either 0 or 10 as these are the 2 values that are returned on correct extensions - Improved error messages to explain more when they appear
1 parent fe9887c commit 981c7de

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

application.fam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ App(
88
fap_category="NFC",
99
fap_author="@acegoal07",
1010
fap_weburl="https://github.com/acegoal07/FlipperZero_NFC_Playlist/tree/main",
11-
fap_version="2.3",
11+
fap_version="2.4",
1212
fap_icon_assets="assets",
1313
fap_icon="assets/Playlist_10px.png",
1414
fap_private_libs=[

scenes/nfc_playlist_scene_emulation.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,13 @@ int32_t nfc_playlist_emulation_task(void* context) {
6767

6868
int time_counter_ms = (options_emulate_timeout[nfc_playlist->settings.emulate_timeout]*1000);
6969

70-
if(!strcasestr(furi_string_get_cstr(tmp_file_ext), ".nfc")) {
70+
int ext_check = furi_string_cmpi_str(tmp_file_ext, ".nfc");
71+
if(ext_check != 0 && ext_check != 10) {
7172
if(nfc_playlist->settings.skip_error) {
7273
skip_delay = true;
7374
continue;
7475
}
75-
furi_string_printf(tmp_header_str, "ERROR invalid file:\n%s", furi_string_get_cstr(tmp_file_name));
76+
furi_string_printf(tmp_header_str, "ERROR invalid file type:\n%s", furi_string_get_cstr(tmp_file_name));
7677
popup_set_header(nfc_playlist->popup, furi_string_get_cstr(tmp_header_str), 64, 10, AlignCenter, AlignTop);
7778
start_blink(nfc_playlist, NfcPlaylistLedState_Error);
7879
while(time_counter_ms > 0 && EmulationState == NfcPlaylistEmulationState_Emulating) {
@@ -86,7 +87,7 @@ int32_t nfc_playlist_emulation_task(void* context) {
8687
skip_delay = true;
8788
continue;
8889
}
89-
furi_string_printf(tmp_header_str, "ERROR not found:\n%s", furi_string_get_cstr(tmp_file_name));
90+
furi_string_printf(tmp_header_str, "ERROR file not found:\n%s", furi_string_get_cstr(tmp_file_name));
9091
popup_set_header(nfc_playlist->popup, furi_string_get_cstr(tmp_header_str), 64, 10, AlignCenter, AlignTop);
9192
start_blink(nfc_playlist, NfcPlaylistLedState_Error);
9293
while(time_counter_ms > 0 && EmulationState == NfcPlaylistEmulationState_Emulating) {

0 commit comments

Comments
 (0)