|
25 | 25 | #include "ola/e133/MessageBuilder.h" |
26 | 26 | #include "ola/io/IOStack.h" |
27 | 27 | #include "ola/rdm/RDMCommandSerializer.h" |
| 28 | +#include "ola/rdm/UID.h" |
28 | 29 |
|
29 | 30 | #include "libs/acn/BrokerPDU.h" |
30 | 31 | #include "libs/acn/E133PDU.h" |
@@ -72,12 +73,27 @@ void MessageBuilder::BuildTCPRDMCommandPDU(IOStack *packet, |
72 | 73 | uint16_t source_endpoint_id, |
73 | 74 | uint16_t destination_endpoint_id, |
74 | 75 | uint32_t sequence_number) { |
| 76 | + // TODO(Peter): Potentially need some future way to handle controller |
| 77 | + // messages here |
| 78 | + ola::rdm::UID rpt_destination_uid = request->DestinationUID(); |
| 79 | + if (rpt_destination_uid.IsBroadcast()) { |
| 80 | + if (rpt_destination_uid.IsVendorcast()) { |
| 81 | + rpt_destination_uid = ola::rdm::UID::RPTVendorcastAddressDevices( |
| 82 | + rpt_destination_uid); |
| 83 | + } else { |
| 84 | + rpt_destination_uid = ola::rdm::UID::RPTAllDevices(); |
| 85 | + } |
| 86 | + if (destination_endpoint_id != NULL_ENDPOINT) { |
| 87 | + // TODO(Peter): Should we handle the reserved endpoints now? |
| 88 | + destination_endpoint_id = BROADCAST_ENDPOINT; |
| 89 | + } |
| 90 | + } |
75 | 91 | ola::rdm::RDMCommandSerializer::Write(*request, packet); |
76 | 92 | ola::acn::RDMPDU::PrependPDU(packet); |
77 | 93 | ola::acn::RPTRequestPDU::PrependPDU(packet); |
78 | 94 | RPTPDU::PrependPDU(packet, ola::acn::VECTOR_RPT_REQUEST, |
79 | 95 | request->SourceUID(), source_endpoint_id, |
80 | | - request->DestinationUID(), destination_endpoint_id, |
| 96 | + rpt_destination_uid, destination_endpoint_id, |
81 | 97 | sequence_number); |
82 | 98 | RootPDU::PrependPDU(packet, ola::acn::VECTOR_ROOT_RPT, m_cid, true); |
83 | 99 | PreamblePacker::AddTCPPreamble(packet); |
|
0 commit comments