diff --git a/NexObject.cpp b/NexObject.cpp index 081ad73a..fa8ee25f 100644 --- a/NexObject.cpp +++ b/NexObject.cpp @@ -18,7 +18,8 @@ NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name) { this->__pid = pid; this->__cid = cid; - this->__name = name; + this->__name_str = name; + this->__name = __name_str.c_str(); } uint8_t NexObject::getObjPid(void) diff --git a/NexObject.h b/NexObject.h index d9678266..8f87c374 100644 --- a/NexObject.h +++ b/NexObject.h @@ -76,6 +76,7 @@ class NexObject uint8_t __pid; /* Page ID */ uint8_t __cid; /* Component ID */ const char *__name; /* An unique name */ + String __name_str; /* space to store the name */ }; /** * @}