mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-14 16:57:22 +00:00
Added function to show different scene depending on supported features of the device
This commit is contained in:
parent
1e6fe92b44
commit
63eeb86bc7
1 changed files with 11 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
||||||
#include "nfc_app_i.h"
|
#include "nfc_app_i.h"
|
||||||
|
#include "helpers/protocol_support/nfc_protocol_support.h"
|
||||||
|
|
||||||
#include <dolphin/dolphin.h>
|
#include <dolphin/dolphin.h>
|
||||||
|
|
||||||
|
@ -466,6 +467,15 @@ static bool nfc_is_hal_ready() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void nfc_show_initial_scene_for_device(NfcApp* nfc) {
|
||||||
|
NfcProtocol prot = nfc_device_get_protocol(nfc->nfc_device);
|
||||||
|
uint32_t scene = nfc_protocol_support_has_feature(
|
||||||
|
prot, NfcProtocolFeatureEmulateFull | NfcProtocolFeatureEmulateUid) ?
|
||||||
|
NfcSceneEmulate :
|
||||||
|
NfcSceneSavedMenu;
|
||||||
|
scene_manager_next_scene(nfc->scene_manager, scene);
|
||||||
|
}
|
||||||
|
|
||||||
int32_t nfc_app(void* p) {
|
int32_t nfc_app(void* p) {
|
||||||
if(!nfc_is_hal_ready()) return 0;
|
if(!nfc_is_hal_ready()) return 0;
|
||||||
|
|
||||||
|
@ -485,7 +495,7 @@ int32_t nfc_app(void* p) {
|
||||||
|
|
||||||
furi_string_set(nfc->file_path, args);
|
furi_string_set(nfc->file_path, args);
|
||||||
if(nfc_load_file(nfc, nfc->file_path, false)) {
|
if(nfc_load_file(nfc, nfc->file_path, false)) {
|
||||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneEmulate);
|
nfc_show_initial_scene_for_device(nfc);
|
||||||
} else {
|
} else {
|
||||||
view_dispatcher_stop(nfc->view_dispatcher);
|
view_dispatcher_stop(nfc->view_dispatcher);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue