MenuFunctions.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. #ifndef MenuFunctions_h
  2. #define MenuFunctions_h
  3. #include "WiFiScan.h"
  4. #include "Display.h"
  5. extern Display display_obj;
  6. extern WiFiScan wifi_scan_obj;
  7. // Keypad start position, key sizes and spacing
  8. #define KEY_X 120 // Centre of key
  9. #define KEY_Y 50
  10. #define KEY_W 240 // Width and height
  11. #define KEY_H 22
  12. #define KEY_SPACING_X 0 // X and Y gap
  13. #define KEY_SPACING_Y 1
  14. #define KEY_TEXTSIZE 1 // Font size multiplier
  15. #define ICON_W 22
  16. #define ICON_H 22
  17. //#define BUTTON_ARRAY_LEN 5
  18. #define FLASH_BUTTON 0
  19. // Icon definitions
  20. #define ATTACKS 0
  21. #define BEACON_SNIFF 1
  22. #define BLUETOOTH 2
  23. #define BLUETOOTH_SNIFF 3
  24. #define DEAUTH_SNIFF 4
  25. #define DRAW 5
  26. #define PACKET_MONITOR 6
  27. #define PROBE_SNIFF 7
  28. #define SCANNERS 8
  29. #define CC_SKIMMERS 9
  30. #define SNIFFERS 10
  31. #define WIFI 11
  32. struct Menu;
  33. // Individual Nodes of a menu
  34. struct MenuNode {
  35. String name;
  36. uint16_t color;
  37. int icon;
  38. TFT_eSPI_Button* button;
  39. std::function<void()> callable;
  40. };
  41. // Full Menus
  42. struct Menu {
  43. String name;
  44. SimpleList<MenuNode>* list;
  45. Menu * parentMenu;
  46. uint8_t selected;
  47. };
  48. class MenuFunctions
  49. {
  50. private:
  51. Menu* current_menu;
  52. // Main menu stuff
  53. Menu mainMenu;
  54. Menu wifiMenu;
  55. Menu bluetoothMenu;
  56. Menu generalMenu;
  57. // WiFi menu stuff
  58. Menu wifiSnifferMenu;
  59. Menu wifiScannerMenu;
  60. Menu wifiAttackMenu;
  61. // Bluetooth menu stuff
  62. Menu bluetoothSnifferMenu;
  63. Menu bluetoothScannerMenu;
  64. // Menu icons
  65. //TFT_eSPI_Button key[BUTTON_ARRAY_LEN];
  66. void addNodes(Menu* menu, String name, uint16_t color, Menu* child, int place, std::function<void()> callable);
  67. void showMenuList(Menu* menu, int layer);
  68. void orientDisplay();
  69. public:
  70. MenuFunctions();
  71. uint16_t x = -1, y = -1;
  72. boolean pressed = false;
  73. void buildButtons(Menu* menu);
  74. void changeMenu(Menu* menu);
  75. void displayCurrentMenu();
  76. void main();
  77. void RunSetup();
  78. };
  79. #endif