nfc_maker.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #pragma once
  2. #include <furi.h>
  3. #include <gui/gui.h>
  4. #include <gui/view.h>
  5. #include <gui/modules/validators.h>
  6. #include <gui/view_dispatcher.h>
  7. #include <gui/scene_manager.h>
  8. #include <assets_icons.h>
  9. #include <gui/modules/submenu.h>
  10. #include <gui/modules/text_input.h>
  11. #include <gui/modules/byte_input.h>
  12. #include <gui/modules/popup.h>
  13. #include "scenes/nfc_maker_scene.h"
  14. #include <lib/flipper_format/flipper_format.h>
  15. #include <toolbox/name_generator.h>
  16. #include <applications/main/nfc/nfc_app_i.h>
  17. #include <furi_hal_bt.h>
  18. #define MAC_INPUT_LEN GAP_MAC_ADDR_SIZE
  19. #define MAIL_INPUT_LEN 128
  20. #define PHONE_INPUT_LEN 17
  21. #define BIG_INPUT_LEN 248
  22. #define SMALL_INPUT_LEN 90
  23. typedef enum {
  24. WifiAuthenticationOpen = 0x01,
  25. WifiAuthenticationWpa2Personal = 0x20,
  26. WifiAuthenticationWpa2Enterprise = 0x10,
  27. WifiAuthenticationWpaPersonal = 0x02,
  28. WifiAuthenticationWpaEnterprise = 0x08,
  29. WifiAuthenticationShared = 0x04,
  30. } WifiAuthentication;
  31. typedef enum {
  32. WifiEncryptionAes = 0x08,
  33. WifiEncryptionWep = 0x02,
  34. WifiEncryptionTkip = 0x04,
  35. WifiEncryptionNone = 0x01,
  36. } WifiEncryption;
  37. typedef struct {
  38. Gui* gui;
  39. SceneManager* scene_manager;
  40. ViewDispatcher* view_dispatcher;
  41. Submenu* submenu;
  42. TextInput* text_input;
  43. ByteInput* byte_input;
  44. Popup* popup;
  45. uint8_t mac_buf[MAC_INPUT_LEN];
  46. char mail_buf[MAIL_INPUT_LEN];
  47. char phone_buf[PHONE_INPUT_LEN];
  48. char big_buf[BIG_INPUT_LEN];
  49. char small_buf1[SMALL_INPUT_LEN];
  50. char small_buf2[SMALL_INPUT_LEN];
  51. char save_buf[BIG_INPUT_LEN];
  52. } NfcMaker;
  53. typedef enum {
  54. NfcMakerViewSubmenu,
  55. NfcMakerViewTextInput,
  56. NfcMakerViewByteInput,
  57. NfcMakerViewPopup,
  58. } NfcMakerView;