Filename will be printed for saved tag in info scene

This commit is contained in:
RebornedBrain 2024-01-16 22:24:54 +03:00
parent cb0cf7b9e2
commit bae0baa42f
13 changed files with 24 additions and 0 deletions

View File

@ -13,6 +13,7 @@ static void nfc_scene_info_on_enter_felica(NfcApp* instance) {
const FelicaData* data = nfc_device_get_data(device, NfcProtocolFelica);
FuriString* temp_str = furi_string_alloc();
nfc_append_filename_string_when_present(instance, temp_str);
furi_string_cat_printf(
temp_str, "\e#%s\n", nfc_device_get_name(device, NfcDeviceNameTypeFull));
nfc_render_felica_info(data, NfcProtocolFormatTypeFull, temp_str);

View File

@ -13,6 +13,8 @@ static void nfc_scene_info_on_enter_iso14443_3a(NfcApp* instance) {
const Iso14443_3aData* data = nfc_device_get_data(device, NfcProtocolIso14443_3a);
FuriString* temp_str = furi_string_alloc();
nfc_append_filename_string_when_present(instance, temp_str);
furi_string_cat_printf(
temp_str, "\e#%s\n", nfc_device_get_name(device, NfcDeviceNameTypeFull));
nfc_render_iso14443_3a_info(data, NfcProtocolFormatTypeFull, temp_str);

View File

@ -13,6 +13,7 @@ static void nfc_scene_info_on_enter_iso14443_3b(NfcApp* instance) {
const Iso14443_3bData* data = nfc_device_get_data(device, NfcProtocolIso14443_3b);
FuriString* temp_str = furi_string_alloc();
nfc_append_filename_string_when_present(instance, temp_str);
furi_string_cat_printf(
temp_str, "\e#%s\n", nfc_device_get_name(device, NfcDeviceNameTypeFull));
nfc_render_iso14443_3b_info(data, NfcProtocolFormatTypeFull, temp_str);

View File

@ -14,6 +14,7 @@ static void nfc_scene_info_on_enter_iso14443_4a(NfcApp* instance) {
const Iso14443_4aData* data = nfc_device_get_data(device, NfcProtocolIso14443_4a);
FuriString* temp_str = furi_string_alloc();
nfc_append_filename_string_when_present(instance, temp_str);
furi_string_cat_printf(
temp_str, "\e#%s\n", nfc_device_get_name(device, NfcDeviceNameTypeFull));
nfc_render_iso14443_4a_info(data, NfcProtocolFormatTypeFull, temp_str);

View File

@ -14,6 +14,7 @@ static void nfc_scene_info_on_enter_iso14443_4b(NfcApp* instance) {
const Iso14443_4bData* data = nfc_device_get_data(device, NfcProtocolIso14443_4b);
FuriString* temp_str = furi_string_alloc();
nfc_append_filename_string_when_present(instance, temp_str);
furi_string_cat_printf(
temp_str, "\e#%s\n", nfc_device_get_name(device, NfcDeviceNameTypeFull));
nfc_render_iso14443_4b_info(data, NfcProtocolFormatTypeFull, temp_str);

View File

@ -14,6 +14,7 @@ static void nfc_scene_info_on_enter_iso15693_3(NfcApp* instance) {
const Iso15693_3Data* data = nfc_device_get_data(device, NfcProtocolIso15693_3);
FuriString* temp_str = furi_string_alloc();
nfc_append_filename_string_when_present(instance, temp_str);
furi_string_cat_printf(
temp_str, "\e#%s\n", nfc_device_get_name(device, NfcDeviceNameTypeFull));
nfc_render_iso15693_3_info(data, NfcProtocolFormatTypeFull, temp_str);

View File

@ -21,6 +21,7 @@ static void nfc_scene_info_on_enter_mf_classic(NfcApp* instance) {
const MfClassicData* data = nfc_device_get_data(device, NfcProtocolMfClassic);
FuriString* temp_str = furi_string_alloc();
nfc_append_filename_string_when_present(instance, temp_str);
furi_string_cat_printf(
temp_str, "\e#%s\n", nfc_device_get_name(device, NfcDeviceNameTypeFull));
furi_string_replace(temp_str, "Mifare", "MIFARE");

View File

@ -14,6 +14,7 @@ static void nfc_scene_info_on_enter_mf_desfire(NfcApp* instance) {
const MfDesfireData* data = nfc_device_get_data(device, NfcProtocolMfDesfire);
FuriString* temp_str = furi_string_alloc();
nfc_append_filename_string_when_present(instance, temp_str);
furi_string_cat_printf(
temp_str, "\e#%s\n", nfc_device_get_name(device, NfcDeviceNameTypeFull));
nfc_render_mf_desfire_info(data, NfcProtocolFormatTypeFull, temp_str);

View File

@ -20,6 +20,8 @@ static void nfc_scene_info_on_enter_mf_ultralight(NfcApp* instance) {
const MfUltralightData* data = nfc_device_get_data(device, NfcProtocolMfUltralight);
FuriString* temp_str = furi_string_alloc();
nfc_append_filename_string_when_present(instance, temp_str);
furi_string_cat_printf(
temp_str, "\e#%s\n", nfc_device_get_name(device, NfcDeviceNameTypeFull));
nfc_render_mf_ultralight_info(data, NfcProtocolFormatTypeFull, temp_str);

View File

@ -14,6 +14,7 @@ static void nfc_scene_info_on_enter_slix(NfcApp* instance) {
const SlixData* data = nfc_device_get_data(device, NfcProtocolSlix);
FuriString* temp_str = furi_string_alloc();
nfc_append_filename_string_when_present(instance, temp_str);
furi_string_cat_printf(
temp_str, "\e#%s\n", nfc_device_get_name(device, NfcDeviceNameTypeFull));
nfc_render_slix_info(data, NfcProtocolFormatTypeFull, temp_str);

View File

@ -13,6 +13,7 @@ static void nfc_scene_info_on_enter_st25tb(NfcApp* instance) {
const St25tbData* data = nfc_device_get_data(device, NfcProtocolSt25tb);
FuriString* temp_str = furi_string_alloc();
nfc_append_filename_string_when_present(instance, temp_str);
furi_string_cat_printf(
temp_str, "\e#%s\n", nfc_device_get_name(device, NfcDeviceNameTypeFull));
nfc_render_st25tb_info(data, NfcProtocolFormatTypeFull, temp_str);

View File

@ -445,6 +445,15 @@ void nfc_app_reset_detected_protocols(NfcApp* instance) {
instance->protocols_detected_num = 0;
}
void nfc_append_filename_string_when_present(NfcApp* instance, FuriString* string) {
furi_assert(instance);
furi_assert(string);
if(!furi_string_empty(instance->file_name)) {
furi_string_cat_printf(string, "Name:%s\n", furi_string_get_cstr(instance->file_name));
}
}
static bool nfc_is_hal_ready() {
if(furi_hal_nfc_is_hal_ready() != FuriHalNfcErrorNone) {
// No connection to the chip, show an error screen

View File

@ -192,3 +192,5 @@ void nfc_make_app_folder(NfcApp* instance);
void nfc_app_set_detected_protocols(NfcApp* instance, const NfcProtocol* types, uint32_t count);
void nfc_app_reset_detected_protocols(NfcApp* instance);
void nfc_append_filename_string_when_present(NfcApp* instance, FuriString* string);