فهرست منبع

Merge wifi_scanner from https://github.com/xMasterX/all-the-plugins

# Conflicts:
#	wifi_scanner/FlipperZeroWiFiModuleDefines.h
Willy-JL 1 سال پیش
والد
کامیت
08201ff5f2
1فایلهای تغییر یافته به همراه12 افزوده شده و 0 حذف شده
  1. 12 0
      wifi_scanner/wifi_scanner.c

+ 12 - 0
wifi_scanner/wifi_scanner.c

@@ -10,6 +10,7 @@
 #include <notification/notification.h>
 #include <notification/notification_messages.h>
 #include <stdlib.h>
+#include <expansion/expansion.h>
 
 #include "FlipperZeroWiFiModuleDefines.h"
 
@@ -838,6 +839,10 @@ void send_serial_command(SWiFiScannerApp* app, ESerialCommand command) {
 int32_t wifi_scanner_app(void* p) {
     UNUSED(p);
 
+    // Disable expansion protocol to avoid interference with UART Handle
+    Expansion* expansion = furi_record_open(RECORD_EXPANSION);
+    expansion_disable(expansion);
+
     WIFI_APP_LOG_I("Init");
 
     // FuriTimer* timer = furi_timer_alloc(blink_test_update, FuriTimerTypePeriodic, event_queue);
@@ -874,6 +879,9 @@ int32_t wifi_scanner_app(void* p) {
     if(!app->mutex) {
         WIFI_APP_LOG_E("cannot create mutex\r\n");
         free(app);
+        // Return previous state of expansion
+        expansion_enable(expansion);
+        furi_record_close(RECORD_EXPANSION);
         return 255;
     }
 
@@ -1061,5 +1069,9 @@ int32_t wifi_scanner_app(void* p) {
     }
 #endif
 
+    // Return previous state of expansion
+    expansion_enable(expansion);
+    furi_record_close(RECORD_EXPANSION);
+
     return 0;
 }