Update wifi marauder companion

and apply same fix to wifi scanner and wifi deauther
This commit is contained in:
MX 2022-11-24 02:23:40 +03:00
parent b6435374d7
commit 6ebdf6dffb
No known key found for this signature in database
GPG Key ID: 6C4C311DFD4B4AB5
4 changed files with 25 additions and 26 deletions

View File

@ -365,8 +365,6 @@ int32_t esp8266_deauth_app(void* p) {
DEAUTH_APP_LOG_I("Mutex created");
app->m_rx_stream = furi_stream_buffer_alloc(1 * 1024, 1);
//app->m_notification = furi_record_open("notification");
ViewPort* view_port = view_port_alloc();
@ -379,13 +377,7 @@ int32_t esp8266_deauth_app(void* p) {
//notification_message(app->notification, &sequence_set_only_blue_255);
// Enable uart listener
#if DISABLE_CONSOLE
furi_hal_console_disable();
#endif
furi_hal_uart_set_br(FuriHalUartIdUSART1, FLIPPERZERO_SERIAL_BAUD);
furi_hal_uart_set_irq_cb(FuriHalUartIdUSART1, uart_on_irq_cb, app);
DEAUTH_APP_LOG_I("UART Listener created");
app->m_rx_stream = furi_stream_buffer_alloc(1 * 1024, 1);
app->m_worker_thread = furi_thread_alloc();
furi_thread_set_name(app->m_worker_thread, "WiFiDeauthModuleUARTWorker");
@ -395,6 +387,14 @@ int32_t esp8266_deauth_app(void* p) {
furi_thread_start(app->m_worker_thread);
DEAUTH_APP_LOG_I("UART thread allocated");
// Enable uart listener
#if DISABLE_CONSOLE
furi_hal_console_disable();
#endif
furi_hal_uart_set_br(FuriHalUartIdUSART1, FLIPPERZERO_SERIAL_BAUD);
furi_hal_uart_set_irq_cb(FuriHalUartIdUSART1, uart_on_irq_cb, app);
DEAUTH_APP_LOG_I("UART Listener created");
SPluginEvent event;
for(bool processing = true; processing;) {
FuriStatus event_status = furi_message_queue_get(event_queue, &event, 100);

View File

@ -34,7 +34,7 @@ void wifi_marauder_scene_console_output_on_enter(void* context) {
app->text_box_store_strlen = 0;
if(0 == strncmp("help", app->selected_tx_string, strlen("help"))) {
const char* help_msg =
"Marauder companion v0.2.1\nFor app support/feedback,\nreach out to me:\n@cococode#6011 (discord)\n0xchocolate (github)\n";
"Marauder companion v0.2.2\nFor app support/feedback,\nreach out to me:\n@cococode#6011 (discord)\n0xchocolate (github)\n";
furi_string_cat_str(app->text_box_store, help_msg);
app->text_box_store_strlen += strlen(help_msg);
}

View File

@ -38,8 +38,6 @@ void wifi_marauder_uart_on_irq_cb(UartIrqEvent ev, uint8_t data, void* context)
static int32_t uart_worker(void* context) {
WifiMarauderUart* uart = (void*)context;
uart->rx_stream = furi_stream_buffer_alloc(RX_BUF_SIZE, 1);
while(1) {
uint32_t events =
furi_thread_flags_wait(WORKER_ALL_RX_EVENTS, FuriFlagWaitAny, FuriWaitForever);
@ -65,18 +63,19 @@ void wifi_marauder_uart_tx(uint8_t* data, size_t len) {
WifiMarauderUart* wifi_marauder_uart_init(WifiMarauderApp* app) {
WifiMarauderUart* uart = malloc(sizeof(WifiMarauderUart));
furi_hal_console_disable();
furi_hal_uart_set_br(UART_CH, BAUDRATE);
furi_hal_uart_set_irq_cb(UART_CH, wifi_marauder_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, "WifiMarauderUartRxThread");
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, wifi_marauder_uart_on_irq_cb, uart);
return uart;
}

View File

@ -674,8 +674,6 @@ int32_t wifi_scanner_app(void* p) {
WIFI_APP_LOG_I("Mutex created");
app->m_rx_stream = furi_stream_buffer_alloc(1 * 1024, 1);
app->m_notification = furi_record_open("notification");
ViewPort* view_port = view_port_alloc();
@ -688,13 +686,7 @@ int32_t wifi_scanner_app(void* p) {
//notification_message(app->notification, &sequence_set_only_blue_255);
// Enable uart listener
#if DISABLE_CONSOLE
furi_hal_console_disable();
#endif
furi_hal_uart_set_br(FuriHalUartIdUSART1, FLIPPERZERO_SERIAL_BAUD);
furi_hal_uart_set_irq_cb(FuriHalUartIdUSART1, uart_on_irq_cb, app);
WIFI_APP_LOG_I("UART Listener created");
app->m_rx_stream = furi_stream_buffer_alloc(1 * 1024, 1);
app->m_worker_thread = furi_thread_alloc();
furi_thread_set_name(app->m_worker_thread, "WiFiModuleUARTWorker");
@ -704,6 +696,14 @@ int32_t wifi_scanner_app(void* p) {
furi_thread_start(app->m_worker_thread);
WIFI_APP_LOG_I("UART thread allocated");
// Enable uart listener
#if DISABLE_CONSOLE
furi_hal_console_disable();
#endif
furi_hal_uart_set_br(FuriHalUartIdUSART1, FLIPPERZERO_SERIAL_BAUD);
furi_hal_uart_set_irq_cb(FuriHalUartIdUSART1, uart_on_irq_cb, app);
WIFI_APP_LOG_I("UART Listener created");
// Because we assume that module was on before we launched the app. We need to ensure that module will be in initial state on app start
send_serial_command(ESerialCommand_Restart);