[FL-3766] Refactor detected protocols list (#3809)

* Refactor detected protocols list
* nfc app: fix detect protocols file name
* nfc app: fix function naming
* nfc app: fix detected protocol menu selection

Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: あく <alleteam@gmail.com>
Co-authored-by: gornekich <n.gorbadey@gmail.com>
This commit is contained in:
Astra
2024-08-01 06:37:37 +09:00
committed by GitHub
parent 59eb749b2b
commit f73d60cba8
9 changed files with 137 additions and 46 deletions

View File

@@ -50,6 +50,7 @@ NfcApp* nfc_app_alloc(void) {
instance->nfc = nfc_alloc();
instance->detected_protocols = nfc_detected_protocols_alloc();
instance->felica_auth = felica_auth_alloc();
instance->mf_ul_auth = mf_ultralight_auth_alloc();
instance->slix_unlock = slix_unlock_alloc();
@@ -142,6 +143,7 @@ void nfc_app_free(NfcApp* instance) {
nfc_free(instance->nfc);
nfc_detected_protocols_free(instance->detected_protocols);
felica_auth_free(instance->felica_auth);
mf_ultralight_auth_free(instance->mf_ul_auth);
slix_unlock_free(instance->slix_unlock);
@@ -433,23 +435,6 @@ void nfc_show_loading_popup(void* context, bool show) {
}
}
void nfc_app_set_detected_protocols(NfcApp* instance, const NfcProtocol* types, uint32_t count) {
furi_assert(instance);
furi_assert(types);
furi_assert(count < NfcProtocolNum);
memcpy(instance->protocols_detected, types, count);
instance->protocols_detected_num = count;
instance->protocols_detected_selected_idx = 0;
}
void nfc_app_reset_detected_protocols(NfcApp* instance) {
furi_assert(instance);
instance->protocols_detected_selected_idx = 0;
instance->protocols_detected_num = 0;
}
void nfc_append_filename_string_when_present(NfcApp* instance, FuriString* string) {
furi_assert(instance);
furi_assert(string);