From 297aa63231b8e2fb1680a105c550cd66ea807ec2 Mon Sep 17 00:00:00 2001 From: Roberto Arellano Date: Thu, 15 Aug 2024 12:08:31 -0600 Subject: [PATCH] feat: apps & features menuconfig --- firmware/main/Kconfig.projbuild | 121 ++++++++++++++++++- firmware/main/modules/menus_module/menus.h | 134 +++++++++++++-------- firmware/sdkconfig.defaults | 52 +++++--- 3 files changed, 239 insertions(+), 68 deletions(-) diff --git a/firmware/main/Kconfig.projbuild b/firmware/main/Kconfig.projbuild index 476398b..7db738b 100644 --- a/firmware/main/Kconfig.projbuild +++ b/firmware/main/Kconfig.projbuild @@ -563,8 +563,8 @@ menu "Frequency Configuration" default 32 if EXAMPLE_MIN_CPU_FREQ_32M endmenu -menu "Enable or Disable Features" - +menu "Apps & Features" +################################# WIFI ################################### config WIFI_APPS_ENABLE bool "Enable WiFi Apps" default y @@ -593,4 +593,121 @@ config WIFI_APP_DOS endif # WIFI_APPS_ENABLE +############################### BLUETOOTH ################################# + +config BLUETOOTH_APPS_ENABLE + bool "Enable Bluetooth Apps" + default y + help + Enable or disable all Bluetooth applications. + +if BLUETOOTH_APPS_ENABLE + +config BLUETOOTH_APP_TRAKERS + bool "Enable Trakers App" + default y + help + Enable or disable the Bluetooth Trakers application. + +config BLUETOOTH_APP_SPAM + bool "Enable Spam App" + default y + help + Enable or disable the Bluetooth Spam application. +endif # BLUETOOTH_APPS_ENABLE + +################################# ZIGBEE ################################### + +config ZIGBEE_APPS_ENABLE + bool "Enable Zigbee Apps" + default y + help + Enable or disable all Zigbee applications. + +if ZIGBEE_APPS_ENABLE + +config ZIGBEE_APP_SPOOFING + bool "Enable Spoofing App" + default y + help + Enable or disable the Zigbee Spoofing application. + +config ZIGBEE_APP_SNIFFER + bool "Enable Sniffer App" + default y + help + Enable or disable the Zigbee Sniffer application. +endif # ZIGBEE_APPS_ENABLE + +################################# THREAD ################################### + +config THREAD_APPS_ENABLE + bool "Enable Thread Apps" + default y + help + Enable or disable all Thread applications. + +if THREAD_APPS_ENABLE + +config THREAD_APP_BROADCAST + bool "Enable Boradcast App" + default y + help + Enable or disable the Thread Broadcast application. + +config THREAD_APP_SNIFFER + bool "Enable Sniffer App" + default y + help + Enable or disable the Thread Sniffer application. +endif # THREAD_APPS_ENABLE + +################################# GPS ################################### + +config GPS_APPS_ENABLE + bool "Enable GPS Apps" + default y + help + Enable or disable all GPS applications. + +if GPS_APPS_ENABLE + +config GPS_APP_WARDRIVING + bool "Enable Wardriving App" + default y + help + Enable or disable the GPS Wardriving application. +endif # GPS_APPS_ENABLE + +################################# OTA ################################### + +config OTA_ENABLE + bool "Enable OTA feature" + default y + help + Enable or disable OTA feature. + +########################### FILE MANAGER ############################# + +config FILE_MANAGER_ENABLE + bool "Enable File Manager Features" + default y + help + Enable or disable all File Manager Features. + +if FILE_MANAGER_ENABLE + +config FILE_MANAGER_LOCAL + bool "Enable Local File Manager" + default y + help + Enable or disable the Local File Manager feature. + +config FILE_MANAGER_WEB + bool "Enable Web File Manager" + default y + help + Enable or disable the Web File Manager Feature. +endif # FILE_MANAGER_ENABLE + endmenu \ No newline at end of file diff --git a/firmware/main/modules/menus_module/menus.h b/firmware/main/modules/menus_module/menus.h index cd4e9cc..aaa31f2 100644 --- a/firmware/main/modules/menus_module/menus.h +++ b/firmware/main/modules/menus_module/menus.h @@ -121,6 +121,34 @@ menu_t menus[] = { ////////////////////////////////// .on_enter_cb = NULL, .on_exit_cb = NULL, .is_visible = true}, + {.display_name = "Version", + .menu_idx = MENU_ABOUT_VERSION_2, + .parent_idx = MENU_ABOUT_2, + .input_cb = NULL, + .on_enter_cb = NULL, + .on_exit_cb = NULL, + .is_visible = true}, + {.display_name = "License", + .menu_idx = MENU_ABOUT_LICENSE_2, + .parent_idx = MENU_ABOUT_2, + .input_cb = NULL, + .on_enter_cb = NULL, + .on_exit_cb = NULL, + .is_visible = true}, + {.display_name = "Credits", + .menu_idx = MENU_ABOUT_CREDITS_2, + .parent_idx = MENU_ABOUT_2, + .input_cb = NULL, + .on_enter_cb = NULL, + .on_exit_cb = NULL, + .is_visible = true}, + {.display_name = "Legal", + .menu_idx = MENU_ABOUT_LEGAL_2, + .parent_idx = MENU_ABOUT_2, + .input_cb = NULL, + .on_enter_cb = NULL, + .on_exit_cb = NULL, + .is_visible = true}, #ifdef CONFIG_WIFI_APPS_ENABLE {.display_name = "WiFi", .menu_idx = MENU_WIFI_APPS_2, @@ -192,6 +220,7 @@ menu_t menus[] = { ////////////////////////////////// .is_visible = true}, #endif #endif +#ifdef CONFIG_BLUETOOTH_APPS_ENABLE {.display_name = "Bluetooth", .menu_idx = MENU_BLUETOOTH_APPS_2, .parent_idx = MENU_APPLICATIONS_2, @@ -199,6 +228,7 @@ menu_t menus[] = { ////////////////////////////////// .on_enter_cb = NULL, .on_exit_cb = NULL, .is_visible = true}, + #ifdef CONFIG_BLUETOOTH_APP_TRAKERS {.display_name = "Trakers scan", .menu_idx = MENU_BLUETOOTH_TRAKERS_SCAN_2, .parent_idx = MENU_BLUETOOTH_APPS_2, @@ -206,6 +236,8 @@ menu_t menus[] = { ////////////////////////////////// .on_enter_cb = NULL, .on_exit_cb = NULL, .is_visible = true}, + #endif + #ifdef CONFIG_BLUETOOTH_APP_SPAM {.display_name = "Spam", .menu_idx = MENU_BLUETOOTH_SPAM_2, .parent_idx = MENU_BLUETOOTH_APPS_2, @@ -213,6 +245,9 @@ menu_t menus[] = { ////////////////////////////////// .on_enter_cb = NULL, .on_exit_cb = NULL, .is_visible = true}, + #endif +#endif +#ifdef CONFIG_ZIGBEE_APPS_ENABLE {.display_name = "Zigbee", .menu_idx = MENU_ZIGBEE_APPS_2, .parent_idx = MENU_APPLICATIONS_2, @@ -220,6 +255,7 @@ menu_t menus[] = { ////////////////////////////////// .on_enter_cb = NULL, .on_exit_cb = NULL, .is_visible = true}, + #ifdef CONFIG_ZIGBEE_APP_SPOOFING {.display_name = "Spoofing", .menu_idx = MENU_ZIGBEE_SPOOFING_2, .parent_idx = MENU_ZIGBEE_APPS_2, @@ -241,6 +277,8 @@ menu_t menus[] = { ////////////////////////////////// .on_enter_cb = NULL, .on_exit_cb = NULL, .is_visible = true}, + #endif + #ifdef CONFIG_ZIGBEE_APP_SNIFFER {.display_name = "Sniffer", .menu_idx = MENU_ZIGBEE_SWITCH_2, .parent_idx = MENU_ZIGBEE_APPS_2, @@ -248,6 +286,9 @@ menu_t menus[] = { ////////////////////////////////// .on_enter_cb = NULL, .on_exit_cb = NULL, .is_visible = true}, + #endif +#endif +#ifdef CONFIG_THREAD_APPS_ENABLE {.display_name = "Thread", .menu_idx = MENU_THREAD_APPS_2, .parent_idx = MENU_APPLICATIONS_2, @@ -255,6 +296,7 @@ menu_t menus[] = { ////////////////////////////////// .on_enter_cb = NULL, .on_exit_cb = NULL, .is_visible = true}, + #ifdef CONFIG_THREAD_APP_BROADCAST {.display_name = "Broadcast", .menu_idx = MENU_THREAD_BROADCAST_2, .parent_idx = MENU_THREAD_APPS_2, @@ -262,6 +304,8 @@ menu_t menus[] = { ////////////////////////////////// .on_enter_cb = NULL, .on_exit_cb = NULL, .is_visible = true}, + #endif + #ifdef CONFIG_THREAD_APP_SNIFFER {.display_name = "Sniffer", .menu_idx = MENU_THREAD_SNIFFER_2, .parent_idx = MENU_THREAD_APPS_2, @@ -276,6 +320,9 @@ menu_t menus[] = { ////////////////////////////////// .on_enter_cb = NULL, .on_exit_cb = NULL, .is_visible = true}, + #endif +#endif +#ifdef CONFIG_GPS_APPS_ENABLE {.display_name = "GPS", .menu_idx = MENU_GPS_2, .parent_idx = MENU_APPLICATIONS_2, @@ -283,6 +330,7 @@ menu_t menus[] = { ////////////////////////////////// .on_enter_cb = NULL, .on_exit_cb = NULL, .is_visible = true}, + #ifdef CONFIG_GPS_APP_WARDRIVING {.display_name = "Wardriving", .menu_idx = MENU_GPS_WARDRIVING_2, .parent_idx = MENU_GPS_2, @@ -304,6 +352,7 @@ menu_t menus[] = { ////////////////////////////////// .on_enter_cb = NULL, .on_exit_cb = NULL, .is_visible = true}, + #endif {.display_name = "Date & Time", .menu_idx = MENU_GPS_DATE_TIME_2, .parent_idx = MENU_GPS_2, @@ -332,34 +381,15 @@ menu_t menus[] = { ////////////////////////////////// .on_enter_cb = NULL, .on_exit_cb = NULL, .is_visible = true}, - {.display_name = "Version", - .menu_idx = MENU_ABOUT_VERSION_2, - .parent_idx = MENU_ABOUT_2, - .input_cb = NULL, - .on_enter_cb = NULL, - .on_exit_cb = NULL, - .is_visible = true}, - {.display_name = "License", - .menu_idx = MENU_ABOUT_LICENSE_2, - .parent_idx = MENU_ABOUT_2, - .input_cb = NULL, - .on_enter_cb = NULL, - .on_exit_cb = NULL, - .is_visible = true}, - {.display_name = "Credits", - .menu_idx = MENU_ABOUT_CREDITS_2, - .parent_idx = MENU_ABOUT_2, - .input_cb = NULL, - .on_enter_cb = NULL, - .on_exit_cb = NULL, - .is_visible = true}, - {.display_name = "Legal", - .menu_idx = MENU_ABOUT_LEGAL_2, - .parent_idx = MENU_ABOUT_2, + {.display_name = "Time zone", + .menu_idx = MENU_SETTINGS_TIME_ZONE_2, + .parent_idx = MENU_SETTINGS_SYSTEM_2, .input_cb = NULL, .on_enter_cb = NULL, .on_exit_cb = NULL, .is_visible = true}, +#endif +#ifdef CONFIG_OTA_ENABLE {.display_name = "Update", .menu_idx = MENU_ABOUT_UPDATE_2, .parent_idx = MENU_ABOUT_2, @@ -367,6 +397,7 @@ menu_t menus[] = { ////////////////////////////////// .on_enter_cb = ota_module_init, .on_exit_cb = ota_module_deinit, .is_visible = true}, +#endif {.display_name = "Display", .menu_idx = MENU_SETTINGS_DISPLAY_2, .parent_idx = MENU_SETTINGS_2, @@ -374,27 +405,6 @@ menu_t menus[] = { ////////////////////////////////// .on_enter_cb = NULL, .on_exit_cb = NULL, .is_visible = true}, - {.display_name = "File Manager", - .menu_idx = MENU_FILE_MANAGER_2, - .parent_idx = MENU_SETTINGS_2, - .input_cb = NULL, - .on_enter_cb = NULL, - .on_exit_cb = NULL, - .is_visible = true}, - {.display_name = "Local", - .menu_idx = MENU_FILE_MANAGER_LOCAL_2, - .parent_idx = MENU_FILE_MANAGER_2, - .input_cb = NULL, - .on_enter_cb = NULL, - .on_exit_cb = NULL, - .is_visible = true}, - {.display_name = "Web", - .menu_idx = MENU_FILE_MANAGER_WEB_2, - .parent_idx = MENU_FILE_MANAGER_2, - .input_cb = NULL, - .on_enter_cb = NULL, - .on_exit_cb = NULL, - .is_visible = true}, {.display_name = "System", .menu_idx = MENU_SETTINGS_SYSTEM_2, .parent_idx = MENU_SETTINGS_2, @@ -402,13 +412,6 @@ menu_t menus[] = { ////////////////////////////////// .on_enter_cb = NULL, .on_exit_cb = NULL, .is_visible = true}, - {.display_name = "Time zone", - .menu_idx = MENU_SETTINGS_TIME_ZONE_2, - .parent_idx = MENU_SETTINGS_SYSTEM_2, - .input_cb = NULL, - .on_enter_cb = NULL, - .on_exit_cb = NULL, - .is_visible = true}, {.display_name = "WiFi", .menu_idx = MENU_SETTINGS_WIFI_2, .parent_idx = MENU_SETTINGS_SYSTEM_2, @@ -437,6 +440,33 @@ menu_t menus[] = { ////////////////////////////////// .on_enter_cb = NULL, .on_exit_cb = NULL, .is_visible = true}, +#ifdef CONFIG_FILE_MANAGER_ENABLE + {.display_name = "File Manager", + .menu_idx = MENU_FILE_MANAGER_2, + .parent_idx = MENU_SETTINGS_2, + .input_cb = NULL, + .on_enter_cb = NULL, + .on_exit_cb = NULL, + .is_visible = true}, + #ifdef CONFIG_FILE_MANAGER_LOCAL + {.display_name = "Local", + .menu_idx = MENU_FILE_MANAGER_LOCAL_2, + .parent_idx = MENU_FILE_MANAGER_2, + .input_cb = NULL, + .on_enter_cb = NULL, + .on_exit_cb = NULL, + .is_visible = true}, + #endif + #ifdef CONFIG_FILE_MANAGER_WEB + {.display_name = "Web", + .menu_idx = MENU_FILE_MANAGER_WEB_2, + .parent_idx = MENU_FILE_MANAGER_2, + .input_cb = NULL, + .on_enter_cb = NULL, + .on_exit_cb = NULL, + .is_visible = true}, + #endif +#endif {.display_name = "Stealth Mode", .menu_idx = MENU_STEALTH_MODE_2, .parent_idx = MENU_SETTINGS_2, diff --git a/firmware/sdkconfig.defaults b/firmware/sdkconfig.defaults index c6adce0..9bf5e15 100644 --- a/firmware/sdkconfig.defaults +++ b/firmware/sdkconfig.defaults @@ -18,16 +18,7 @@ CONFIG_BT_BLUEDROID_ENABLED=y CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y # Open Thread Configuration -# -# Partition Table -# -CONFIG_OPENTHREAD_ENABLED=y -CONFIG_PARTITION_TABLE_CUSTOM=y -CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" -CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" -CONFIG_PARTITION_TABLE_OFFSET=0x8000 -CONFIG_PARTITION_TABLE_MD5=y -# end of Partition Table + # # mbedTLS @@ -96,7 +87,40 @@ CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG_ENABLED=y # # Enabled Features # -WIFI_APPS_ENABLE=y -WIFI_APP_ANALYZER=y -WIFI_APP_DEAUTH=y -WIFI_APP_DOS=y \ No newline at end of file +## WIFI ## +CONFIG_WIFI_APPS_ENABLE=y +CONFIG_WIFI_APP_ANALYZER=y +CONFIG_WIFI_APP_DEAUTH=y +CONFIG_WIFI_APP_DOS=y +## BLUETOOTH ## +CONFIG_BLUETOOTH_APPS_ENABLE=y +CONFIG_BLUETOOTH_APP_TRAKERS=y +CONFIG_BLUETOOTH_APP_SPAM=y +## ZIGBEE ## +CONFIG_ZIGBEE_APPS_ENABLE=y +CONFIG_ZIGBEE_APP_SPOOFING=y +CONFIG_ZIGBEE_APP_SNIFFER=y +## THREAD ## +CONFIG_THREAD_APPS_ENABLE=y +CONFIG_THREAD_APP_BROADCAST=y +CONFIG_THREAD_APP_SNIFFER=y +## GPS ## +CONFIG_GPS_APPS_ENABLE=y +CONFIG_GPS_APP_WARDRIVING=y +## OTA ## +CONFIG_OTA_ENABLE=y +## FILE MANAGER ## +CONFIG_FILE_MANAGER_ENABLE=y +CONFIG_FILE_MANAGER_LOCAL=y +CONFIG_FILE_MANAGER_WEB=y + +# +# Partition Table +# +CONFIG_OPENTHREAD_ENABLED=y +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" +CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" +CONFIG_PARTITION_TABLE_OFFSET=0x8000 +CONFIG_PARTITION_TABLE_MD5=y +# end of Partition Table \ No newline at end of file