MX 2 سال پیش
والد
کامیت
2fa94c9fcf
100فایلهای تغییر یافته به همراه261 افزوده شده و 4382 حذف شده
  1. 0 7
      ReadMe.md
  2. BIN
      apps/GPIO/mayhem_camera.fap
  3. BIN
      apps/GPIO/mayhem_marauder.fap
  4. BIN
      apps/GPIO/mayhem_morseflash.fap
  5. BIN
      apps/GPIO/mayhem_motion.fap
  6. BIN
      apps/GPIO/mayhem_nannycam.fap
  7. BIN
      apps/GPIO/mayhem_qrcode.fap
  8. BIN
      apps_source_code/esp32cam_camera/.flipcorg/banner.png
  9. BIN
      apps_source_code/esp32cam_camera/.flipcorg/gallery/cam1.png
  10. BIN
      apps_source_code/esp32cam_camera/.flipcorg/gallery/cam2.png
  11. 0 15
      apps_source_code/esp32cam_camera/application.fam
  12. 0 310
      apps_source_code/esp32cam_camera/camera.c
  13. 0 100
      apps_source_code/esp32cam_camera/camera.h
  14. BIN
      apps_source_code/esp32cam_camera/icon.png
  15. BIN
      apps_source_code/esp32cam_marauder_companion/.flipcorg/banner.png
  16. BIN
      apps_source_code/esp32cam_marauder_companion/.flipcorg/gallery/mau1.png
  17. BIN
      apps_source_code/esp32cam_marauder_companion/.flipcorg/gallery/mau2.png
  18. BIN
      apps_source_code/esp32cam_marauder_companion/.flipcorg/gallery/mau3.png
  19. 0 13
      apps_source_code/esp32cam_marauder_companion/application.fam
  20. 0 30
      apps_source_code/esp32cam_marauder_companion/scenes/wifi_marauder_scene.c
  21. 0 29
      apps_source_code/esp32cam_marauder_companion/scenes/wifi_marauder_scene.h
  22. 0 5
      apps_source_code/esp32cam_marauder_companion/scenes/wifi_marauder_scene_config.h
  23. 0 134
      apps_source_code/esp32cam_marauder_companion/scenes/wifi_marauder_scene_console_output.c
  24. 0 185
      apps_source_code/esp32cam_marauder_companion/scenes/wifi_marauder_scene_log_viewer.c
  25. 0 130
      apps_source_code/esp32cam_marauder_companion/scenes/wifi_marauder_scene_settings_init.c
  26. 0 269
      apps_source_code/esp32cam_marauder_companion/scenes/wifi_marauder_scene_start.c
  27. 0 154
      apps_source_code/esp32cam_marauder_companion/scenes/wifi_marauder_scene_text_input.c
  28. BIN
      apps_source_code/esp32cam_marauder_companion/wifi_10px.png
  29. 0 190
      apps_source_code/esp32cam_marauder_companion/wifi_marauder_app.c
  30. 0 13
      apps_source_code/esp32cam_marauder_companion/wifi_marauder_app.h
  31. 0 108
      apps_source_code/esp32cam_marauder_companion/wifi_marauder_app_i.h
  32. 0 11
      apps_source_code/esp32cam_marauder_companion/wifi_marauder_custom_event.h
  33. 0 64
      apps_source_code/esp32cam_marauder_companion/wifi_marauder_pcap.c
  34. 0 20
      apps_source_code/esp32cam_marauder_companion/wifi_marauder_pcap.h
  35. 0 115
      apps_source_code/esp32cam_marauder_companion/wifi_marauder_uart.c
  36. 0 16
      apps_source_code/esp32cam_marauder_companion/wifi_marauder_uart.h
  37. BIN
      apps_source_code/esp32cam_morseflasher/.flipcorg/banner.png
  38. BIN
      apps_source_code/esp32cam_morseflasher/.flipcorg/gallery/1.png
  39. BIN
      apps_source_code/esp32cam_morseflasher/.flipcorg/gallery/2.png
  40. BIN
      apps_source_code/esp32cam_morseflasher/.flipcorg/gallery/3.png
  41. 0 22
      apps_source_code/esp32cam_morseflasher/LICENSE
  42. 0 45
      apps_source_code/esp32cam_morseflasher/README.md
  43. 0 14
      apps_source_code/esp32cam_morseflasher/application.fam
  44. BIN
      apps_source_code/esp32cam_morseflasher/assets/KeyBackspaceSelected_16x9.png
  45. BIN
      apps_source_code/esp32cam_morseflasher/assets/KeyBackspace_16x9.png
  46. BIN
      apps_source_code/esp32cam_morseflasher/assets/KeySaveSelected_24x11.png
  47. BIN
      apps_source_code/esp32cam_morseflasher/assets/KeySave_24x11.png
  48. BIN
      apps_source_code/esp32cam_morseflasher/assets/WarningDolphin_45x42.png
  49. BIN
      apps_source_code/esp32cam_morseflasher/icon.png
  50. 0 30
      apps_source_code/esp32cam_morseflasher/scenes/uart_terminal_scene.c
  51. 0 29
      apps_source_code/esp32cam_morseflasher/scenes/uart_terminal_scene.h
  52. 0 3
      apps_source_code/esp32cam_morseflasher/scenes/uart_terminal_scene_config.h
  53. 0 97
      apps_source_code/esp32cam_morseflasher/scenes/uart_terminal_scene_console_output.c
  54. 0 137
      apps_source_code/esp32cam_morseflasher/scenes/uart_terminal_scene_start.c
  55. 0 60
      apps_source_code/esp32cam_morseflasher/scenes/uart_terminal_scene_text_input.c
  56. 0 114
      apps_source_code/esp32cam_morseflasher/uart_terminal_app.c
  57. 0 11
      apps_source_code/esp32cam_morseflasher/uart_terminal_app.h
  58. 0 47
      apps_source_code/esp32cam_morseflasher/uart_terminal_app_i.h
  59. 0 7
      apps_source_code/esp32cam_morseflasher/uart_terminal_custom_event.h
  60. 0 101
      apps_source_code/esp32cam_morseflasher/uart_terminal_uart.c
  61. 0 14
      apps_source_code/esp32cam_morseflasher/uart_terminal_uart.h
  62. 0 637
      apps_source_code/esp32cam_morseflasher/uart_text_input.c
  63. 0 82
      apps_source_code/esp32cam_morseflasher/uart_text_input.h
  64. 0 57
      apps_source_code/esp32cam_morseflasher/uart_validators.c
  65. 0 21
      apps_source_code/esp32cam_morseflasher/uart_validators.h
  66. BIN
      apps_source_code/esp32cam_motion_detection/.flipcorg/banner.png
  67. BIN
      apps_source_code/esp32cam_motion_detection/.flipcorg/gallery/mot1.png
  68. BIN
      apps_source_code/esp32cam_motion_detection/.flipcorg/gallery/mot2.png
  69. 0 15
      apps_source_code/esp32cam_motion_detection/application.fam
  70. BIN
      apps_source_code/esp32cam_motion_detection/icon.png
  71. 0 240
      apps_source_code/esp32cam_motion_detection/uart_echo.c
  72. 0 69
      apps_source_code/esp32cam_motion_detection/uart_echo.h
  73. BIN
      apps_source_code/esp32cam_nannycam/.flipcorg/banner.png
  74. BIN
      apps_source_code/esp32cam_nannycam/.flipcorg/gallery/1.png
  75. BIN
      apps_source_code/esp32cam_nannycam/.flipcorg/gallery/2.png
  76. 0 15
      apps_source_code/esp32cam_nannycam/application.fam
  77. BIN
      apps_source_code/esp32cam_nannycam/icon.png
  78. 0 234
      apps_source_code/esp32cam_nannycam/uart_echo.c
  79. 0 52
      apps_source_code/esp32cam_nannycam/uart_echo.h
  80. BIN
      apps_source_code/esp32cam_qrcode/.flipcorg/banner.png
  81. BIN
      apps_source_code/esp32cam_qrcode/.flipcorg/gallery/qr1.png
  82. BIN
      apps_source_code/esp32cam_qrcode/.flipcorg/gallery/qr2.png
  83. BIN
      apps_source_code/esp32cam_qrcode/.flipcorg/gallery/qr3.png
  84. 0 15
      apps_source_code/esp32cam_qrcode/application.fam
  85. BIN
      apps_source_code/esp32cam_qrcode/icon.png
  86. 0 234
      apps_source_code/esp32cam_qrcode/uart_echo.c
  87. 0 52
      apps_source_code/esp32cam_qrcode/uart_echo.h
  88. 0 0
      main_apps_sources/barcode_gen/LICENSE
  89. 4 4
      main_apps_sources/barcode_gen/README.md
  90. 0 0
      main_apps_sources/barcode_gen/application.fam
  91. 0 0
      main_apps_sources/barcode_gen/barcode_app.c
  92. 4 1
      main_apps_sources/barcode_gen/barcode_app.h
  93. 12 1
      main_apps_sources/barcode_gen/barcode_utils.c
  94. 3 2
      main_apps_sources/barcode_gen/barcode_utils.h
  95. 130 1
      main_apps_sources/barcode_gen/barcode_validator.c
  96. 2 1
      main_apps_sources/barcode_gen/barcode_validator.h
  97. 0 0
      main_apps_sources/barcode_gen/encoding_tables/codabar_encodings.txt
  98. 0 0
      main_apps_sources/barcode_gen/encoding_tables/code128_encodings.txt
  99. 106 0
      main_apps_sources/barcode_gen/encoding_tables/code128c_encodings.txt
  100. 0 0
      main_apps_sources/barcode_gen/encoding_tables/code39_encodings.txt

+ 0 - 7
ReadMe.md

@@ -81,12 +81,6 @@ The Flipper and its community wouldn't be as rich as it is without your contribu
 - [Oscilloscope (By anfractuosity)](https://github.com/anfractuosity/flipperscope) -> (Fixed furi_bus issues by @xMasterX)
 - [LORA Terminal (By aafksab)](https://github.com/aafksab/LORA-Term)
 - [NRF24 Batch Read/Send (WIP) (By vad7)](https://github.com/vad7/nRF24-Batch)
-- [ESP32CAM Camera (By Z4urce & eried)](https://github.com/eried/flipperzero-mayhem)
-- [ESP32CAM Marauder (By 0xchocolate & eried)](https://github.com/eried/flipperzero-mayhem)
-- [ESP32CAM Motion Detection (By eried)](https://github.com/eried/flipperzero-mayhem)
-- [ESP32CAM QR Code (By eried)](https://github.com/eried/flipperzero-mayhem)
-- [ESP32CAM Morse Flasher (By eried)](https://github.com/eried/flipperzero-mayhem)
-- [ESP32CAM Nanny Cam (By eried)](https://github.com/eried/flipperzero-mayhem)
 - [RCWL-516 Motion Sensor (By ahmedafe1)](https://github.com/ahmedafe1/rcwl_0516-Flipperzero)
 - [Logic analyzer (By g3gg0)](https://github.com/g3gg0/flipper-logic_analyzer) -> [How to use](https://github.com/g3gg0/flipper-logic_analyzer#readme)
 - [ServoTester (By spin7ion)](https://github.com/spin7ion/flipper-servotester)
@@ -118,7 +112,6 @@ The Flipper and its community wouldn't be as rich as it is without your contribu
 - [VB Lab Migration Assistant (By GMMan (cyanic))](https://github.com/GMMan/flipperzero-vb-migrate)
 - [Analog Clock (By scrolltex)](https://github.com/scrolltex/flipper_analog_clock)
 - [DCF77 Transmitter (By arha)](https://github.com/arha/flipper-dcf77)
-- [Barcode Generator (By Kingal1337)](https://github.com/Kingal1337/flipper-barcode-generator)
 - [Brainfuck interpreter (By nymda)](https://github.com/nymda/FlipperZeroBrainfuck)
 - [NightStand Clock (By nymda)](https://github.com/nymda/FlipperNightStand) - Fixes by [Willy-JL](https://github.com/Willy-JL)
 - [BT Camera Trigger (By Nem0oo)](https://github.com/Nem0oo/flipper-zero-bluetooth-trigger)

BIN
apps/GPIO/mayhem_camera.fap


BIN
apps/GPIO/mayhem_marauder.fap


BIN
apps/GPIO/mayhem_morseflash.fap


BIN
apps/GPIO/mayhem_motion.fap


BIN
apps/GPIO/mayhem_nannycam.fap


BIN
apps/GPIO/mayhem_qrcode.fap


BIN
apps_source_code/esp32cam_camera/.flipcorg/banner.png


BIN
apps_source_code/esp32cam_camera/.flipcorg/gallery/cam1.png


BIN
apps_source_code/esp32cam_camera/.flipcorg/gallery/cam2.png


+ 0 - 15
apps_source_code/esp32cam_camera/application.fam

@@ -1,15 +0,0 @@
-App(
-    appid="mayhem_camera",
-    name="[MAYHEM] Camera",
-    apptype=FlipperAppType.EXTERNAL,
-    entry_point="camera_app",
-    cdefines=["APP_CAMERA"],
-    requires=["gui"],
-    stack_size=8 * 1024,
-    order=1,
-    fap_icon="icon.png",
-    fap_category="GPIO",
-    fap_description="ESP32-CAM live feed and photo capture, use left/right for orientation/mode, up/down for brightness and center for saving a screenshot. [Unplug the USB cable to test with Mayhem]",
-    fap_author="Z4urce",
-    fap_weburl="https://github.com/Z4urce/flipper-camera",
-)

+ 0 - 310
apps_source_code/esp32cam_camera/camera.c

@@ -1,310 +0,0 @@
-#include "camera.h"
-
-static void camera_view_draw_callback(Canvas* canvas, void* _model) {
-    UartDumpModel* model = _model;
-
-    // Prepare canvas
-    //canvas_clear(canvas);
-    canvas_set_color(canvas, ColorBlack);
-    canvas_draw_frame(canvas, 0, 0, FRAME_WIDTH, FRAME_HEIGTH);
-
-    for(size_t p = 0; p < FRAME_BUFFER_LENGTH; ++p) {
-        uint8_t x = p % ROW_BUFFER_LENGTH; // 0 .. 15
-        uint8_t y = p / ROW_BUFFER_LENGTH; // 0 .. 63
-
-        for(uint8_t i = 0; i < 8; ++i) {
-            if((model->pixels[p] & (1 << (7 - i))) != 0) {
-                canvas_draw_dot(canvas, (x * 8) + i, y);
-            }
-        }
-    }
-
-    if(!model->initialized) {
-        /*if(!model->marauderInitialized)
-        {
-          // Init marauder into stream mode
-          uint8_t data[] = "\nstream\n";
-          furi_hal_uart_tx(FuriHalUartIdUSART1, data, sizeof(data));
-        }*/
-
-        canvas_draw_icon(canvas, 74, 16, &I_DolphinCommon_56x48);
-        canvas_set_font(canvas, FontSecondary);
-        canvas_draw_str(canvas, 8, 12, "Waiting ESP32-CAM...");
-        canvas_draw_str(canvas, 20, 24, "VCC - 3V3/5V");
-        canvas_draw_str(canvas, 20, 34, "GND - GND");
-        canvas_draw_str(canvas, 20, 44, "U0R - TX");
-        canvas_draw_str(canvas, 20, 54, "U0T - RX");
-    }
-}
-
-void get_timefilename(FuriString* name) {
-    FuriHalRtcDateTime datetime = {0};
-    furi_hal_rtc_get_datetime(&datetime);
-    furi_string_printf(
-        name,
-        EXT_PATH("DCIM/%.4d%.2d%.2d-%.2d%.2d%.2d.bmp"),
-        datetime.year,
-        datetime.month,
-        datetime.day,
-        datetime.hour,
-        datetime.minute,
-        datetime.second);
-}
-
-static void save_image(void* context) {
-    UartEchoApp* app = context;
-    furi_assert(app);
-
-    NotificationApp* notifications = furi_record_open(RECORD_NOTIFICATION);
-
-    // We need a storage struct (gain accesso to the filesystem API )
-    Storage* storage = furi_record_open(RECORD_STORAGE);
-
-    // storage_file_alloc gives to us a File pointer using the Storage API.
-    File* file = storage_file_alloc(storage);
-
-    if(storage_common_stat(storage, IMAGE_FILE_DIRECTORY_PATH, NULL) == FSE_NOT_EXIST) {
-        storage_simply_mkdir(storage, IMAGE_FILE_DIRECTORY_PATH);
-    }
-
-    // create file name
-    FuriString* file_name = furi_string_alloc();
-    get_timefilename(file_name);
-
-    // this functions open a file, using write access and creates new file if not exist.
-    bool result =
-        storage_file_open(file, furi_string_get_cstr(file_name), FSAM_WRITE, FSOM_OPEN_ALWAYS);
-    //bool result = storage_file_open(file, EXT_PATH("DCIM/test.bmp"), FSAM_WRITE, FSOM_OPEN_ALWAYS);
-    furi_string_free(file_name);
-
-    if(result) {
-        storage_file_write(file, bitmap_header, BITMAP_HEADER_LENGTH);
-        with_view_model(
-            app->view,
-            UartDumpModel * model,
-            {
-                int8_t row_buffer[ROW_BUFFER_LENGTH];
-                for(size_t i = 64; i > 0; --i) {
-                    for(size_t j = 0; j < ROW_BUFFER_LENGTH; ++j) {
-                        row_buffer[j] = model->pixels[((i - 1) * ROW_BUFFER_LENGTH) + j];
-                    }
-                    storage_file_write(file, row_buffer, ROW_BUFFER_LENGTH);
-                }
-            },
-            false);
-    }
-
-    // Closing the "file descriptor"
-    storage_file_close(file);
-
-    // Freeing up memory
-    storage_file_free(file);
-
-    notification_message(notifications, result ? &sequence_success : &sequence_error);
-}
-
-static bool camera_view_input_callback(InputEvent* event, void* context) {
-    if(event->type == InputTypePress) {
-        uint8_t data[1];
-        if(event->key == InputKeyUp) {
-            data[0] = 'C';
-        } else if(event->key == InputKeyDown) {
-            data[0] = 'c';
-        } else if(event->key == InputKeyRight) {
-            data[0] = '>';
-        } else if(event->key == InputKeyLeft) {
-            data[0] = '<';
-        } else if(event->key == InputKeyOk) {
-            save_image(context);
-        }
-        furi_hal_uart_tx(FuriHalUartIdUSART1, data, 1);
-    }
-
-    return false;
-}
-
-static uint32_t camera_exit(void* context) {
-    UNUSED(context);
-    return VIEW_NONE;
-}
-
-static void camera_on_irq_cb(UartIrqEvent ev, uint8_t data, void* context) {
-    furi_assert(context);
-    UartEchoApp* app = context;
-
-    if(ev == UartIrqEventRXNE) {
-        furi_stream_buffer_send(app->rx_stream, &data, 1, 0);
-        furi_thread_flags_set(furi_thread_get_id(app->worker_thread), WorkerEventRx);
-    }
-}
-
-static void process_ringbuffer(UartDumpModel* model, uint8_t byte) {
-    //// 1. Phase: filling the ringbuffer
-    if(model->ringbuffer_index == 0 && byte != 'Y') { // First char has to be 'Y' in the buffer.
-        return;
-    }
-
-    if(model->ringbuffer_index == 1 &&
-       byte != ':') { // Second char has to be ':' in the buffer or reset.
-        model->ringbuffer_index = 0;
-        process_ringbuffer(model, byte);
-        return;
-    }
-
-    model->row_ringbuffer[model->ringbuffer_index] =
-        byte; // Assign current byte to the ringbuffer;
-    ++model->ringbuffer_index; // Increment the ringbuffer index
-
-    if(model->ringbuffer_index < RING_BUFFER_LENGTH) { // Let's wait 'till the buffer fills.
-        return;
-    }
-
-    //// 2. Phase: flushing the ringbuffer to the framebuffer
-    model->ringbuffer_index = 0; // Let's reset the ringbuffer
-    model->initialized = true; // We've successfully established the connection
-    size_t row_start_index =
-        model->row_ringbuffer[2] * ROW_BUFFER_LENGTH; // Third char will determine the row number
-
-    if(row_start_index > LAST_ROW_INDEX) { // Failsafe
-        row_start_index = 0;
-    }
-
-    for(size_t i = 0; i < ROW_BUFFER_LENGTH; ++i) {
-        model->pixels[row_start_index + i] =
-            model->row_ringbuffer[i + 3]; // Writing the remaining 16 bytes into the frame buffer
-    }
-}
-
-static int32_t camera_worker(void* context) {
-    furi_assert(context);
-    UartEchoApp* app = context;
-
-    while(1) {
-        uint32_t events =
-            furi_thread_flags_wait(WORKER_EVENTS_MASK, FuriFlagWaitAny, FuriWaitForever);
-        furi_check((events & FuriFlagError) == 0);
-
-        if(events & WorkerEventStop) break;
-        if(events & WorkerEventRx) {
-            size_t length = 0;
-            do {
-                size_t intended_data_size = 64;
-                uint8_t data[intended_data_size];
-                length = furi_stream_buffer_receive(app->rx_stream, data, intended_data_size, 0);
-
-                if(length > 0) {
-                    //furi_hal_uart_tx(FuriHalUartIdUSART1, data, length);
-                    with_view_model(
-                        app->view,
-                        UartDumpModel * model,
-                        {
-                            for(size_t i = 0; i < length; i++) {
-                                process_ringbuffer(model, data[i]);
-                            }
-                        },
-                        false);
-                }
-            } while(length > 0);
-
-            notification_message(app->notification, &sequence_notification);
-            with_view_model(
-                app->view, UartDumpModel * model, { UNUSED(model); }, true);
-        }
-    }
-
-    return 0;
-}
-
-static UartEchoApp* camera_app_alloc() {
-    UartEchoApp* app = malloc(sizeof(UartEchoApp));
-
-    app->rx_stream = furi_stream_buffer_alloc(2048, 1);
-
-    // Gui
-    app->gui = furi_record_open(RECORD_GUI);
-    app->notification = furi_record_open(RECORD_NOTIFICATION);
-
-    // View dispatcher
-    app->view_dispatcher = view_dispatcher_alloc();
-    view_dispatcher_enable_queue(app->view_dispatcher);
-    view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen);
-
-    // Views
-    app->view = view_alloc();
-    view_set_context(app->view, app);
-    view_set_draw_callback(app->view, camera_view_draw_callback);
-    view_set_input_callback(app->view, camera_view_input_callback);
-    view_allocate_model(app->view, ViewModelTypeLocking, sizeof(UartDumpModel));
-
-    with_view_model(
-        app->view,
-        UartDumpModel * model,
-        {
-            for(size_t i = 0; i < FRAME_BUFFER_LENGTH; i++) {
-                model->pixels[i] = 0;
-            }
-        },
-        true);
-
-    view_set_previous_callback(app->view, camera_exit);
-    view_dispatcher_add_view(app->view_dispatcher, 0, app->view);
-    view_dispatcher_switch_to_view(app->view_dispatcher, 0);
-
-    app->worker_thread = furi_thread_alloc_ex("UsbUartWorker", 2048, camera_worker, app);
-    furi_thread_start(app->worker_thread);
-
-    // Enable uart listener
-    furi_hal_console_disable();
-    furi_hal_uart_set_br(FuriHalUartIdUSART1, 230400);
-    furi_hal_uart_set_irq_cb(FuriHalUartIdUSART1, camera_on_irq_cb, app);
-
-    furi_hal_power_disable_external_3_3v();
-    furi_hal_power_disable_otg();
-    furi_delay_ms(200);
-    furi_hal_power_enable_external_3_3v();
-    furi_hal_power_enable_otg();
-    for(int i = 0; i < 2; i++) {
-        furi_delay_ms(500);
-        furi_hal_uart_tx(FuriHalUartIdUSART1, (uint8_t[1]){'c'}, 1);
-    }
-    furi_delay_ms(1);
-    return app;
-}
-
-static void camera_app_free(UartEchoApp* app) {
-    furi_assert(app);
-
-    furi_hal_console_enable(); // this will also clear IRQ callback so thread is no longer referenced
-
-    furi_thread_flags_set(furi_thread_get_id(app->worker_thread), WorkerEventStop);
-    furi_thread_join(app->worker_thread);
-    furi_thread_free(app->worker_thread);
-
-    // Free views
-    view_dispatcher_remove_view(app->view_dispatcher, 0);
-
-    view_free(app->view);
-    view_dispatcher_free(app->view_dispatcher);
-
-    // Close gui record
-    furi_record_close(RECORD_GUI);
-    furi_record_close(RECORD_NOTIFICATION);
-    app->gui = NULL;
-
-    furi_stream_buffer_free(app->rx_stream);
-
-    // Free rest
-    free(app);
-}
-
-int32_t camera_app(void* p) {
-    UNUSED(p);
-
-    UartEchoApp* app = camera_app_alloc();
-    view_dispatcher_run(app->view_dispatcher);
-    camera_app_free(app);
-
-    furi_hal_power_disable_otg();
-
-    return 0;
-}

+ 0 - 100
apps_source_code/esp32cam_camera/camera.h

@@ -1,100 +0,0 @@
-// TODO
-// (DONE) Fix performance when not being charged
-// (DONE) Add UART command parsing to Esp32
-// (DONE) Prepare application and icon on github
-// (DONE) Write snapshots to SD card
-// 5. Set a constant refresh rate to the Flipper's display
-// 6. Emulate grayscale
-// 7. Photo browser app
-
-#include <furi.h>
-#include <furi_hal.h>
-#include <gui/gui.h>
-#include <gui/icon_i.h>
-#include <notification/notification.h>
-#include <notification/notification_messages.h>
-#include <gui/elements.h>
-#include <furi_hal_uart.h>
-#include <furi_hal_console.h>
-#include <gui/view_dispatcher.h>
-#include <gui/modules/dialog_ex.h>
-#include <storage/filesystem_api_defines.h>
-#include <storage/storage.h>
-
-#define THREAD_ALLOC 2048
-
-#define FRAME_WIDTH 128
-#define FRAME_HEIGTH 64
-#define FRAME_BIT_DEPTH 1
-#define FRAME_BUFFER_LENGTH \
-    (FRAME_WIDTH * FRAME_HEIGTH * FRAME_BIT_DEPTH / 8) // 128*64*1 / 8 = 1024
-#define ROW_BUFFER_LENGTH (FRAME_WIDTH / 8) // 128/8 = 16
-#define LAST_ROW_INDEX (FRAME_BUFFER_LENGTH - ROW_BUFFER_LENGTH) // 1024 - 16 = 1008
-#define RING_BUFFER_LENGTH (ROW_BUFFER_LENGTH + 3) // ROW_BUFFER_LENGTH + Header => 16 + 3 = 19
-#define BITMAP_HEADER_LENGTH 62
-#define IMAGE_FILE_DIRECTORY_PATH EXT_PATH("DCIM")
-
-static const unsigned char bitmap_header[BITMAP_HEADER_LENGTH] = {
-    0x42, 0x4D, 0x3E, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x28, 0x00,
-    0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00};
-
-const uint8_t _I_DolphinCommon_56x48_0[] = {
-    0x01, 0x00, 0xdf, 0x00, 0x00, 0x1f, 0xfe, 0x0e, 0x05, 0x3f, 0x04, 0x06, 0x78, 0x06, 0x30, 0x20,
-    0xf8, 0x00, 0xc6, 0x12, 0x1c, 0x04, 0x0c, 0x0a, 0x38, 0x08, 0x08, 0x0c, 0x60, 0xc0, 0x21, 0xe0,
-    0x04, 0x0a, 0x18, 0x02, 0x1b, 0x00, 0x18, 0xa3, 0x00, 0x21, 0x90, 0x01, 0x8a, 0x20, 0x02, 0x19,
-    0x80, 0x18, 0x80, 0x64, 0x09, 0x20, 0x89, 0x81, 0x8c, 0x3e, 0x41, 0xe2, 0x80, 0x50, 0x00, 0x43,
-    0x08, 0x01, 0x0c, 0xfc, 0x68, 0x40, 0x61, 0xc0, 0x50, 0x30, 0x00, 0x63, 0xa0, 0x7f, 0x80, 0xc4,
-    0x41, 0x19, 0x07, 0xff, 0x02, 0x06, 0x18, 0x24, 0x03, 0x41, 0xf3, 0x2b, 0x10, 0x19, 0x38, 0x10,
-    0x30, 0x31, 0x7f, 0xe0, 0x34, 0x08, 0x30, 0x19, 0x60, 0x80, 0x65, 0x86, 0x0a, 0x4c, 0x0c, 0x30,
-    0x81, 0xb9, 0x41, 0xa0, 0x54, 0x08, 0xc7, 0xe2, 0x06, 0x8a, 0x18, 0x25, 0x02, 0x21, 0x0f, 0x19,
-    0x88, 0xd8, 0x6e, 0x1b, 0x01, 0xd1, 0x1b, 0x86, 0x39, 0x66, 0x3a, 0xa4, 0x1a, 0x50, 0x06, 0x48,
-    0x18, 0x18, 0xd0, 0x03, 0x01, 0x41, 0x98, 0xcc, 0x60, 0x39, 0x01, 0x49, 0x2d, 0x06, 0x03, 0x50,
-    0xf8, 0x40, 0x3e, 0x02, 0xc1, 0x82, 0x86, 0xc7, 0xfe, 0x0f, 0x28, 0x2c, 0x91, 0xd2, 0x90, 0x9a,
-    0x18, 0x19, 0x3e, 0x6d, 0x73, 0x12, 0x16, 0x00, 0x32, 0x49, 0x72, 0xc0, 0x7e, 0x5d, 0x44, 0xba,
-    0x2c, 0x08, 0xa4, 0xc8, 0x82, 0x06, 0x17, 0xe0, 0x81, 0x90, 0x2a, 0x40, 0x61, 0xe1, 0xa2, 0x44,
-    0x0c, 0x76, 0x2b, 0xe8, 0x89, 0x26, 0x43, 0x83, 0x31, 0x8c, 0x78, 0x0c, 0xb0, 0x48, 0x10, 0x1a,
-    0xe0, 0x00, 0x63,
-};
-const uint8_t* const _I_DolphinCommon_56x48[] = {_I_DolphinCommon_56x48_0};
-const Icon I_DolphinCommon_56x48 = {
-    .width = 56,
-    .height = 48,
-    .frame_count = 1,
-    .frame_rate = 0,
-    .frames = _I_DolphinCommon_56x48};
-
-typedef struct UartDumpModel UartDumpModel;
-
-typedef struct {
-    Gui* gui;
-    NotificationApp* notification;
-    ViewDispatcher* view_dispatcher;
-    View* view;
-    FuriThread* worker_thread;
-    FuriStreamBuffer* rx_stream;
-} UartEchoApp;
-
-struct UartDumpModel {
-    uint8_t pixels[FRAME_BUFFER_LENGTH];
-
-    bool initialized;
-    //bool marauderInitialized;
-    uint8_t row_ringbuffer[RING_BUFFER_LENGTH];
-    uint8_t ringbuffer_index;
-};
-
-typedef enum {
-    WorkerEventReserved = (1 << 0), // Reserved for StreamBuffer internal event
-    WorkerEventStop = (1 << 1),
-    WorkerEventRx = (1 << 2),
-} WorkerEventFlags;
-
-#define WORKER_EVENTS_MASK (WorkerEventStop | WorkerEventRx)
-
-const NotificationSequence sequence_notification = {
-    &message_display_backlight_on,
-    &message_delay_10,
-    NULL,
-};

BIN
apps_source_code/esp32cam_camera/icon.png


BIN
apps_source_code/esp32cam_marauder_companion/.flipcorg/banner.png


BIN
apps_source_code/esp32cam_marauder_companion/.flipcorg/gallery/mau1.png


BIN
apps_source_code/esp32cam_marauder_companion/.flipcorg/gallery/mau2.png


BIN
apps_source_code/esp32cam_marauder_companion/.flipcorg/gallery/mau3.png


+ 0 - 13
apps_source_code/esp32cam_marauder_companion/application.fam

@@ -1,13 +0,0 @@
-App(
-    appid="mayhem_marauder",
-    name="[MAYHEM] Marauder",
-    apptype=FlipperAppType.EXTERNAL,
-    entry_point="wifi_marauder_app",
-    cdefines=["APP_WIFI_MARAUDER"],
-    requires=["gui"],
-    stack_size=4 * 1024,
-    order=2,
-    fap_icon="wifi_10px.png",
-    fap_category="GPIO",
-    fap_description="ESP32-CAM version of Marauder. Includes all functionality from the original plus some options to trigger the camera and flashlight. [Unplug the USB cable to test with Mayhem]",
-)

+ 0 - 30
apps_source_code/esp32cam_marauder_companion/scenes/wifi_marauder_scene.c

@@ -1,30 +0,0 @@
-#include "wifi_marauder_scene.h"
-
-// Generate scene on_enter handlers array
-#define ADD_SCENE(prefix, name, id) prefix##_scene_##name##_on_enter,
-void (*const wifi_marauder_scene_on_enter_handlers[])(void*) = {
-#include "wifi_marauder_scene_config.h"
-};
-#undef ADD_SCENE
-
-// Generate scene on_event handlers array
-#define ADD_SCENE(prefix, name, id) prefix##_scene_##name##_on_event,
-bool (*const wifi_marauder_scene_on_event_handlers[])(void* context, SceneManagerEvent event) = {
-#include "wifi_marauder_scene_config.h"
-};
-#undef ADD_SCENE
-
-// Generate scene on_exit handlers array
-#define ADD_SCENE(prefix, name, id) prefix##_scene_##name##_on_exit,
-void (*const wifi_marauder_scene_on_exit_handlers[])(void* context) = {
-#include "wifi_marauder_scene_config.h"
-};
-#undef ADD_SCENE
-
-// Initialize scene handlers configuration structure
-const SceneManagerHandlers wifi_marauder_scene_handlers = {
-    .on_enter_handlers = wifi_marauder_scene_on_enter_handlers,
-    .on_event_handlers = wifi_marauder_scene_on_event_handlers,
-    .on_exit_handlers = wifi_marauder_scene_on_exit_handlers,
-    .scene_num = WifiMarauderSceneNum,
-};

+ 0 - 29
apps_source_code/esp32cam_marauder_companion/scenes/wifi_marauder_scene.h

@@ -1,29 +0,0 @@
-#pragma once
-
-#include <gui/scene_manager.h>
-
-// Generate scene id and total number
-#define ADD_SCENE(prefix, name, id) WifiMarauderScene##id,
-typedef enum {
-#include "wifi_marauder_scene_config.h"
-    WifiMarauderSceneNum,
-} WifiMarauderScene;
-#undef ADD_SCENE
-
-extern const SceneManagerHandlers wifi_marauder_scene_handlers;
-
-// Generate scene on_enter handlers declaration
-#define ADD_SCENE(prefix, name, id) void prefix##_scene_##name##_on_enter(void*);
-#include "wifi_marauder_scene_config.h"
-#undef ADD_SCENE
-
-// Generate scene on_event handlers declaration
-#define ADD_SCENE(prefix, name, id) \
-    bool prefix##_scene_##name##_on_event(void* context, SceneManagerEvent event);
-#include "wifi_marauder_scene_config.h"
-#undef ADD_SCENE
-
-// Generate scene on_exit handlers declaration
-#define ADD_SCENE(prefix, name, id) void prefix##_scene_##name##_on_exit(void* context);
-#include "wifi_marauder_scene_config.h"
-#undef ADD_SCENE

+ 0 - 5
apps_source_code/esp32cam_marauder_companion/scenes/wifi_marauder_scene_config.h

@@ -1,5 +0,0 @@
-ADD_SCENE(wifi_marauder, start, Start)
-ADD_SCENE(wifi_marauder, console_output, ConsoleOutput)
-ADD_SCENE(wifi_marauder, text_input, TextInput)
-ADD_SCENE(wifi_marauder, settings_init, SettingsInit)
-ADD_SCENE(wifi_marauder, log_viewer, LogViewer)

+ 0 - 134
apps_source_code/esp32cam_marauder_companion/scenes/wifi_marauder_scene_console_output.c

@@ -1,134 +0,0 @@
-#include "../wifi_marauder_app_i.h"
-
-void wifi_marauder_console_output_handle_rx_data_cb(uint8_t* buf, size_t len, void* context) {
-    furi_assert(context);
-    WifiMarauderApp* app = context;
-
-    if(app->is_writing_log) {
-        app->has_saved_logs_this_session = true;
-        storage_file_write(app->log_file, buf, len);
-    }
-
-    // If text box store gets too big, then truncate it
-    app->text_box_store_strlen += len;
-    if(app->text_box_store_strlen >= WIFI_MARAUDER_TEXT_BOX_STORE_SIZE - 1) {
-        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
-    buf[len] = '\0';
-    furi_string_cat_printf(app->text_box_store, "%s", buf);
-    view_dispatcher_send_custom_event(app->view_dispatcher, WifiMarauderEventRefreshConsoleOutput);
-}
-
-void wifi_marauder_console_output_handle_rx_packets_cb(uint8_t* buf, size_t len, void* context) {
-    furi_assert(context);
-    WifiMarauderApp* app = context;
-
-    if(app->is_writing_pcap) {
-        storage_file_write(app->capture_file, buf, len);
-    }
-}
-
-void wifi_marauder_scene_console_output_on_enter(void* context) {
-    WifiMarauderApp* app = context;
-
-    TextBox* text_box = app->text_box;
-    text_box_reset(app->text_box);
-    text_box_set_font(text_box, TextBoxFontText);
-    if(app->focus_console_start) {
-        text_box_set_focus(text_box, TextBoxFocusStart);
-    } else {
-        text_box_set_focus(text_box, TextBoxFocusEnd);
-    }
-    if(app->is_command) {
-        furi_string_reset(app->text_box_store);
-        app->text_box_store_strlen = 0;
-        if(0 == strncmp("help", app->selected_tx_string, strlen("help"))) {
-            const char* help_msg = "Marauder companion " WIFI_MARAUDER_APP_VERSION "\n";
-            furi_string_cat_str(app->text_box_store, help_msg);
-            app->text_box_store_strlen += strlen(help_msg);
-        }
-
-        if(app->show_stopscan_tip) {
-            const char* help_msg = "Press BACK to send stopscan\n";
-            furi_string_cat_str(app->text_box_store, help_msg);
-            app->text_box_store_strlen += strlen(help_msg);
-        }
-    }
-
-    // Set starting text - for "View Log from end", this will just be what was already in the 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);
-    view_dispatcher_switch_to_view(app->view_dispatcher, WifiMarauderAppViewConsoleOutput);
-
-    // Register callback to receive data
-    wifi_marauder_uart_set_handle_rx_data_cb(
-        app->uart,
-        wifi_marauder_console_output_handle_rx_data_cb); // setup callback for general log rx thread
-    wifi_marauder_uart_set_handle_rx_data_cb(
-        app->lp_uart,
-        wifi_marauder_console_output_handle_rx_packets_cb); // setup callback for packets rx thread
-
-    // Get ready to send command
-    if(app->is_command && app->selected_tx_string) {
-        // Create files *before* sending command
-        // (it takes time to iterate through the directory)
-        if(app->ok_to_save_logs) {
-            app->is_writing_log = true;
-            wifi_marauder_create_log_file(app);
-        }
-
-        // If it is a sniff function, open the pcap file for recording
-        if(app->ok_to_save_pcaps &&
-           strncmp("sniff", app->selected_tx_string, strlen("sniff")) == 0) {
-            app->is_writing_pcap = true;
-            wifi_marauder_create_pcap_file(app);
-        }
-
-        // Send command with newline '\n'
-        wifi_marauder_uart_tx(
-            (uint8_t*)(app->selected_tx_string), strlen(app->selected_tx_string));
-        wifi_marauder_uart_tx((uint8_t*)("\n"), 1);
-    }
-}
-
-bool wifi_marauder_scene_console_output_on_event(void* context, SceneManagerEvent event) {
-    WifiMarauderApp* app = context;
-
-    bool consumed = false;
-
-    if(event.type == SceneManagerEventTypeCustom) {
-        text_box_set_text(app->text_box, furi_string_get_cstr(app->text_box_store));
-        consumed = true;
-    } else if(event.type == SceneManagerEventTypeTick) {
-        consumed = true;
-    }
-
-    return consumed;
-}
-
-void wifi_marauder_scene_console_output_on_exit(void* context) {
-    WifiMarauderApp* app = context;
-
-    // Unregister rx callback
-    wifi_marauder_uart_set_handle_rx_data_cb(app->uart, NULL);
-    wifi_marauder_uart_set_handle_rx_data_cb(app->lp_uart, NULL);
-
-    // Automatically stop the scan when exiting view
-    if(app->is_command) {
-        wifi_marauder_uart_tx((uint8_t*)("stopscan\n"), strlen("stopscan\n"));
-    }
-
-    app->is_writing_pcap = false;
-    if(app->capture_file && storage_file_is_open(app->capture_file)) {
-        storage_file_close(app->capture_file);
-    }
-
-    app->is_writing_log = false;
-    if(app->log_file && storage_file_is_open(app->log_file)) {
-        storage_file_close(app->log_file);
-    }
-}

+ 0 - 185
apps_source_code/esp32cam_marauder_companion/scenes/wifi_marauder_scene_log_viewer.c

@@ -1,185 +0,0 @@
-#include "../wifi_marauder_app_i.h"
-
-void wifi_marauder_scene_log_viewer_widget_callback(
-    GuiButtonType result,
-    InputType type,
-    void* context) {
-    WifiMarauderApp* app = context;
-    if(type == InputTypeShort) {
-        view_dispatcher_send_custom_event(app->view_dispatcher, result);
-    }
-}
-
-static void _read_log_page_into_text_store(WifiMarauderApp* app) {
-    char temp[64 + 1];
-    storage_file_seek(
-        app->log_file, WIFI_MARAUDER_TEXT_BOX_STORE_SIZE * (app->open_log_file_page - 1), true);
-    furi_string_reset(app->text_box_store);
-    for(uint16_t i = 0; i < (WIFI_MARAUDER_TEXT_BOX_STORE_SIZE / (sizeof(temp) - 1)); i++) {
-        uint16_t num_bytes = storage_file_read(app->log_file, temp, sizeof(temp) - 1);
-        if(num_bytes == 0) {
-            break;
-        }
-        temp[num_bytes] = '\0';
-        furi_string_cat_str(app->text_box_store, temp);
-    }
-}
-
-void wifi_marauder_scene_log_viewer_setup_widget(WifiMarauderApp* app, bool called_from_browse) {
-    Widget* widget = app->widget;
-    bool is_open = storage_file_is_open(app->log_file);
-    bool should_open_log = (app->has_saved_logs_this_session || called_from_browse);
-    if(is_open) {
-        _read_log_page_into_text_store(app);
-    } else if(
-        should_open_log &&
-        storage_file_open(app->log_file, app->log_file_path, FSAM_READ, FSOM_OPEN_EXISTING)) {
-        uint64_t filesize = storage_file_size(app->log_file);
-        app->open_log_file_num_pages = filesize / WIFI_MARAUDER_TEXT_BOX_STORE_SIZE;
-        int extra_page = (filesize % WIFI_MARAUDER_TEXT_BOX_STORE_SIZE != 0) ? 1 : 0;
-        app->open_log_file_num_pages = (filesize / WIFI_MARAUDER_TEXT_BOX_STORE_SIZE) + extra_page;
-        app->open_log_file_page = 1;
-        _read_log_page_into_text_store(app);
-    } else {
-        app->open_log_file_page = 0;
-        app->open_log_file_num_pages = 0;
-    }
-
-    widget_reset(widget);
-
-    if(furi_string_empty(app->text_box_store)) {
-        char help_msg[256];
-        snprintf(
-            help_msg,
-            sizeof(help_msg),
-            "The log is empty! :(\nTry sending a command?\n\nSaving pcaps to flipper sdcard: %s\nSaving logs to flipper sdcard: %s",
-            app->ok_to_save_pcaps ? "ON" : "OFF",
-            app->ok_to_save_logs ? "ON" : "OFF");
-        furi_string_set_str(app->text_box_store, help_msg);
-    }
-
-    widget_add_text_scroll_element(
-        widget, 0, 0, 128, 53, furi_string_get_cstr(app->text_box_store));
-
-    if(1 < app->open_log_file_page && app->open_log_file_page < app->open_log_file_num_pages) {
-        // hide "Browse" text for middle pages
-        widget_add_button_element(
-            widget, GuiButtonTypeCenter, "", wifi_marauder_scene_log_viewer_widget_callback, app);
-    } else {
-        // only show "Browse" text on first and last page
-        widget_add_button_element(
-            widget,
-            GuiButtonTypeCenter,
-            "Browse",
-            wifi_marauder_scene_log_viewer_widget_callback,
-            app);
-    }
-
-    char pagecounter[100];
-    snprintf(
-        pagecounter,
-        sizeof(pagecounter),
-        "%d/%d",
-        app->open_log_file_page,
-        app->open_log_file_num_pages);
-    if(app->open_log_file_page > 1) {
-        if(app->open_log_file_page == app->open_log_file_num_pages) {
-            // only show left side page-count on last page
-            widget_add_button_element(
-                widget,
-                GuiButtonTypeLeft,
-                pagecounter,
-                wifi_marauder_scene_log_viewer_widget_callback,
-                app);
-        } else {
-            widget_add_button_element(
-                widget, GuiButtonTypeLeft, "", wifi_marauder_scene_log_viewer_widget_callback, app);
-        }
-    }
-    if(app->open_log_file_page < app->open_log_file_num_pages) {
-        widget_add_button_element(
-            widget,
-            GuiButtonTypeRight,
-            pagecounter,
-            wifi_marauder_scene_log_viewer_widget_callback,
-            app);
-    }
-}
-
-void wifi_marauder_scene_log_viewer_on_enter(void* context) {
-    WifiMarauderApp* app = context;
-
-    app->open_log_file_page = 0;
-    app->open_log_file_num_pages = 0;
-    bool saved_logs_exist = false;
-    if(!app->has_saved_logs_this_session && furi_string_empty(app->text_box_store)) {
-        // no commands sent yet this session, find last saved log
-        if(storage_dir_open(app->log_file, MARAUDER_APP_FOLDER_LOGS)) {
-            char name[70];
-            char lastname[70];
-            while(storage_dir_read(app->log_file, NULL, name, sizeof(name))) {
-                // keep reading directory until last file is reached
-                strlcpy(lastname, name, sizeof(lastname));
-                saved_logs_exist = true;
-            }
-            if(saved_logs_exist) {
-                snprintf(
-                    app->log_file_path,
-                    sizeof(app->log_file_path),
-                    "%s/%s",
-                    MARAUDER_APP_FOLDER_LOGS,
-                    lastname);
-            }
-        }
-        storage_dir_close(app->log_file);
-    }
-
-    wifi_marauder_scene_log_viewer_setup_widget(app, saved_logs_exist);
-
-    view_dispatcher_switch_to_view(app->view_dispatcher, WifiMarauderAppViewWidget);
-}
-
-bool wifi_marauder_scene_log_viewer_on_event(void* context, SceneManagerEvent event) {
-    WifiMarauderApp* app = context;
-    bool consumed = false;
-
-    if(event.type == SceneManagerEventTypeCustom) {
-        if(event.event == GuiButtonTypeCenter) {
-            // Browse
-            FuriString* predefined_filepath = furi_string_alloc_set_str(MARAUDER_APP_FOLDER_LOGS);
-            FuriString* selected_filepath = furi_string_alloc();
-            if(dialog_file_browser_show(
-                   app->dialogs, selected_filepath, predefined_filepath, NULL)) {
-                strncpy(
-                    app->log_file_path,
-                    furi_string_get_cstr(selected_filepath),
-                    sizeof(app->log_file_path));
-                if(storage_file_is_open(app->log_file)) {
-                    storage_file_close(app->log_file);
-                }
-                wifi_marauder_scene_log_viewer_setup_widget(app, true);
-            }
-            furi_string_free(selected_filepath);
-            furi_string_free(predefined_filepath);
-            consumed = true;
-        } else if(event.event == GuiButtonTypeRight) {
-            // Advance page
-            ++app->open_log_file_page;
-            wifi_marauder_scene_log_viewer_setup_widget(app, false);
-        } else if(event.event == GuiButtonTypeLeft) {
-            // Previous page
-            --app->open_log_file_page;
-            wifi_marauder_scene_log_viewer_setup_widget(app, false);
-        }
-    }
-
-    return consumed;
-}
-
-void wifi_marauder_scene_log_viewer_on_exit(void* context) {
-    WifiMarauderApp* app = context;
-    widget_reset(app->widget);
-    if(storage_file_is_open(app->log_file)) {
-        storage_file_close(app->log_file);
-    }
-}

+ 0 - 130
apps_source_code/esp32cam_marauder_companion/scenes/wifi_marauder_scene_settings_init.c

@@ -1,130 +0,0 @@
-#include "../wifi_marauder_app_i.h"
-
-const char* Y = "Y";
-const char* N = "N";
-
-#define PROMPT_PCAPS 0
-#define PROMPT_LOGS 1
-
-void wifi_marauder_scene_settings_init_widget_callback(
-    GuiButtonType result,
-    InputType type,
-    void* context) {
-    WifiMarauderApp* app = context;
-    if(type == InputTypeShort) {
-        view_dispatcher_send_custom_event(app->view_dispatcher, result);
-    }
-}
-
-void wifi_marauder_scene_settings_init_setup_widget(WifiMarauderApp* app) {
-    Widget* widget = app->widget;
-
-    widget_reset(widget);
-
-    widget_add_button_element(
-        widget, GuiButtonTypeLeft, "No", wifi_marauder_scene_settings_init_widget_callback, app);
-    widget_add_button_element(
-        widget, GuiButtonTypeRight, "Yes", wifi_marauder_scene_settings_init_widget_callback, app);
-
-    if(app->which_prompt == PROMPT_PCAPS) {
-        widget_add_string_element(widget, 0, 0, AlignLeft, AlignTop, FontPrimary, "Save pcaps?");
-        widget_add_text_scroll_element(
-            widget,
-            0,
-            12,
-            128,
-            38,
-            "With compatible marauder\nfirmware, you can choose to\nsave captures (pcaps) to the\nflipper sd card here:\n" MARAUDER_APP_FOLDER_USER_PCAPS
-            "\n\nYou can change this setting in the app at any time. Would\nyou like to enable this feature now?");
-    } else {
-        widget_add_string_element(widget, 0, 0, AlignLeft, AlignTop, FontPrimary, "Save logs?");
-        widget_add_text_scroll_element(
-            widget,
-            0,
-            12,
-            128,
-            38,
-            "This app supports saving text\nlogs of console output to the\nflipper sd card here:\n" MARAUDER_APP_FOLDER_USER_LOGS
-            "\n\nYou can change this setting in the app at any time. Would\nyou like to enable this feature now?");
-    }
-}
-
-void wifi_marauder_scene_settings_init_on_enter(void* context) {
-    WifiMarauderApp* app = context;
-
-    app->which_prompt = PROMPT_PCAPS;
-    wifi_marauder_scene_settings_init_setup_widget(app);
-
-    view_dispatcher_switch_to_view(app->view_dispatcher, WifiMarauderAppViewWidget);
-}
-
-bool wifi_marauder_scene_settings_init_on_event(void* context, SceneManagerEvent event) {
-    WifiMarauderApp* app = context;
-    bool consumed = false;
-
-    if(event.type == SceneManagerEventTypeCustom) {
-        // get which button press: "Yes" or "No"
-        if(event.event == GuiButtonTypeRight) {
-            // Yes
-            if(app->which_prompt == PROMPT_PCAPS) {
-                app->ok_to_save_pcaps = true;
-            } else {
-                app->ok_to_save_logs = true;
-            }
-        } else if(event.event == GuiButtonTypeLeft) {
-            // No
-            if(app->which_prompt == PROMPT_PCAPS) {
-                app->ok_to_save_pcaps = false;
-            } else {
-                app->ok_to_save_logs = false;
-            }
-        }
-
-        // save setting to file, load next widget or scene
-        if(app->which_prompt == PROMPT_PCAPS) {
-            if(storage_file_open(
-                   app->save_pcap_setting_file,
-                   SAVE_PCAP_SETTING_FILEPATH,
-                   FSAM_WRITE,
-                   FSOM_CREATE_ALWAYS)) {
-                const char* ok = app->ok_to_save_pcaps ? Y : N;
-                storage_file_write(app->save_pcap_setting_file, ok, sizeof(ok));
-            } else {
-                dialog_message_show_storage_error(app->dialogs, "Cannot save settings");
-            }
-            storage_file_close(app->save_pcap_setting_file);
-            // same scene, different-looking widget
-            app->which_prompt = PROMPT_LOGS;
-            wifi_marauder_scene_settings_init_setup_widget(app);
-        } else {
-            if(storage_file_open(
-                   app->save_logs_setting_file,
-                   SAVE_LOGS_SETTING_FILEPATH,
-                   FSAM_WRITE,
-                   FSOM_CREATE_ALWAYS)) {
-                const char* ok = app->ok_to_save_logs ? Y : N;
-                storage_file_write(app->save_logs_setting_file, ok, sizeof(ok));
-            } else {
-                dialog_message_show_storage_error(app->dialogs, "Cannot save settings");
-            }
-            storage_file_close(app->save_logs_setting_file);
-            // go back to start scene (main menu)
-            app->need_to_prompt_settings_init = false;
-            scene_manager_previous_scene(app->scene_manager);
-        }
-        consumed = true;
-    }
-
-    return consumed;
-}
-
-void wifi_marauder_scene_settings_init_on_exit(void* context) {
-    WifiMarauderApp* app = context;
-    widget_reset(app->widget);
-    if(storage_file_is_open(app->save_pcap_setting_file)) {
-        storage_file_close(app->save_pcap_setting_file);
-    }
-    if(storage_file_is_open(app->save_logs_setting_file)) {
-        storage_file_close(app->save_logs_setting_file);
-    }
-}

+ 0 - 269
apps_source_code/esp32cam_marauder_companion/scenes/wifi_marauder_scene_start.c

@@ -1,269 +0,0 @@
-//** Includes sniffbt and sniffskim for compatible ESP32-WROOM hardware.
-//wifi_marauder_app_i.h also changed **//
-#include "../wifi_marauder_app_i.h"
-
-// For each command, define whether additional arguments are needed
-// (enabling text input to fill them out), and whether the console
-// text box should focus at the start of the output or the end
-typedef enum { NO_ARGS = 0, INPUT_ARGS, TOGGLE_ARGS } InputArgs;
-
-typedef enum { FOCUS_CONSOLE_END = 0, FOCUS_CONSOLE_START, FOCUS_CONSOLE_TOGGLE } FocusConsole;
-
-#define SHOW_STOPSCAN_TIP (true)
-#define NO_TIP (false)
-
-#define MAX_OPTIONS (9)
-typedef struct {
-    const char* item_string;
-    const char* options_menu[MAX_OPTIONS];
-    int num_options_menu;
-    const char* actual_commands[MAX_OPTIONS];
-    InputArgs needs_keyboard;
-    FocusConsole focus_console;
-    bool show_stopscan_tip;
-} WifiMarauderItem;
-
-// NUM_MENU_ITEMS defined in wifi_marauder_app_i.h - if you add an entry here, increment it!
-const WifiMarauderItem items[NUM_MENU_ITEMS] = {
-    {"View Log from", {"start", "end"}, 2, {"", ""}, NO_ARGS, FOCUS_CONSOLE_TOGGLE, NO_TIP},
-    {"Scan",
-     {"ap", "station"},
-     2,
-     {"scanap", "scansta"},
-     NO_ARGS,
-     FOCUS_CONSOLE_END,
-     SHOW_STOPSCAN_TIP},
-    {"SSID",
-     {"add rand", "add name", "remove"},
-     3,
-     {"ssid -a -g", "ssid -a -n", "ssid -r"},
-     INPUT_ARGS,
-     FOCUS_CONSOLE_START,
-     NO_TIP},
-    {"List",
-     {"ap", "ssid", "station"},
-     3,
-     {"list -a", "list -s", "list -c"},
-     NO_ARGS,
-     FOCUS_CONSOLE_START,
-     NO_TIP},
-    {"Select",
-     {"ap", "ssid", "station"},
-     3,
-     {"select -a", "select -s", "select -c"},
-     INPUT_ARGS,
-     FOCUS_CONSOLE_END,
-     NO_TIP},
-    {"Clear List",
-     {"ap", "ssid", "station"},
-     3,
-     {"clearlist -a", "clearlist -s", "clearlist -c"},
-     NO_ARGS,
-     FOCUS_CONSOLE_END,
-     NO_TIP},
-    {"Attack",
-     {"deauth", "probe", "rickroll"},
-     3,
-     {"attack -t deauth", "attack -t probe", "attack -t rickroll"},
-     NO_ARGS,
-     FOCUS_CONSOLE_END,
-     SHOW_STOPSCAN_TIP},
-    {"Targeted Deauth",
-     {"station", "manual"},
-     2,
-     {"attack -t deauth -c", "attack -t deauth -s"},
-     TOGGLE_ARGS,
-     FOCUS_CONSOLE_END,
-     SHOW_STOPSCAN_TIP},
-    {"Beacon Spam",
-     {"ap list", "ssid list", "random"},
-     3,
-     {"attack -t beacon -a", "attack -t beacon -l", "attack -t beacon -r"},
-     NO_ARGS,
-     FOCUS_CONSOLE_END,
-     SHOW_STOPSCAN_TIP},
-    {"Sniff",
-     {"beacon", "deauth", "esp", "pmkid", "probe", "pwn", "raw", "bt", "skim"},
-     9,
-     {"sniffbeacon",
-      "sniffdeauth",
-      "sniffesp",
-      "sniffpmkid",
-      "sniffprobe",
-      "sniffpwn",
-      "sniffraw",
-      "sniffbt",
-      "sniffskim"},
-     NO_ARGS,
-     FOCUS_CONSOLE_END,
-     SHOW_STOPSCAN_TIP},
-    {"Sniff PMKID on channel",
-     {""},
-     1,
-     {"sniffpmkid -c"},
-     INPUT_ARGS,
-     FOCUS_CONSOLE_END,
-     SHOW_STOPSCAN_TIP},
-    {"Channel",
-     {"get", "set"},
-     2,
-     {"channel", "channel -s"},
-     TOGGLE_ARGS,
-     FOCUS_CONSOLE_END,
-     NO_TIP},
-    {"Camera",
-     {"photo", "flashlight"},
-     2,
-     {"photo", "flashlight"},
-     NO_ARGS,
-     FOCUS_CONSOLE_END,
-     NO_TIP},
-    {"Settings",
-     {"display", "restore", "ForcePMKID", "ForceProbe", "SavePCAP", "EnableLED", "other"},
-     7,
-     {"settings",
-      "settings -r",
-      "settings -s ForcePMKID enable",
-      "settings -s ForceProbe enable",
-      "settings -s SavePCAP enable",
-      "settings -s EnableLED enable",
-      "settings -s"},
-     TOGGLE_ARGS,
-     FOCUS_CONSOLE_START,
-     NO_TIP},
-    {"Update", {"ota", "sd"}, 2, {"update -w", "update -s"}, NO_ARGS, FOCUS_CONSOLE_END, NO_TIP},
-    {"Reboot", {""}, 1, {"reboot"}, NO_ARGS, FOCUS_CONSOLE_END, NO_TIP},
-    {"Help", {""}, 1, {"help"}, NO_ARGS, FOCUS_CONSOLE_START, SHOW_STOPSCAN_TIP},
-    {"Save to flipper sdcard", // keep as last entry or change logic in callback below
-     {""},
-     1,
-     {""},
-     NO_ARGS,
-     FOCUS_CONSOLE_START,
-     NO_TIP},
-};
-
-static void wifi_marauder_scene_start_var_list_enter_callback(void* context, uint32_t index) {
-    furi_assert(context);
-    WifiMarauderApp* app = context;
-
-    furi_assert(index < NUM_MENU_ITEMS);
-    const WifiMarauderItem* item = &items[index];
-
-    if(index == NUM_MENU_ITEMS - 1) {
-        // "Save to flipper sdcard" special case - start SettingsInit widget
-        view_dispatcher_send_custom_event(
-            app->view_dispatcher, WifiMarauderEventStartSettingsInit);
-        return;
-    }
-
-    const int selected_option_index = app->selected_option_index[index];
-    furi_assert(selected_option_index < item->num_options_menu);
-    app->selected_tx_string = item->actual_commands[selected_option_index];
-    app->is_command = (1 <= index);
-    app->is_custom_tx_string = false;
-    app->selected_menu_index = index;
-    app->focus_console_start = (item->focus_console == FOCUS_CONSOLE_TOGGLE) ?
-                                   (selected_option_index == 0) :
-                                   item->focus_console;
-    app->show_stopscan_tip = item->show_stopscan_tip;
-
-    if(!app->is_command && selected_option_index == 0) {
-        // View Log from start
-        view_dispatcher_send_custom_event(app->view_dispatcher, WifiMarauderEventStartLogViewer);
-        return;
-    }
-
-    bool needs_keyboard = (item->needs_keyboard == TOGGLE_ARGS) ? (selected_option_index != 0) :
-                                                                  item->needs_keyboard;
-    if(needs_keyboard) {
-        view_dispatcher_send_custom_event(app->view_dispatcher, WifiMarauderEventStartKeyboard);
-    } else {
-        view_dispatcher_send_custom_event(app->view_dispatcher, WifiMarauderEventStartConsole);
-    }
-}
-
-static void wifi_marauder_scene_start_var_list_change_callback(VariableItem* item) {
-    furi_assert(item);
-
-    WifiMarauderApp* app = variable_item_get_context(item);
-    furi_assert(app);
-
-    const WifiMarauderItem* menu_item = &items[app->selected_menu_index];
-    uint8_t item_index = variable_item_get_current_value_index(item);
-    furi_assert(item_index < menu_item->num_options_menu);
-    variable_item_set_current_value_text(item, menu_item->options_menu[item_index]);
-    app->selected_option_index[app->selected_menu_index] = item_index;
-}
-
-void wifi_marauder_scene_start_on_enter(void* context) {
-    WifiMarauderApp* app = context;
-    VariableItemList* var_item_list = app->var_item_list;
-
-    variable_item_list_set_enter_callback(
-        var_item_list, wifi_marauder_scene_start_var_list_enter_callback, app);
-
-    VariableItem* item;
-    for(int i = 0; i < NUM_MENU_ITEMS; ++i) {
-        item = variable_item_list_add(
-            var_item_list,
-            items[i].item_string,
-            items[i].num_options_menu,
-            wifi_marauder_scene_start_var_list_change_callback,
-            app);
-        variable_item_set_current_value_index(item, app->selected_option_index[i]);
-        variable_item_set_current_value_text(
-            item, items[i].options_menu[app->selected_option_index[i]]);
-    }
-
-    variable_item_list_set_selected_item(
-        var_item_list, scene_manager_get_scene_state(app->scene_manager, WifiMarauderSceneStart));
-
-    view_dispatcher_switch_to_view(app->view_dispatcher, WifiMarauderAppViewVarItemList);
-
-    // Wait, if the user hasn't initialized sdcard settings, let's prompt them once (then come back here)
-    if(app->need_to_prompt_settings_init) {
-        scene_manager_next_scene(app->scene_manager, WifiMarauderSceneSettingsInit);
-    }
-}
-
-bool wifi_marauder_scene_start_on_event(void* context, SceneManagerEvent event) {
-    UNUSED(context);
-    WifiMarauderApp* app = context;
-    bool consumed = false;
-
-    if(event.type == SceneManagerEventTypeCustom) {
-        if(event.event == WifiMarauderEventStartKeyboard) {
-            scene_manager_set_scene_state(
-                app->scene_manager, WifiMarauderSceneStart, app->selected_menu_index);
-            scene_manager_next_scene(app->scene_manager, WifiMarauderSceneTextInput);
-        } else if(event.event == WifiMarauderEventStartConsole) {
-            scene_manager_set_scene_state(
-                app->scene_manager, WifiMarauderSceneStart, app->selected_menu_index);
-            scene_manager_next_scene(app->scene_manager, WifiMarauderSceneConsoleOutput);
-        } else if(event.event == WifiMarauderEventStartSettingsInit) {
-            scene_manager_set_scene_state(
-                app->scene_manager, WifiMarauderSceneStart, app->selected_menu_index);
-            scene_manager_next_scene(app->scene_manager, WifiMarauderSceneSettingsInit);
-        } else if(event.event == WifiMarauderEventStartLogViewer) {
-            scene_manager_set_scene_state(
-                app->scene_manager, WifiMarauderSceneStart, app->selected_menu_index);
-            scene_manager_next_scene(app->scene_manager, WifiMarauderSceneLogViewer);
-        }
-        consumed = true;
-    } else if(event.type == SceneManagerEventTypeTick) {
-        app->selected_menu_index = variable_item_list_get_selected_item_index(app->var_item_list);
-        consumed = true;
-    } else if(event.type == SceneManagerEventTypeBack) {
-        scene_manager_stop(app->scene_manager);
-        view_dispatcher_stop(app->view_dispatcher);
-        consumed = true;
-    }
-
-    return consumed;
-}
-
-void wifi_marauder_scene_start_on_exit(void* context) {
-    WifiMarauderApp* app = context;
-    variable_item_list_reset(app->var_item_list);
-}

+ 0 - 154
apps_source_code/esp32cam_marauder_companion/scenes/wifi_marauder_scene_text_input.c

@@ -1,154 +0,0 @@
-#include "../wifi_marauder_app_i.h"
-
-void wifi_marauder_scene_text_input_callback(void* context) {
-    WifiMarauderApp* app = context;
-
-    switch(app->special_case_input_step) {
-    case 0: // most commands
-        view_dispatcher_send_custom_event(app->view_dispatcher, WifiMarauderEventStartConsole);
-        break;
-    case 1: // special case for deauth: save source MAC
-        view_dispatcher_send_custom_event(app->view_dispatcher, WifiMarauderEventSaveSourceMac);
-        break;
-    case 2: // special case for deauth: save destination MAC
-        view_dispatcher_send_custom_event(
-            app->view_dispatcher, WifiMarauderEventSaveDestinationMac);
-        break;
-    default:
-        break;
-    }
-}
-
-void wifi_marauder_scene_text_input_on_enter(void* context) {
-    WifiMarauderApp* app = context;
-
-    if(0 ==
-       strncmp("attack -t deauth -s", app->selected_tx_string, strlen("attack -t deauth -s"))) {
-        // Special case for manual deauth input
-        app->special_case_input_step = 1;
-        bzero(app->text_input_store, WIFI_MARAUDER_TEXT_INPUT_STORE_SIZE);
-    } else if(false == app->is_custom_tx_string) {
-        // Most commands
-        app->special_case_input_step = 0;
-
-        // Fill text input with selected string so that user can add to it
-        size_t length = strlen(app->selected_tx_string);
-        furi_assert(length < WIFI_MARAUDER_TEXT_INPUT_STORE_SIZE);
-        bzero(app->text_input_store, WIFI_MARAUDER_TEXT_INPUT_STORE_SIZE);
-        strncpy(app->text_input_store, app->selected_tx_string, length);
-
-        // Add space - because flipper keyboard currently doesn't have a space
-        app->text_input_store[length] = ' ';
-        app->text_input_store[length + 1] = '\0';
-        app->is_custom_tx_string = true;
-    }
-
-    // Setup view
-    TextInput* text_input = app->text_input;
-    // Add help message to header
-    if(app->special_case_input_step == 1) {
-        text_input_set_header_text(text_input, "Enter source MAC");
-    } else if(0 == strncmp("ssid -a -g", app->selected_tx_string, strlen("ssid -a -g"))) {
-        text_input_set_header_text(text_input, "Enter # SSIDs to generate");
-    } else if(0 == strncmp("ssid -a -n", app->selected_tx_string, strlen("ssid -a -n"))) {
-        text_input_set_header_text(text_input, "Enter SSID name to add");
-    } else if(0 == strncmp("ssid -r", app->selected_tx_string, strlen("ssid -r"))) {
-        text_input_set_header_text(text_input, "Remove target from SSID list");
-    } else if(0 == strncmp("select -a", app->selected_tx_string, strlen("select -a"))) {
-        text_input_set_header_text(text_input, "Add target from AP list");
-    } else if(0 == strncmp("select -s", app->selected_tx_string, strlen("select -s"))) {
-        text_input_set_header_text(text_input, "Add target from SSID list");
-    } else {
-        text_input_set_header_text(text_input, "Add command arguments");
-    }
-    text_input_set_result_callback(
-        text_input,
-        wifi_marauder_scene_text_input_callback,
-        app,
-        app->text_input_store,
-        WIFI_MARAUDER_TEXT_INPUT_STORE_SIZE,
-        false);
-
-    view_dispatcher_switch_to_view(app->view_dispatcher, WifiMarauderAppViewTextInput);
-}
-
-bool wifi_marauder_scene_text_input_on_event(void* context, SceneManagerEvent event) {
-    WifiMarauderApp* app = context;
-    bool consumed = false;
-
-    if(event.type == SceneManagerEventTypeCustom) {
-        if(event.event == WifiMarauderEventStartConsole) {
-            // Point to custom string to send
-            app->selected_tx_string = app->text_input_store;
-            scene_manager_next_scene(app->scene_manager, WifiMarauderSceneConsoleOutput);
-            consumed = true;
-        } else if(event.event == WifiMarauderEventSaveSourceMac) {
-            if(12 != strlen(app->text_input_store)) {
-                text_input_set_header_text(app->text_input, "MAC must be 12 hex chars!");
-            } else {
-                snprintf(
-                    app->special_case_input_src_addr,
-                    sizeof(app->special_case_input_src_addr),
-                    "%c%c:%c%c:%c%c:%c%c:%c%c:%c%c",
-                    app->text_input_store[0],
-                    app->text_input_store[1],
-                    app->text_input_store[2],
-                    app->text_input_store[3],
-                    app->text_input_store[4],
-                    app->text_input_store[5],
-                    app->text_input_store[6],
-                    app->text_input_store[7],
-                    app->text_input_store[8],
-                    app->text_input_store[9],
-                    app->text_input_store[10],
-                    app->text_input_store[11]);
-
-                // Advance scene to input destination MAC, clear text input
-                app->special_case_input_step = 2;
-                bzero(app->text_input_store, WIFI_MARAUDER_TEXT_INPUT_STORE_SIZE);
-                text_input_set_header_text(app->text_input, "Enter destination MAC");
-            }
-            consumed = true;
-        } else if(event.event == WifiMarauderEventSaveDestinationMac) {
-            if(12 != strlen(app->text_input_store)) {
-                text_input_set_header_text(app->text_input, "MAC must be 12 hex chars!");
-            } else {
-                snprintf(
-                    app->special_case_input_dst_addr,
-                    sizeof(app->special_case_input_dst_addr),
-                    "%c%c:%c%c:%c%c:%c%c:%c%c:%c%c",
-                    app->text_input_store[0],
-                    app->text_input_store[1],
-                    app->text_input_store[2],
-                    app->text_input_store[3],
-                    app->text_input_store[4],
-                    app->text_input_store[5],
-                    app->text_input_store[6],
-                    app->text_input_store[7],
-                    app->text_input_store[8],
-                    app->text_input_store[9],
-                    app->text_input_store[10],
-                    app->text_input_store[11]);
-
-                // Construct command with source and destination MACs
-                snprintf(
-                    app->text_input_store,
-                    WIFI_MARAUDER_TEXT_INPUT_STORE_SIZE,
-                    "attack -t deauth -s %18s -d %18s",
-                    app->special_case_input_src_addr,
-                    app->special_case_input_dst_addr);
-                app->selected_tx_string = app->text_input_store;
-                scene_manager_next_scene(app->scene_manager, WifiMarauderSceneConsoleOutput);
-            }
-            consumed = true;
-        }
-    }
-
-    return consumed;
-}
-
-void wifi_marauder_scene_text_input_on_exit(void* context) {
-    WifiMarauderApp* app = context;
-
-    text_input_reset(app->text_input);
-}

BIN
apps_source_code/esp32cam_marauder_companion/wifi_10px.png


+ 0 - 190
apps_source_code/esp32cam_marauder_companion/wifi_marauder_app.c

@@ -1,190 +0,0 @@
-#include "wifi_marauder_app_i.h"
-
-#include <furi.h>
-#include <furi_hal.h>
-
-static bool wifi_marauder_app_custom_event_callback(void* context, uint32_t event) {
-    furi_assert(context);
-    WifiMarauderApp* app = context;
-    return scene_manager_handle_custom_event(app->scene_manager, event);
-}
-
-static bool wifi_marauder_app_back_event_callback(void* context) {
-    furi_assert(context);
-    WifiMarauderApp* app = context;
-    return scene_manager_handle_back_event(app->scene_manager);
-}
-
-static void wifi_marauder_app_tick_event_callback(void* context) {
-    furi_assert(context);
-    WifiMarauderApp* app = context;
-    scene_manager_handle_tick_event(app->scene_manager);
-}
-
-WifiMarauderApp* wifi_marauder_app_alloc() {
-    WifiMarauderApp* app = malloc(sizeof(WifiMarauderApp));
-
-    app->gui = furi_record_open(RECORD_GUI);
-    app->dialogs = furi_record_open(RECORD_DIALOGS);
-    app->storage = furi_record_open(RECORD_STORAGE);
-    app->capture_file = storage_file_alloc(app->storage);
-    app->log_file = storage_file_alloc(app->storage);
-    app->save_pcap_setting_file = storage_file_alloc(app->storage);
-    app->save_logs_setting_file = storage_file_alloc(app->storage);
-
-    app->view_dispatcher = view_dispatcher_alloc();
-    app->scene_manager = scene_manager_alloc(&wifi_marauder_scene_handlers, app);
-    view_dispatcher_enable_queue(app->view_dispatcher);
-    view_dispatcher_set_event_callback_context(app->view_dispatcher, app);
-
-    view_dispatcher_set_custom_event_callback(
-        app->view_dispatcher, wifi_marauder_app_custom_event_callback);
-    view_dispatcher_set_navigation_event_callback(
-        app->view_dispatcher, wifi_marauder_app_back_event_callback);
-    view_dispatcher_set_tick_event_callback(
-        app->view_dispatcher, wifi_marauder_app_tick_event_callback, 100);
-
-    view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen);
-
-    app->var_item_list = variable_item_list_alloc();
-    view_dispatcher_add_view(
-        app->view_dispatcher,
-        WifiMarauderAppViewVarItemList,
-        variable_item_list_get_view(app->var_item_list));
-
-    for(int i = 0; i < NUM_MENU_ITEMS; ++i) {
-        app->selected_option_index[i] = 0;
-    }
-
-    app->special_case_input_step = 0;
-
-    app->text_box = text_box_alloc();
-    view_dispatcher_add_view(
-        app->view_dispatcher, WifiMarauderAppViewConsoleOutput, text_box_get_view(app->text_box));
-    app->text_box_store = furi_string_alloc();
-    furi_string_reserve(app->text_box_store, WIFI_MARAUDER_TEXT_BOX_STORE_SIZE);
-
-    app->text_input = text_input_alloc();
-    view_dispatcher_add_view(
-        app->view_dispatcher, WifiMarauderAppViewTextInput, text_input_get_view(app->text_input));
-
-    app->widget = widget_alloc();
-    view_dispatcher_add_view(
-        app->view_dispatcher, WifiMarauderAppViewWidget, widget_get_view(app->widget));
-
-    app->has_saved_logs_this_session = false;
-
-    // if user hasn't confirmed whether to save pcaps and logs to sdcard, then prompt when scene starts
-    app->need_to_prompt_settings_init =
-        (!storage_file_exists(app->storage, SAVE_PCAP_SETTING_FILEPATH) ||
-         !storage_file_exists(app->storage, SAVE_LOGS_SETTING_FILEPATH));
-
-    scene_manager_next_scene(app->scene_manager, WifiMarauderSceneStart);
-
-    return app;
-}
-
-void wifi_marauder_make_app_folder(WifiMarauderApp* app) {
-    furi_assert(app);
-
-    if(!storage_simply_mkdir(app->storage, MARAUDER_APP_FOLDER)) {
-        dialog_message_show_storage_error(app->dialogs, "Cannot create\napp folder");
-    }
-
-    if(!storage_simply_mkdir(app->storage, MARAUDER_APP_FOLDER_PCAPS)) {
-        dialog_message_show_storage_error(app->dialogs, "Cannot create\npcaps folder");
-    }
-
-    if(!storage_simply_mkdir(app->storage, MARAUDER_APP_FOLDER_LOGS)) {
-        dialog_message_show_storage_error(app->dialogs, "Cannot create\npcaps folder");
-    }
-}
-
-void wifi_marauder_load_settings(WifiMarauderApp* app) {
-    if(storage_file_open(
-           app->save_pcap_setting_file,
-           SAVE_PCAP_SETTING_FILEPATH,
-           FSAM_READ,
-           FSOM_OPEN_EXISTING)) {
-        char ok[1];
-        storage_file_read(app->save_pcap_setting_file, ok, sizeof(ok));
-        app->ok_to_save_pcaps = ok[0] == 'Y';
-    }
-    storage_file_close(app->save_pcap_setting_file);
-
-    if(storage_file_open(
-           app->save_logs_setting_file,
-           SAVE_LOGS_SETTING_FILEPATH,
-           FSAM_READ,
-           FSOM_OPEN_EXISTING)) {
-        char ok[1];
-        storage_file_read(app->save_logs_setting_file, ok, sizeof(ok));
-        app->ok_to_save_logs = ok[0] == 'Y';
-    }
-    storage_file_close(app->save_logs_setting_file);
-}
-
-void wifi_marauder_app_free(WifiMarauderApp* app) {
-    furi_assert(app);
-
-    // Views
-    view_dispatcher_remove_view(app->view_dispatcher, WifiMarauderAppViewVarItemList);
-    view_dispatcher_remove_view(app->view_dispatcher, WifiMarauderAppViewConsoleOutput);
-    view_dispatcher_remove_view(app->view_dispatcher, WifiMarauderAppViewTextInput);
-    view_dispatcher_remove_view(app->view_dispatcher, WifiMarauderAppViewWidget);
-    widget_free(app->widget);
-    text_box_free(app->text_box);
-    furi_string_free(app->text_box_store);
-    text_input_free(app->text_input);
-    storage_file_free(app->capture_file);
-    storage_file_free(app->log_file);
-    storage_file_free(app->save_pcap_setting_file);
-    storage_file_free(app->save_logs_setting_file);
-
-    // View dispatcher
-    view_dispatcher_free(app->view_dispatcher);
-    scene_manager_free(app->scene_manager);
-
-    wifi_marauder_uart_free(app->uart);
-    wifi_marauder_uart_free(app->lp_uart);
-
-    // Close records
-    furi_record_close(RECORD_GUI);
-    furi_record_close(RECORD_STORAGE);
-    furi_record_close(RECORD_DIALOGS);
-
-    free(app);
-}
-
-int32_t wifi_marauder_app(void* p) {
-    UNUSED(p);
-    uint8_t attempts = 0;
-    while(!furi_hal_power_is_otg_enabled() && attempts++ < 5) {
-        furi_hal_power_enable_otg();
-        furi_delay_ms(10);
-    }
-    furi_delay_ms(200);
-    for(int i = 0; i < 2; i++) {
-        furi_delay_ms(500);
-        furi_hal_uart_tx(FuriHalUartIdUSART1, (uint8_t[1]){'w'}, 1);
-    }
-    furi_delay_ms(1);
-
-    WifiMarauderApp* wifi_marauder_app = wifi_marauder_app_alloc();
-
-    wifi_marauder_make_app_folder(wifi_marauder_app);
-    wifi_marauder_load_settings(wifi_marauder_app);
-
-    wifi_marauder_app->uart = wifi_marauder_usart_init(wifi_marauder_app);
-    wifi_marauder_app->lp_uart = wifi_marauder_lp_uart_init(wifi_marauder_app);
-
-    view_dispatcher_run(wifi_marauder_app->view_dispatcher);
-
-    wifi_marauder_app_free(wifi_marauder_app);
-
-    if(furi_hal_power_is_otg_enabled()) {
-        furi_hal_power_disable_otg();
-    }
-
-    return 0;
-}

+ 0 - 13
apps_source_code/esp32cam_marauder_companion/wifi_marauder_app.h

@@ -1,13 +0,0 @@
-#pragma once
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define WIFI_MARAUDER_APP_VERSION "v0.3.3"
-
-typedef struct WifiMarauderApp WifiMarauderApp;
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 108
apps_source_code/esp32cam_marauder_companion/wifi_marauder_app_i.h

@@ -1,108 +0,0 @@
-//** Includes sniffbt and sniffskim for compatible ESP32-WROOM hardware.
-// wifi_marauder_scene_start.c also changed **//
-#pragma once
-
-#include "wifi_marauder_app.h"
-#include "scenes/wifi_marauder_scene.h"
-#include "wifi_marauder_custom_event.h"
-#include "wifi_marauder_uart.h"
-#include "wifi_marauder_pcap.h"
-
-#include <gui/gui.h>
-#include <gui/view_dispatcher.h>
-#include <gui/scene_manager.h>
-#include <gui/modules/text_box.h>
-#include <gui/modules/text_input.h>
-#include <gui/modules/variable_item_list.h>
-#include <gui/modules/widget.h>
-
-#include <storage/storage.h>
-#include <dialogs/dialogs.h>
-
-#define NUM_MENU_ITEMS (18)
-
-#define WIFI_MARAUDER_TEXT_BOX_STORE_SIZE (4096)
-#define WIFI_MARAUDER_TEXT_INPUT_STORE_SIZE (512)
-
-#define MARAUDER_APP_FOLDER_USER "apps_data/marauder"
-#define MARAUDER_APP_FOLDER ANY_PATH(MARAUDER_APP_FOLDER_USER)
-#define MARAUDER_APP_FOLDER_PCAPS MARAUDER_APP_FOLDER "/pcaps"
-#define MARAUDER_APP_FOLDER_LOGS MARAUDER_APP_FOLDER "/logs"
-#define MARAUDER_APP_FOLDER_USER_PCAPS MARAUDER_APP_FOLDER_USER "/pcaps"
-#define MARAUDER_APP_FOLDER_USER_LOGS MARAUDER_APP_FOLDER_USER "/logs"
-#define SAVE_PCAP_SETTING_FILEPATH MARAUDER_APP_FOLDER "/save_pcaps_here.setting"
-#define SAVE_LOGS_SETTING_FILEPATH MARAUDER_APP_FOLDER "/save_logs_here.setting"
-
-struct WifiMarauderApp {
-    Gui* gui;
-    ViewDispatcher* view_dispatcher;
-    SceneManager* scene_manager;
-
-    char text_input_store[WIFI_MARAUDER_TEXT_INPUT_STORE_SIZE + 1];
-    FuriString* text_box_store;
-    size_t text_box_store_strlen;
-    TextBox* text_box;
-    TextInput* text_input;
-    Storage* storage;
-    File* capture_file;
-    File* log_file;
-    char log_file_path[100];
-    File* save_pcap_setting_file;
-    File* save_logs_setting_file;
-    bool need_to_prompt_settings_init;
-    int which_prompt;
-    bool ok_to_save_pcaps;
-    bool ok_to_save_logs;
-    bool has_saved_logs_this_session;
-    DialogsApp* dialogs;
-
-    VariableItemList* var_item_list;
-    Widget* widget;
-    int open_log_file_page;
-    int open_log_file_num_pages;
-
-    WifiMarauderUart* uart;
-    WifiMarauderUart* lp_uart;
-    int selected_menu_index;
-    int selected_option_index[NUM_MENU_ITEMS];
-    const char* selected_tx_string;
-    bool is_command;
-    bool is_custom_tx_string;
-    bool focus_console_start;
-    bool show_stopscan_tip;
-    bool is_writing_pcap;
-    bool is_writing_log;
-
-    // For input source and destination MAC in targeted deauth attack
-    int special_case_input_step;
-    char special_case_input_src_addr[20];
-    char special_case_input_dst_addr[20];
-};
-
-// Supported commands:
-// https://github.com/justcallmekoko/ESP32Marauder/wiki/cli
-//   Scan
-//    -> If list is empty, then start a new scanap. (Tap any button to stop.)
-//    -> If there's a list, provide option to rescan and dump list of targets to select.
-//    -> Press BACK to go back to top-level.
-//   Attack
-//    -> Beacon
-//    -> Deauth
-//    -> Probe
-//    -> Rickroll
-//   Sniff
-//    -> Beacon
-//    -> Deauth
-//    -> ESP
-//    -> PMKID
-//    -> Pwnagotchi
-//   Channel
-//   Update
-//   Reboot
-
-typedef enum {
-    WifiMarauderAppViewVarItemList,
-    WifiMarauderAppViewConsoleOutput,
-    WifiMarauderAppViewTextInput,
-    WifiMarauderAppViewWidget,
-} WifiMarauderAppView;

+ 0 - 11
apps_source_code/esp32cam_marauder_companion/wifi_marauder_custom_event.h

@@ -1,11 +0,0 @@
-#pragma once
-
-typedef enum {
-    WifiMarauderEventRefreshConsoleOutput = 0,
-    WifiMarauderEventStartConsole,
-    WifiMarauderEventStartKeyboard,
-    WifiMarauderEventSaveSourceMac,
-    WifiMarauderEventSaveDestinationMac,
-    WifiMarauderEventStartSettingsInit,
-    WifiMarauderEventStartLogViewer
-} WifiMarauderCustomEvent;

+ 0 - 64
apps_source_code/esp32cam_marauder_companion/wifi_marauder_pcap.c

@@ -1,64 +0,0 @@
-#include "wifi_marauder_app_i.h"
-#include "wifi_marauder_pcap.h"
-
-void wifi_marauder_get_prefix_from_sniff_cmd(char* dest, const char* command) {
-    int start, end, delta;
-    start = strlen("sniff");
-    end = strcspn(command, " ");
-    delta = end - start;
-    strncpy(dest, command + start, end - start);
-    dest[delta] = '\0';
-}
-
-void wifi_marauder_get_prefix_from_cmd(char* dest, const char* command) {
-    int end;
-    end = strcspn(command, " ");
-    strncpy(dest, command, end);
-    dest[end] = '\0';
-}
-
-void wifi_marauder_create_pcap_file(WifiMarauderApp* app) {
-    char prefix[10];
-    char capture_file_path[100];
-    wifi_marauder_get_prefix_from_sniff_cmd(prefix, app->selected_tx_string);
-
-    int i = 0;
-    do {
-        snprintf(
-            capture_file_path,
-            sizeof(capture_file_path),
-            "%s/%s_%d.pcap",
-            MARAUDER_APP_FOLDER_PCAPS,
-            prefix,
-            i);
-        i++;
-    } while(storage_file_exists(app->storage, capture_file_path));
-
-    if(!storage_file_open(app->capture_file, capture_file_path, FSAM_WRITE, FSOM_CREATE_ALWAYS)) {
-        dialog_message_show_storage_error(app->dialogs, "Cannot open pcap file");
-    }
-}
-
-void wifi_marauder_create_log_file(WifiMarauderApp* app) {
-    char prefix[10];
-    char log_file_path[100];
-    wifi_marauder_get_prefix_from_cmd(prefix, app->selected_tx_string);
-
-    int i = 0;
-    do {
-        snprintf(
-            log_file_path,
-            sizeof(log_file_path),
-            "%s/%s_%d.log",
-            MARAUDER_APP_FOLDER_LOGS,
-            prefix,
-            i);
-        i++;
-    } while(storage_file_exists(app->storage, log_file_path));
-
-    if(!storage_file_open(app->log_file, log_file_path, FSAM_WRITE, FSOM_CREATE_ALWAYS)) {
-        dialog_message_show_storage_error(app->dialogs, "Cannot open log file");
-    } else {
-        strcpy(app->log_file_path, log_file_path);
-    }
-}

+ 0 - 20
apps_source_code/esp32cam_marauder_companion/wifi_marauder_pcap.h

@@ -1,20 +0,0 @@
-#pragma once
-
-#include "furi_hal.h"
-
-/**
- * Creates a PCAP file to store incoming packets.
- * The file name will have a prefix according to the type of scan being performed by the application (Eg: raw_0.pcap)
- * 
- * @param app Application context
- */
-void wifi_marauder_create_pcap_file(WifiMarauderApp* app);
-
-/**
- * Creates a log file to store text from console output.
- * The file name will have a prefix according to the command being performed by the application (Eg: scanap_0.log)
- *
- * @param app Application context
- */
-// same as wifi_marauder_create_pcap_file, but for log files (to save console text output)
-void wifi_marauder_create_log_file(WifiMarauderApp* app);

+ 0 - 115
apps_source_code/esp32cam_marauder_companion/wifi_marauder_uart.c

@@ -1,115 +0,0 @@
-#include "wifi_marauder_app_i.h"
-#include "wifi_marauder_uart.h"
-
-#define UART_CH (FuriHalUartIdUSART1)
-#define LP_UART_CH (FuriHalUartIdLPUART1)
-#define BAUDRATE (230400)
-
-struct WifiMarauderUart {
-    WifiMarauderApp* app;
-    FuriHalUartId channel;
-    FuriThread* rx_thread;
-    FuriStreamBuffer* rx_stream;
-    uint8_t rx_buf[RX_BUF_SIZE + 1];
-    void (*handle_rx_data_cb)(uint8_t* buf, size_t len, void* context);
-};
-
-typedef enum {
-    WorkerEvtStop = (1 << 0),
-    WorkerEvtRxDone = (1 << 1),
-} WorkerEvtFlags;
-
-void wifi_marauder_uart_set_handle_rx_data_cb(
-    WifiMarauderUart* uart,
-    void (*handle_rx_data_cb)(uint8_t* buf, size_t len, void* context)) {
-    furi_assert(uart);
-    uart->handle_rx_data_cb = handle_rx_data_cb;
-}
-
-#define WORKER_ALL_RX_EVENTS (WorkerEvtStop | WorkerEvtRxDone)
-
-void wifi_marauder_uart_on_irq_cb(UartIrqEvent ev, uint8_t data, void* context) {
-    WifiMarauderUart* uart = (WifiMarauderUart*)context;
-
-    if(ev == UartIrqEventRXNE) {
-        furi_stream_buffer_send(uart->rx_stream, &data, 1, 0);
-        furi_thread_flags_set(furi_thread_get_id(uart->rx_thread), WorkerEvtRxDone);
-    }
-}
-
-static int32_t uart_worker(void* context) {
-    WifiMarauderUart* uart = (void*)context;
-
-    while(1) {
-        uint32_t events =
-            furi_thread_flags_wait(WORKER_ALL_RX_EVENTS, FuriFlagWaitAny, FuriWaitForever);
-        furi_check((events & FuriFlagError) == 0);
-        if(events & WorkerEvtStop) break;
-        if(events & WorkerEvtRxDone) {
-            size_t len = furi_stream_buffer_receive(uart->rx_stream, uart->rx_buf, RX_BUF_SIZE, 0);
-            if(len > 0) {
-                if(uart->handle_rx_data_cb) uart->handle_rx_data_cb(uart->rx_buf, len, uart->app);
-            }
-        }
-    }
-
-    furi_stream_buffer_free(uart->rx_stream);
-
-    return 0;
-}
-
-void wifi_marauder_uart_tx(uint8_t* data, size_t len) {
-    furi_hal_uart_tx(UART_CH, data, len);
-}
-
-void wifi_marauder_lp_uart_tx(uint8_t* data, size_t len) {
-    furi_hal_uart_tx(LP_UART_CH, data, len);
-}
-
-WifiMarauderUart*
-    wifi_marauder_uart_init(WifiMarauderApp* app, FuriHalUartId channel, const char* thread_name) {
-    WifiMarauderUart* uart = malloc(sizeof(WifiMarauderUart));
-
-    uart->app = app;
-    uart->channel = channel;
-    uart->rx_stream = furi_stream_buffer_alloc(RX_BUF_SIZE, 1);
-    uart->rx_thread = furi_thread_alloc();
-    furi_thread_set_name(uart->rx_thread, thread_name);
-    furi_thread_set_stack_size(uart->rx_thread, 1024);
-    furi_thread_set_context(uart->rx_thread, uart);
-    furi_thread_set_callback(uart->rx_thread, uart_worker);
-    furi_thread_start(uart->rx_thread);
-    if(channel == FuriHalUartIdUSART1) {
-        furi_hal_console_disable();
-    } else if(channel == FuriHalUartIdLPUART1) {
-        furi_hal_uart_init(channel, BAUDRATE);
-    }
-    furi_hal_uart_set_br(channel, BAUDRATE);
-    furi_hal_uart_set_irq_cb(channel, wifi_marauder_uart_on_irq_cb, uart);
-
-    return uart;
-}
-
-WifiMarauderUart* wifi_marauder_usart_init(WifiMarauderApp* app) {
-    return wifi_marauder_uart_init(app, UART_CH, "WifiMarauderUartRxThread");
-}
-
-WifiMarauderUart* wifi_marauder_lp_uart_init(WifiMarauderApp* app) {
-    return wifi_marauder_uart_init(app, LP_UART_CH, "WifiMarauderLPUartRxThread");
-}
-
-void wifi_marauder_uart_free(WifiMarauderUart* uart) {
-    furi_assert(uart);
-
-    furi_thread_flags_set(furi_thread_get_id(uart->rx_thread), WorkerEvtStop);
-    furi_thread_join(uart->rx_thread);
-    furi_thread_free(uart->rx_thread);
-
-    furi_hal_uart_set_irq_cb(uart->channel, NULL, NULL);
-    if(uart->channel == FuriHalUartIdLPUART1) {
-        furi_hal_uart_deinit(uart->channel);
-    }
-    furi_hal_console_enable();
-
-    free(uart);
-}

+ 0 - 16
apps_source_code/esp32cam_marauder_companion/wifi_marauder_uart.h

@@ -1,16 +0,0 @@
-#pragma once
-
-#include "furi_hal.h"
-
-#define RX_BUF_SIZE (2048)
-
-typedef struct WifiMarauderUart WifiMarauderUart;
-
-void wifi_marauder_uart_set_handle_rx_data_cb(
-    WifiMarauderUart* uart,
-    void (*handle_rx_data_cb)(uint8_t* buf, size_t len, void* context));
-void wifi_marauder_uart_tx(uint8_t* data, size_t len);
-void wifi_marauder_lp_uart_tx(uint8_t* data, size_t len);
-WifiMarauderUart* wifi_marauder_usart_init(WifiMarauderApp* app);
-WifiMarauderUart* wifi_marauder_lp_uart_init(WifiMarauderApp* app);
-void wifi_marauder_uart_free(WifiMarauderUart* uart);

BIN
apps_source_code/esp32cam_morseflasher/.flipcorg/banner.png


BIN
apps_source_code/esp32cam_morseflasher/.flipcorg/gallery/1.png


BIN
apps_source_code/esp32cam_morseflasher/.flipcorg/gallery/2.png


BIN
apps_source_code/esp32cam_morseflasher/.flipcorg/gallery/3.png


+ 0 - 22
apps_source_code/esp32cam_morseflasher/LICENSE

@@ -1,22 +0,0 @@
-MIT License
-
-Copyright (c) 2023 Malik cool4uma
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-

+ 0 - 45
apps_source_code/esp32cam_morseflasher/README.md

@@ -1,45 +0,0 @@
-# UART Terminal for Flipper Zero
-[Flipper Zero](https://flipperzero.one/) app to control various devices via UART interface.
-
-## Capabilities
-- Read log and command output by uart
-- Send commands by uart
-- Set baud rate
-- Fast commands
-
-## Connecting
-| Flipper Zero pin | UART interface  |
-| ---------------- | --------------- |
-| 13 TX            | RX              |
-| 14 RX            | TX              |
-|8, 18 GND         | GND             |
-
-Info: If possible, do not power your devices from 3V3 (pin 9) Flipper Zero. It does not support hot plugging.
-
-## Keyboard
-UART_terminal uses its own special keyboard for work, which has all the symbols necessary for working in the console.
-
-To accommodate more characters on a small display, some characters are called up by holding.
-
-![kbf](https://user-images.githubusercontent.com/122148894/212286637-7063f1ee-c6ff-46b9-8dc5-79a5f367fab1.png)
-
-
-## How to install
-Copy the contents of the repository to the applications_user/uart_terminal folder Flipper Zero firmware and build app with the command ./fbt fap_uart_terminal.
-
-Or use the tool [uFBT](https://github.com/flipperdevices/flipperzero-ufbt) for building applications for Flipper Zero.
-
-## How it works
-
-
-![1f](https://user-images.githubusercontent.com/122148894/211161450-6d177638-3bfa-42a8-9c73-0cf3af5e5ca7.jpg)
-
-
-![2f](https://user-images.githubusercontent.com/122148894/211161456-4d2be15b-4a05-4450-a62e-edcaab3772fd.jpg)
-
-
-![4f](https://user-images.githubusercontent.com/122148894/211161461-4507120b-42df-441f-9e01-e4517aa83537.jpg)
-
-## INFO:
-
-~70% of the source code is taken from the [Wifi Marauder](https://github.com/0xchocolate/flipperzero-firmware-with-wifi-marauder-companion) project. Many thanks to the developers of the Wifi Marauder project.

+ 0 - 14
apps_source_code/esp32cam_morseflasher/application.fam

@@ -1,14 +0,0 @@
-App(
-    appid="mayhem_morseflash",
-    name="[MAYHEM] Morse Flasher",
-    apptype=FlipperAppType.EXTERNAL,
-    entry_point="uart_terminal_app",
-    cdefines=["APP_UART_TERMINAL"],
-    requires=["gui"],
-    stack_size=1 * 1024,
-    order=90,
-    fap_icon_assets="assets",
-    fap_icon="icon.png",
-    fap_category="GPIO",
-    fap_description="ESP32-CAM app to stream a message in morse using the powerful flashlight. [Unplug the USB cable to test with Mayhem]",
-)

BIN
apps_source_code/esp32cam_morseflasher/assets/KeyBackspaceSelected_16x9.png


BIN
apps_source_code/esp32cam_morseflasher/assets/KeyBackspace_16x9.png


BIN
apps_source_code/esp32cam_morseflasher/assets/KeySaveSelected_24x11.png


BIN
apps_source_code/esp32cam_morseflasher/assets/KeySave_24x11.png


BIN
apps_source_code/esp32cam_morseflasher/assets/WarningDolphin_45x42.png


BIN
apps_source_code/esp32cam_morseflasher/icon.png


+ 0 - 30
apps_source_code/esp32cam_morseflasher/scenes/uart_terminal_scene.c

@@ -1,30 +0,0 @@
-#include "uart_terminal_scene.h"
-
-// Generate scene on_enter handlers array
-#define ADD_SCENE(prefix, name, id) prefix##_scene_##name##_on_enter,
-void (*const uart_terminal_scene_on_enter_handlers[])(void*) = {
-#include "uart_terminal_scene_config.h"
-};
-#undef ADD_SCENE
-
-// Generate scene on_event handlers array
-#define ADD_SCENE(prefix, name, id) prefix##_scene_##name##_on_event,
-bool (*const uart_terminal_scene_on_event_handlers[])(void* context, SceneManagerEvent event) = {
-#include "uart_terminal_scene_config.h"
-};
-#undef ADD_SCENE
-
-// Generate scene on_exit handlers array
-#define ADD_SCENE(prefix, name, id) prefix##_scene_##name##_on_exit,
-void (*const uart_terminal_scene_on_exit_handlers[])(void* context) = {
-#include "uart_terminal_scene_config.h"
-};
-#undef ADD_SCENE
-
-// Initialize scene handlers configuration structure
-const SceneManagerHandlers uart_terminal_scene_handlers = {
-    .on_enter_handlers = uart_terminal_scene_on_enter_handlers,
-    .on_event_handlers = uart_terminal_scene_on_event_handlers,
-    .on_exit_handlers = uart_terminal_scene_on_exit_handlers,
-    .scene_num = UART_TerminalSceneNum,
-};

+ 0 - 29
apps_source_code/esp32cam_morseflasher/scenes/uart_terminal_scene.h

@@ -1,29 +0,0 @@
-#pragma once
-
-#include <gui/scene_manager.h>
-
-// Generate scene id and total number
-#define ADD_SCENE(prefix, name, id) UART_TerminalScene##id,
-typedef enum {
-#include "uart_terminal_scene_config.h"
-    UART_TerminalSceneNum,
-} UART_TerminalScene;
-#undef ADD_SCENE
-
-extern const SceneManagerHandlers uart_terminal_scene_handlers;
-
-// Generate scene on_enter handlers declaration
-#define ADD_SCENE(prefix, name, id) void prefix##_scene_##name##_on_enter(void*);
-#include "uart_terminal_scene_config.h"
-#undef ADD_SCENE
-
-// Generate scene on_event handlers declaration
-#define ADD_SCENE(prefix, name, id) \
-    bool prefix##_scene_##name##_on_event(void* context, SceneManagerEvent event);
-#include "uart_terminal_scene_config.h"
-#undef ADD_SCENE
-
-// Generate scene on_exit handlers declaration
-#define ADD_SCENE(prefix, name, id) void prefix##_scene_##name##_on_exit(void* context);
-#include "uart_terminal_scene_config.h"
-#undef ADD_SCENE

+ 0 - 3
apps_source_code/esp32cam_morseflasher/scenes/uart_terminal_scene_config.h

@@ -1,3 +0,0 @@
-ADD_SCENE(uart_terminal, start, Start)
-ADD_SCENE(uart_terminal, console_output, ConsoleOutput)
-ADD_SCENE(uart_terminal, text_input, UART_TextInput)

+ 0 - 97
apps_source_code/esp32cam_morseflasher/scenes/uart_terminal_scene_console_output.c

@@ -1,97 +0,0 @@
-#include "../uart_terminal_app_i.h"
-
-void uart_terminal_console_output_handle_rx_data_cb(uint8_t* buf, size_t len, void* context) {
-    furi_assert(context);
-    UART_TerminalApp* app = context;
-
-    // If text box store gets too big, then truncate it
-    app->text_box_store_strlen += len;
-    if(app->text_box_store_strlen >= UART_TERMINAL_TEXT_BOX_STORE_SIZE - 1) {
-        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
-    buf[len] = '\0';
-    furi_string_cat_printf(app->text_box_store, "%s", buf);
-
-    view_dispatcher_send_custom_event(
-        app->view_dispatcher, UART_TerminalEventRefreshConsoleOutput);
-}
-
-void uart_terminal_scene_console_output_on_enter(void* context) {
-    UART_TerminalApp* app = context;
-
-    TextBox* text_box = app->text_box;
-    text_box_reset(app->text_box);
-    text_box_set_font(text_box, TextBoxFontText);
-    if(app->focus_console_start) {
-        text_box_set_focus(text_box, TextBoxFocusStart);
-    } else {
-        text_box_set_focus(text_box, TextBoxFocusEnd);
-    }
-
-    if(app->is_command) {
-        furi_string_reset(app->text_box_store);
-        app->text_box_store_strlen = 0;
-
-        // app->show_stopscan_tip in the if is just a hack to get the help displayed since there is no commands in this app
-        if(app->show_stopscan_tip ||
-           0 == strncmp("help", app->selected_tx_string, strlen("help"))) {
-            const char* help_msg =
-                "Morse Flasher for\nMayhem Fin\n\nBased on UART terminal by\ncool4uma, which is a\nmodified WiFi Marauder\ncompanion by 0xchocolate\n\n";
-            furi_string_cat_str(app->text_box_store, help_msg);
-            app->text_box_store_strlen += strlen(help_msg);
-        }
-
-        if(app->show_stopscan_tip) {
-            const char* help_msg = "Press BACK to return\n";
-            furi_string_cat_str(app->text_box_store, 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
-    text_box_set_text(app->text_box, furi_string_get_cstr(app->text_box_store));
-
-    scene_manager_set_scene_state(app->scene_manager, UART_TerminalSceneConsoleOutput, 0);
-    view_dispatcher_switch_to_view(app->view_dispatcher, UART_TerminalAppViewConsoleOutput);
-
-    // Register callback to receive data
-    uart_terminal_uart_set_handle_rx_data_cb(
-        app->uart, uart_terminal_console_output_handle_rx_data_cb); // setup callback for rx thread
-
-    // Send command with newline '\n'
-    /*if(!app->is_command && app->selected_tx_string)*/ {
-        uart_terminal_uart_tx(
-            (uint8_t*)(app->selected_tx_string), strlen(app->selected_tx_string));
-        uart_terminal_uart_tx((uint8_t*)("\n"), 1);
-    }
-}
-
-bool uart_terminal_scene_console_output_on_event(void* context, SceneManagerEvent event) {
-    UART_TerminalApp* app = context;
-
-    bool consumed = false;
-
-    if(event.type == SceneManagerEventTypeCustom) {
-        text_box_set_text(app->text_box, furi_string_get_cstr(app->text_box_store));
-        consumed = true;
-    } else if(event.type == SceneManagerEventTypeTick) {
-        consumed = true;
-    }
-
-    return consumed;
-}
-
-void uart_terminal_scene_console_output_on_exit(void* context) {
-    UART_TerminalApp* app = context;
-
-    // Unregister rx callback
-    uart_terminal_uart_set_handle_rx_data_cb(app->uart, NULL);
-
-    // Automatically logut when exiting view
-    //if(app->is_command) {
-    //    uart_terminal_uart_tx((uint8_t*)("exit\n"), strlen("exit\n"));
-    //}
-}

+ 0 - 137
apps_source_code/esp32cam_morseflasher/scenes/uart_terminal_scene_start.c

@@ -1,137 +0,0 @@
-#include "../uart_terminal_app_i.h"
-
-// For each command, define whether additional arguments are needed
-// (enabling text input to fill them out), and whether the console
-// text box should focus at the start of the output or the end
-typedef enum { NO_ARGS = 0, INPUT_ARGS, TOGGLE_ARGS } InputArgs;
-
-typedef enum { FOCUS_CONSOLE_END = 0, FOCUS_CONSOLE_START, FOCUS_CONSOLE_TOGGLE } FocusConsole;
-
-#define SHOW_STOPSCAN_TIP (true)
-#define NO_TIP (false)
-
-#define MAX_OPTIONS (9)
-typedef struct {
-    const char* item_string;
-    const char* options_menu[MAX_OPTIONS];
-    int num_options_menu;
-    const char* actual_commands[MAX_OPTIONS];
-    InputArgs needs_keyboard;
-    FocusConsole focus_console;
-    bool show_stopscan_tip;
-} UART_TerminalItem;
-
-// 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] = {
-    {"New custom message", {""}, 1, {""}, INPUT_ARGS, FOCUS_CONSOLE_END, NO_TIP},
-    {"Quick message",
-     {"SOS", "CQD", "VVV", "Eureka", "E.T ph...", "what h...", "Mayhem", "Flipper"},
-     8,
-     {"sos",
-      "cqd",
-      "vvv",
-      "eureka",
-      "e.t. phone home",
-      "what hath god wrought!",
-      "let the mayhem begin",
-      "flipper zero in da housa"},
-     NO_ARGS,
-     FOCUS_CONSOLE_END,
-     NO_TIP},
-    {"Help", {""}, 1, {""}, NO_ARGS, FOCUS_CONSOLE_START, SHOW_STOPSCAN_TIP},
-};
-
-static void uart_terminal_scene_start_var_list_enter_callback(void* context, uint32_t index) {
-    furi_assert(context);
-    UART_TerminalApp* app = context;
-
-    furi_assert(index < NUM_MENU_ITEMS);
-    const UART_TerminalItem* item = &items[index];
-
-    const int selected_option_index = app->selected_option_index[index];
-    furi_assert(selected_option_index < item->num_options_menu);
-    app->selected_tx_string = item->actual_commands[selected_option_index];
-    app->is_command = (1 <= index);
-    app->is_custom_tx_string = false;
-    app->selected_menu_index = index;
-    app->focus_console_start = (item->focus_console == FOCUS_CONSOLE_TOGGLE) ?
-                                   (selected_option_index == 0) :
-                                   item->focus_console;
-    app->show_stopscan_tip = item->show_stopscan_tip;
-
-    bool needs_keyboard = (item->needs_keyboard == TOGGLE_ARGS) ? (selected_option_index != 0) :
-                                                                  item->needs_keyboard;
-    if(needs_keyboard) {
-        view_dispatcher_send_custom_event(app->view_dispatcher, UART_TerminalEventStartKeyboard);
-    } else {
-        view_dispatcher_send_custom_event(app->view_dispatcher, UART_TerminalEventStartConsole);
-    }
-}
-
-static void uart_terminal_scene_start_var_list_change_callback(VariableItem* item) {
-    furi_assert(item);
-
-    UART_TerminalApp* app = variable_item_get_context(item);
-    furi_assert(app);
-
-    const UART_TerminalItem* menu_item = &items[app->selected_menu_index];
-    uint8_t item_index = variable_item_get_current_value_index(item);
-    furi_assert(item_index < menu_item->num_options_menu);
-    variable_item_set_current_value_text(item, menu_item->options_menu[item_index]);
-    app->selected_option_index[app->selected_menu_index] = item_index;
-}
-
-void uart_terminal_scene_start_on_enter(void* context) {
-    UART_TerminalApp* app = context;
-    VariableItemList* var_item_list = app->var_item_list;
-
-    variable_item_list_set_enter_callback(
-        var_item_list, uart_terminal_scene_start_var_list_enter_callback, app);
-
-    VariableItem* item;
-    for(int i = 0; i < NUM_MENU_ITEMS; ++i) {
-        item = variable_item_list_add(
-            var_item_list,
-            items[i].item_string,
-            items[i].num_options_menu,
-            uart_terminal_scene_start_var_list_change_callback,
-            app);
-        variable_item_set_current_value_index(item, app->selected_option_index[i]);
-        variable_item_set_current_value_text(
-            item, items[i].options_menu[app->selected_option_index[i]]);
-    }
-
-    variable_item_list_set_selected_item(
-        var_item_list, scene_manager_get_scene_state(app->scene_manager, UART_TerminalSceneStart));
-
-    view_dispatcher_switch_to_view(app->view_dispatcher, UART_TerminalAppViewVarItemList);
-}
-
-bool uart_terminal_scene_start_on_event(void* context, SceneManagerEvent event) {
-    UNUSED(context);
-    UART_TerminalApp* app = context;
-    bool consumed = false;
-
-    if(event.type == SceneManagerEventTypeCustom) {
-        if(event.event == UART_TerminalEventStartKeyboard) {
-            scene_manager_set_scene_state(
-                app->scene_manager, UART_TerminalSceneStart, app->selected_menu_index);
-            scene_manager_next_scene(app->scene_manager, UART_TerminalAppViewTextInput);
-        } else if(event.event == UART_TerminalEventStartConsole) {
-            scene_manager_set_scene_state(
-                app->scene_manager, UART_TerminalSceneStart, app->selected_menu_index);
-            scene_manager_next_scene(app->scene_manager, UART_TerminalAppViewConsoleOutput);
-        }
-        consumed = true;
-    } else if(event.type == SceneManagerEventTypeTick) {
-        app->selected_menu_index = variable_item_list_get_selected_item_index(app->var_item_list);
-        consumed = true;
-    }
-
-    return consumed;
-}
-
-void uart_terminal_scene_start_on_exit(void* context) {
-    UART_TerminalApp* app = context;
-    variable_item_list_reset(app->var_item_list);
-}

+ 0 - 60
apps_source_code/esp32cam_morseflasher/scenes/uart_terminal_scene_text_input.c

@@ -1,60 +0,0 @@
-#include "../uart_terminal_app_i.h"
-
-void uart_terminal_scene_text_input_callback(void* context) {
-    UART_TerminalApp* app = context;
-
-    view_dispatcher_send_custom_event(app->view_dispatcher, UART_TerminalEventStartConsole);
-}
-
-void uart_terminal_scene_text_input_on_enter(void* context) {
-    UART_TerminalApp* app = context;
-
-    if(false == app->is_custom_tx_string) {
-        // Fill text input with selected string so that user can add to it
-        size_t length = strlen(app->selected_tx_string);
-        furi_assert(length < UART_TERMINAL_TEXT_INPUT_STORE_SIZE);
-        bzero(app->text_input_store, UART_TERMINAL_TEXT_INPUT_STORE_SIZE);
-        strncpy(app->text_input_store, app->selected_tx_string, length);
-
-        // Add space - because flipper keyboard currently doesn't have a space
-        //app->text_input_store[length] = ' ';
-        app->text_input_store[length + 1] = '\0';
-        app->is_custom_tx_string = true;
-    }
-
-    // Setup view
-    UART_TextInput* text_input = app->text_input;
-    // Add help message to header
-    uart_text_input_set_header_text(text_input, "Send new morse message");
-    uart_text_input_set_result_callback(
-        text_input,
-        uart_terminal_scene_text_input_callback,
-        app,
-        app->text_input_store,
-        UART_TERMINAL_TEXT_INPUT_STORE_SIZE,
-        false);
-
-    view_dispatcher_switch_to_view(app->view_dispatcher, UART_TerminalAppViewTextInput);
-}
-
-bool uart_terminal_scene_text_input_on_event(void* context, SceneManagerEvent event) {
-    UART_TerminalApp* app = context;
-    bool consumed = false;
-
-    if(event.type == SceneManagerEventTypeCustom) {
-        if(event.event == UART_TerminalEventStartConsole) {
-            // Point to custom string to send
-            app->selected_tx_string = app->text_input_store;
-            scene_manager_next_scene(app->scene_manager, UART_TerminalAppViewConsoleOutput);
-            consumed = true;
-        }
-    }
-
-    return consumed;
-}
-
-void uart_terminal_scene_text_input_on_exit(void* context) {
-    UART_TerminalApp* app = context;
-
-    uart_text_input_reset(app->text_input);
-}

+ 0 - 114
apps_source_code/esp32cam_morseflasher/uart_terminal_app.c

@@ -1,114 +0,0 @@
-#include "uart_terminal_app_i.h"
-
-#include <furi.h>
-#include <furi_hal.h>
-
-static bool uart_terminal_app_custom_event_callback(void* context, uint32_t event) {
-    furi_assert(context);
-    UART_TerminalApp* app = context;
-    return scene_manager_handle_custom_event(app->scene_manager, event);
-}
-
-static bool uart_terminal_app_back_event_callback(void* context) {
-    furi_assert(context);
-    UART_TerminalApp* app = context;
-    return scene_manager_handle_back_event(app->scene_manager);
-}
-
-static void uart_terminal_app_tick_event_callback(void* context) {
-    furi_assert(context);
-    UART_TerminalApp* app = context;
-    scene_manager_handle_tick_event(app->scene_manager);
-}
-
-UART_TerminalApp* uart_terminal_app_alloc() {
-    UART_TerminalApp* app = malloc(sizeof(UART_TerminalApp));
-
-    app->gui = furi_record_open(RECORD_GUI);
-
-    app->view_dispatcher = view_dispatcher_alloc();
-    app->scene_manager = scene_manager_alloc(&uart_terminal_scene_handlers, app);
-    view_dispatcher_enable_queue(app->view_dispatcher);
-    view_dispatcher_set_event_callback_context(app->view_dispatcher, app);
-
-    view_dispatcher_set_custom_event_callback(
-        app->view_dispatcher, uart_terminal_app_custom_event_callback);
-    view_dispatcher_set_navigation_event_callback(
-        app->view_dispatcher, uart_terminal_app_back_event_callback);
-    view_dispatcher_set_tick_event_callback(
-        app->view_dispatcher, uart_terminal_app_tick_event_callback, 100);
-
-    view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen);
-
-    app->var_item_list = variable_item_list_alloc();
-    view_dispatcher_add_view(
-        app->view_dispatcher,
-        UART_TerminalAppViewVarItemList,
-        variable_item_list_get_view(app->var_item_list));
-
-    for(int i = 0; i < NUM_MENU_ITEMS; ++i) {
-        app->selected_option_index[i] = 0;
-    }
-
-    app->text_box = text_box_alloc();
-    view_dispatcher_add_view(
-        app->view_dispatcher, UART_TerminalAppViewConsoleOutput, text_box_get_view(app->text_box));
-    app->text_box_store = furi_string_alloc();
-    furi_string_reserve(app->text_box_store, UART_TERMINAL_TEXT_BOX_STORE_SIZE);
-
-    app->text_input = uart_text_input_alloc();
-    view_dispatcher_add_view(
-        app->view_dispatcher,
-        UART_TerminalAppViewTextInput,
-        uart_text_input_get_view(app->text_input));
-
-    scene_manager_next_scene(app->scene_manager, UART_TerminalSceneStart);
-
-    return app;
-}
-
-void uart_terminal_app_free(UART_TerminalApp* app) {
-    furi_assert(app);
-
-    // Views
-    view_dispatcher_remove_view(app->view_dispatcher, UART_TerminalAppViewVarItemList);
-    view_dispatcher_remove_view(app->view_dispatcher, UART_TerminalAppViewConsoleOutput);
-    view_dispatcher_remove_view(app->view_dispatcher, UART_TerminalAppViewTextInput);
-    text_box_free(app->text_box);
-    furi_string_free(app->text_box_store);
-    uart_text_input_free(app->text_input);
-
-    // View dispatcher
-    view_dispatcher_free(app->view_dispatcher);
-    scene_manager_free(app->scene_manager);
-
-    uart_terminal_uart_free(app->uart);
-
-    // Close records
-    furi_record_close(RECORD_GUI);
-
-    free(app);
-}
-
-int32_t uart_terminal_app(void* p) {
-    UNUSED(p);
-    furi_hal_power_disable_external_3_3v();
-    furi_hal_power_disable_otg();
-    furi_delay_ms(200);
-    furi_hal_power_enable_external_3_3v();
-    furi_hal_power_enable_otg();
-    for(int i = 0; i < 2; i++) {
-        furi_delay_ms(500);
-        furi_hal_uart_tx(FuriHalUartIdUSART1, (uint8_t[1]){'.'}, 1);
-    }
-    furi_delay_ms(1);
-    UART_TerminalApp* uart_terminal_app = uart_terminal_app_alloc();
-
-    uart_terminal_app->uart = uart_terminal_uart_init(uart_terminal_app);
-
-    view_dispatcher_run(uart_terminal_app->view_dispatcher);
-
-    uart_terminal_app_free(uart_terminal_app);
-    furi_hal_power_disable_otg();
-    return 0;
-}

+ 0 - 11
apps_source_code/esp32cam_morseflasher/uart_terminal_app.h

@@ -1,11 +0,0 @@
-#pragma once
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct UART_TerminalApp UART_TerminalApp;
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 47
apps_source_code/esp32cam_morseflasher/uart_terminal_app_i.h

@@ -1,47 +0,0 @@
-#pragma once
-
-#include "uart_terminal_app.h"
-#include "scenes/uart_terminal_scene.h"
-#include "uart_terminal_custom_event.h"
-#include "uart_terminal_uart.h"
-
-#include <gui/gui.h>
-#include <gui/view_dispatcher.h>
-#include <gui/scene_manager.h>
-#include <gui/modules/text_box.h>
-#include "uart_text_input.h"
-#include <gui/modules/variable_item_list.h>
-
-#define NUM_MENU_ITEMS (3)
-
-#define UART_TERMINAL_TEXT_BOX_STORE_SIZE (4096)
-#define UART_TERMINAL_TEXT_INPUT_STORE_SIZE (512)
-
-struct UART_TerminalApp {
-    Gui* gui;
-    ViewDispatcher* view_dispatcher;
-    SceneManager* scene_manager;
-
-    char text_input_store[UART_TERMINAL_TEXT_INPUT_STORE_SIZE + 1];
-    FuriString* text_box_store;
-    size_t text_box_store_strlen;
-    TextBox* text_box;
-    UART_TextInput* text_input;
-
-    VariableItemList* var_item_list;
-
-    UART_TerminalUart* uart;
-    int selected_menu_index;
-    int selected_option_index[NUM_MENU_ITEMS];
-    const char* selected_tx_string;
-    bool is_command;
-    bool is_custom_tx_string;
-    bool focus_console_start;
-    bool show_stopscan_tip;
-};
-
-typedef enum {
-    UART_TerminalAppViewVarItemList,
-    UART_TerminalAppViewConsoleOutput,
-    UART_TerminalAppViewTextInput,
-} UART_TerminalAppView;

+ 0 - 7
apps_source_code/esp32cam_morseflasher/uart_terminal_custom_event.h

@@ -1,7 +0,0 @@
-#pragma once
-
-typedef enum {
-    UART_TerminalEventRefreshConsoleOutput = 0,
-    UART_TerminalEventStartConsole,
-    UART_TerminalEventStartKeyboard,
-} UART_TerminalCustomEvent;

+ 0 - 101
apps_source_code/esp32cam_morseflasher/uart_terminal_uart.c

@@ -1,101 +0,0 @@
-#include "uart_terminal_app_i.h"
-#include "uart_terminal_uart.h"
-
-#define UART_CH (FuriHalUartIdUSART1)
-#define BAUDRATE (230400)
-
-struct UART_TerminalUart {
-    UART_TerminalApp* app;
-    FuriThread* rx_thread;
-    FuriStreamBuffer* rx_stream;
-    uint8_t rx_buf[RX_BUF_SIZE + 1];
-    void (*handle_rx_data_cb)(uint8_t* buf, size_t len, void* context);
-};
-
-typedef enum {
-    WorkerEvtStop = (1 << 0),
-    WorkerEvtRxDone = (1 << 1),
-} WorkerEvtFlags;
-
-void uart_terminal_uart_set_handle_rx_data_cb(
-    UART_TerminalUart* uart,
-    void (*handle_rx_data_cb)(uint8_t* buf, size_t len, void* context)) {
-    furi_assert(uart);
-    uart->handle_rx_data_cb = handle_rx_data_cb;
-}
-
-#define WORKER_ALL_RX_EVENTS (WorkerEvtStop | WorkerEvtRxDone)
-
-void uart_terminal_uart_on_irq_cb(UartIrqEvent ev, uint8_t data, void* context) {
-    UART_TerminalUart* uart = (UART_TerminalUart*)context;
-
-    if(ev == UartIrqEventRXNE) {
-        furi_stream_buffer_send(uart->rx_stream, &data, 1, 0);
-        furi_thread_flags_set(furi_thread_get_id(uart->rx_thread), WorkerEvtRxDone);
-    }
-}
-
-static int32_t uart_worker(void* context) {
-    UART_TerminalUart* uart = (void*)context;
-
-    while(1) {
-        uint32_t events =
-            furi_thread_flags_wait(WORKER_ALL_RX_EVENTS, FuriFlagWaitAny, FuriWaitForever);
-        furi_check((events & FuriFlagError) == 0);
-        if(events & WorkerEvtStop) break;
-        if(events & WorkerEvtRxDone) {
-            size_t len = furi_stream_buffer_receive(uart->rx_stream, uart->rx_buf, RX_BUF_SIZE, 0);
-            if(len > 0) {
-                if(uart->handle_rx_data_cb) uart->handle_rx_data_cb(uart->rx_buf, len, uart->app);
-            }
-        }
-    }
-
-    furi_stream_buffer_free(uart->rx_stream);
-
-    return 0;
-}
-
-void uart_terminal_uart_tx(uint8_t* data, size_t len) {
-    furi_hal_uart_tx(UART_CH, data, len);
-}
-
-UART_TerminalUart* uart_terminal_uart_init(UART_TerminalApp* app) {
-    UART_TerminalUart* uart = malloc(sizeof(UART_TerminalUart));
-
-    /*furi_hal_console_disable();
-    if(app->BAUDRATE == 0) {
-        app->BAUDRATE = 230400;
-    }
-    furi_hal_uart_set_br(UART_CH, app->BAUDRATE);
-    furi_hal_uart_set_irq_cb(UART_CH, uart_terminal_uart_on_irq_cb, uart);*/
-
-    uart->app = app;
-    uart->rx_stream = furi_stream_buffer_alloc(RX_BUF_SIZE, 1);
-    uart->rx_thread = furi_thread_alloc();
-    furi_thread_set_name(uart->rx_thread, "UART_TerminalUartRxThread");
-    furi_thread_set_stack_size(uart->rx_thread, 1024);
-    furi_thread_set_context(uart->rx_thread, uart);
-    furi_thread_set_callback(uart->rx_thread, uart_worker);
-
-    furi_thread_start(uart->rx_thread);
-
-    furi_hal_console_disable();
-    furi_hal_uart_set_br(UART_CH, BAUDRATE);
-    furi_hal_uart_set_irq_cb(UART_CH, uart_terminal_uart_on_irq_cb, uart);
-
-    return uart;
-}
-
-void uart_terminal_uart_free(UART_TerminalUart* uart) {
-    furi_assert(uart);
-
-    furi_thread_flags_set(furi_thread_get_id(uart->rx_thread), WorkerEvtStop);
-    furi_thread_join(uart->rx_thread);
-    furi_thread_free(uart->rx_thread);
-
-    furi_hal_uart_set_irq_cb(UART_CH, NULL, NULL);
-    furi_hal_console_enable();
-
-    free(uart);
-}

+ 0 - 14
apps_source_code/esp32cam_morseflasher/uart_terminal_uart.h

@@ -1,14 +0,0 @@
-#pragma once
-
-#include "furi_hal.h"
-
-#define RX_BUF_SIZE (320)
-
-typedef struct UART_TerminalUart UART_TerminalUart;
-
-void uart_terminal_uart_set_handle_rx_data_cb(
-    UART_TerminalUart* uart,
-    void (*handle_rx_data_cb)(uint8_t* buf, size_t len, void* context));
-void uart_terminal_uart_tx(uint8_t* data, size_t len);
-UART_TerminalUart* uart_terminal_uart_init(UART_TerminalApp* app);
-void uart_terminal_uart_free(UART_TerminalUart* uart);

+ 0 - 637
apps_source_code/esp32cam_morseflasher/uart_text_input.c

@@ -1,637 +0,0 @@
-#include "uart_text_input.h"
-#include <gui/elements.h>
-#include "mayhem_morseflash_icons.h"
-#include <furi.h>
-
-struct UART_TextInput {
-    View* view;
-    FuriTimer* timer;
-};
-
-typedef struct {
-    const char text;
-    const uint8_t x;
-    const uint8_t y;
-} UART_TextInputKey;
-
-typedef struct {
-    const char* header;
-    char* text_buffer;
-    size_t text_buffer_size;
-    bool clear_default_text;
-
-    UART_TextInputCallback callback;
-    void* callback_context;
-
-    uint8_t selected_row;
-    uint8_t selected_column;
-
-    UART_TextInputValidatorCallback validator_callback;
-    void* validator_callback_context;
-    FuriString* validator_text;
-    bool valadator_message_visible;
-} UART_TextInputModel;
-
-static const uint8_t keyboard_origin_x = 1;
-static const uint8_t keyboard_origin_y = 29;
-static const uint8_t keyboard_row_count = 4;
-
-#define ENTER_KEY '\r'
-#define BACKSPACE_KEY '\b'
-
-static const UART_TextInputKey keyboard_keys_row_1[] = {
-    {'{', 1, 0},
-    {'(', 9, 0},
-    {'[', 17, 0},
-    {'|', 25, 0},
-    {'@', 33, 0},
-    {'&', 41, 0},
-    {'#', 49, 0},
-    {';', 57, 0},
-    {'^', 65, 0},
-    {'*', 73, 0},
-    {'`', 81, 0},
-    {'"', 89, 0},
-    {'~', 97, 0},
-    {'\'', 105, 0},
-    {'.', 113, 0},
-    {'/', 120, 0},
-};
-
-static const UART_TextInputKey keyboard_keys_row_2[] = {
-    {'q', 1, 10},
-    {'w', 9, 10},
-    {'e', 17, 10},
-    {'r', 25, 10},
-    {'t', 33, 10},
-    {'y', 41, 10},
-    {'u', 49, 10},
-    {'i', 57, 10},
-    {'o', 65, 10},
-    {'p', 73, 10},
-    {'0', 81, 10},
-    {'1', 89, 10},
-    {'2', 97, 10},
-    {'3', 105, 10},
-    {'=', 113, 10},
-    {'-', 120, 10},
-};
-
-static const UART_TextInputKey keyboard_keys_row_3[] = {
-    {'a', 1, 21},
-    {'s', 9, 21},
-    {'d', 18, 21},
-    {'f', 25, 21},
-    {'g', 33, 21},
-    {'h', 41, 21},
-    {'j', 49, 21},
-    {'k', 57, 21},
-    {'l', 65, 21},
-    {BACKSPACE_KEY, 72, 13},
-    {'4', 89, 21},
-    {'5', 97, 21},
-    {'6', 105, 21},
-    {'$', 113, 21},
-    {'%', 120, 21},
-
-};
-
-static const UART_TextInputKey keyboard_keys_row_4[] = {
-    {'z', 1, 33},
-    {'x', 9, 33},
-    {'c', 18, 33},
-    {'v', 25, 33},
-    {'b', 33, 33},
-    {'n', 41, 33},
-    {'m', 49, 33},
-    {'_', 57, 33},
-    {ENTER_KEY, 64, 24},
-    {'7', 89, 33},
-    {'8', 97, 33},
-    {'9', 105, 33},
-    {'!', 113, 33},
-    {'+', 120, 33},
-};
-
-static uint8_t get_row_size(uint8_t row_index) {
-    uint8_t row_size = 0;
-
-    switch(row_index + 1) {
-    case 1:
-        row_size = sizeof(keyboard_keys_row_1) / sizeof(UART_TextInputKey);
-        break;
-    case 2:
-        row_size = sizeof(keyboard_keys_row_2) / sizeof(UART_TextInputKey);
-        break;
-    case 3:
-        row_size = sizeof(keyboard_keys_row_3) / sizeof(UART_TextInputKey);
-        break;
-    case 4:
-        row_size = sizeof(keyboard_keys_row_4) / sizeof(UART_TextInputKey);
-        break;
-    }
-
-    return row_size;
-}
-
-static const UART_TextInputKey* get_row(uint8_t row_index) {
-    const UART_TextInputKey* row = NULL;
-
-    switch(row_index + 1) {
-    case 1:
-        row = keyboard_keys_row_1;
-        break;
-    case 2:
-        row = keyboard_keys_row_2;
-        break;
-    case 3:
-        row = keyboard_keys_row_3;
-        break;
-    case 4:
-        row = keyboard_keys_row_4;
-        break;
-    }
-
-    return row;
-}
-
-static char get_selected_char(UART_TextInputModel* model) {
-    return get_row(model->selected_row)[model->selected_column].text;
-}
-
-static bool char_is_lowercase(char letter) {
-    return (letter >= 0x61 && letter <= 0x7A);
-}
-
-static char char_to_uppercase(const char letter) {
-    switch(letter) {
-    case '_':
-        return 0x20;
-        break;
-    case '(':
-        return 0x29;
-        break;
-    case '{':
-        return 0x7d;
-        break;
-    case '[':
-        return 0x5d;
-        break;
-    case '/':
-        return 0x5c;
-        break;
-    case ';':
-        return 0x3a;
-        break;
-    case '.':
-        return 0x2c;
-        break;
-    case '!':
-        return 0x3f;
-        break;
-    case '<':
-        return 0x3e;
-        break;
-    }
-    if(isalpha(letter)) {
-        return (letter - 0x20);
-    } else {
-        return letter;
-    }
-}
-
-static void uart_text_input_backspace_cb(UART_TextInputModel* model) {
-    uint8_t text_length = model->clear_default_text ? 1 : strlen(model->text_buffer);
-    if(text_length > 0) {
-        model->text_buffer[text_length - 1] = 0;
-    }
-}
-
-static void uart_text_input_view_draw_callback(Canvas* canvas, void* _model) {
-    UART_TextInputModel* model = _model;
-    uint8_t text_length = model->text_buffer ? strlen(model->text_buffer) : 0;
-    uint8_t needed_string_width = canvas_width(canvas) - 8;
-    uint8_t start_pos = 4;
-
-    const char* text = model->text_buffer;
-
-    canvas_clear(canvas);
-    canvas_set_color(canvas, ColorBlack);
-
-    canvas_draw_str(canvas, 2, 7, model->header);
-    elements_slightly_rounded_frame(canvas, 1, 8, 126, 12);
-
-    if(canvas_string_width(canvas, text) > needed_string_width) {
-        canvas_draw_str(canvas, start_pos, 17, "...");
-        start_pos += 6;
-        needed_string_width -= 8;
-    }
-
-    while(text != 0 && canvas_string_width(canvas, text) > needed_string_width) {
-        text++;
-    }
-
-    if(model->clear_default_text) {
-        elements_slightly_rounded_box(
-            canvas, start_pos - 1, 14, canvas_string_width(canvas, text) + 2, 10);
-        canvas_set_color(canvas, ColorWhite);
-    } else {
-        canvas_draw_str(canvas, start_pos + canvas_string_width(canvas, text) + 1, 18, "|");
-        canvas_draw_str(canvas, start_pos + canvas_string_width(canvas, text) + 2, 18, "|");
-    }
-    canvas_draw_str(canvas, start_pos, 17, text);
-
-    canvas_set_font(canvas, FontKeyboard);
-
-    for(uint8_t row = 0; row <= keyboard_row_count; row++) {
-        const uint8_t column_count = get_row_size(row);
-        const UART_TextInputKey* keys = get_row(row);
-
-        for(size_t column = 0; column < column_count; column++) {
-            if(keys[column].text == ENTER_KEY) {
-                canvas_set_color(canvas, ColorBlack);
-                if(model->selected_row == row && model->selected_column == column) {
-                    canvas_draw_icon(
-                        canvas,
-                        keyboard_origin_x + keys[column].x,
-                        keyboard_origin_y + keys[column].y,
-                        &I_KeySaveSelected_24x11);
-                } else {
-                    canvas_draw_icon(
-                        canvas,
-                        keyboard_origin_x + keys[column].x,
-                        keyboard_origin_y + keys[column].y,
-                        &I_KeySave_24x11);
-                }
-            } else if(keys[column].text == BACKSPACE_KEY) {
-                canvas_set_color(canvas, ColorBlack);
-                if(model->selected_row == row && model->selected_column == column) {
-                    canvas_draw_icon(
-                        canvas,
-                        keyboard_origin_x + keys[column].x,
-                        keyboard_origin_y + keys[column].y,
-                        &I_KeyBackspaceSelected_16x9);
-                } else {
-                    canvas_draw_icon(
-                        canvas,
-                        keyboard_origin_x + keys[column].x,
-                        keyboard_origin_y + keys[column].y,
-                        &I_KeyBackspace_16x9);
-                }
-            } else {
-                if(model->selected_row == row && model->selected_column == column) {
-                    canvas_set_color(canvas, ColorBlack);
-                    canvas_draw_box(
-                        canvas,
-                        keyboard_origin_x + keys[column].x - 1,
-                        keyboard_origin_y + keys[column].y - 8,
-                        7,
-                        10);
-                    canvas_set_color(canvas, ColorWhite);
-                } else {
-                    canvas_set_color(canvas, ColorBlack);
-                }
-
-                if(model->clear_default_text ||
-                   (text_length == 0 && char_is_lowercase(keys[column].text))) {
-                    canvas_draw_glyph(
-                        canvas,
-                        keyboard_origin_x + keys[column].x,
-                        keyboard_origin_y + keys[column].y,
-                        //char_to_uppercase(keys[column].text));
-                        keys[column].text);
-                } else {
-                    canvas_draw_glyph(
-                        canvas,
-                        keyboard_origin_x + keys[column].x,
-                        keyboard_origin_y + keys[column].y,
-                        keys[column].text);
-                }
-            }
-        }
-    }
-    if(model->valadator_message_visible) {
-        canvas_set_font(canvas, FontSecondary);
-        canvas_set_color(canvas, ColorWhite);
-        canvas_draw_box(canvas, 8, 10, 110, 48);
-        canvas_set_color(canvas, ColorBlack);
-        canvas_draw_icon(canvas, 10, 14, &I_WarningDolphin_45x42);
-        canvas_draw_rframe(canvas, 8, 8, 112, 50, 3);
-        canvas_draw_rframe(canvas, 9, 9, 110, 48, 2);
-        elements_multiline_text(canvas, 62, 20, furi_string_get_cstr(model->validator_text));
-        canvas_set_font(canvas, FontKeyboard);
-    }
-}
-
-static void
-    uart_text_input_handle_up(UART_TextInput* uart_text_input, UART_TextInputModel* model) {
-    UNUSED(uart_text_input);
-    if(model->selected_row > 0) {
-        model->selected_row--;
-        if(model->selected_column > get_row_size(model->selected_row) - 6) {
-            model->selected_column = model->selected_column + 1;
-        }
-    }
-}
-
-static void
-    uart_text_input_handle_down(UART_TextInput* uart_text_input, UART_TextInputModel* model) {
-    UNUSED(uart_text_input);
-    if(model->selected_row < keyboard_row_count - 1) {
-        model->selected_row++;
-        if(model->selected_column > get_row_size(model->selected_row) - 4) {
-            model->selected_column = model->selected_column - 1;
-        }
-    }
-}
-
-static void
-    uart_text_input_handle_left(UART_TextInput* uart_text_input, UART_TextInputModel* model) {
-    UNUSED(uart_text_input);
-    if(model->selected_column > 0) {
-        model->selected_column--;
-    } else {
-        model->selected_column = get_row_size(model->selected_row) - 1;
-    }
-}
-
-static void
-    uart_text_input_handle_right(UART_TextInput* uart_text_input, UART_TextInputModel* model) {
-    UNUSED(uart_text_input);
-    if(model->selected_column < get_row_size(model->selected_row) - 1) {
-        model->selected_column++;
-    } else {
-        model->selected_column = 0;
-    }
-}
-
-static void uart_text_input_handle_ok(
-    UART_TextInput* uart_text_input,
-    UART_TextInputModel* model,
-    bool shift) {
-    char selected = get_selected_char(model);
-    uint8_t text_length = strlen(model->text_buffer);
-
-    if(shift) {
-        selected = char_to_uppercase(selected);
-    }
-
-    if(selected == ENTER_KEY) {
-        if(model->validator_callback &&
-           (!model->validator_callback(
-               model->text_buffer, model->validator_text, model->validator_callback_context))) {
-            model->valadator_message_visible = true;
-            furi_timer_start(uart_text_input->timer, furi_kernel_get_tick_frequency() * 4);
-        } else if(model->callback != 0 && text_length > 0) {
-            model->callback(model->callback_context);
-        }
-    } else if(selected == BACKSPACE_KEY) {
-        uart_text_input_backspace_cb(model);
-    } else {
-        if(model->clear_default_text) {
-            text_length = 0;
-        }
-        if(text_length < (model->text_buffer_size - 1)) {
-            if(text_length == 0 && char_is_lowercase(selected)) {
-                //selected = char_to_uppercase(selected);
-            }
-            model->text_buffer[text_length] = selected;
-            model->text_buffer[text_length + 1] = 0;
-        }
-    }
-    model->clear_default_text = false;
-}
-
-static bool uart_text_input_view_input_callback(InputEvent* event, void* context) {
-    UART_TextInput* uart_text_input = context;
-    furi_assert(uart_text_input);
-
-    bool consumed = false;
-
-    // Acquire model
-    UART_TextInputModel* model = view_get_model(uart_text_input->view);
-
-    if((!(event->type == InputTypePress) && !(event->type == InputTypeRelease)) &&
-       model->valadator_message_visible) {
-        model->valadator_message_visible = false;
-        consumed = true;
-    } else if(event->type == InputTypeShort) {
-        consumed = true;
-        switch(event->key) {
-        case InputKeyUp:
-            uart_text_input_handle_up(uart_text_input, model);
-            break;
-        case InputKeyDown:
-            uart_text_input_handle_down(uart_text_input, model);
-            break;
-        case InputKeyLeft:
-            uart_text_input_handle_left(uart_text_input, model);
-            break;
-        case InputKeyRight:
-            uart_text_input_handle_right(uart_text_input, model);
-            break;
-        case InputKeyOk:
-            uart_text_input_handle_ok(uart_text_input, model, false);
-            break;
-        default:
-            consumed = false;
-            break;
-        }
-    } else if(event->type == InputTypeLong) {
-        consumed = true;
-        switch(event->key) {
-        case InputKeyUp:
-            uart_text_input_handle_up(uart_text_input, model);
-            break;
-        case InputKeyDown:
-            uart_text_input_handle_down(uart_text_input, model);
-            break;
-        case InputKeyLeft:
-            uart_text_input_handle_left(uart_text_input, model);
-            break;
-        case InputKeyRight:
-            uart_text_input_handle_right(uart_text_input, model);
-            break;
-        case InputKeyOk:
-            uart_text_input_handle_ok(uart_text_input, model, true);
-            break;
-        case InputKeyBack:
-            uart_text_input_backspace_cb(model);
-            break;
-        default:
-            consumed = false;
-            break;
-        }
-    } else if(event->type == InputTypeRepeat) {
-        consumed = true;
-        switch(event->key) {
-        case InputKeyUp:
-            uart_text_input_handle_up(uart_text_input, model);
-            break;
-        case InputKeyDown:
-            uart_text_input_handle_down(uart_text_input, model);
-            break;
-        case InputKeyLeft:
-            uart_text_input_handle_left(uart_text_input, model);
-            break;
-        case InputKeyRight:
-            uart_text_input_handle_right(uart_text_input, model);
-            break;
-        case InputKeyBack:
-            uart_text_input_backspace_cb(model);
-            break;
-        default:
-            consumed = false;
-            break;
-        }
-    }
-
-    // Commit model
-    view_commit_model(uart_text_input->view, consumed);
-
-    return consumed;
-}
-
-void uart_text_input_timer_callback(void* context) {
-    furi_assert(context);
-    UART_TextInput* uart_text_input = context;
-
-    with_view_model(
-        uart_text_input->view,
-        UART_TextInputModel * model,
-        { model->valadator_message_visible = false; },
-        true);
-}
-
-UART_TextInput* uart_text_input_alloc() {
-    UART_TextInput* uart_text_input = malloc(sizeof(UART_TextInput));
-    uart_text_input->view = view_alloc();
-    view_set_context(uart_text_input->view, uart_text_input);
-    view_allocate_model(uart_text_input->view, ViewModelTypeLocking, sizeof(UART_TextInputModel));
-    view_set_draw_callback(uart_text_input->view, uart_text_input_view_draw_callback);
-    view_set_input_callback(uart_text_input->view, uart_text_input_view_input_callback);
-
-    uart_text_input->timer =
-        furi_timer_alloc(uart_text_input_timer_callback, FuriTimerTypeOnce, uart_text_input);
-
-    with_view_model(
-        uart_text_input->view,
-        UART_TextInputModel * model,
-        { model->validator_text = furi_string_alloc(); },
-        false);
-
-    uart_text_input_reset(uart_text_input);
-
-    return uart_text_input;
-}
-
-void uart_text_input_free(UART_TextInput* uart_text_input) {
-    furi_assert(uart_text_input);
-    with_view_model(
-        uart_text_input->view,
-        UART_TextInputModel * model,
-        { furi_string_free(model->validator_text); },
-        false);
-
-    // Send stop command
-    furi_timer_stop(uart_text_input->timer);
-    // Release allocated memory
-    furi_timer_free(uart_text_input->timer);
-
-    view_free(uart_text_input->view);
-
-    free(uart_text_input);
-}
-
-void uart_text_input_reset(UART_TextInput* uart_text_input) {
-    furi_assert(uart_text_input);
-    with_view_model(
-        uart_text_input->view,
-        UART_TextInputModel * model,
-        {
-            model->text_buffer_size = 0;
-            model->header = "";
-            model->selected_row = 0;
-            model->selected_column = 0;
-            model->clear_default_text = false;
-            model->text_buffer = NULL;
-            model->text_buffer_size = 0;
-            model->callback = NULL;
-            model->callback_context = NULL;
-            model->validator_callback = NULL;
-            model->validator_callback_context = NULL;
-            furi_string_reset(model->validator_text);
-            model->valadator_message_visible = false;
-        },
-        true);
-}
-
-View* uart_text_input_get_view(UART_TextInput* uart_text_input) {
-    furi_assert(uart_text_input);
-    return uart_text_input->view;
-}
-
-void uart_text_input_set_result_callback(
-    UART_TextInput* uart_text_input,
-    UART_TextInputCallback callback,
-    void* callback_context,
-    char* text_buffer,
-    size_t text_buffer_size,
-    bool clear_default_text) {
-    with_view_model(
-        uart_text_input->view,
-        UART_TextInputModel * model,
-        {
-            model->callback = callback;
-            model->callback_context = callback_context;
-            model->text_buffer = text_buffer;
-            model->text_buffer_size = text_buffer_size;
-            model->clear_default_text = clear_default_text;
-            if(text_buffer && text_buffer[0] != '\0') {
-                // Set focus on Save
-                model->selected_row = 2;
-                model->selected_column = 8;
-            }
-        },
-        true);
-}
-
-void uart_text_input_set_validator(
-    UART_TextInput* uart_text_input,
-    UART_TextInputValidatorCallback callback,
-    void* callback_context) {
-    with_view_model(
-        uart_text_input->view,
-        UART_TextInputModel * model,
-        {
-            model->validator_callback = callback;
-            model->validator_callback_context = callback_context;
-        },
-        true);
-}
-
-UART_TextInputValidatorCallback
-    uart_text_input_get_validator_callback(UART_TextInput* uart_text_input) {
-    UART_TextInputValidatorCallback validator_callback = NULL;
-    with_view_model(
-        uart_text_input->view,
-        UART_TextInputModel * model,
-        { validator_callback = model->validator_callback; },
-        false);
-    return validator_callback;
-}
-
-void* uart_text_input_get_validator_callback_context(UART_TextInput* uart_text_input) {
-    void* validator_callback_context = NULL;
-    with_view_model(
-        uart_text_input->view,
-        UART_TextInputModel * model,
-        { validator_callback_context = model->validator_callback_context; },
-        false);
-    return validator_callback_context;
-}
-
-void uart_text_input_set_header_text(UART_TextInput* uart_text_input, const char* text) {
-    with_view_model(
-        uart_text_input->view, UART_TextInputModel * model, { model->header = text; }, true);
-}

+ 0 - 82
apps_source_code/esp32cam_morseflasher/uart_text_input.h

@@ -1,82 +0,0 @@
-#pragma once
-
-#include <gui/view.h>
-#include "uart_validators.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** Text input anonymous structure */
-typedef struct UART_TextInput UART_TextInput;
-typedef void (*UART_TextInputCallback)(void* context);
-typedef bool (*UART_TextInputValidatorCallback)(const char* text, FuriString* error, void* context);
-
-/** Allocate and initialize text input 
- * 
- * This text input is used to enter string
- *
- * @return     UART_TextInput instance
- */
-UART_TextInput* uart_text_input_alloc();
-
-/** Deinitialize and free text input
- *
- * @param      uart_text_input  UART_TextInput instance
- */
-void uart_text_input_free(UART_TextInput* uart_text_input);
-
-/** Clean text input view Note: this function does not free memory
- *
- * @param      uart_text_input  Text input instance
- */
-void uart_text_input_reset(UART_TextInput* uart_text_input);
-
-/** Get text input view
- *
- * @param      uart_text_input  UART_TextInput instance
- *
- * @return     View instance that can be used for embedding
- */
-View* uart_text_input_get_view(UART_TextInput* uart_text_input);
-
-/** Set text input result callback
- *
- * @param      uart_text_input          UART_TextInput instance
- * @param      callback            callback fn
- * @param      callback_context    callback context
- * @param      text_buffer         pointer to YOUR text buffer, that we going
- *                                 to modify
- * @param      text_buffer_size    YOUR text buffer size in bytes. Max string
- *                                 length will be text_buffer_size-1.
- * @param      clear_default_text  clear text from text_buffer on first OK
- *                                 event
- */
-void uart_text_input_set_result_callback(
-    UART_TextInput* uart_text_input,
-    UART_TextInputCallback callback,
-    void* callback_context,
-    char* text_buffer,
-    size_t text_buffer_size,
-    bool clear_default_text);
-
-void uart_text_input_set_validator(
-    UART_TextInput* uart_text_input,
-    UART_TextInputValidatorCallback callback,
-    void* callback_context);
-
-UART_TextInputValidatorCallback
-    uart_text_input_get_validator_callback(UART_TextInput* uart_text_input);
-
-void* uart_text_input_get_validator_callback_context(UART_TextInput* uart_text_input);
-
-/** Set text input header text
- *
- * @param      uart_text_input  UART_TextInput instance
- * @param      text        text to be shown
- */
-void uart_text_input_set_header_text(UART_TextInput* uart_text_input, const char* text);
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 57
apps_source_code/esp32cam_morseflasher/uart_validators.c

@@ -1,57 +0,0 @@
-#include <furi.h>
-#include "uart_validators.h"
-#include <storage/storage.h>
-
-struct ValidatorIsFile {
-    char* app_path_folder;
-    const char* app_extension;
-    char* current_name;
-};
-
-bool validator_is_file_callback(const char* text, FuriString* error, void* context) {
-    furi_assert(context);
-    ValidatorIsFile* instance = context;
-
-    if(instance->current_name != NULL) {
-        if(strcmp(instance->current_name, text) == 0) {
-            return true;
-        }
-    }
-
-    bool ret = true;
-    FuriString* path = furi_string_alloc_printf(
-        "%s/%s%s", instance->app_path_folder, text, instance->app_extension);
-    Storage* storage = furi_record_open(RECORD_STORAGE);
-    if(storage_common_stat(storage, furi_string_get_cstr(path), NULL) == FSE_OK) {
-        ret = false;
-        furi_string_printf(error, "This name\nexists!\nChoose\nanother one.");
-    } else {
-        ret = true;
-    }
-    furi_string_free(path);
-    furi_record_close(RECORD_STORAGE);
-
-    return ret;
-}
-
-ValidatorIsFile* validator_is_file_alloc_init(
-    const char* app_path_folder,
-    const char* app_extension,
-    const char* current_name) {
-    ValidatorIsFile* instance = malloc(sizeof(ValidatorIsFile));
-
-    instance->app_path_folder = strdup(app_path_folder);
-    instance->app_extension = app_extension;
-    if(current_name != NULL) {
-        instance->current_name = strdup(current_name);
-    }
-
-    return instance;
-}
-
-void validator_is_file_free(ValidatorIsFile* instance) {
-    furi_assert(instance);
-    free(instance->app_path_folder);
-    free(instance->current_name);
-    free(instance);
-}

+ 0 - 21
apps_source_code/esp32cam_morseflasher/uart_validators.h

@@ -1,21 +0,0 @@
-#pragma once
-
-#include <core/common_defines.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-typedef struct ValidatorIsFile ValidatorIsFile;
-
-ValidatorIsFile* validator_is_file_alloc_init(
-    const char* app_path_folder,
-    const char* app_extension,
-    const char* current_name);
-
-void validator_is_file_free(ValidatorIsFile* instance);
-
-bool validator_is_file_callback(const char* text, FuriString* error, void* context);
-
-#ifdef __cplusplus
-}
-#endif

BIN
apps_source_code/esp32cam_motion_detection/.flipcorg/banner.png


BIN
apps_source_code/esp32cam_motion_detection/.flipcorg/gallery/mot1.png


BIN
apps_source_code/esp32cam_motion_detection/.flipcorg/gallery/mot2.png


+ 0 - 15
apps_source_code/esp32cam_motion_detection/application.fam

@@ -1,15 +0,0 @@
-App(
-    appid="mayhem_motion",
-    name="[MAYHEM] Motion detection",
-    apptype=FlipperAppType.EXTERNAL,
-    entry_point="uart_echo_app",
-    cdefines=["APP_QRCODE"],
-    requires=["gui"],
-    stack_size=8 * 1024,
-    order=1,
-    fap_icon="icon.png",
-    fap_category="GPIO",
-    fap_description="ESP32-CAM Motion detection. It generates a beep when motion is detected. Can be extended to trigger more stuff in the code. [Unplug the USB cable to test with Mayhem]",
-    fap_author="eried",
-    fap_weburl="https://flipper.ried.cl",
-)

BIN
apps_source_code/esp32cam_motion_detection/icon.png


+ 0 - 240
apps_source_code/esp32cam_motion_detection/uart_echo.c

@@ -1,240 +0,0 @@
-#include "uart_echo.h"
-
-static void uart_echo_view_draw_callback(Canvas* canvas, void* _model) {
-    UartDumpModel* model = _model;
-
-    // Prepare canvas
-    canvas_clear(canvas);
-    canvas_set_color(canvas, ColorBlack);
-    canvas_set_font(canvas, FontKeyboard);
-
-    for(size_t i = 0; i < LINES_ON_SCREEN; i++) {
-        canvas_draw_str(
-            canvas,
-            0,
-            (i + 1) * (canvas_current_font_height(canvas) - 1),
-            furi_string_get_cstr(model->list[i]->text));
-
-        if(i == model->line) {
-            uint8_t width =
-                canvas_string_width(canvas, furi_string_get_cstr(model->list[i]->text));
-
-            canvas_draw_box(
-                canvas,
-                width,
-                (i) * (canvas_current_font_height(canvas) - 1) + 2,
-                2,
-                canvas_current_font_height(canvas) - 2);
-        }
-    }
-}
-
-static bool uart_echo_view_input_callback(InputEvent* event, void* context) {
-    UNUSED(event);
-    UNUSED(context);
-    return false;
-}
-
-static uint32_t uart_echo_exit(void* context) {
-    UNUSED(context);
-    return VIEW_NONE;
-}
-
-static void uart_echo_on_irq_cb(UartIrqEvent ev, uint8_t data, void* context) {
-    furi_assert(context);
-    UartEchoApp* app = context;
-
-    if(ev == UartIrqEventRXNE) {
-        furi_stream_buffer_send(app->rx_stream, &data, 1, 0);
-        furi_thread_flags_set(furi_thread_get_id(app->worker_thread), WorkerEventRx);
-    }
-}
-
-static void uart_echo_push_to_list(UartDumpModel* model, void* context, const char data) {
-    // Alarm sound
-    if(data == '!') {
-        UartEchoApp* app = context;
-        notification_message(app->notification, &sequence_alarm);
-    }
-
-    if(model->escape) {
-        // escape code end with letter
-        if((data >= 'a' && data <= 'z') || (data >= 'A' && data <= 'Z')) {
-            model->escape = false;
-        }
-    } else if(data == '[' && model->last_char == '\e') {
-        // "Esc[" is a escape code
-        model->escape = true;
-    } else if((data >= ' ' && data <= '~') || (data == '\n' || data == '\r')) {
-        bool new_string_needed = false;
-        if(furi_string_size(model->list[model->line]->text) >= COLUMNS_ON_SCREEN) {
-            new_string_needed = true;
-        } else if((data == '\n' || data == '\r')) {
-            // pack line breaks
-            if(model->last_char != '\n' && model->last_char != '\r') {
-                new_string_needed = true;
-            }
-        }
-
-        if(new_string_needed) {
-            if((model->line + 1) < LINES_ON_SCREEN) {
-                model->line += 1;
-            } else {
-                ListElement* first = model->list[0];
-
-                for(size_t i = 1; i < LINES_ON_SCREEN; i++) {
-                    model->list[i - 1] = model->list[i];
-                }
-
-                furi_string_reset(first->text);
-                model->list[model->line] = first;
-            }
-        }
-
-        if(data != '\n' && data != '\r') {
-            furi_string_push_back(model->list[model->line]->text, data);
-        }
-    }
-    model->last_char = data;
-}
-
-static int32_t uart_echo_worker(void* context) {
-    furi_assert(context);
-    UartEchoApp* app = context;
-
-    while(1) {
-        uint32_t events =
-            furi_thread_flags_wait(WORKER_EVENTS_MASK, FuriFlagWaitAny, FuriWaitForever);
-        furi_check((events & FuriFlagError) == 0);
-
-        if(events & WorkerEventStop) break;
-        if(events & WorkerEventRx) {
-            size_t length = 0;
-            do {
-                uint8_t data[64];
-                length = furi_stream_buffer_receive(app->rx_stream, data, 64, 0);
-                if(length > 0 && app->initialized) {
-                    furi_hal_uart_tx(FuriHalUartIdUSART1, data, length);
-                    with_view_model(
-                        app->view,
-                        UartDumpModel * model,
-                        {
-                            for(size_t i = 0; i < length; i++) {
-                                uart_echo_push_to_list(model, app, data[i]);
-                            }
-                        },
-                        false);
-                }
-            } while(length > 0);
-
-            //notification_message(app->notification, &sequence_notification);
-            with_view_model(
-                app->view, UartDumpModel * model, { UNUSED(model); }, true);
-        }
-    }
-
-    return 0;
-}
-
-static UartEchoApp* uart_echo_app_alloc() {
-    UartEchoApp* app = malloc(sizeof(UartEchoApp));
-
-    app->rx_stream = furi_stream_buffer_alloc(2048, 1);
-
-    // Gui
-    app->gui = furi_record_open(RECORD_GUI);
-    app->notification = furi_record_open(RECORD_NOTIFICATION);
-
-    // View dispatcher
-    app->view_dispatcher = view_dispatcher_alloc();
-    view_dispatcher_enable_queue(app->view_dispatcher);
-    view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen);
-
-    // Views
-    app->view = view_alloc();
-    view_set_draw_callback(app->view, uart_echo_view_draw_callback);
-    view_set_input_callback(app->view, uart_echo_view_input_callback);
-    view_allocate_model(app->view, ViewModelTypeLocking, sizeof(UartDumpModel));
-    with_view_model(
-        app->view,
-        UartDumpModel * model,
-        {
-            for(size_t i = 0; i < LINES_ON_SCREEN; i++) {
-                model->line = 0;
-                model->escape = false;
-                model->list[i] = malloc(sizeof(ListElement));
-                model->list[i]->text = furi_string_alloc();
-            }
-        },
-        true);
-
-    view_set_previous_callback(app->view, uart_echo_exit);
-    view_dispatcher_add_view(app->view_dispatcher, 0, app->view);
-    view_dispatcher_switch_to_view(app->view_dispatcher, 0);
-
-    app->worker_thread = furi_thread_alloc_ex("UsbUartWorker", 1024, uart_echo_worker, app);
-    furi_thread_start(app->worker_thread);
-
-    // Enable uart listener
-    furi_hal_console_disable();
-    furi_hal_uart_set_br(FuriHalUartIdUSART1, 230400);
-    furi_hal_uart_set_irq_cb(FuriHalUartIdUSART1, uart_echo_on_irq_cb, app);
-
-    furi_hal_power_disable_external_3_3v();
-    furi_hal_power_disable_otg();
-    furi_delay_ms(200);
-    furi_hal_power_enable_external_3_3v();
-    furi_hal_power_enable_otg();
-    for(int i = 0; i < 2; i++) {
-        furi_delay_ms(500);
-        furi_hal_uart_tx(FuriHalUartIdUSART1, (uint8_t[1]){'m'}, 1);
-    }
-    furi_delay_ms(1);
-    app->initialized = true;
-    return app;
-}
-
-static void uart_echo_app_free(UartEchoApp* app) {
-    furi_assert(app);
-
-    furi_hal_console_enable(); // this will also clear IRQ callback so thread is no longer referenced
-
-    furi_thread_flags_set(furi_thread_get_id(app->worker_thread), WorkerEventStop);
-    furi_thread_join(app->worker_thread);
-    furi_thread_free(app->worker_thread);
-
-    // Free views
-    view_dispatcher_remove_view(app->view_dispatcher, 0);
-
-    with_view_model(
-        app->view,
-        UartDumpModel * model,
-        {
-            for(size_t i = 0; i < LINES_ON_SCREEN; i++) {
-                furi_string_free(model->list[i]->text);
-                free(model->list[i]);
-            }
-        },
-        true);
-    view_free(app->view);
-    view_dispatcher_free(app->view_dispatcher);
-
-    // Close gui record
-    furi_record_close(RECORD_GUI);
-    furi_record_close(RECORD_NOTIFICATION);
-    app->gui = NULL;
-
-    furi_stream_buffer_free(app->rx_stream);
-
-    // Free rest
-    free(app);
-}
-
-int32_t uart_echo_app(void* p) {
-    UNUSED(p);
-    UartEchoApp* app = uart_echo_app_alloc();
-    view_dispatcher_run(app->view_dispatcher);
-    uart_echo_app_free(app);
-    furi_hal_power_disable_otg();
-    return 0;
-}

+ 0 - 69
apps_source_code/esp32cam_motion_detection/uart_echo.h

@@ -1,69 +0,0 @@
-#include <furi.h>
-#include <furi_hal.h>
-#include <gui/gui.h>
-#include <notification/notification.h>
-#include <notification/notification_messages.h>
-#include <gui/elements.h>
-#include <furi_hal_uart.h>
-#include <furi_hal_console.h>
-#include <gui/view_dispatcher.h>
-#include <gui/modules/dialog_ex.h>
-
-#define LINES_ON_SCREEN 6
-#define COLUMNS_ON_SCREEN 21
-
-static const NotificationSequence sequence_alarm = {
-    &message_display_backlight_on,
-    &message_red_255,
-    //&message_vibro_on,
-    &message_note_d5,
-    &message_delay_100,
-    //&message_vibro_off,
-    &message_sound_off,
-    &message_note_b4,
-    &message_delay_50,
-    &message_sound_off,
-    &message_display_backlight_off,
-    //&message_red_0,
-    //&message_delay_50,
-    NULL,
-};
-
-typedef struct UartDumpModel UartDumpModel;
-
-typedef struct {
-    Gui* gui;
-    NotificationApp* notification;
-    ViewDispatcher* view_dispatcher;
-    View* view;
-    FuriThread* worker_thread;
-    FuriStreamBuffer* rx_stream;
-    bool initialized;
-} UartEchoApp;
-
-typedef struct {
-    FuriString* text;
-} ListElement;
-
-struct UartDumpModel {
-    ListElement* list[LINES_ON_SCREEN];
-    uint8_t line;
-
-    char last_char;
-    bool escape;
-};
-
-typedef enum {
-    WorkerEventReserved = (1 << 0), // Reserved for StreamBuffer internal event
-    WorkerEventStop = (1 << 1),
-    WorkerEventRx = (1 << 2),
-} WorkerEventFlags;
-
-#define WORKER_EVENTS_MASK (WorkerEventStop | WorkerEventRx)
-
-/*const NotificationSequence sequence_notification = {
-    &message_display_backlight_on,
-    &message_green_255,
-    &message_delay_10,
-    NULL,
-};*/

BIN
apps_source_code/esp32cam_nannycam/.flipcorg/banner.png


BIN
apps_source_code/esp32cam_nannycam/.flipcorg/gallery/1.png


BIN
apps_source_code/esp32cam_nannycam/.flipcorg/gallery/2.png


+ 0 - 15
apps_source_code/esp32cam_nannycam/application.fam

@@ -1,15 +0,0 @@
-App(
-    appid="mayhem_nannycam",
-    name="[MAYHEM] Nanny Cam",
-    apptype=FlipperAppType.EXTERNAL,
-    entry_point="uart_echo_app",
-    cdefines=["APP_QRCODE"],
-    requires=["gui"],
-    stack_size=8 * 1024,
-    order=1,
-    fap_icon="icon.png",
-    fap_category="GPIO",
-    fap_description="ESP32-CAM simple app to start a remote camera. [Unplug the USB cable to test with Mayhem]",
-    fap_author="eried",
-    fap_weburl="https://flipper.ried.cl",
-)

BIN
apps_source_code/esp32cam_nannycam/icon.png


+ 0 - 234
apps_source_code/esp32cam_nannycam/uart_echo.c

@@ -1,234 +0,0 @@
-#include "uart_echo.h"
-
-static void uart_echo_view_draw_callback(Canvas* canvas, void* _model) {
-    UartDumpModel* model = _model;
-
-    // Prepare canvas
-    canvas_clear(canvas);
-    canvas_set_color(canvas, ColorBlack);
-    canvas_set_font(canvas, FontKeyboard);
-
-    for(size_t i = 0; i < LINES_ON_SCREEN; i++) {
-        canvas_draw_str(
-            canvas,
-            0,
-            (i + 1) * (canvas_current_font_height(canvas) - 1),
-            furi_string_get_cstr(model->list[i]->text));
-
-        if(i == model->line) {
-            uint8_t width =
-                canvas_string_width(canvas, furi_string_get_cstr(model->list[i]->text));
-
-            canvas_draw_box(
-                canvas,
-                width,
-                (i) * (canvas_current_font_height(canvas) - 1) + 2,
-                2,
-                canvas_current_font_height(canvas) - 2);
-        }
-    }
-}
-
-static bool uart_echo_view_input_callback(InputEvent* event, void* context) {
-    UNUSED(event);
-    UNUSED(context);
-    return false;
-}
-
-static uint32_t uart_echo_exit(void* context) {
-    UNUSED(context);
-    return VIEW_NONE;
-}
-
-static void uart_echo_on_irq_cb(UartIrqEvent ev, uint8_t data, void* context) {
-    furi_assert(context);
-    UartEchoApp* app = context;
-
-    if(ev == UartIrqEventRXNE) {
-        furi_stream_buffer_send(app->rx_stream, &data, 1, 0);
-        furi_thread_flags_set(furi_thread_get_id(app->worker_thread), WorkerEventRx);
-    }
-}
-
-static void uart_echo_push_to_list(UartDumpModel* model, const char data) {
-    if(model->escape) {
-        // escape code end with letter
-        if((data >= 'a' && data <= 'z') || (data >= 'A' && data <= 'Z')) {
-            model->escape = false;
-        }
-    } else if(data == '[' && model->last_char == '\e') {
-        // "Esc[" is a escape code
-        model->escape = true;
-    } else if((data >= ' ' && data <= '~') || (data == '\n' || data == '\r')) {
-        bool new_string_needed = false;
-        if(furi_string_size(model->list[model->line]->text) >= COLUMNS_ON_SCREEN) {
-            new_string_needed = true;
-        } else if((data == '\n' || data == '\r')) {
-            // pack line breaks
-            if(model->last_char != '\n' && model->last_char != '\r') {
-                new_string_needed = true;
-            }
-        }
-
-        if(new_string_needed) {
-            if((model->line + 1) < LINES_ON_SCREEN) {
-                model->line += 1;
-            } else {
-                ListElement* first = model->list[0];
-
-                for(size_t i = 1; i < LINES_ON_SCREEN; i++) {
-                    model->list[i - 1] = model->list[i];
-                }
-
-                furi_string_reset(first->text);
-                model->list[model->line] = first;
-            }
-        }
-
-        if(data != '\n' && data != '\r') {
-            furi_string_push_back(model->list[model->line]->text, data);
-        }
-    }
-    model->last_char = data;
-}
-
-static int32_t uart_echo_worker(void* context) {
-    furi_assert(context);
-    UartEchoApp* app = context;
-
-    while(1) {
-        uint32_t events =
-            furi_thread_flags_wait(WORKER_EVENTS_MASK, FuriFlagWaitAny, FuriWaitForever);
-        furi_check((events & FuriFlagError) == 0);
-
-        if(events & WorkerEventStop) break;
-        if(events & WorkerEventRx) {
-            size_t length = 0;
-            do {
-                uint8_t data[64];
-                length = furi_stream_buffer_receive(app->rx_stream, data, 64, 0);
-                if(length > 0 && app->initialized) {
-                    furi_hal_uart_tx(FuriHalUartIdUSART1, data, length);
-                    with_view_model(
-                        app->view,
-                        UartDumpModel * model,
-                        {
-                            for(size_t i = 0; i < length; i++) {
-                                uart_echo_push_to_list(model, data[i]);
-                            }
-                        },
-                        false);
-                }
-            } while(length > 0);
-
-            notification_message(app->notification, &sequence_notification);
-            with_view_model(
-                app->view, UartDumpModel * model, { UNUSED(model); }, true);
-        }
-    }
-
-    return 0;
-}
-
-static UartEchoApp* uart_echo_app_alloc() {
-    UartEchoApp* app = malloc(sizeof(UartEchoApp));
-
-    app->rx_stream = furi_stream_buffer_alloc(2048, 1);
-
-    // Gui
-    app->gui = furi_record_open(RECORD_GUI);
-    app->notification = furi_record_open(RECORD_NOTIFICATION);
-
-    // View dispatcher
-    app->view_dispatcher = view_dispatcher_alloc();
-    view_dispatcher_enable_queue(app->view_dispatcher);
-    view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen);
-
-    // Views
-    app->view = view_alloc();
-    view_set_draw_callback(app->view, uart_echo_view_draw_callback);
-    view_set_input_callback(app->view, uart_echo_view_input_callback);
-    view_allocate_model(app->view, ViewModelTypeLocking, sizeof(UartDumpModel));
-    with_view_model(
-        app->view,
-        UartDumpModel * model,
-        {
-            for(size_t i = 0; i < LINES_ON_SCREEN; i++) {
-                model->line = 0;
-                model->escape = false;
-                model->list[i] = malloc(sizeof(ListElement));
-                model->list[i]->text = furi_string_alloc();
-            }
-        },
-        true);
-
-    view_set_previous_callback(app->view, uart_echo_exit);
-    view_dispatcher_add_view(app->view_dispatcher, 0, app->view);
-    view_dispatcher_switch_to_view(app->view_dispatcher, 0);
-
-    app->worker_thread = furi_thread_alloc_ex("UsbUartWorker", 1024, uart_echo_worker, app);
-    furi_thread_start(app->worker_thread);
-
-    // Enable uart listener
-    furi_hal_console_disable();
-    furi_hal_uart_set_br(FuriHalUartIdUSART1, 230400);
-    furi_hal_uart_set_irq_cb(FuriHalUartIdUSART1, uart_echo_on_irq_cb, app);
-
-    furi_hal_power_disable_external_3_3v();
-    furi_hal_power_disable_otg();
-    furi_delay_ms(200);
-    furi_hal_power_enable_external_3_3v();
-    furi_hal_power_enable_otg();
-    for(int i = 0; i < 2; i++) {
-        furi_delay_ms(500);
-        furi_hal_uart_tx(FuriHalUartIdUSART1, (uint8_t[1]){'n'}, 1);
-    }
-    furi_delay_ms(1);
-    app->initialized = true;
-    return app;
-}
-
-static void uart_echo_app_free(UartEchoApp* app) {
-    furi_assert(app);
-
-    furi_hal_console_enable(); // this will also clear IRQ callback so thread is no longer referenced
-
-    furi_thread_flags_set(furi_thread_get_id(app->worker_thread), WorkerEventStop);
-    furi_thread_join(app->worker_thread);
-    furi_thread_free(app->worker_thread);
-
-    // Free views
-    view_dispatcher_remove_view(app->view_dispatcher, 0);
-
-    with_view_model(
-        app->view,
-        UartDumpModel * model,
-        {
-            for(size_t i = 0; i < LINES_ON_SCREEN; i++) {
-                furi_string_free(model->list[i]->text);
-                free(model->list[i]);
-            }
-        },
-        true);
-    view_free(app->view);
-    view_dispatcher_free(app->view_dispatcher);
-
-    // Close gui record
-    furi_record_close(RECORD_GUI);
-    furi_record_close(RECORD_NOTIFICATION);
-    app->gui = NULL;
-
-    furi_stream_buffer_free(app->rx_stream);
-
-    // Free rest
-    free(app);
-}
-
-int32_t uart_echo_app(void* p) {
-    UNUSED(p);
-    UartEchoApp* app = uart_echo_app_alloc();
-    view_dispatcher_run(app->view_dispatcher);
-    uart_echo_app_free(app);
-    furi_hal_power_disable_otg();
-    return 0;
-}

+ 0 - 52
apps_source_code/esp32cam_nannycam/uart_echo.h

@@ -1,52 +0,0 @@
-#include <furi.h>
-#include <furi_hal.h>
-#include <gui/gui.h>
-#include <notification/notification.h>
-#include <notification/notification_messages.h>
-#include <gui/elements.h>
-#include <furi_hal_uart.h>
-#include <furi_hal_console.h>
-#include <gui/view_dispatcher.h>
-#include <gui/modules/dialog_ex.h>
-
-#define LINES_ON_SCREEN 6
-#define COLUMNS_ON_SCREEN 21
-
-typedef struct UartDumpModel UartDumpModel;
-
-typedef struct {
-    Gui* gui;
-    NotificationApp* notification;
-    ViewDispatcher* view_dispatcher;
-    View* view;
-    FuriThread* worker_thread;
-    FuriStreamBuffer* rx_stream;
-    bool initialized;
-} UartEchoApp;
-
-typedef struct {
-    FuriString* text;
-} ListElement;
-
-struct UartDumpModel {
-    ListElement* list[LINES_ON_SCREEN];
-    uint8_t line;
-
-    char last_char;
-    bool escape;
-};
-
-typedef enum {
-    WorkerEventReserved = (1 << 0), // Reserved for StreamBuffer internal event
-    WorkerEventStop = (1 << 1),
-    WorkerEventRx = (1 << 2),
-} WorkerEventFlags;
-
-#define WORKER_EVENTS_MASK (WorkerEventStop | WorkerEventRx)
-
-const NotificationSequence sequence_notification = {
-    &message_display_backlight_on,
-    &message_green_255,
-    &message_delay_10,
-    NULL,
-};

BIN
apps_source_code/esp32cam_qrcode/.flipcorg/banner.png


BIN
apps_source_code/esp32cam_qrcode/.flipcorg/gallery/qr1.png


BIN
apps_source_code/esp32cam_qrcode/.flipcorg/gallery/qr2.png


BIN
apps_source_code/esp32cam_qrcode/.flipcorg/gallery/qr3.png


+ 0 - 15
apps_source_code/esp32cam_qrcode/application.fam

@@ -1,15 +0,0 @@
-App(
-    appid="mayhem_qrcode",
-    name="[MAYHEM] QR Code",
-    apptype=FlipperAppType.EXTERNAL,
-    entry_point="uart_echo_app",
-    cdefines=["APP_QRCODE"],
-    requires=["gui"],
-    stack_size=8 * 1024,
-    order=1,
-    fap_icon="icon.png",
-    fap_category="GPIO",
-    fap_description="ESP32-CAM simple app to show a payload from QR codes. Can be extended to trigger more stuff in the code. [Unplug the USB cable to test with Mayhem]",
-    fap_author="eried",
-    fap_weburl="https://flipper.ried.cl",
-)

BIN
apps_source_code/esp32cam_qrcode/icon.png


+ 0 - 234
apps_source_code/esp32cam_qrcode/uart_echo.c

@@ -1,234 +0,0 @@
-#include "uart_echo.h"
-
-static void uart_echo_view_draw_callback(Canvas* canvas, void* _model) {
-    UartDumpModel* model = _model;
-
-    // Prepare canvas
-    canvas_clear(canvas);
-    canvas_set_color(canvas, ColorBlack);
-    canvas_set_font(canvas, FontKeyboard);
-
-    for(size_t i = 0; i < LINES_ON_SCREEN; i++) {
-        canvas_draw_str(
-            canvas,
-            0,
-            (i + 1) * (canvas_current_font_height(canvas) - 1),
-            furi_string_get_cstr(model->list[i]->text));
-
-        if(i == model->line) {
-            uint8_t width =
-                canvas_string_width(canvas, furi_string_get_cstr(model->list[i]->text));
-
-            canvas_draw_box(
-                canvas,
-                width,
-                (i) * (canvas_current_font_height(canvas) - 1) + 2,
-                2,
-                canvas_current_font_height(canvas) - 2);
-        }
-    }
-}
-
-static bool uart_echo_view_input_callback(InputEvent* event, void* context) {
-    UNUSED(event);
-    UNUSED(context);
-    return false;
-}
-
-static uint32_t uart_echo_exit(void* context) {
-    UNUSED(context);
-    return VIEW_NONE;
-}
-
-static void uart_echo_on_irq_cb(UartIrqEvent ev, uint8_t data, void* context) {
-    furi_assert(context);
-    UartEchoApp* app = context;
-
-    if(ev == UartIrqEventRXNE) {
-        furi_stream_buffer_send(app->rx_stream, &data, 1, 0);
-        furi_thread_flags_set(furi_thread_get_id(app->worker_thread), WorkerEventRx);
-    }
-}
-
-static void uart_echo_push_to_list(UartDumpModel* model, const char data) {
-    if(model->escape) {
-        // escape code end with letter
-        if((data >= 'a' && data <= 'z') || (data >= 'A' && data <= 'Z')) {
-            model->escape = false;
-        }
-    } else if(data == '[' && model->last_char == '\e') {
-        // "Esc[" is a escape code
-        model->escape = true;
-    } else if((data >= ' ' && data <= '~') || (data == '\n' || data == '\r')) {
-        bool new_string_needed = false;
-        if(furi_string_size(model->list[model->line]->text) >= COLUMNS_ON_SCREEN) {
-            new_string_needed = true;
-        } else if((data == '\n' || data == '\r')) {
-            // pack line breaks
-            if(model->last_char != '\n' && model->last_char != '\r') {
-                new_string_needed = true;
-            }
-        }
-
-        if(new_string_needed) {
-            if((model->line + 1) < LINES_ON_SCREEN) {
-                model->line += 1;
-            } else {
-                ListElement* first = model->list[0];
-
-                for(size_t i = 1; i < LINES_ON_SCREEN; i++) {
-                    model->list[i - 1] = model->list[i];
-                }
-
-                furi_string_reset(first->text);
-                model->list[model->line] = first;
-            }
-        }
-
-        if(data != '\n' && data != '\r') {
-            furi_string_push_back(model->list[model->line]->text, data);
-        }
-    }
-    model->last_char = data;
-}
-
-static int32_t uart_echo_worker(void* context) {
-    furi_assert(context);
-    UartEchoApp* app = context;
-
-    while(1) {
-        uint32_t events =
-            furi_thread_flags_wait(WORKER_EVENTS_MASK, FuriFlagWaitAny, FuriWaitForever);
-        furi_check((events & FuriFlagError) == 0);
-
-        if(events & WorkerEventStop) break;
-        if(events & WorkerEventRx) {
-            size_t length = 0;
-            do {
-                uint8_t data[64];
-                length = furi_stream_buffer_receive(app->rx_stream, data, 64, 0);
-                if(length > 0 && app->initialized) {
-                    furi_hal_uart_tx(FuriHalUartIdUSART1, data, length);
-                    with_view_model(
-                        app->view,
-                        UartDumpModel * model,
-                        {
-                            for(size_t i = 0; i < length; i++) {
-                                uart_echo_push_to_list(model, data[i]);
-                            }
-                        },
-                        false);
-                }
-            } while(length > 0);
-
-            notification_message(app->notification, &sequence_notification);
-            with_view_model(
-                app->view, UartDumpModel * model, { UNUSED(model); }, true);
-        }
-    }
-
-    return 0;
-}
-
-static UartEchoApp* uart_echo_app_alloc() {
-    UartEchoApp* app = malloc(sizeof(UartEchoApp));
-
-    app->rx_stream = furi_stream_buffer_alloc(2048, 1);
-
-    // Gui
-    app->gui = furi_record_open(RECORD_GUI);
-    app->notification = furi_record_open(RECORD_NOTIFICATION);
-
-    // View dispatcher
-    app->view_dispatcher = view_dispatcher_alloc();
-    view_dispatcher_enable_queue(app->view_dispatcher);
-    view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen);
-
-    // Views
-    app->view = view_alloc();
-    view_set_draw_callback(app->view, uart_echo_view_draw_callback);
-    view_set_input_callback(app->view, uart_echo_view_input_callback);
-    view_allocate_model(app->view, ViewModelTypeLocking, sizeof(UartDumpModel));
-    with_view_model(
-        app->view,
-        UartDumpModel * model,
-        {
-            for(size_t i = 0; i < LINES_ON_SCREEN; i++) {
-                model->line = 0;
-                model->escape = false;
-                model->list[i] = malloc(sizeof(ListElement));
-                model->list[i]->text = furi_string_alloc();
-            }
-        },
-        true);
-
-    view_set_previous_callback(app->view, uart_echo_exit);
-    view_dispatcher_add_view(app->view_dispatcher, 0, app->view);
-    view_dispatcher_switch_to_view(app->view_dispatcher, 0);
-
-    app->worker_thread = furi_thread_alloc_ex("UsbUartWorker", 1024, uart_echo_worker, app);
-    furi_thread_start(app->worker_thread);
-
-    // Enable uart listener
-    furi_hal_console_disable();
-    furi_hal_uart_set_br(FuriHalUartIdUSART1, 230400);
-    furi_hal_uart_set_irq_cb(FuriHalUartIdUSART1, uart_echo_on_irq_cb, app);
-
-    furi_hal_power_disable_external_3_3v();
-    furi_hal_power_disable_otg();
-    furi_delay_ms(200);
-    furi_hal_power_enable_external_3_3v();
-    furi_hal_power_enable_otg();
-    for(int i = 0; i < 2; i++) {
-        furi_delay_ms(500);
-        furi_hal_uart_tx(FuriHalUartIdUSART1, (uint8_t[1]){'q'}, 1);
-    }
-    furi_delay_ms(1);
-    app->initialized = true;
-    return app;
-}
-
-static void uart_echo_app_free(UartEchoApp* app) {
-    furi_assert(app);
-
-    furi_hal_console_enable(); // this will also clear IRQ callback so thread is no longer referenced
-
-    furi_thread_flags_set(furi_thread_get_id(app->worker_thread), WorkerEventStop);
-    furi_thread_join(app->worker_thread);
-    furi_thread_free(app->worker_thread);
-
-    // Free views
-    view_dispatcher_remove_view(app->view_dispatcher, 0);
-
-    with_view_model(
-        app->view,
-        UartDumpModel * model,
-        {
-            for(size_t i = 0; i < LINES_ON_SCREEN; i++) {
-                furi_string_free(model->list[i]->text);
-                free(model->list[i]);
-            }
-        },
-        true);
-    view_free(app->view);
-    view_dispatcher_free(app->view_dispatcher);
-
-    // Close gui record
-    furi_record_close(RECORD_GUI);
-    furi_record_close(RECORD_NOTIFICATION);
-    app->gui = NULL;
-
-    furi_stream_buffer_free(app->rx_stream);
-
-    // Free rest
-    free(app);
-}
-
-int32_t uart_echo_app(void* p) {
-    UNUSED(p);
-    UartEchoApp* app = uart_echo_app_alloc();
-    view_dispatcher_run(app->view_dispatcher);
-    uart_echo_app_free(app);
-    furi_hal_power_disable_otg();
-    return 0;
-}

+ 0 - 52
apps_source_code/esp32cam_qrcode/uart_echo.h

@@ -1,52 +0,0 @@
-#include <furi.h>
-#include <furi_hal.h>
-#include <gui/gui.h>
-#include <notification/notification.h>
-#include <notification/notification_messages.h>
-#include <gui/elements.h>
-#include <furi_hal_uart.h>
-#include <furi_hal_console.h>
-#include <gui/view_dispatcher.h>
-#include <gui/modules/dialog_ex.h>
-
-#define LINES_ON_SCREEN 6
-#define COLUMNS_ON_SCREEN 21
-
-typedef struct UartDumpModel UartDumpModel;
-
-typedef struct {
-    Gui* gui;
-    NotificationApp* notification;
-    ViewDispatcher* view_dispatcher;
-    View* view;
-    FuriThread* worker_thread;
-    FuriStreamBuffer* rx_stream;
-    bool initialized;
-} UartEchoApp;
-
-typedef struct {
-    FuriString* text;
-} ListElement;
-
-struct UartDumpModel {
-    ListElement* list[LINES_ON_SCREEN];
-    uint8_t line;
-
-    char last_char;
-    bool escape;
-};
-
-typedef enum {
-    WorkerEventReserved = (1 << 0), // Reserved for StreamBuffer internal event
-    WorkerEventStop = (1 << 1),
-    WorkerEventRx = (1 << 2),
-} WorkerEventFlags;
-
-#define WORKER_EVENTS_MASK (WorkerEventStop | WorkerEventRx)
-
-const NotificationSequence sequence_notification = {
-    &message_display_backlight_on,
-    &message_green_255,
-    &message_delay_10,
-    NULL,
-};

+ 0 - 0
apps_source_code/barcode_gen/LICENSE → main_apps_sources/barcode_gen/LICENSE


+ 4 - 4
apps_source_code/barcode_gen/README.md → main_apps_sources/barcode_gen/README.md

@@ -80,9 +80,9 @@ For example, if you wanted to represent `1234` as a barcode you will need to ent
 
 ## Credits
 
-[Kingal1337](https://github.com/Kingal1337) - Developer
+- [Kingal1337](https://github.com/Kingal1337) - Developer
+- [Z0wl](https://github.com/Z0wl) - Added Code128-C Support
+- [@teeebor](https://github.com/teeebor) - Menu Code Snippet
 
-[@teeebor](https://github.com/teeebor) - Menu Code Snippet
 
-
-[1] - Only supports Set B and only the characters from 0-94
+[1] - supports Set B (only the characters from 0-94). Also supports Set C

+ 0 - 0
apps_source_code/barcode_gen/application.fam → main_apps_sources/barcode_gen/application.fam


+ 0 - 0
apps_source_code/barcode_gen/barcode_app.c → main_apps_sources/barcode_gen/barcode_app.c


+ 4 - 1
apps_source_code/barcode_gen/barcode_app.h → main_apps_sources/barcode_gen/barcode_app.h

@@ -35,6 +35,9 @@
 //the folder where the code 128 encoding table is located
 #define CODE128_DICT_FILE_PATH BARCODE_DATA_FILE_DIR_PATH "/code128_encodings.txt"
 
+//the folder where the code 128 C encoding table is located
+#define CODE128C_DICT_FILE_PATH BARCODE_DATA_FILE_DIR_PATH "/code128c_encodings.txt"
+
 //the folder where the user stores their barcodes
 #define DEFAULT_USER_BARCODES EXT_PATH("apps_data/barcodes")
 
@@ -85,4 +88,4 @@ uint32_t main_menu_callback(void* context);
 
 uint32_t exit_callback(void* context);
 
-int32_t barcode_main(void* p);
+int32_t barcode_main(void* p);

+ 12 - 1
apps_source_code/barcode_gen/barcode_utils.c → main_apps_sources/barcode_gen/barcode_utils.c

@@ -43,6 +43,14 @@ void init_types() {
     code_128->start_pos = 0;
     barcode_type_objs[CODE128] = code_128;
 
+    BarcodeTypeObj* code_128c = malloc(sizeof(BarcodeTypeObj));
+    code_128c->name = "CODE-128C";
+    code_128c->type = CODE128C;
+    code_128c->min_digits = 2;
+    code_128c->max_digits = -1;
+    code_128c->start_pos = 0;
+    barcode_type_objs[CODE128C] = code_128c;
+
     BarcodeTypeObj* codabar = malloc(sizeof(BarcodeTypeObj));
     codabar->name = "Codabar";
     codabar->type = CODABAR;
@@ -82,6 +90,9 @@ BarcodeTypeObj* get_type(FuriString* type_string) {
     if(furi_string_cmp_str(type_string, "CODE-128") == 0) {
         return barcode_type_objs[CODE128];
     }
+    if(furi_string_cmp_str(type_string, "CODE-128C") == 0) {
+        return barcode_type_objs[CODE128C];
+    }
     if(furi_string_cmp_str(type_string, "Codabar") == 0) {
         return barcode_type_objs[CODABAR];
     }
@@ -133,4 +144,4 @@ const char* get_error_code_message(ErrorCode error_code) {
     default:
         return "Could not read barcode data";
     };
-}
+}

+ 3 - 2
apps_source_code/barcode_gen/barcode_utils.h → main_apps_sources/barcode_gen/barcode_utils.h

@@ -3,7 +3,7 @@
 #include <furi.h>
 #include <furi_hal.h>
 
-#define NUMBER_OF_BARCODE_TYPES 7
+#define NUMBER_OF_BARCODE_TYPES 8
 
 typedef enum {
     WrongNumberOfDigits, //There is too many or too few digits in the barcode
@@ -22,6 +22,7 @@ typedef enum {
     EAN13,
     CODE39,
     CODE128,
+    CODE128C,
     CODABAR,
 
     UNKNOWN
@@ -51,4 +52,4 @@ void init_types();
 void free_types();
 BarcodeTypeObj* get_type(FuriString* type_string);
 const char* get_error_code_name(ErrorCode error_code);
-const char* get_error_code_message(ErrorCode error_code);
+const char* get_error_code_message(ErrorCode error_code);

+ 130 - 1
apps_source_code/barcode_gen/barcode_validator.c → main_apps_sources/barcode_gen/barcode_validator.c

@@ -13,6 +13,9 @@ void barcode_loader(BarcodeData* barcode_data) {
     case CODE128:
         code_128_loader(barcode_data);
         break;
+    case CODE128C:
+        code_128c_loader(barcode_data);
+        break;
     case CODABAR:
         codabar_loader(barcode_data);
         break;
@@ -39,6 +42,7 @@ int calculate_check_digit(BarcodeData* barcode_data) {
         break;
     case CODE39:
     case CODE128:
+    case CODE128C:
     case CODABAR:
     case UNKNOWN:
     default:
@@ -345,6 +349,131 @@ void code_128_loader(BarcodeData* barcode_data) {
     furi_string_free(barcode_bits);
 }
 
+/**
+ * Loads a code 128 C barcode
+*/
+void code_128c_loader(BarcodeData* barcode_data) {
+    int barcode_length = furi_string_size(barcode_data->raw_data);
+
+    //the start code for character set C
+    int start_code_value = 105;
+
+    //The bits for the start code
+    const char* start_code_bits = "11010011100";
+
+    //The bits for the stop code
+    const char* stop_code_bits = "1100011101011";
+
+    int min_digits = barcode_data->type_obj->min_digits;
+
+    int checksum_adder = start_code_value;
+    int checksum_digits = 0;
+
+    //the calculated check digit
+    int final_check_digit = 0;
+
+    // check the length of the barcode, must contain atleast 2 character,
+    // this can have as many characters as it wants, it might not fit on the screen
+    // code 128 C: the length must be even
+    if((barcode_length < min_digits) || (barcode_length & 1)) {
+        barcode_data->reason = WrongNumberOfDigits;
+        barcode_data->valid = false;
+        return;
+    }
+    //Open Storage
+    Storage* storage = furi_record_open(RECORD_STORAGE);
+    FlipperFormat* ff = flipper_format_file_alloc(storage);
+
+    FuriString* barcode_bits = furi_string_alloc();
+
+    //add the start code
+    furi_string_cat(barcode_bits, start_code_bits);
+
+    if(!flipper_format_file_open_existing(ff, CODE128C_DICT_FILE_PATH)) {
+        FURI_LOG_E(TAG, "c128c Could not open file %s", CODE128C_DICT_FILE_PATH);
+        barcode_data->reason = MissingEncodingTable;
+        barcode_data->valid = false;
+    } else {
+        FuriString* value = furi_string_alloc();
+        FuriString* char_bits = furi_string_alloc();
+        for(int i = 0; i < barcode_length; i += 2) {
+            char barcode_char1 = furi_string_get_char(barcode_data->raw_data, i);
+            char barcode_char2 = furi_string_get_char(barcode_data->raw_data, i + 1);
+            FURI_LOG_I(TAG, "c128c bc1='%c' bc2='%c'", barcode_char1, barcode_char2);
+
+            char current_chars[4];
+            snprintf(current_chars, 3, "%c%c", barcode_char1, barcode_char2);
+            FURI_LOG_I(TAG, "c128c current_chars='%s'", current_chars);
+
+            //using the value of the characters, get the characters bits
+            if(!flipper_format_read_string(ff, current_chars, char_bits)) {
+                FURI_LOG_E(TAG, "c128c Could not read \"%s\" string", current_chars);
+                barcode_data->reason = EncodingTableError;
+                barcode_data->valid = false;
+                break;
+            } else {
+                //add the bits to the full barcode
+                furi_string_cat(barcode_bits, char_bits);
+
+                // calculate the checksum
+                checksum_digits += 1;
+                checksum_adder += (atoi(current_chars) * checksum_digits);
+
+                FURI_LOG_I(
+                    TAG,
+                    "c128c \"%s\" string: %s : %s : %d : %d : %d",
+                    current_chars,
+                    furi_string_get_cstr(char_bits),
+                    furi_string_get_cstr(value),
+                    checksum_digits,
+                    (atoi(furi_string_get_cstr(value)) * checksum_digits),
+                    checksum_adder);
+            }
+            //bring the file pointer back to the begining
+            flipper_format_rewind(ff);
+        }
+        //calculate the check digit and convert it into a c string for lookup in the encoding table
+        final_check_digit = checksum_adder % 103;
+        FURI_LOG_I(TAG, "c128c finale_check_digit=%d", final_check_digit);
+
+        int length = snprintf(NULL, 0, "%d", final_check_digit);
+        if(final_check_digit < 100) length = 2;
+        char* final_check_digit_string = malloc(length + 1);
+        snprintf(final_check_digit_string, length + 1, "%02d", final_check_digit);
+
+        //after the checksum has been calculated, add the bits to the full barcode
+        if(!flipper_format_read_string(ff, final_check_digit_string, char_bits)) {
+            FURI_LOG_E(TAG, "c128c cksum Could not read \"%s\" string", final_check_digit_string);
+            barcode_data->reason = EncodingTableError;
+            barcode_data->valid = false;
+        } else {
+            //add the check digit bits to the full barcode
+            furi_string_cat(barcode_bits, char_bits);
+
+            FURI_LOG_I(
+                TAG,
+                "check digit \"%s\" string: %s",
+                final_check_digit_string,
+                furi_string_get_cstr(char_bits));
+        }
+
+        free(final_check_digit_string);
+        furi_string_free(value);
+        furi_string_free(char_bits);
+    }
+
+    //add the stop code
+    furi_string_cat(barcode_bits, stop_code_bits);
+
+    //Close Storage
+    flipper_format_free(ff);
+    furi_record_close(RECORD_STORAGE);
+
+    FURI_LOG_I(TAG, "c128c %s", furi_string_get_cstr(barcode_bits));
+    furi_string_cat(barcode_data->correct_data, barcode_bits);
+    furi_string_free(barcode_bits);
+}
+
 void codabar_loader(BarcodeData* barcode_data) {
     int barcode_length = furi_string_size(barcode_data->raw_data);
 
@@ -400,4 +529,4 @@ void codabar_loader(BarcodeData* barcode_data) {
 
     furi_string_cat(barcode_data->correct_data, barcode_bits);
     furi_string_free(barcode_bits);
-}
+}

+ 2 - 1
apps_source_code/barcode_gen/barcode_validator.h → main_apps_sources/barcode_gen/barcode_validator.h

@@ -10,5 +10,6 @@ void ean_8_loader(BarcodeData* barcode_data);
 void ean_13_loader(BarcodeData* barcode_data);
 void code_39_loader(BarcodeData* barcode_data);
 void code_128_loader(BarcodeData* barcode_data);
+void code_128c_loader(BarcodeData* barcode_data);
 void codabar_loader(BarcodeData* barcode_data);
-void barcode_loader(BarcodeData* barcode_data);
+void barcode_loader(BarcodeData* barcode_data);

+ 0 - 0
apps_source_code/barcode_gen/encoding_tables/codabar_encodings.txt → main_apps_sources/barcode_gen/encoding_tables/codabar_encodings.txt


+ 0 - 0
apps_source_code/barcode_gen/encoding_tables/code128_encodings.txt → main_apps_sources/barcode_gen/encoding_tables/code128_encodings.txt


+ 106 - 0
main_apps_sources/barcode_gen/encoding_tables/code128c_encodings.txt

@@ -0,0 +1,106 @@
+00: 11011001100
+01: 11001101100
+02: 11001100110
+03: 10010011000
+04: 10010001100
+05: 10001001100
+06: 10011001000
+07: 10011000100
+08: 10001100100
+09: 11001001000
+10: 11001000100
+11: 11000100100
+12: 10110011100
+13: 10011011100
+14: 10011001110
+15: 10111001100
+16: 10011101100
+17: 10011100110
+18: 11001110010
+19: 11001011100
+20: 11001001110
+21: 11011100100
+22: 11001110100
+23: 11101101110
+24: 11101001100
+25: 11100101100
+26: 11100100110
+27: 11101100100
+28: 11100110100
+29: 11100110010
+30: 11011011000
+31: 11011000110
+32: 11000110110
+33: 10100011000
+34: 10001011000
+35: 10001000110
+36: 10110001000
+37: 10001101000
+38: 10001100010
+39: 11010001000
+40: 11000101000
+41: 11000100010
+42: 10110111000
+43: 10110001110
+44: 10001101110
+45: 10111011000
+46: 10111000110
+47: 10001110110
+48: 11101110110
+49: 11010001110
+50: 11000101110
+51: 11011101000
+52: 11011100010
+53: 11011101110
+54: 11101011000
+55: 11101000110
+56: 11100010110
+57: 11101101000
+58: 11101100010
+59: 11100011010
+60: 11101111010
+61: 11001000010
+62: 11110001010
+63: 10100110000
+64: 10100001100
+65: 10010110000
+66: 10010000110
+67: 10000101100
+68: 10000100110
+69: 10110010000
+70: 10110000100
+71: 10011010000
+72: 10011000010
+73: 10000110100
+74: 10000110010
+75: 11000010010
+76: 11001010000
+77: 11110111010
+78: 11000010100
+79: 10001111010
+80: 10100111100
+81: 10010111100
+82: 10010011110
+83: 10111100100
+84: 10011110100
+85: 10011110010
+86: 11110100100
+87: 11110010100
+88: 11110010010
+89: 11011011110
+90: 11011110110
+91: 11110110110
+92: 10101111000
+93: 10100011110
+94: 10001011110
+95: 10111101000
+96: 10111100010
+97: 11110101000
+98: 11110100010
+99: 10111011110
+100: 10111101110
+101: 11101011110
+102: 11110101110
+103: 11010000100
+104: 11010010000
+105: 11010011100

+ 0 - 0
apps_source_code/barcode_gen/encoding_tables/code39_encodings.txt → main_apps_sources/barcode_gen/encoding_tables/code39_encodings.txt


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است