add code path for (eventually) receiving discovery messages
This commit is contained in:
parent
946a2dd9f4
commit
4f76a2f96c
|
@ -38,11 +38,9 @@ Widget::Widget()
|
|||
, rdm_controller_(nullptr)
|
||||
, rdm_responder_(nullptr)
|
||||
{
|
||||
token_rdm_receive_ = DMX::Universe::onRxData(RDM::SC_RDM, [this](const std::vector<uint8_t> &data)
|
||||
{
|
||||
if (rdm_responder_)
|
||||
rdm_responder_->receive(data);
|
||||
});
|
||||
// receive RDM alt-start-code'd messages from the universe
|
||||
token_rdm_receive_ = onRxData(RDM::SC_RDM, std::bind(&Widget::receiveRDM,
|
||||
this, std::placeholders::_1));
|
||||
}
|
||||
|
||||
|
||||
|
@ -624,6 +622,23 @@ void Widget::sendRDMdiscovery(const std::vector<uint8_t> &data) const
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Widget::receiveRDM
|
||||
* @param data
|
||||
*/
|
||||
void Widget::receiveRDM(const std::vector<uint8_t> &data)
|
||||
{
|
||||
if (!rdm_responder_)
|
||||
return;
|
||||
|
||||
if (data.size() > RDM::MESSAGE_MINIMUM_LENGTH)
|
||||
rdm_responder_->receive(data);
|
||||
else
|
||||
/// \todo The format for receiving DISC_UNIQUE_BRANCH messages is special.
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Widget::rxMsgHello
|
||||
*/
|
||||
|
@ -828,7 +843,7 @@ void Widget::rdm_configure_responder_()
|
|||
rdm_responder_->deviceModelDescription = "DMX USB Pro";
|
||||
rdm_responder_->deviceModelID = (uint16_t)70304; // manufacturer SKU
|
||||
rdm_responder_->deviceProductCategory = RDM::PRODUCT_CATEGORY_DATA;
|
||||
rdm_responder_->addProductDetailId(RDM::PRODUCT_DETAIL_PROTOCOL_CONVERTOR);
|
||||
rdm_responder_->addProductDetail(RDM::PRODUCT_DETAIL_PROTOCOL_CONVERTOR);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -25,10 +25,10 @@
|
|||
|
||||
#include "pro.h"
|
||||
|
||||
#include <rdm_controller.h>
|
||||
#include <cstring>
|
||||
#include <future>
|
||||
#include <mutex>
|
||||
#include <rdm_controller.h>
|
||||
#include <responder.h>
|
||||
#include <universe.h>
|
||||
#include <vector>
|
||||
|
@ -112,6 +112,7 @@ protected:
|
|||
void sendDmx(bool trimmed = true) const;
|
||||
void sendRDMdata(const std::vector<uint8_t> &) const;
|
||||
void sendRDMdiscovery(const std::vector<uint8_t> &) const;
|
||||
void receiveRDM(const std::vector<uint8_t> &);
|
||||
|
||||
/**
|
||||
* @brief writeFwPage
|
||||
|
|
Loading…
Reference in New Issue