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

Fetch updates from unleashed to build as FAP

0xchocolate 3 лет назад
Родитель
Сommit
2450cb325e

+ 0 - 1
applications/main/application.fam

@@ -3,7 +3,6 @@ App(
     name="Basic applications for main menu",
     name="Basic applications for main menu",
     apptype=FlipperAppType.METAPACKAGE,
     apptype=FlipperAppType.METAPACKAGE,
     provides=[
     provides=[
-        "wifi_marauder",
         "gpio",
         "gpio",
         "ibutton",
         "ibutton",
         "infrared",
         "infrared",

+ 6 - 5
applications/plugins/wifi_marauder_companion/application.fam

@@ -1,11 +1,12 @@
 App(
 App(
-    appid="wifi_marauder",
-    name="WiFi (Marauder)",
-    apptype=FlipperAppType.APP,
+    appid="ESP32_WiFi_Marauder",
+    name="[ESP32] WiFi Marauder",
+    apptype=FlipperAppType.EXTERNAL,
     entry_point="wifi_marauder_app",
     entry_point="wifi_marauder_app",
     cdefines=["APP_WIFI_MARAUDER"],
     cdefines=["APP_WIFI_MARAUDER"],
     requires=["gui"],
     requires=["gui"],
     stack_size=1 * 1024,
     stack_size=1 * 1024,
-    icon="A_Infrared_14",
-    order=50,
+    order=90,
+    fap_icon="wifi_10px.png",
+    fap_category="GPIO",
 )
 )

+ 8 - 8
applications/plugins/wifi_marauder_companion/scenes/wifi_marauder_scene_console_output.c

@@ -7,13 +7,13 @@ void wifi_marauder_console_output_handle_rx_data_cb(uint8_t* buf, size_t len, vo
     // If text box store gets too big, then truncate it
     // If text box store gets too big, then truncate it
     app->text_box_store_strlen += len;
     app->text_box_store_strlen += len;
     if(app->text_box_store_strlen >= WIFI_MARAUDER_TEXT_BOX_STORE_SIZE - 1) {
     if(app->text_box_store_strlen >= WIFI_MARAUDER_TEXT_BOX_STORE_SIZE - 1) {
-        string_right(app->text_box_store, app->text_box_store_strlen / 2);
-        app->text_box_store_strlen = string_size(app->text_box_store) + len;
+        furi_string_right(app->text_box_store, app->text_box_store_strlen / 2);
+        app->text_box_store_strlen = furi_string_size(app->text_box_store) + len;
     }
     }
 
 
     // Null-terminate buf and append to text box store
     // Null-terminate buf and append to text box store
     buf[len] = '\0';
     buf[len] = '\0';
-    string_cat_printf(app->text_box_store, "%s", buf);
+    furi_string_cat_printf(app->text_box_store, "%s", buf);
 
 
     view_dispatcher_send_custom_event(app->view_dispatcher, WifiMarauderEventRefreshConsoleOutput);
     view_dispatcher_send_custom_event(app->view_dispatcher, WifiMarauderEventRefreshConsoleOutput);
 }
 }
@@ -30,24 +30,24 @@ void wifi_marauder_scene_console_output_on_enter(void* context) {
         text_box_set_focus(text_box, TextBoxFocusEnd);
         text_box_set_focus(text_box, TextBoxFocusEnd);
     }
     }
     if(app->is_command) {
     if(app->is_command) {
-        string_reset(app->text_box_store);
+        furi_string_reset(app->text_box_store);
         app->text_box_store_strlen = 0;
         app->text_box_store_strlen = 0;
         if(0 == strncmp("help", app->selected_tx_string, strlen("help"))) {
         if(0 == strncmp("help", app->selected_tx_string, strlen("help"))) {
             const char* help_msg =
             const char* help_msg =
                 "For app support/feedback,\nreach out to me:\n@cococode#6011 (discord)\n0xchocolate (github)\n";
                 "For app support/feedback,\nreach out to me:\n@cococode#6011 (discord)\n0xchocolate (github)\n";
-            string_cat_str(app->text_box_store, help_msg);
+            furi_string_cat_str(app->text_box_store, help_msg);
             app->text_box_store_strlen += strlen(help_msg);
             app->text_box_store_strlen += strlen(help_msg);
         }
         }
 
 
         if(app->show_stopscan_tip) {
         if(app->show_stopscan_tip) {
             const char* help_msg = "Press BACK to send stopscan\n";
             const char* help_msg = "Press BACK to send stopscan\n";
-            string_cat_str(app->text_box_store, help_msg);
+            furi_string_cat_str(app->text_box_store, help_msg);
             app->text_box_store_strlen += strlen(help_msg);
             app->text_box_store_strlen += strlen(help_msg);
         }
         }
     }
     }
 
 
     // Set starting text - for "View Log", this will just be what was already in the text box store
     // Set starting text - for "View Log", this will just be what was already in the text box store
-    text_box_set_text(app->text_box, string_get_cstr(app->text_box_store));
+    text_box_set_text(app->text_box, furi_string_get_cstr(app->text_box_store));
 
 
     scene_manager_set_scene_state(app->scene_manager, WifiMarauderSceneConsoleOutput, 0);
     scene_manager_set_scene_state(app->scene_manager, WifiMarauderSceneConsoleOutput, 0);
     view_dispatcher_switch_to_view(app->view_dispatcher, WifiMarauderAppViewConsoleOutput);
     view_dispatcher_switch_to_view(app->view_dispatcher, WifiMarauderAppViewConsoleOutput);
@@ -70,7 +70,7 @@ bool wifi_marauder_scene_console_output_on_event(void* context, SceneManagerEven
     bool consumed = false;
     bool consumed = false;
 
 
     if(event.type == SceneManagerEventTypeCustom) {
     if(event.type == SceneManagerEventTypeCustom) {
-        text_box_set_text(app->text_box, string_get_cstr(app->text_box_store));
+        text_box_set_text(app->text_box, furi_string_get_cstr(app->text_box_store));
         consumed = true;
         consumed = true;
     } else if(event.type == SceneManagerEventTypeTick) {
     } else if(event.type == SceneManagerEventTypeTick) {
         consumed = true;
         consumed = true;

BIN
applications/plugins/wifi_marauder_companion/wifi_10px.png


+ 1 - 1
applications/plugins/wifi_marauder_companion/wifi_marauder_app_i.h

@@ -27,7 +27,7 @@ struct WifiMarauderApp {
     size_t text_box_store_strlen;
     size_t text_box_store_strlen;
     TextBox* text_box;
     TextBox* text_box;
     TextInput* text_input;
     TextInput* text_input;
-    // Widget* widget;
+    //Widget* widget;
 
 
     VariableItemList* var_item_list;
     VariableItemList* var_item_list;
 
 

+ 5 - 9
applications/plugins/wifi_marauder_companion/wifi_marauder_uart.c

@@ -1,15 +1,13 @@
 #include "wifi_marauder_app_i.h"
 #include "wifi_marauder_app_i.h"
 #include "wifi_marauder_uart.h"
 #include "wifi_marauder_uart.h"
 
 
-#include <stream_buffer.h>
-
 #define UART_CH (FuriHalUartIdUSART1)
 #define UART_CH (FuriHalUartIdUSART1)
 #define BAUDRATE (115200)
 #define BAUDRATE (115200)
 
 
 struct WifiMarauderUart {
 struct WifiMarauderUart {
     WifiMarauderApp* app;
     WifiMarauderApp* app;
     FuriThread* rx_thread;
     FuriThread* rx_thread;
-    StreamBufferHandle_t rx_stream;
+    FuriStreamBuffer* rx_stream;
     uint8_t rx_buf[RX_BUF_SIZE + 1];
     uint8_t rx_buf[RX_BUF_SIZE + 1];
     void (*handle_rx_data_cb)(uint8_t* buf, size_t len, void* context);
     void (*handle_rx_data_cb)(uint8_t* buf, size_t len, void* context);
 };
 };
@@ -30,19 +28,17 @@ void wifi_marauder_uart_set_handle_rx_data_cb(
 
 
 void wifi_marauder_uart_on_irq_cb(UartIrqEvent ev, uint8_t data, void* context) {
 void wifi_marauder_uart_on_irq_cb(UartIrqEvent ev, uint8_t data, void* context) {
     WifiMarauderUart* uart = (WifiMarauderUart*)context;
     WifiMarauderUart* uart = (WifiMarauderUart*)context;
-    BaseType_t xHigherPriorityTaskWoken = pdFALSE;
 
 
     if(ev == UartIrqEventRXNE) {
     if(ev == UartIrqEventRXNE) {
-        xStreamBufferSendFromISR(uart->rx_stream, &data, 1, &xHigherPriorityTaskWoken);
+        furi_stream_buffer_send(uart->rx_stream, &data, 1, 0);
         furi_thread_flags_set(furi_thread_get_id(uart->rx_thread), WorkerEvtRxDone);
         furi_thread_flags_set(furi_thread_get_id(uart->rx_thread), WorkerEvtRxDone);
-        portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
     }
     }
 }
 }
 
 
 static int32_t uart_worker(void* context) {
 static int32_t uart_worker(void* context) {
     WifiMarauderUart* uart = (void*)context;
     WifiMarauderUart* uart = (void*)context;
 
 
-    uart->rx_stream = xStreamBufferCreate(RX_BUF_SIZE, 1);
+    uart->rx_stream = furi_stream_buffer_alloc(RX_BUF_SIZE, 1);
 
 
     while(1) {
     while(1) {
         uint32_t events =
         uint32_t events =
@@ -50,14 +46,14 @@ static int32_t uart_worker(void* context) {
         furi_check((events & FuriFlagError) == 0);
         furi_check((events & FuriFlagError) == 0);
         if(events & WorkerEvtStop) break;
         if(events & WorkerEvtStop) break;
         if(events & WorkerEvtRxDone) {
         if(events & WorkerEvtRxDone) {
-            size_t len = xStreamBufferReceive(uart->rx_stream, uart->rx_buf, RX_BUF_SIZE, 0);
+            size_t len = furi_stream_buffer_receive(uart->rx_stream, uart->rx_buf, RX_BUF_SIZE, 0);
             if(len > 0) {
             if(len > 0) {
                 if(uart->handle_rx_data_cb) uart->handle_rx_data_cb(uart->rx_buf, len, uart->app);
                 if(uart->handle_rx_data_cb) uart->handle_rx_data_cb(uart->rx_buf, len, uart->app);
             }
             }
         }
         }
     }
     }
 
 
-    vStreamBufferDelete(uart->rx_stream);
+    furi_stream_buffer_free(uart->rx_stream);
 
 
     return 0;
     return 0;
 }
 }