Просмотр исходного кода

set/check flow mode for nfc emulation

Eric Betts 9 месяцев назад
Родитель
Сommit
0a31e5be30
2 измененных файлов с 4 добавлено и 2 удалено
  1. 1 0
      scenes/seos_scene_file_select.c
  2. 3 2
      seos_emulator.c

+ 1 - 0
scenes/seos_scene_file_select.c

@@ -7,6 +7,7 @@ void seos_scene_file_select_on_enter(void* context) {
     // Process file_select return
     // Process file_select return
     seos_emulator_set_loading_callback(seos_emulator, seos_show_loading_popup, seos);
     seos_emulator_set_loading_callback(seos_emulator, seos_show_loading_popup, seos);
     if(seos_emulator_file_select(seos_emulator)) {
     if(seos_emulator_file_select(seos_emulator)) {
+        seos->flow_mode = FLOW_CRED;
         scene_manager_next_scene(seos->scene_manager, SeosSceneSavedMenu);
         scene_manager_next_scene(seos->scene_manager, SeosSceneSavedMenu);
     } else {
     } else {
         scene_manager_search_and_switch_to_previous_scene(seos->scene_manager, SeosSceneStart);
         scene_manager_search_and_switch_to_previous_scene(seos->scene_manager, SeosSceneStart);

+ 3 - 2
seos_emulator.c

@@ -649,8 +649,9 @@ NfcCommand seos_worker_listener_callback(NfcGenericEvent event, void* context) {
         // Some ISO14443a framing I need to figure out
         // Some ISO14443a framing I need to figure out
         bit_buffer_append_bytes(tx_buffer, rx_data, offset);
         bit_buffer_append_bytes(tx_buffer, rx_data, offset);
 
 
-        // if (flow_mode == FLOW_CRED) {
-        ret = seos_worker_listener_process_message(seos);
+        if(seos->flow_mode == FLOW_CRED) {
+            ret = seos_worker_listener_process_message(seos);
+        }
 
 
         if(bit_buffer_get_size_bytes(seos_emulator->tx_buffer) >
         if(bit_buffer_get_size_bytes(seos_emulator->tx_buffer) >
            offset) { // contents belong iso framing
            offset) { // contents belong iso framing