xremote_i.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. #pragma once
  2. #include <stdint.h>
  3. #include <stdbool.h>
  4. #include <stddef.h>
  5. #include <stdlib.h>
  6. #include <stdio.h>
  7. #include <furi.h>
  8. #include <furi_hal.h>
  9. #include <gui/gui.h>
  10. #include <gui/elements.h>
  11. #include <gui/view.h>
  12. #include <gui/view_stack.h>
  13. #include <gui/view_dispatcher.h>
  14. #include <gui/scene_manager.h>
  15. #include <gui/modules/popup.h>
  16. #include <gui/modules/loading.h>
  17. #include <gui/modules/submenu.h>
  18. #include <gui/modules/dialog_ex.h>
  19. #include <gui/modules/number_input.h>
  20. #include <gui/modules/text_input.h>
  21. #include <gui/modules/button_menu.h>
  22. #include <gui/modules/button_panel.h>
  23. #include <gui/modules/variable_item_list.h>
  24. #include <input/input.h>
  25. #include <notification/notification_messages.h>
  26. #include <string.h>
  27. #include <m-array.h>
  28. #include <toolbox/path.h>
  29. #include <storage/storage.h>
  30. #include <dialogs/dialogs.h>
  31. #include <core/check.h>
  32. #include <core/common_defines.h>
  33. #include <dolphin/dolphin.h>
  34. #include <infrared.h>
  35. #include <infrared_worker.h>
  36. #include <infrared_transmit.h>
  37. #include <flipper_format/flipper_format.h>
  38. #include "xremote_icons.h"
  39. #include "models/subghz/xremote_sg_remote.h"
  40. #define XREMOTE_APP_FOLDER EXT_PATH("apps_data/xremote")
  41. #define XREMOTE_DEFAULT_REMOTE_NAME "remote"
  42. #define XREMOTE_APP_EXTENSION ".xr"
  43. #define XREMOTE_FILE_TYPE "Cross Remote File"
  44. #define XREMOTE_FILE_VERSION 1
  45. #define XREMOTE_TEXT_STORE_NUM 3
  46. #define XREMOTE_TEXT_STORE_SIZE 128
  47. #define XREMOTE_MAX_ITEM_NAME_LENGTH 22
  48. #define XREMOTE_MAX_REMOTE_NAME_LENGTH 22
  49. #define XREMOTE_VERSION FAP_VERSION
  50. #define INFRARED_APP_EXTENSION ".ir"
  51. #define INFRARED_APP_FOLDER EXT_PATH("infrared")
  52. #define TAG "XRemote"
  53. typedef enum {
  54. XRemoteRemoteItemTypeInfrared,
  55. XRemoteRemoteItemTypeSubGhz,
  56. XRemoteRemoteItemTypePause,
  57. } XRemoteRemoteItemType;
  58. typedef enum {
  59. InfraredNotificationMessageSuccess,
  60. InfraredNotificationMessageGreenOn,
  61. InfraredNotificationMessageGreenOff,
  62. InfraredNotificationMessageYellowOn,
  63. InfraredNotificationMessageYellowOff,
  64. InfraredNotificationMessageBlinkStartRead,
  65. InfraredNotificationMessageBlinkStartSend,
  66. InfraredNotificationMessageBlinkStop,
  67. PauseNotificationMessageBlinkStartSend,
  68. PauseNotificationMessageBlinkStop,
  69. SubGhzNotificationMessageBlinkStartSend,
  70. SubGhzNotificationMessageBlinkStop,
  71. } XRemoteNotificationMessage;
  72. typedef enum {
  73. XRemoteTransmittingIdle,
  74. XRemoteTransmittingStart,
  75. XRemoteTransmittingStop,
  76. XRemoteTransmittingStopSubghz,
  77. } XRemoteRemoteTransmissionStatus;
  78. struct InfraredSignal {
  79. bool is_raw;
  80. union {
  81. InfraredMessage message;
  82. InfraredRawSignal raw;
  83. } payload;
  84. };
  85. struct CrossRemoteItem {
  86. FuriString* name;
  87. FuriString* filename;
  88. InfraredSignal* ir_signal;
  89. SubGhzRemote* sg_signal;
  90. int16_t type;
  91. uint32_t time;
  92. };
  93. typedef struct CrossRemote CrossRemote;
  94. typedef struct CrossRemoteItem CrossRemoteItem;
  95. typedef struct XRemoteTransmit XRemoteTransmit;
  96. typedef struct XRemotePauseSet XRemotePauseSet;