u2f_app_i.h 1.2 KB

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