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.

50 lines
1.2 KiB

9 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
  1. #pragma once
  2. #include <stdint.h>
  3. #include <functional>
  4. #include "appevent_type.hpp"
  5. extern "C" {
  6. #include "uicontroler/tjc/tjc_base_type.h"
  7. }
  8. /**
  9. *
  10. * @ע
  11. * ׶󣬷ջ
  12. */
  13. // typedef struct {
  14. // } AppEvent;
  15. class AppEvent {
  16. public:
  17. AppEventType_t type;
  18. std::function<void()> onfnc = nullptr;
  19. private:
  20. uint8_t buf[50];
  21. UIEvent* uieventpointer = nullptr;
  22. public:
  23. AppEvent() { memset(buf, 0, sizeof(buf)); }
  24. public:
  25. int getBufSize() { return sizeof(buf); }
  26. void setBleName(const char* name) { strncpy((char*)buf, name, sizeof(buf)); }
  27. char* getBleName() { return (char*)buf; }
  28. void setPageChangeTo(int32_t page) { *(int32_t*)buf = page; }
  29. int32_t getPageChangeTo() { return *(int32_t*)buf; }
  30. void setStateDisplayInfo(const char* info) { strncpy((char*)buf, info, sizeof(buf)); }
  31. char* getStateDisplayInfo() { return (char*)buf; }
  32. UIEvent* getUIEvent() { return uieventpointer; }
  33. void setUIEvent(UIEvent* event) { uieventpointer = event; }
  34. AcidStateChangeEvent_t* getAcidStateChangeEvent() { return (AcidStateChangeEvent_t*)buf; }
  35. void setOnFnc(std::function<void()> fnc) { onfnc = fnc; }
  36. };