mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-12 11:28:36 -07:00
BLE Spam add basic config page (parameters later)
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
ADD_SCENE(main, Main)
|
||||
ADD_SCENE(config, Config)
|
||||
#include "../protocols/_scenes.h"
|
||||
|
||||
34
applications/external/ble_spam/scenes/config.c
vendored
Normal file
34
applications/external/ble_spam/scenes/config.c
vendored
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user