forked from Flipper-XFW/Xtreme-Firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BLE Spam add basic config page (parameters later)
- Loading branch information
Showing
9 changed files
with
71 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,22 @@ | ||
#pragma once | ||
|
||
#include <gui/view_dispatcher.h> | ||
#include <gui/modules/variable_item_list.h> | ||
|
||
#include "scenes/_setup.h" | ||
|
||
enum { | ||
ViewMain, | ||
ViewVariableItemList, | ||
}; | ||
|
||
typedef struct Attack Attack; | ||
|
||
typedef struct { | ||
Attack* attack; | ||
|
||
ViewDispatcher* view_dispatcher; | ||
SceneManager* scene_manager; | ||
|
||
VariableItemList* variable_item_list; | ||
} Ctx; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#include "continuity_scenes.h" | ||
#include "fastpair_scenes.h" | ||
#include "swiftpair_scenes.h" |
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
ADD_SCENE(main, Main) | ||
ADD_SCENE(config, Config) | ||
#include "../protocols/_scenes.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} |