nfc_maker.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 "nfc_maker_icons.h"
  9. #include <gui/modules/submenu.h>
  10. #include "nfc_maker_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 <lib/toolbox/random_name.h>
  16. #include <applications/main/nfc/nfc_i.h>
  17. #include <furi_hal_bt.h>
  18. #include "strnlen.h"
  19. #define MAC_INPUT_LEN GAP_MAC_ADDR_SIZE
  20. #define MAIL_INPUT_LEN 128
  21. #define PHONE_INPUT_LEN 17
  22. #define BIG_INPUT_LEN 248
  23. #define SMALL_INPUT_LEN 90
  24. typedef enum {
  25. WifiAuthenticationOpen = 0x01,
  26. WifiAuthenticationWpa2Personal = 0x20,
  27. WifiAuthenticationWpa2Enterprise = 0x10,
  28. WifiAuthenticationWpaPersonal = 0x02,
  29. WifiAuthenticationWpaEnterprise = 0x08,
  30. WifiAuthenticationShared = 0x04,
  31. } WifiAuthentication;
  32. typedef enum {
  33. WifiEncryptionAes = 0x08,
  34. WifiEncryptionWep = 0x02,
  35. WifiEncryptionTkip = 0x04,
  36. WifiEncryptionNone = 0x01,
  37. } WifiEncryption;
  38. typedef struct {
  39. Gui* gui;
  40. SceneManager* scene_manager;
  41. ViewDispatcher* view_dispatcher;
  42. Submenu* submenu;
  43. NFCMaker_TextInput* text_input;
  44. ByteInput* byte_input;
  45. Popup* popup;
  46. uint8_t mac_buf[MAC_INPUT_LEN];
  47. char mail_buf[MAIL_INPUT_LEN];
  48. char phone_buf[PHONE_INPUT_LEN];
  49. char big_buf[BIG_INPUT_LEN];
  50. char small_buf1[SMALL_INPUT_LEN];
  51. char small_buf2[SMALL_INPUT_LEN];
  52. char save_buf[BIG_INPUT_LEN];
  53. } NfcMaker;
  54. typedef enum {
  55. NfcMakerViewSubmenu,
  56. NfcMakerViewTextInput,
  57. NfcMakerViewByteInput,
  58. NfcMakerViewPopup,
  59. } NfcMakerView;