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.

47 lines
942 B

11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 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 <functional>
  4. #include "config_index_enum.hpp"
  5. namespace iflytop {
  6. using namespace std;
  7. typedef enum {
  8. kAppEvent_RunModeChangeEvent,
  9. kAppEvent_RemoterConnectStateChangeEvent,
  10. kAppEvent_PumpWorkStateChangeEvent,
  11. kAppEvent_ConfigChangeEvent,
  12. kAppEvent_BleConnectEvent,
  13. } AppEventType_t;
  14. /**
  15. *
  16. * @brief
  17. *
  18. *
  19. * @ע
  20. * ׶󣬷ջ
  21. */
  22. typedef struct {
  23. AppEventType_t type;
  24. union event {
  25. uint32_t placeholder;
  26. config_index_t configIndex;
  27. char bleName[20];
  28. } d;
  29. } AppEvent_t;
  30. static inline AppEvent_t createAppEvent(AppEventType_t type) {
  31. AppEvent_t event;
  32. event.type = type;
  33. return event;
  34. }
  35. static inline AppEvent_t createConfigChangeEvent(config_index_t index) {
  36. AppEvent_t event;
  37. event.type = kAppEvent_ConfigChangeEvent;
  38. event.d.configIndex = index;
  39. return event;
  40. }
  41. } // namespace iflytop