From 1f1c05d81a6dfc65af3698d8f59f38a6b0ef308d Mon Sep 17 00:00:00 2001 From: Willy-JL <49810075+Willy-JL@users.noreply.github.com> Date: Tue, 28 May 2024 04:51:02 +0100 Subject: [PATCH] Remove redundant extra API --- applications/external | 2 +- .../helpers/protocol_support/nfc_protocol_support.c | 8 +++++++- lib/nfc/nfc_device.c | 13 ------------- lib/nfc/nfc_device.h | 11 ----------- targets/f7/api_symbols.csv | 1 - 5 files changed, 8 insertions(+), 27 deletions(-) diff --git a/applications/external b/applications/external index 7b65d07fb..8706bacad 160000 --- a/applications/external +++ b/applications/external @@ -1 +1 @@ -Subproject commit 7b65d07fbabb5cf00e0e2dcbe77e97dc548fff7c +Subproject commit 8706bacad2f737643b7c88b26de442189b73c074 diff --git a/applications/main/nfc/helpers/protocol_support/nfc_protocol_support.c b/applications/main/nfc/helpers/protocol_support/nfc_protocol_support.c index 3cfbebf67..ba55a0663 100644 --- a/applications/main/nfc/helpers/protocol_support/nfc_protocol_support.c +++ b/applications/main/nfc/helpers/protocol_support/nfc_protocol_support.c @@ -482,7 +482,13 @@ static void nfc_protocol_support_scene_save_name_on_enter(NfcApp* instance) { if(name_is_empty) { furi_string_set(instance->file_path, NFC_APP_FOLDER); FuriString* prefix = furi_string_alloc(); - nfc_device_get_abbreviated_name(instance->nfc_device, prefix); + furi_string_set(prefix, nfc_device_get_name(instance->nfc_device, NfcDeviceNameTypeFull)); + furi_string_replace(prefix, "Mifare", "MF"); + furi_string_replace(prefix, " Classic", "C"); // MFC + furi_string_replace(prefix, "Desfire", "Des"); // MF Des + furi_string_replace(prefix, "Ultralight", "UL"); // MF UL + furi_string_replace(prefix, " Plus", "+"); // NTAG I2C+ + furi_string_replace(prefix, " (Unknown)", ""); furi_string_replace_all(prefix, " ", "_"); name_generator_make_auto( instance->text_store, NFC_TEXT_STORE_SIZE, furi_string_get_cstr(prefix)); diff --git a/lib/nfc/nfc_device.c b/lib/nfc/nfc_device.c index edb0eed6c..9f95dfc15 100644 --- a/lib/nfc/nfc_device.c +++ b/lib/nfc/nfc_device.c @@ -74,19 +74,6 @@ const char* nfc_device_get_name(const NfcDevice* instance, NfcDeviceNameType nam return nfc_devices[instance->protocol]->get_name(instance->protocol_data, name_type); } -void nfc_device_get_abbreviated_name(const NfcDevice* instance, FuriString* name) { - furi_assert(instance); - furi_assert(instance->protocol < NfcProtocolNum); - - furi_string_set(name, nfc_device_get_name(instance, NfcDeviceNameTypeFull)); - furi_string_replace(name, "Mifare", "MF"); - furi_string_replace(name, " Classic", "C"); // MFC - furi_string_replace(name, "Desfire", "Des"); // MF Des - furi_string_replace(name, "Ultralight", "UL"); // MF UL - furi_string_replace(name, " Plus", "+"); // NTAG I2C+ - furi_string_replace(name, " (Unknown)", ""); -} - const uint8_t* nfc_device_get_uid(const NfcDevice* instance, size_t* uid_len) { furi_check(instance); furi_check(uid_len); diff --git a/lib/nfc/nfc_device.h b/lib/nfc/nfc_device.h index 58bc24dc1..055acec0a 100644 --- a/lib/nfc/nfc_device.h +++ b/lib/nfc/nfc_device.h @@ -13,7 +13,6 @@ #include #include #include -#include #include "protocols/nfc_device_base.h" #include "protocols/nfc_protocol.h" @@ -138,16 +137,6 @@ const char* nfc_device_get_protocol_name(NfcProtocol protocol); */ const char* nfc_device_get_name(const NfcDevice* instance, NfcDeviceNameType name_type); -/** - * @brief Get the abbreviated name of an NfcDevice instance. - * - * The return value may change depending on the instance's internal state. - * - * @param[in] instance pointer to the instance to be queried. - * @param[out] name FuriString to save the abbreviated device name to. - */ -void nfc_device_get_abbreviated_name(const NfcDevice* instance, FuriString* name); - /** * @brief Get the unique identifier (UID) of an NfcDevice instance. * diff --git a/targets/f7/api_symbols.csv b/targets/f7/api_symbols.csv index 510d5e019..14b24d5c4 100644 --- a/targets/f7/api_symbols.csv +++ b/targets/f7/api_symbols.csv @@ -2792,7 +2792,6 @@ Function,+,nfc_device_alloc,NfcDevice*, Function,+,nfc_device_clear,void,NfcDevice* Function,+,nfc_device_copy_data,void,"const NfcDevice*, NfcProtocol, NfcDeviceData*" Function,+,nfc_device_free,void,NfcDevice* -Function,+,nfc_device_get_abbreviated_name,void,"const NfcDevice*, FuriString*" Function,+,nfc_device_get_data,const NfcDeviceData*,"const NfcDevice*, NfcProtocol" Function,+,nfc_device_get_name,const char*,"const NfcDevice*, NfcDeviceNameType" Function,+,nfc_device_get_protocol,NfcProtocol,const NfcDevice*