BLE Spam add basic config page (parameters later)

This commit is contained in:
Willy-JL
2023-10-19 03:43:09 +01:00
parent b090d28282
commit cb2c00a84f
9 changed files with 71 additions and 8 deletions

View File

@@ -1,2 +1,3 @@
ADD_SCENE(main, Main)
ADD_SCENE(config, Config)
#include "../protocols/_scenes.h"

View File

@@ -0,0 +1,34 @@
#include "../ble_spam.h"
#include "protocols/_registry.h"
static void random_mac_changed(VariableItem* item) {
Ctx* ctx = variable_item_get_context(item);
ctx->attack->payload.random_mac = variable_item_get_current_value_index(item);
variable_item_set_current_value_text(item, ctx->attack->payload.random_mac ? "ON" : "OFF");
}
void scene_config_on_enter(void* _ctx) {
Ctx* ctx = _ctx;
VariableItem* item;
VariableItemList* list = ctx->variable_item_list;
variable_item_list_reset(list);
variable_item_list_set_header(list, ctx->attack->title);
item = variable_item_list_add(list, "Random MAC", 2, random_mac_changed, ctx);
variable_item_set_current_value_index(item, ctx->attack->payload.random_mac);
variable_item_set_current_value_text(item, ctx->attack->payload.random_mac ? "ON" : "OFF");
view_dispatcher_switch_to_view(ctx->view_dispatcher, ViewVariableItemList);
}
bool scene_config_on_event(void* _ctx, SceneManagerEvent event) {
UNUSED(_ctx);
UNUSED(event);
return false;
}
void scene_config_on_exit(void* _ctx) {
UNUSED(_ctx);
}