mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-11 06:09:08 -07:00
BLE Spam support protocols extra config menus
This commit is contained in:
1
applications/external/ble_spam/ble_spam.c
vendored
1
applications/external/ble_spam/ble_spam.c
vendored
@@ -320,6 +320,7 @@ static bool input_callback(InputEvent* input, void* ctx) {
|
|||||||
if(input->type == InputTypeLong) {
|
if(input->type == InputTypeLong) {
|
||||||
if(advertising) toggle_adv(state);
|
if(advertising) toggle_adv(state);
|
||||||
state->ctx.attack = &attacks[state->index];
|
state->ctx.attack = &attacks[state->index];
|
||||||
|
scene_manager_set_scene_state(state->ctx.scene_manager, SceneConfig, 0);
|
||||||
scene_manager_next_scene(state->ctx.scene_manager, SceneConfig);
|
scene_manager_next_scene(state->ctx.scene_manager, SceneConfig);
|
||||||
} else if(input->type == InputTypeShort) {
|
} else if(input->type == InputTypeShort) {
|
||||||
toggle_adv(state);
|
toggle_adv(state);
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
#include "ble_spam_icons.h"
|
#include "ble_spam_icons.h"
|
||||||
#include <furi_hal_random.h>
|
#include <furi_hal_random.h>
|
||||||
#include <core/core_defines.h>
|
#include <core/core_defines.h>
|
||||||
|
#include "../ble_spam.h"
|
||||||
|
|
||||||
typedef union ProtocolCfg ProtocolCfg;
|
typedef union ProtocolCfg ProtocolCfg;
|
||||||
|
|
||||||
@@ -15,4 +16,5 @@ typedef struct {
|
|||||||
const Icon* icon;
|
const Icon* icon;
|
||||||
const char* (*get_name)(const ProtocolCfg* _cfg);
|
const char* (*get_name)(const ProtocolCfg* _cfg);
|
||||||
void (*make_packet)(uint8_t* _size, uint8_t** _packet, const ProtocolCfg* _cfg);
|
void (*make_packet)(uint8_t* _size, uint8_t** _packet, const ProtocolCfg* _cfg);
|
||||||
|
uint8_t (*config_list)(Ctx* ctx);
|
||||||
} Protocol;
|
} Protocol;
|
||||||
|
|||||||
@@ -15,11 +15,19 @@ void scene_config_on_enter(void* _ctx) {
|
|||||||
variable_item_list_reset(list);
|
variable_item_list_reset(list);
|
||||||
|
|
||||||
variable_item_list_set_header(list, ctx->attack->title);
|
variable_item_list_set_header(list, ctx->attack->title);
|
||||||
|
uint8_t item_count = 0;
|
||||||
|
if(ctx->attack->protocol && ctx->attack->protocol->config_list) {
|
||||||
|
item_count = ctx->attack->protocol->config_list(ctx);
|
||||||
|
}
|
||||||
|
UNUSED(item_count);
|
||||||
|
|
||||||
item = variable_item_list_add(list, "Random MAC", 2, random_mac_changed, ctx);
|
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_index(item, ctx->attack->payload.random_mac);
|
||||||
variable_item_set_current_value_text(item, ctx->attack->payload.random_mac ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, ctx->attack->payload.random_mac ? "ON" : "OFF");
|
||||||
|
|
||||||
|
variable_item_list_set_selected_item(
|
||||||
|
list, scene_manager_get_scene_state(ctx->scene_manager, SceneConfig));
|
||||||
|
|
||||||
view_dispatcher_switch_to_view(ctx->view_dispatcher, ViewVariableItemList);
|
view_dispatcher_switch_to_view(ctx->view_dispatcher, ViewVariableItemList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user