plugin_state.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #pragma once
  2. #include <notification/notification.h>
  3. #include <gui/gui.h>
  4. #include <dialogs/dialogs.h>
  5. #include "../features_config.h"
  6. #include "../ui/totp_scenes_enum.h"
  7. #include "../services/config/config_file_context.h"
  8. #include "notification_method.h"
  9. #include "automation_method.h"
  10. #ifdef TOTP_BADBT_TYPE_ENABLED
  11. #include "../workers/bt_type_code/bt_type_code.h"
  12. #endif
  13. #define TOTP_IV_SIZE (16)
  14. /**
  15. * @brief Application state structure
  16. */
  17. typedef struct {
  18. /**
  19. * @brief Application current scene
  20. */
  21. Scene current_scene;
  22. /**
  23. * @brief Application current scene state
  24. */
  25. void* current_scene_state;
  26. /**
  27. * @brief Reference to the firmware notification subsystem
  28. */
  29. NotificationApp* notification_app;
  30. /**
  31. * @brief Reference to the firmware dialogs subsystem
  32. */
  33. DialogsApp* dialogs_app;
  34. /**
  35. * @brief Reference to the firmware GUI subsystem
  36. */
  37. Gui* gui;
  38. /**
  39. * @brief Timezone UTC offset in hours
  40. */
  41. float timezone_offset;
  42. ConfigFileContext* config_file_context;
  43. /**
  44. * @brief Encrypted well-known string data
  45. */
  46. uint8_t* crypto_verify_data;
  47. /**
  48. * @brief Encrypted well-known string data length
  49. */
  50. size_t crypto_verify_data_length;
  51. /**
  52. * @brief Whether PIN is set by user or not
  53. */
  54. bool pin_set;
  55. /**
  56. * @brief Initialization vector (IV) to be used for encryption\decryption
  57. */
  58. uint8_t iv[TOTP_IV_SIZE];
  59. /**
  60. * @brief Basic randomly-generated initialization vector (IV)
  61. */
  62. uint8_t base_iv[TOTP_IV_SIZE];
  63. /**
  64. * @brief Notification method
  65. */
  66. NotificationMethod notification_method;
  67. /**
  68. * @brief Main rendering loop mutex
  69. */
  70. FuriMutex* mutex;
  71. /**
  72. * @brief Automation method
  73. */
  74. AutomationMethod automation_method;
  75. #ifdef TOTP_BADBT_TYPE_ENABLED
  76. /**
  77. * @brief Bad-Bluetooth worker context
  78. */
  79. TotpBtTypeCodeWorkerContext* bt_type_code_worker_context;
  80. #endif
  81. } PluginState;