Skip to content
This repository has been archived by the owner on Jul 28, 2024. It is now read-only.

Commit

Permalink
Quick saved track2 emulate tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyweiss committed Jan 11, 2023
1 parent 52c51f6 commit 436db4b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
15 changes: 15 additions & 0 deletions scenes/mag_scene_emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ void mag_scene_emulate_on_enter(void* context) {
widget, 0, 15, AlignLeft, AlignTop, FontSecondary, furi_string_get_cstr(tmp_str));

widget_add_button_element(widget, GuiButtonTypeLeft, "Config", mag_widget_callback, mag);
widget_add_button_element(widget, GuiButtonTypeRight, "Send", mag_widget_callback, mag);

view_dispatcher_switch_to_view(mag->view_dispatcher, MagViewWidget);
furi_string_free(tmp_str);
Expand All @@ -35,6 +36,19 @@ bool mag_scene_emulate_on_event(void* context, SceneManagerEvent event) {
consumed = true;

scene_manager_next_scene(scene_manager, MagSceneEmulateConfig);
} else if(event.event == GuiButtonTypeRight) {
consumed = true;

FuriString* tmp_str;
tmp_str = furi_string_alloc_set_str(furi_string_get_cstr(mag->mag_dev->dev_data));

// Assumes track 2 for temporary testing.
// Will overhaul alongside file format and config system
notification_message(mag->notifications, &sequence_blink_start_cyan);
mag_spoof_single_track_rfid(tmp_str, 1);
notification_message(mag->notifications, &sequence_blink_stop);

furi_string_free(tmp_str);
}
}

Expand All @@ -43,5 +57,6 @@ bool mag_scene_emulate_on_event(void* context, SceneManagerEvent event) {

void mag_scene_emulate_on_exit(void* context) {
Mag* mag = context;
notification_message(mag->notifications, &sequence_blink_stop);
widget_reset(mag->widget);
}
1 change: 0 additions & 1 deletion scenes/mag_scene_saved_info.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "../mag_i.h"
#include "mag_icons.h"

void mag_scene_saved_info_on_enter(void* context) {
Mag* mag = context;
Expand Down
4 changes: 2 additions & 2 deletions scenes/mag_scene_saved_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ void mag_scene_saved_menu_on_enter(void* context) {
Submenu* submenu = mag->submenu;

submenu_add_item(
submenu, "Emulate WIP", SubmenuIndexEmulate, mag_scene_saved_menu_submenu_callback, mag);
submenu, "Emulate (WIP)", SubmenuIndexEmulate, mag_scene_saved_menu_submenu_callback, mag);
submenu_add_item(
submenu, "Edit", SubmenuIndexEdit, mag_scene_saved_menu_submenu_callback, mag);
submenu, "Edit (WIP)", SubmenuIndexEdit, mag_scene_saved_menu_submenu_callback, mag);
submenu_add_item(
submenu, "Delete", SubmenuIndexDelete, mag_scene_saved_menu_submenu_callback, mag);
submenu_add_item(
Expand Down

0 comments on commit 436db4b

Please sign in to comment.