|
@ -21,7 +21,10 @@ class AppEvent { |
|
|
public: |
|
|
public: |
|
|
AppEventType_t type; |
|
|
AppEventType_t type; |
|
|
std::function<void()> onfnc = nullptr; |
|
|
std::function<void()> onfnc = nullptr; |
|
|
uint8_t buf[sizeof(UIEvent) + 10]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
|
|
uint8_t buf[50]; |
|
|
|
|
|
UIEvent* uieventpointer = nullptr; |
|
|
|
|
|
|
|
|
public: |
|
|
public: |
|
|
AppEvent() { memset(buf, 0, sizeof(buf)); } |
|
|
AppEvent() { memset(buf, 0, sizeof(buf)); } |
|
@ -29,18 +32,18 @@ class AppEvent { |
|
|
public: |
|
|
public: |
|
|
int getBufSize() { return sizeof(buf); } |
|
|
int getBufSize() { return sizeof(buf); } |
|
|
|
|
|
|
|
|
void setBleName(const char* name) { strcpy((char*)buf, name); } |
|
|
|
|
|
|
|
|
void setBleName(const char* name) { strncpy((char*)buf, name, sizeof(buf)); } |
|
|
char* getBleName() { return (char*)buf; } |
|
|
char* getBleName() { return (char*)buf; } |
|
|
|
|
|
|
|
|
UIEvent* getUIEvent() { return (UIEvent*)buf; } |
|
|
|
|
|
void setUIEvent(const UIEvent& event) { memcpy(buf, &event, sizeof(UIEvent)); } |
|
|
|
|
|
|
|
|
|
|
|
void setPageChangeTo(int32_t page) { *(int32_t*)buf = page; } |
|
|
void setPageChangeTo(int32_t page) { *(int32_t*)buf = page; } |
|
|
int32_t getPageChangeTo() { return *(int32_t*)buf; } |
|
|
int32_t getPageChangeTo() { return *(int32_t*)buf; } |
|
|
|
|
|
|
|
|
void setStateDisplayInfo(const char* info) { strcpy((char*)buf, info); } |
|
|
|
|
|
|
|
|
void setStateDisplayInfo(const char* info) { strncpy((char*)buf, info, sizeof(buf)); } |
|
|
char* getStateDisplayInfo() { return (char*)buf; } |
|
|
char* getStateDisplayInfo() { return (char*)buf; } |
|
|
|
|
|
|
|
|
|
|
|
UIEvent* getUIEvent() { return uieventpointer; } |
|
|
|
|
|
void setUIEvent(UIEvent* event) { uieventpointer = event; } |
|
|
|
|
|
|
|
|
AcidStateChangeEvent_t* getAcidStateChangeEvent() { return (AcidStateChangeEvent_t*)buf; } |
|
|
AcidStateChangeEvent_t* getAcidStateChangeEvent() { return (AcidStateChangeEvent_t*)buf; } |
|
|
|
|
|
|
|
|
void setOnFnc(std::function<void()> fnc) { onfnc = fnc; } |
|
|
void setOnFnc(std::function<void()> fnc) { onfnc = fnc; } |
|
|