diff --git a/protocol/esta/rdm/device.cpp b/protocol/esta/rdm/device.cpp index df987e1..3b3896f 100644 --- a/protocol/esta/rdm/device.cpp +++ b/protocol/esta/rdm/device.cpp @@ -34,8 +34,9 @@ namespace RDM { */ Device::Device(UID id, Device* parent) : DMX::Device() - , deviceModelID(0) + , deviceManufacturerLabel(MY_ESTA_MANUFACTURER_LABEL) , deviceModelDescription("Basic RDM Device") + , deviceModelID(0) , deviceProductCategory(PRODUCT_CATEGORY_NOT_DECLARED) , id_(id) , parent_(parent) @@ -589,13 +590,8 @@ void Device::actionGetManufacturerLabel(const MsgPtr message, MsgPtr response) return; response->responseType = RESPONSE_TYPE_ACK; - std::string label = std::string(MY_ESTA_MANUFACTURER_LABEL); - for (size_t i = 0; i < label.size(); i++) - { - if (i > 32) - break; - response->appendData(label.at(i)); - } + for (size_t i = 0; i < deviceManufacturerLabel.size() && i <= 32; i++) + response->appendData(deviceManufacturerLabel.at(i)); } diff --git a/protocol/esta/rdm/device.h b/protocol/esta/rdm/device.h index 26d90f3..271d3e9 100644 --- a/protocol/esta/rdm/device.h +++ b/protocol/esta/rdm/device.h @@ -58,8 +58,9 @@ public: virtual void identify(bool state); virtual void reset(bool hard); - uint16_t deviceModelID; //!< model ID number + std::string deviceManufacturerLabel; //!< manufacturer label std::string deviceModelDescription; //!< model description + uint16_t deviceModelID; //!< model ID number uint16_t deviceProductCategory; //!< device category protected: