diff --git a/platform/qt/dmxwidget/dmxwidget.cpp b/platform/qt/dmxwidget/dmxwidget.cpp index fba5ab8..b1e35a6 100644 --- a/platform/qt/dmxwidget/dmxwidget.cpp +++ b/platform/qt/dmxwidget/dmxwidget.cpp @@ -63,6 +63,17 @@ void DmxWidget::close() */ void DmxWidget::parseMessageBuffer() { + OperatingMode other_side = USBunknown; + switch (usb_mode) { + case ENTTEC::Widget::USBdevice: + other_side = USBhost; + break; + case ENTTEC::Widget::USBhost: + other_side = USBdevice; + break; + default: + break; + } uint16_t length; const int fixed_length = 5; // start + label + 2xlength + end auto fast_forward = [this](int offset = 0) { @@ -90,7 +101,7 @@ void DmxWidget::parseMessageBuffer() continue; } // make a new message data - auto msg = std::make_shared((uint8_t)message_rx_buffer_[1]); + auto msg = MessageDataFactory((MESSAGE_LABEL)message_rx_buffer_[1], other_side); // fill it with data std::shared_ptr stream(new bufferstream( reinterpret_cast(message_rx_buffer_.data())+fixed_length-1,