diff --git a/applications/main/nfc/nfc.c b/applications/main/nfc/nfc.c index 57e25f81..43263020 100644 --- a/applications/main/nfc/nfc.c +++ b/applications/main/nfc/nfc.c @@ -201,8 +201,16 @@ void nfc_text_store_clear(Nfc* nfc) { memset(nfc->text_store, 0, sizeof(nfc->text_store)); } -void nfc_blink_start(Nfc* nfc) { - notification_message(nfc->notifications, &sequence_blink_start_blue); +void nfc_blink_read_start(Nfc* nfc) { + notification_message(nfc->notifications, &sequence_blink_start_cyan); +} + +void nfc_blink_emulate_start(Nfc* nfc) { + notification_message(nfc->notifications, &sequence_blink_start_magenta); +} + +void nfc_blink_detect_start(Nfc* nfc) { + notification_message(nfc->notifications, &sequence_blink_start_yellow); } void nfc_blink_stop(Nfc* nfc) { diff --git a/applications/main/nfc/nfc_i.h b/applications/main/nfc/nfc_i.h index c9ba7fff..b5d284d5 100644 --- a/applications/main/nfc/nfc_i.h +++ b/applications/main/nfc/nfc_i.h @@ -98,7 +98,11 @@ void nfc_text_store_set(Nfc* nfc, const char* text, ...); void nfc_text_store_clear(Nfc* nfc); -void nfc_blink_start(Nfc* nfc); +void nfc_blink_read_start(Nfc* nfc); + +void nfc_blink_emulate_start(Nfc* nfc); + +void nfc_blink_detect_start(Nfc* nfc); void nfc_blink_stop(Nfc* nfc); diff --git a/applications/main/nfc/scenes/nfc_scene_detect_reader.c b/applications/main/nfc/scenes/nfc_scene_detect_reader.c index 8945feba..5f4582d8 100644 --- a/applications/main/nfc/scenes/nfc_scene_detect_reader.c +++ b/applications/main/nfc/scenes/nfc_scene_detect_reader.c @@ -29,7 +29,7 @@ void nfc_scene_detect_reader_on_enter(void* context) { view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewDetectReader); - nfc_blink_start(nfc); + nfc_blink_read_start(nfc); } bool nfc_scene_detect_reader_on_event(void* context, SceneManagerEvent event) { diff --git a/applications/main/nfc/scenes/nfc_scene_emulate_apdu_sequence.c b/applications/main/nfc/scenes/nfc_scene_emulate_apdu_sequence.c index e6062ba4..358ad2ab 100644 --- a/applications/main/nfc/scenes/nfc_scene_emulate_apdu_sequence.c +++ b/applications/main/nfc/scenes/nfc_scene_emulate_apdu_sequence.c @@ -12,7 +12,7 @@ void nfc_scene_emulate_apdu_sequence_on_enter(void* context) { view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewPopup); nfc_worker_start(nfc->worker, NfcWorkerStateEmulateApdu, &nfc->dev->dev_data, NULL, nfc); - nfc_blink_start(nfc); + nfc_blink_emulate_start(nfc); } bool nfc_scene_emulate_apdu_sequence_on_event(void* context, SceneManagerEvent event) { diff --git a/applications/main/nfc/scenes/nfc_scene_emulate_uid.c b/applications/main/nfc/scenes/nfc_scene_emulate_uid.c index 0d92c9f0..f6402301 100644 --- a/applications/main/nfc/scenes/nfc_scene_emulate_uid.c +++ b/applications/main/nfc/scenes/nfc_scene_emulate_uid.c @@ -82,7 +82,7 @@ void nfc_scene_emulate_uid_on_enter(void* context) { nfc_emulate_uid_worker_callback, nfc); - nfc_blink_start(nfc); + nfc_blink_emulate_start(nfc); } bool nfc_scene_emulate_uid_on_event(void* context, SceneManagerEvent event) { diff --git a/applications/main/nfc/scenes/nfc_scene_emv_read_success.c b/applications/main/nfc/scenes/nfc_scene_emv_read_success.c index 9cf7ff9e..a40b4c1c 100644 --- a/applications/main/nfc/scenes/nfc_scene_emv_read_success.c +++ b/applications/main/nfc/scenes/nfc_scene_emv_read_success.c @@ -55,6 +55,8 @@ void nfc_scene_emv_read_success_on_enter(void* context) { string_clear(country_name); } + notification_message_block(nfc->notifications, &sequence_set_green_255); + widget_add_text_scroll_element(nfc->widget, 0, 0, 128, 52, string_get_cstr(temp_str)); string_clear(temp_str); @@ -83,6 +85,8 @@ bool nfc_scene_emv_read_success_on_event(void* context, SceneManagerEvent event) void nfc_scene_emv_read_success_on_exit(void* context) { Nfc* nfc = context; + notification_message_block(nfc->notifications, &sequence_reset_green); + // Clear view widget_reset(nfc->widget); } diff --git a/applications/main/nfc/scenes/nfc_scene_mf_classic_dict_attack.c b/applications/main/nfc/scenes/nfc_scene_mf_classic_dict_attack.c index d821c182..b23f4b8f 100644 --- a/applications/main/nfc/scenes/nfc_scene_mf_classic_dict_attack.c +++ b/applications/main/nfc/scenes/nfc_scene_mf_classic_dict_attack.c @@ -90,7 +90,7 @@ void nfc_scene_mf_classic_dict_attack_on_enter(void* context) { Nfc* nfc = context; nfc_scene_mf_classic_dict_attack_prepare_view(nfc, DictAttackStateIdle); view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewDictAttack); - nfc_blink_start(nfc); + nfc_blink_read_start(nfc); } bool nfc_scene_mf_classic_dict_attack_on_event(void* context, SceneManagerEvent event) { diff --git a/applications/main/nfc/scenes/nfc_scene_mf_classic_emulate.c b/applications/main/nfc/scenes/nfc_scene_mf_classic_emulate.c index 044388b8..65639b2b 100644 --- a/applications/main/nfc/scenes/nfc_scene_mf_classic_emulate.c +++ b/applications/main/nfc/scenes/nfc_scene_mf_classic_emulate.c @@ -35,7 +35,7 @@ void nfc_scene_mf_classic_emulate_on_enter(void* context) { &nfc->dev->dev_data, nfc_mf_classic_emulate_worker_callback, nfc); - nfc_blink_start(nfc); + nfc_blink_emulate_start(nfc); } bool nfc_scene_mf_classic_emulate_on_event(void* context, SceneManagerEvent event) { diff --git a/applications/main/nfc/scenes/nfc_scene_mf_classic_read_success.c b/applications/main/nfc/scenes/nfc_scene_mf_classic_read_success.c index efe67670..3ca24416 100644 --- a/applications/main/nfc/scenes/nfc_scene_mf_classic_read_success.c +++ b/applications/main/nfc/scenes/nfc_scene_mf_classic_read_success.c @@ -48,6 +48,8 @@ void nfc_scene_mf_classic_read_success_on_enter(void* context) { widget_add_text_scroll_element(widget, 0, 0, 128, 52, string_get_cstr(temp_str)); string_clear(temp_str); + notification_message_block(nfc->notifications, &sequence_set_green_255); + view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewWidget); } @@ -76,6 +78,8 @@ bool nfc_scene_mf_classic_read_success_on_event(void* context, SceneManagerEvent void nfc_scene_mf_classic_read_success_on_exit(void* context) { Nfc* nfc = context; + notification_message_block(nfc->notifications, &sequence_reset_green); + // Clear view widget_reset(nfc->widget); } diff --git a/applications/main/nfc/scenes/nfc_scene_mf_desfire_read_success.c b/applications/main/nfc/scenes/nfc_scene_mf_desfire_read_success.c index 4827c285..12047c15 100644 --- a/applications/main/nfc/scenes/nfc_scene_mf_desfire_read_success.c +++ b/applications/main/nfc/scenes/nfc_scene_mf_desfire_read_success.c @@ -52,6 +52,8 @@ void nfc_scene_mf_desfire_read_success_on_enter(void* context) { string_push_back(temp_str, 's'); } + notification_message_block(nfc->notifications, &sequence_set_green_255); + // Add text scroll element widget_add_text_scroll_element(widget, 0, 0, 128, 52, string_get_cstr(temp_str)); string_clear(temp_str); @@ -88,6 +90,8 @@ bool nfc_scene_mf_desfire_read_success_on_event(void* context, SceneManagerEvent void nfc_scene_mf_desfire_read_success_on_exit(void* context) { Nfc* nfc = context; + notification_message_block(nfc->notifications, &sequence_reset_green); + // Clean dialog widget_reset(nfc->widget); } diff --git a/applications/main/nfc/scenes/nfc_scene_mf_ultralight_emulate.c b/applications/main/nfc/scenes/nfc_scene_mf_ultralight_emulate.c index ce375554..712ddc07 100644 --- a/applications/main/nfc/scenes/nfc_scene_mf_ultralight_emulate.c +++ b/applications/main/nfc/scenes/nfc_scene_mf_ultralight_emulate.c @@ -35,7 +35,7 @@ void nfc_scene_mf_ultralight_emulate_on_enter(void* context) { &nfc->dev->dev_data, nfc_mf_ultralight_emulate_worker_callback, nfc); - nfc_blink_start(nfc); + nfc_blink_emulate_start(nfc); } bool nfc_scene_mf_ultralight_emulate_on_event(void* context, SceneManagerEvent event) { diff --git a/applications/main/nfc/scenes/nfc_scene_mf_ultralight_read_auth.c b/applications/main/nfc/scenes/nfc_scene_mf_ultralight_read_auth.c index 853ccb05..1a106bdb 100644 --- a/applications/main/nfc/scenes/nfc_scene_mf_ultralight_read_auth.c +++ b/applications/main/nfc/scenes/nfc_scene_mf_ultralight_read_auth.c @@ -65,7 +65,7 @@ void nfc_scene_mf_ultralight_read_auth_on_enter(void* context) { nfc_scene_mf_ultralight_read_auth_worker_callback, nfc); - nfc_blink_start(nfc); + nfc_blink_read_start(nfc); } bool nfc_scene_mf_ultralight_read_auth_on_event(void* context, SceneManagerEvent event) { diff --git a/applications/main/nfc/scenes/nfc_scene_mf_ultralight_read_success.c b/applications/main/nfc/scenes/nfc_scene_mf_ultralight_read_success.c index d775bb71..56fa2057 100644 --- a/applications/main/nfc/scenes/nfc_scene_mf_ultralight_read_success.c +++ b/applications/main/nfc/scenes/nfc_scene_mf_ultralight_read_success.c @@ -47,6 +47,8 @@ void nfc_scene_mf_ultralight_read_success_on_enter(void* context) { widget_add_text_scroll_element(widget, 0, 0, 128, 52, string_get_cstr(temp_str)); string_clear(temp_str); + notification_message_block(nfc->notifications, &sequence_set_green_255); + view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewWidget); } @@ -73,6 +75,8 @@ bool nfc_scene_mf_ultralight_read_success_on_event(void* context, SceneManagerEv void nfc_scene_mf_ultralight_read_success_on_exit(void* context) { Nfc* nfc = context; + notification_message_block(nfc->notifications, &sequence_reset_green); + // Clean view widget_reset(nfc->widget); } diff --git a/applications/main/nfc/scenes/nfc_scene_nfca_read_success.c b/applications/main/nfc/scenes/nfc_scene_nfca_read_success.c index 3467a03b..c695da24 100644 --- a/applications/main/nfc/scenes/nfc_scene_nfca_read_success.c +++ b/applications/main/nfc/scenes/nfc_scene_nfca_read_success.c @@ -25,6 +25,8 @@ void nfc_scene_nfca_read_success_on_enter(void* context) { string_t temp_str; string_init_set_str(temp_str, "\e#Unknown ISO tag\n"); + notification_message_block(nfc->notifications, &sequence_set_green_255); + char iso_type = FURI_BIT(data->sak, 5) ? '4' : '3'; string_cat_printf(temp_str, "ISO 14443-%c (NFC-A)\n", iso_type); string_cat_printf(temp_str, "UID:"); @@ -67,6 +69,8 @@ bool nfc_scene_nfca_read_success_on_event(void* context, SceneManagerEvent event void nfc_scene_nfca_read_success_on_exit(void* context) { Nfc* nfc = context; + notification_message_block(nfc->notifications, &sequence_reset_green); + // Clear view widget_reset(nfc->widget); } diff --git a/applications/main/nfc/scenes/nfc_scene_read.c b/applications/main/nfc/scenes/nfc_scene_read.c index 00b7c8fa..da21b9f3 100644 --- a/applications/main/nfc/scenes/nfc_scene_read.c +++ b/applications/main/nfc/scenes/nfc_scene_read.c @@ -49,7 +49,7 @@ void nfc_scene_read_on_enter(void* context) { nfc_worker_start( nfc->worker, NfcWorkerStateRead, &nfc->dev->dev_data, nfc_scene_read_worker_callback, nfc); - nfc_blink_start(nfc); + nfc_blink_read_start(nfc); } bool nfc_scene_read_on_event(void* context, SceneManagerEvent event) { @@ -92,9 +92,11 @@ bool nfc_scene_read_on_event(void* context, SceneManagerEvent event) { consumed = true; } else if(event.event == NfcWorkerEventCardDetected) { nfc_scene_read_set_state(nfc, NfcSceneReadStateReading); + nfc_blink_detect_start(nfc); consumed = true; } else if(event.event == NfcWorkerEventNoCardDetected) { nfc_scene_read_set_state(nfc, NfcSceneReadStateDetecting); + nfc_blink_read_start(nfc); consumed = true; } } diff --git a/applications/main/nfc/scenes/nfc_scene_rpc.c b/applications/main/nfc/scenes/nfc_scene_rpc.c index 7a9eb450..e5128a52 100644 --- a/applications/main/nfc/scenes/nfc_scene_rpc.c +++ b/applications/main/nfc/scenes/nfc_scene_rpc.c @@ -62,7 +62,7 @@ bool nfc_scene_rpc_on_event(void* context, SceneManagerEvent event) { nfc->rpc_state = NfcRpcStateEmulating; result = true; - nfc_blink_start(nfc); + nfc_blink_emulate_start(nfc); nfc_text_store_set(nfc, "emulating\n%s", nfc->dev->dev_name); popup_set_text(popup, nfc->text_store, 89, 44, AlignCenter, AlignTop); }