mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-20 04:54:45 -07:00
[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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user