Skip to content

Commit

Permalink
fix: items navigation deauth submenus
Browse files Browse the repository at this point in the history
  • Loading branch information
Otrebor671 committed Aug 27, 2024
1 parent 4b4680e commit cf5f4e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
1 change: 1 addition & 0 deletions firmware/components/wifi_attacks/wifi_attacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ typedef enum {
WIFI_ATTACK_COMBINE,
WIFI_ATTACK_MULTI_AP,
WIFI_ATTACK_PASSWORD,
WIFI_ATTACKS_NUM
} wifi_attacks_types_t;

/**
Expand Down
25 changes: 7 additions & 18 deletions firmware/main/apps/wifi/deauth/deauth_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,18 +216,12 @@ static void deauth_module_cb_event_select_ap(uint8_t button_name,
}
switch (button_name) {
case BUTTON_UP:
deauth_decrement_item();
if (current_item < 0) {
current_item = ap_records->count;
}
current_item = current_item-- == 0 ? ap_records->count - 1 : current_item;
deauth_display_scanned_ap(ap_records->records, ap_records->count,
current_item);
break;
case BUTTON_DOWN:
deauth_increment_item();
if (current_item > ap_records->count) {
current_item = 0;
}
current_item = ++current_item > ap_records->count - 1 ? 0 : current_item;
deauth_display_scanned_ap(ap_records->records, ap_records->count,
current_item);
break;
Expand All @@ -254,11 +248,11 @@ static void deauth_module_cb_event_attacks(uint8_t button_name,
}
switch (button_name) {
case BUTTON_UP:
deauth_decrement_item();
current_item = current_item-- == 0 ? ATTACKSCOUNT - 1 : current_item;
deauth_display_attacks(current_item, menu_stadistics);
break;
case BUTTON_DOWN:
deauth_increment_item();
current_item = ++current_item > ATTACKSCOUNT - 1 ? 0 : current_item;
deauth_display_attacks(current_item, menu_stadistics);
break;
case BUTTON_RIGHT:
Expand Down Expand Up @@ -308,17 +302,12 @@ static void deauth_module_cb_event_captive_portal(uint8_t button_name,
}
switch (button_name) {
case BUTTON_UP:
deauth_decrement_item();
if (current_item < 0) {
current_item = CAPTIVEPORTALCOUNT - 1;
}
current_item =
current_item-- == 0 ? CAPTIVEPORTALCOUNT - 1 : current_item;
deauth_display_captive_portals(current_item, menu_stadistics);
break;
case BUTTON_DOWN:
deauth_increment_item();
if (current_item > CAPTIVEPORTALCOUNT - 1) {
current_item = 0;
}
current_item = ++current_item > CAPTIVEPORTALCOUNT - 1 ? 0 : current_item;
deauth_display_captive_portals(current_item, menu_stadistics);
break;
case BUTTON_LEFT:
Expand Down

0 comments on commit cf5f4e4

Please sign in to comment.