Skip to content

Commit

Permalink
fix: show analyzer packets on 32px screen
Browse files Browse the repository at this point in the history
  • Loading branch information
Otrebor671 committed Sep 23, 2024
1 parent fb6ffe0 commit 3fe69c8
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions firmware/main/modules/wifi/wifi_screens_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@

TaskHandle_t wifi_sniffer_animation_task_handle = NULL;

#ifdef CONFIG_RESOLUTION_128X64
uint8_t pkts_offset = 3;
#else
uint8_t pkts_offset = 2;
#endif

void wifi_screens_module_display_sniffer_cb(sniffer_runtime_t* sniffer) {
if (sniffer->is_running) {
const char* packets_str = malloc(16);
Expand All @@ -19,8 +25,10 @@ void wifi_screens_module_display_sniffer_cb(sniffer_runtime_t* sniffer) {
uint8_t x_offset = 66;
oled_screen_display_text("Packets", x_offset, 0, OLED_DISPLAY_INVERT);
oled_screen_display_text(packets_str, x_offset, 1, OLED_DISPLAY_INVERT);
oled_screen_display_text("Channel", x_offset, 3, OLED_DISPLAY_INVERT);
oled_screen_display_text(channel_str, x_offset, 4, OLED_DISPLAY_INVERT);
oled_screen_display_text("Channel", x_offset, pkts_offset,
OLED_DISPLAY_INVERT);
oled_screen_display_text(channel_str, x_offset, pkts_offset + 1,
OLED_DISPLAY_INVERT);
} else {
ESP_LOGI(TAG_WIFI_SCREENS_MODULE, "sniffer task stopped");
}
Expand All @@ -45,6 +53,7 @@ void wifi_screens_display_sniffer_animation_task() {
}

void wifi_screens_sniffer_animation_start() {
oled_screen_clear();
animations_task_run(&wifi_screens_display_sniffer_animation_task, 100, NULL);
}

Expand Down

0 comments on commit 3fe69c8

Please sign in to comment.