u2f_app_i.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #pragma once
  2. #include "u2f_app.h"
  3. #include "scenes/u2f_scene.h"
  4. #include <gui/gui.h>
  5. #include <assets_icons.h>
  6. #include <gui/view_dispatcher.h>
  7. #include <gui/scene_manager.h>
  8. #include <gui/modules/submenu.h>
  9. #include <dialogs/dialogs.h>
  10. #include <notification/notification_messages.h>
  11. #include <gui/modules/variable_item_list.h>
  12. #include <gui/modules/widget.h>
  13. #include "views/u2f_view.h"
  14. #include "u2f_hid.h"
  15. #include "u2f.h"
  16. typedef enum {
  17. U2fAppErrorNoFiles,
  18. U2fAppErrorCloseRpc,
  19. } U2fAppError;
  20. typedef enum {
  21. U2fCustomEventNone,
  22. U2fCustomEventConnect,
  23. U2fCustomEventDisconnect,
  24. U2fCustomEventDataError,
  25. U2fCustomEventRegister,
  26. U2fCustomEventAuth,
  27. U2fCustomEventAuthSuccess,
  28. U2fCustomEventWink,
  29. U2fCustomEventTimeout,
  30. U2fCustomEventConfirm,
  31. U2fCustomEventErrorBack,
  32. } GpioCustomEvent;
  33. typedef enum {
  34. U2fAppViewError,
  35. U2fAppViewMain,
  36. } U2fAppView;
  37. struct U2fApp {
  38. Gui* gui;
  39. ViewDispatcher* view_dispatcher;
  40. SceneManager* scene_manager;
  41. NotificationApp* notifications;
  42. Widget* widget;
  43. FuriTimer* timer;
  44. U2fHid* u2f_hid;
  45. U2fView* u2f_view;
  46. U2fData* u2f_instance;
  47. GpioCustomEvent event_cur;
  48. bool u2f_ready;
  49. U2fAppError error;
  50. };