rpc_debug_app.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #pragma once
  2. #include <furi.h>
  3. #include <gui/gui.h>
  4. #include <gui/view.h>
  5. #include <gui/scene_manager.h>
  6. #include <gui/view_dispatcher.h>
  7. #include <gui/modules/widget.h>
  8. #include <gui/modules/submenu.h>
  9. #include <gui/modules/text_box.h>
  10. #include <gui/modules/text_input.h>
  11. #include <gui/modules/byte_input.h>
  12. #include <rpc/rpc_app.h>
  13. #include <notification/notification_messages.h>
  14. #include "scenes/rpc_debug_app_scene.h"
  15. #define DATA_STORE_SIZE 64U
  16. #define TEXT_STORE_SIZE 64U
  17. typedef struct {
  18. Gui* gui;
  19. RpcAppSystem* rpc;
  20. SceneManager* scene_manager;
  21. ViewDispatcher* view_dispatcher;
  22. NotificationApp* notifications;
  23. Widget* widget;
  24. Submenu* submenu;
  25. TextBox* text_box;
  26. TextInput* text_input;
  27. ByteInput* byte_input;
  28. char text_store[TEXT_STORE_SIZE];
  29. uint8_t data_store[DATA_STORE_SIZE];
  30. } RpcDebugApp;
  31. typedef enum {
  32. RpcDebugAppViewWidget,
  33. RpcDebugAppViewSubmenu,
  34. RpcDebugAppViewTextBox,
  35. RpcDebugAppViewTextInput,
  36. RpcDebugAppViewByteInput,
  37. } RpcDebugAppView;
  38. typedef enum {
  39. // Reserve first 100 events for button types and indexes, starting from 0
  40. RpcDebugAppCustomEventInputErrorCode = 100,
  41. RpcDebugAppCustomEventInputErrorText,
  42. RpcDebugAppCustomEventInputDataExchange,
  43. RpcDebugAppCustomEventRpcDataExchange,
  44. } RpcDebugAppCustomEvent;