ifttt_virtual_button.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #pragma once
  2. #include <furi.h>
  3. #include <power/power_service/power.h>
  4. #include <gui/gui.h>
  5. #include <gui/view.h>
  6. #include <gui/view_dispatcher.h>
  7. #include <gui/scene_manager.h>
  8. #include "views/send_view.h"
  9. #include "views/about_view.h"
  10. #include <gui/modules/submenu.h>
  11. #include <gui/modules/dialog_ex.h>
  12. #include <flipper_format/flipper_format.h>
  13. #include <flipper_format/flipper_format_i.h>
  14. #include <storage/storage.h>
  15. #include <furi_hal_uart.h>
  16. #include "scenes/virtual_button_scene.h"
  17. #define APP_NAME "[ESP8266] IFTTT Virtual Button"
  18. #define CONF_SSID "wifi_ssid"
  19. #define CONF_PASSWORD "wifi_password"
  20. #define CONF_KEY "webhooks_key"
  21. #define CONF_EVENT "event"
  22. #define CONFIG_FILE_HEADER "IFTTT Virtual Button Config File"
  23. #define CONFIG_FILE_VERSION 1
  24. typedef struct{
  25. char *save_ssid;
  26. char *save_password;
  27. char *save_key;
  28. char *save_event;
  29. } Settings;
  30. typedef struct {
  31. Power* power;
  32. Gui* gui;
  33. SceneManager* scene_manager;
  34. ViewDispatcher* view_dispatcher;
  35. SendView* sen_view;
  36. AboutView* abou_view;
  37. Submenu* submenu;
  38. DialogEx* dialog;
  39. PowerInfo info;
  40. Settings settings;
  41. } VirtualButtonApp;
  42. typedef enum {
  43. VirtualButtonAppViewSendView,
  44. VirtualButtonAppViewAboutView,
  45. VirtualButtonAppViewSubmenu,
  46. VirtualButtonAppViewDialog,
  47. } VirtualButtonAppView;
  48. Settings save_settings(Settings settings);
  49. Settings *load_settings();