2021-12-22 20:04:08 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "u2f_app.h"
|
|
|
|
#include "scenes/u2f_scene.h"
|
|
|
|
|
|
|
|
#include <gui/gui.h>
|
|
|
|
#include <gui/view_dispatcher.h>
|
|
|
|
#include <gui/scene_manager.h>
|
|
|
|
#include <gui/modules/submenu.h>
|
|
|
|
#include <dialogs/dialogs.h>
|
2022-01-05 16:10:18 +00:00
|
|
|
#include <notification/notification_messages.h>
|
|
|
|
#include <gui/modules/variable_item_list.h>
|
2022-02-02 14:27:33 +00:00
|
|
|
#include <gui/modules/widget.h>
|
2021-12-22 20:04:08 +00:00
|
|
|
#include "views/u2f_view.h"
|
|
|
|
#include "u2f_hid.h"
|
|
|
|
#include "u2f.h"
|
|
|
|
|
2022-03-24 15:45:03 +00:00
|
|
|
typedef enum {
|
|
|
|
U2fAppErrorNoFiles,
|
|
|
|
U2fAppErrorCloseRpc,
|
|
|
|
} U2fAppError;
|
|
|
|
|
2021-12-22 20:04:08 +00:00
|
|
|
typedef enum {
|
|
|
|
U2fCustomEventNone,
|
|
|
|
|
2022-01-02 23:33:28 +00:00
|
|
|
U2fCustomEventConnect,
|
|
|
|
U2fCustomEventDisconnect,
|
2022-02-07 13:34:09 +00:00
|
|
|
U2fCustomEventDataError,
|
2022-01-02 23:33:28 +00:00
|
|
|
|
2021-12-22 20:04:08 +00:00
|
|
|
U2fCustomEventRegister,
|
|
|
|
U2fCustomEventAuth,
|
2022-01-02 23:33:28 +00:00
|
|
|
U2fCustomEventAuthSuccess,
|
2021-12-22 20:04:08 +00:00
|
|
|
U2fCustomEventWink,
|
|
|
|
|
|
|
|
U2fCustomEventTimeout,
|
|
|
|
|
|
|
|
U2fCustomEventConfirm,
|
|
|
|
|
2022-02-02 14:27:33 +00:00
|
|
|
U2fCustomEventErrorBack,
|
|
|
|
|
2021-12-22 20:04:08 +00:00
|
|
|
} GpioCustomEvent;
|
|
|
|
|
|
|
|
typedef enum {
|
2022-02-02 14:27:33 +00:00
|
|
|
U2fAppViewError,
|
2021-12-22 20:04:08 +00:00
|
|
|
U2fAppViewMain,
|
|
|
|
} U2fAppView;
|
|
|
|
|
|
|
|
struct U2fApp {
|
|
|
|
Gui* gui;
|
|
|
|
ViewDispatcher* view_dispatcher;
|
|
|
|
SceneManager* scene_manager;
|
|
|
|
NotificationApp* notifications;
|
2022-02-02 14:27:33 +00:00
|
|
|
Widget* widget;
|
2022-07-20 10:56:33 +00:00
|
|
|
FuriTimer* timer;
|
2021-12-22 20:04:08 +00:00
|
|
|
U2fHid* u2f_hid;
|
|
|
|
U2fView* u2f_view;
|
|
|
|
U2fData* u2f_instance;
|
|
|
|
GpioCustomEvent event_cur;
|
|
|
|
bool u2f_ready;
|
2022-03-24 15:45:03 +00:00
|
|
|
U2fAppError error;
|
2021-12-22 20:04:08 +00:00
|
|
|
};
|