u2f_app_i.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. U2fCustomEventNone,
  17. U2fCustomEventConnect,
  18. U2fCustomEventDisconnect,
  19. U2fCustomEventDataError,
  20. U2fCustomEventRegister,
  21. U2fCustomEventAuth,
  22. U2fCustomEventAuthSuccess,
  23. U2fCustomEventWink,
  24. U2fCustomEventTimeout,
  25. U2fCustomEventConfirm,
  26. U2fCustomEventErrorBack,
  27. } GpioCustomEvent;
  28. typedef enum {
  29. U2fAppViewError,
  30. U2fAppViewMain,
  31. } U2fAppView;
  32. struct U2fApp {
  33. Gui* gui;
  34. ViewDispatcher* view_dispatcher;
  35. SceneManager* scene_manager;
  36. NotificationApp* notifications;
  37. Widget* widget;
  38. osTimerId_t timer;
  39. U2fHid* u2f_hid;
  40. U2fView* u2f_view;
  41. U2fData* u2f_instance;
  42. GpioCustomEvent event_cur;
  43. bool u2f_ready;
  44. };