Fuzzer App: prtocol carusel prototype

This commit is contained in:
gid9798 2023-06-05 14:35:15 +03:00
parent b95620cdd0
commit 6eed74c716
3 changed files with 33 additions and 4 deletions

View File

@ -1,7 +1,6 @@
#pragma once
#include <furi.h>
#include <furi_hal.h>
typedef struct {
uint8_t menu_index;

View File

@ -24,6 +24,7 @@
- [x] Icon in dialog
- [ ] Description and buttons in `field_editor` view
- [ ] Protocol carousel in `main_menu`
- [x] prototype
- [x] UID
- [x] Simplify the storage and exchange of `uids.data` `uid.data_size` in `views`
- [x] `UID_MAX_SIZE`

View File

@ -5,6 +5,9 @@
#include "../lib/worker/protocol.h"
#define PROTOCOL_NAME_Y 12
// #define PROTOCOL_CAROUSEL
struct FuzzerViewMain {
View* view;
FuzzerViewMainCallback callback;
@ -84,10 +87,36 @@ void fuzzer_view_main_draw(Canvas* canvas, FuzzerViewMainModel* model) {
}
canvas_set_font(canvas, FontPrimary);
canvas_draw_str_aligned(canvas, 27, 4, AlignCenter, AlignTop, "<");
canvas_draw_str_aligned(canvas, 27, PROTOCOL_NAME_Y, AlignCenter, AlignBottom, "<");
canvas_draw_str_aligned(
canvas, 64, 4, AlignCenter, AlignTop, fuzzer_proto_get_name(model->proto_index));
canvas_draw_str_aligned(canvas, 101, 4, AlignCenter, AlignTop, ">");
canvas,
64,
PROTOCOL_NAME_Y,
AlignCenter,
AlignBottom,
fuzzer_proto_get_name(model->proto_index));
canvas_draw_str_aligned(canvas, 101, PROTOCOL_NAME_Y, AlignCenter, AlignBottom, ">");
#ifdef PROTOCOL_CAROUSEL
canvas_set_font(canvas, FontSecondary);
canvas_draw_str_aligned(
canvas,
20,
PROTOCOL_NAME_Y,
AlignRight,
AlignBottom,
(model->proto_index > 0) ? fuzzer_proto_get_name(model->proto_index - 1) :
fuzzer_proto_get_name((model->proto_max - 1)));
canvas_draw_str_aligned(
canvas,
108,
PROTOCOL_NAME_Y,
AlignLeft,
AlignBottom,
(model->proto_index < (model->proto_max - 1)) ?
fuzzer_proto_get_name(model->proto_index + 1) :
fuzzer_proto_get_name(0));
#endif
}
bool fuzzer_view_main_input(InputEvent* event, void* context) {