瀏覽代碼

add fast commands and minor improvements

cool4uma 3 年之前
父節點
當前提交
6519b50a68

+ 5 - 5
scenes/uart_terminal_scene_console_output.c

@@ -86,8 +86,8 @@ void uart_terminal_scene_console_output_on_exit(void* context) {
     // Unregister rx callback
     // Unregister rx callback
     uart_terminal_uart_set_handle_rx_data_cb(app->uart, NULL);
     uart_terminal_uart_set_handle_rx_data_cb(app->uart, NULL);
 
 
-    // Automatically stop the scan when exiting view
-    if(app->is_command) {
-        uart_terminal_uart_tx((uint8_t*)("stopscan\n"), strlen("stopscan\n"));
-    }
-}
+    // Automatically logut when exiting view
+    //if(app->is_command) {
+    //    uart_terminal_uart_tx((uint8_t*)("stopscan\n"), strlen("stopscan\n"));
+    //}
+}

+ 9 - 5
scenes/uart_terminal_scene_start.c

@@ -1,5 +1,3 @@
-//** Includes sniffbt and sniffskim for compatible ESP32-WROOM hardware.
-//uart_terminal_app_i.h also changed **//
 #include "../uart_terminal_app_i.h"
 #include "../uart_terminal_app_i.h"
 
 
 // For each command, define whether additional arguments are needed
 // For each command, define whether additional arguments are needed
@@ -26,14 +24,20 @@ typedef struct {
 // NUM_MENU_ITEMS defined in uart_terminal_app_i.h - if you add an entry here, increment it!
 // NUM_MENU_ITEMS defined in uart_terminal_app_i.h - if you add an entry here, increment it!
 const UART_TerminalItem items[NUM_MENU_ITEMS] = {
 const UART_TerminalItem items[NUM_MENU_ITEMS] = {
     {"Console",
     {"Console",
-     {"9600", "19200", "57600", "115200"},
-     4,
+     {"115200", "2400", "9600", "19200", "38400", "57600", "230400", "460800", "921600"},
+     9,
      {"", ""},
      {"", ""},
      NO_ARGS,
      NO_ARGS,
      FOCUS_CONSOLE_TOGGLE,
      FOCUS_CONSOLE_TOGGLE,
      NO_TIP},
      NO_TIP},
     {"Send command", {""}, 1, {""}, INPUT_ARGS, FOCUS_CONSOLE_END, NO_TIP},
     {"Send command", {""}, 1, {""}, INPUT_ARGS, FOCUS_CONSOLE_END, NO_TIP},
-    {"Reboot", {""}, 1, {"reboot"}, NO_ARGS, FOCUS_CONSOLE_END, NO_TIP},
+    {"Fast cmd",
+     {"help", "uptime", "date", "df -h", "ps", "dmesg", "reboot", "poweroff"},
+     8,
+     {"help", "uptime", "date", "df -h", "ps", "dmesg", "reboot", "poweroff"},
+     INPUT_ARGS,
+     FOCUS_CONSOLE_END,
+     NO_TIP},
     {"Help", {""}, 1, {"help"}, NO_ARGS, FOCUS_CONSOLE_START, SHOW_STOPSCAN_TIP},
     {"Help", {""}, 1, {"help"}, NO_ARGS, FOCUS_CONSOLE_START, SHOW_STOPSCAN_TIP},
 };
 };
 
 

+ 1 - 1
scenes/uart_terminal_scene_text_input.c

@@ -17,7 +17,7 @@ void uart_terminal_scene_text_input_on_enter(void* context) {
         strncpy(app->text_input_store, app->selected_tx_string, length);
         strncpy(app->text_input_store, app->selected_tx_string, length);
 
 
         // Add space - because flipper keyboard currently doesn't have a space
         // Add space - because flipper keyboard currently doesn't have a space
-        app->text_input_store[length] = ' ';
+        //app->text_input_store[length] = ' ';
         app->text_input_store[length + 1] = '\0';
         app->text_input_store[length + 1] = '\0';
         app->is_custom_tx_string = true;
         app->is_custom_tx_string = true;
     }
     }

+ 0 - 3
uart_terminal_app_i.h

@@ -1,5 +1,3 @@
-//** Includes sniffbt and sniffskim for compatible ESP32-WROOM hardware.
-// uart_terminal_scene_start.c also changed **//
 #pragma once
 #pragma once
 
 
 #include "uart_terminal_app.h"
 #include "uart_terminal_app.h"
@@ -11,7 +9,6 @@
 #include <gui/view_dispatcher.h>
 #include <gui/view_dispatcher.h>
 #include <gui/scene_manager.h>
 #include <gui/scene_manager.h>
 #include <gui/modules/text_box.h>
 #include <gui/modules/text_box.h>
-//#include <gui/modules/text_input.h>
 #include <gui/modules/variable_item_list.h>
 #include <gui/modules/variable_item_list.h>
 #include "uart_text_input.h"
 #include "uart_text_input.h"