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

ESubghzChat: Comment out NFC stuff

Willy-JL 2 лет назад
Родитель
Сommit
8bbe81cb3b

+ 1 - 1
esubghz_chat/application.fam

@@ -1,5 +1,5 @@
 App(
 App(
-    appid=".esubghz_chat",
+    appid="esubghz_chat",
     name="Enhanced Sub-Ghz Chat",
     name="Enhanced Sub-Ghz Chat",
     apptype=FlipperAppType.EXTERNAL,
     apptype=FlipperAppType.EXTERNAL,
     entry_point="esubghz_chat",
     entry_point="esubghz_chat",

+ 16 - 16
esubghz_chat/esubghz_chat.c

@@ -610,16 +610,16 @@ int32_t esubghz_chat(const char* args) {
         goto err_alloc_worker;
         goto err_alloc_worker;
     }
     }
 
 
-    state->nfc_worker = nfc_worker_alloc();
-    if(state->nfc_worker == NULL) {
-        goto err_alloc_nworker;
-    }
+    // state->nfc_worker = nfc_worker_alloc();
+    // if(state->nfc_worker == NULL) {
+    //     goto err_alloc_nworker;
+    // }
 
 
-    state->nfc_dev_data = malloc(sizeof(NfcDeviceData));
-    if(state->nfc_dev_data == NULL) {
-        goto err_alloc_ndevdata;
-    }
-    memset(state->nfc_dev_data, 0, sizeof(NfcDeviceData));
+    // state->nfc_dev_data = malloc(sizeof(NfcDeviceData));
+    // if(state->nfc_dev_data == NULL) {
+    //     goto err_alloc_ndevdata;
+    // }
+    // memset(state->nfc_dev_data, 0, sizeof(NfcDeviceData));
 
 
     state->crypto_ctx = crypto_ctx_alloc();
     state->crypto_ctx = crypto_ctx_alloc();
     if(state->crypto_ctx == NULL) {
     if(state->crypto_ctx == NULL) {
@@ -715,7 +715,7 @@ int32_t esubghz_chat(const char* args) {
     }
     }
 
 
     /* if it is running, stop the NFC worker */
     /* if it is running, stop the NFC worker */
-    nfc_worker_stop(state->nfc_worker);
+    // nfc_worker_stop(state->nfc_worker);
 
 
     err = 0;
     err = 0;
 
 
@@ -740,10 +740,10 @@ int32_t esubghz_chat(const char* args) {
     crypto_ctx_clear(state->crypto_ctx);
     crypto_ctx_clear(state->crypto_ctx);
 
 
     /* clear nfc data */
     /* clear nfc data */
-    if(state->nfc_dev_data->parsed_data != NULL) {
-        furi_string_free(state->nfc_dev_data->parsed_data);
-    }
-    crypto_explicit_bzero(state->nfc_dev_data, sizeof(NfcDeviceData));
+    // if(state->nfc_dev_data->parsed_data != NULL) {
+    //     furi_string_free(state->nfc_dev_data->parsed_data);
+    // }
+    // crypto_explicit_bzero(state->nfc_dev_data, sizeof(NfcDeviceData));
 
 
     /* deinit devices */
     /* deinit devices */
     radio_device_loader_end(state->subghz_device);
     radio_device_loader_end(state->subghz_device);
@@ -758,10 +758,10 @@ int32_t esubghz_chat(const char* args) {
     crypto_ctx_free(state->crypto_ctx);
     crypto_ctx_free(state->crypto_ctx);
 
 
 err_alloc_crypto:
 err_alloc_crypto:
-    free(state->nfc_dev_data);
+    // free(state->nfc_dev_data);
 
 
 err_alloc_ndevdata:
 err_alloc_ndevdata:
-    nfc_worker_free(state->nfc_worker);
+    // nfc_worker_free(state->nfc_worker);
 
 
 err_alloc_nworker:
 err_alloc_nworker:
     subghz_tx_rx_worker_free(state->subghz_worker);
     subghz_tx_rx_worker_free(state->subghz_worker);

+ 4 - 4
esubghz_chat/esubghz_chat_i.h

@@ -11,7 +11,7 @@
 #include <gui/modules/text_box.h>
 #include <gui/modules/text_box.h>
 #include <gui/modules/text_input.h>
 #include <gui/modules/text_input.h>
 #include <notification/notification_messages.h>
 #include <notification/notification_messages.h>
-#include <lib/nfc/nfc_worker.h>
+// #include <lib/nfc/nfc_worker.h>
 #include <lib/subghz/subghz_tx_rx_worker.h>
 #include <lib/subghz/subghz_tx_rx_worker.h>
 #include <toolbox/sha256.h>
 #include <toolbox/sha256.h>
 
 
@@ -59,8 +59,8 @@ typedef struct {
     const SubGhzDevice* subghz_device;
     const SubGhzDevice* subghz_device;
 
 
     // for NFC
     // for NFC
-    NfcWorker* nfc_worker;
-    NfcDeviceData* nfc_dev_data;
+    // NfcWorker* nfc_worker;
+    // NfcDeviceData* nfc_dev_data;
 
 
     // message assembly before TX
     // message assembly before TX
     FuriString* name_prefix;
     FuriString* name_prefix;
@@ -101,7 +101,7 @@ typedef enum {
     ESubGhzChatEvent_KeyMenuPassword,
     ESubGhzChatEvent_KeyMenuPassword,
     ESubGhzChatEvent_KeyMenuHexKey,
     ESubGhzChatEvent_KeyMenuHexKey,
     ESubGhzChatEvent_KeyMenuGenKey,
     ESubGhzChatEvent_KeyMenuGenKey,
-    ESubGhzChatEvent_KeyMenuReadKeyFromNfc,
+    // ESubGhzChatEvent_KeyMenuReadKeyFromNfc,
     ESubGhzChatEvent_KeyReadPopupFailed,
     ESubGhzChatEvent_KeyReadPopupFailed,
     ESubGhzChatEvent_KeyReadPopupSucceeded,
     ESubGhzChatEvent_KeyReadPopupSucceeded,
     ESubGhzChatEvent_PassEntered,
     ESubGhzChatEvent_PassEntered,

+ 5 - 5
esubghz_chat/scenes/esubghz_chat_key_display.c

@@ -88,7 +88,7 @@ void scene_on_enter_key_display(void* context) {
     dialog_ex_set_left_button_text(state->key_display, "Back");
     dialog_ex_set_left_button_text(state->key_display, "Back");
 
 
     if(state->encrypted) {
     if(state->encrypted) {
-        dialog_ex_set_center_button_text(state->key_display, "Share");
+        // dialog_ex_set_center_button_text(state->key_display, "Share");
     }
     }
 
 
     dialog_ex_set_result_callback(state->key_display, key_display_result_cb);
     dialog_ex_set_result_callback(state->key_display, key_display_result_cb);
@@ -120,10 +120,10 @@ bool scene_on_event_key_display(void* context, SceneManagerEvent event) {
             break;
             break;
 
 
         /* open key sharing popup */
         /* open key sharing popup */
-        case ESubGhzChatEvent_KeyDisplayShare:
-            scene_manager_next_scene(state->scene_manager, ESubGhzChatScene_KeySharePopup);
-            consumed = true;
-            break;
+        // case ESubGhzChatEvent_KeyDisplayShare:
+        //     scene_manager_next_scene(state->scene_manager, ESubGhzChatScene_KeySharePopup);
+        //     consumed = true;
+        //     break;
         }
         }
         break;
         break;
 
 

+ 17 - 17
esubghz_chat/scenes/esubghz_chat_key_menu.c

@@ -5,7 +5,7 @@ typedef enum {
     ESubGhzChatKeyMenuItems_Password,
     ESubGhzChatKeyMenuItems_Password,
     ESubGhzChatKeyMenuItems_HexKey,
     ESubGhzChatKeyMenuItems_HexKey,
     ESubGhzChatKeyMenuItems_GenKey,
     ESubGhzChatKeyMenuItems_GenKey,
-    ESubGhzChatKeyMenuItems_ReadKeyFromNfc,
+    // ESubGhzChatKeyMenuItems_ReadKeyFromNfc,
 } ESubGhzChatKeyMenuItems;
 } ESubGhzChatKeyMenuItems;
 
 
 static void key_menu_cb(void* context, uint32_t index) {
 static void key_menu_cb(void* context, uint32_t index) {
@@ -52,10 +52,10 @@ static void key_menu_cb(void* context, uint32_t index) {
         view_dispatcher_send_custom_event(state->view_dispatcher, ESubGhzChatEvent_KeyMenuGenKey);
         view_dispatcher_send_custom_event(state->view_dispatcher, ESubGhzChatEvent_KeyMenuGenKey);
         break;
         break;
 
 
-    case ESubGhzChatKeyMenuItems_ReadKeyFromNfc:
-        view_dispatcher_send_custom_event(
-            state->view_dispatcher, ESubGhzChatEvent_KeyMenuReadKeyFromNfc);
-        break;
+    // case ESubGhzChatKeyMenuItems_ReadKeyFromNfc:
+    //     view_dispatcher_send_custom_event(
+    //         state->view_dispatcher, ESubGhzChatEvent_KeyMenuReadKeyFromNfc);
+    //     break;
 
 
     default:
     default:
         break;
         break;
@@ -98,13 +98,13 @@ void scene_on_enter_key_menu(void* context) {
         ESubGhzChatKeyMenuItems_GenKey,
         ESubGhzChatKeyMenuItems_GenKey,
         key_menu_cb,
         key_menu_cb,
         state);
         state);
-    menu_add_item(
-        state->menu,
-        "Read Key from NFC",
-        &I_Nfc_14px,
-        ESubGhzChatKeyMenuItems_ReadKeyFromNfc,
-        key_menu_cb,
-        state);
+    // menu_add_item(
+    //     state->menu,
+    //     "Read Key from NFC",
+    //     &I_Nfc_14px,
+    //     ESubGhzChatKeyMenuItems_ReadKeyFromNfc,
+    //     key_menu_cb,
+    //     state);
 
 
     view_dispatcher_switch_to_view(state->view_dispatcher, ESubGhzChatView_Menu);
     view_dispatcher_switch_to_view(state->view_dispatcher, ESubGhzChatView_Menu);
 }
 }
@@ -141,11 +141,11 @@ bool scene_on_event_key_menu(void* context, SceneManagerEvent event) {
             break;
             break;
 
 
         /* switch to hex key read scene */
         /* switch to hex key read scene */
-        case ESubGhzChatEvent_KeyMenuReadKeyFromNfc:
-            scene_manager_next_scene(state->scene_manager, ESubGhzChatScene_KeyReadPopup);
-            consumed = true;
-            break;
-        }
+        // case ESubGhzChatEvent_KeyMenuReadKeyFromNfc:
+        //     scene_manager_next_scene(state->scene_manager, ESubGhzChatScene_KeyReadPopup);
+        //     consumed = true;
+        //     break;
+        // }
 
 
         break;
         break;
 
 

+ 2 - 2
esubghz_chat/scenes/esubghz_chat_scene_config.h

@@ -2,8 +2,8 @@ ADD_SCENE(esubghz_chat, freq_input, FreqInput)
 ADD_SCENE(esubghz_chat, key_menu, KeyMenu)
 ADD_SCENE(esubghz_chat, key_menu, KeyMenu)
 ADD_SCENE(esubghz_chat, pass_input, PassInput)
 ADD_SCENE(esubghz_chat, pass_input, PassInput)
 ADD_SCENE(esubghz_chat, hex_key_input, HexKeyInput)
 ADD_SCENE(esubghz_chat, hex_key_input, HexKeyInput)
-ADD_SCENE(esubghz_chat, key_read_popup, KeyReadPopup)
+// ADD_SCENE(esubghz_chat, key_read_popup, KeyReadPopup)
 ADD_SCENE(esubghz_chat, chat_input, ChatInput)
 ADD_SCENE(esubghz_chat, chat_input, ChatInput)
 ADD_SCENE(esubghz_chat, chat_box, ChatBox)
 ADD_SCENE(esubghz_chat, chat_box, ChatBox)
 ADD_SCENE(esubghz_chat, key_display, KeyDisplay)
 ADD_SCENE(esubghz_chat, key_display, KeyDisplay)
-ADD_SCENE(esubghz_chat, key_share_popup, KeySharePopup)
+// ADD_SCENE(esubghz_chat, key_share_popup, KeySharePopup)