You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.1 KiB

11 months ago
11 months ago
11 months ago
11 months ago
9 months ago
11 months ago
11 months ago
11 months ago
11 months ago
9 months ago
9 months ago
11 months ago
11 months ago
11 months ago
9 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
  1. #pragma once
  2. #include <stdint.h>
  3. #include <stdio.h>
  4. #include <string.h>
  5. #include <functional>
  6. #include "uicontroler\tjc\tjc_constant.hpp"
  7. namespace iflytop {
  8. using namespace std;
  9. typedef enum {
  10. kAppEvent_RunModeChangeEvent,
  11. kAppEvent_RemoterConnectStateChangeEvent,
  12. kAppEvent_StateDisplayInfo,
  13. kAppEvent_BleConnectEvent,
  14. kAppEvent_AcidChCfgChangeEvent,
  15. // UI_EVENT
  16. KAE_UIEvent,
  17. kAE_LoginEvent,
  18. } AppEventType_t;
  19. /**
  20. *
  21. * @brief
  22. *
  23. *
  24. * @ע
  25. * ׶󣬷ջ
  26. */
  27. typedef struct {
  28. AppEventType_t type;
  29. union event {
  30. uint32_t placeholder;
  31. char bleName[20];
  32. char stateDisplayInfo[30];
  33. tjc::UIEvent uiEvent;
  34. } d;
  35. } AppEvent_t;
  36. static inline AppEvent_t createAppEvent(AppEventType_t type) {
  37. AppEvent_t event;
  38. event.type = type;
  39. return event;
  40. }
  41. static inline AppEvent_t createStateDisplayInfoEvent(const char* info) {
  42. AppEvent_t event;
  43. event.type = kAppEvent_StateDisplayInfo;
  44. strncpy(event.d.stateDisplayInfo, info, sizeof(event.d.stateDisplayInfo));
  45. return event;
  46. }
  47. } // namespace iflytop