Skip to content

Commit

Permalink
Handle vendorcast/broadcast when sending RDM commands via E1.33
Browse files Browse the repository at this point in the history
(cherry picked from commit 9e113f0)
  • Loading branch information
peternewman committed Apr 14, 2024
1 parent 7e83985 commit d89abd2
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion libs/acn/MessageBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "ola/e133/MessageBuilder.h"
#include "ola/io/IOStack.h"
#include "ola/rdm/RDMCommandSerializer.h"
#include "ola/rdm/UID.h"

#include "libs/acn/BrokerPDU.h"
#include "libs/acn/E133PDU.h"
Expand Down Expand Up @@ -72,12 +73,27 @@ void MessageBuilder::BuildTCPRDMCommandPDU(IOStack *packet,
uint16_t source_endpoint_id,
uint16_t destination_endpoint_id,
uint32_t sequence_number) {
// TODO(Peter): Potentially need some future way to handle controller
// messages here
ola::rdm::UID rpt_destination_uid = request->DestinationUID();
if (rpt_destination_uid.IsBroadcast()) {
if (rpt_destination_uid.IsVendorcast()) {
rpt_destination_uid = ola::rdm::UID::RPTVendorcastAddressDevices(
rpt_destination_uid);
} else {
rpt_destination_uid = ola::rdm::UID::RPTAllDevices();
}
if (destination_endpoint_id != NULL_ENDPOINT) {
// TODO(Peter): Should we handle the reserved endpoints now?
destination_endpoint_id = BROADCAST_ENDPOINT;
}
}
ola::rdm::RDMCommandSerializer::Write(*request, packet);
ola::acn::RDMPDU::PrependPDU(packet);
ola::acn::RPTRequestPDU::PrependPDU(packet);
RPTPDU::PrependPDU(packet, ola::acn::VECTOR_RPT_REQUEST,
request->SourceUID(), source_endpoint_id,
request->DestinationUID(), destination_endpoint_id,
rpt_destination_uid, destination_endpoint_id,
sequence_number);
RootPDU::PrependPDU(packet, ola::acn::VECTOR_ROOT_RPT, m_cid, true);
PreamblePacker::AddTCPPreamble(packet);
Expand Down

0 comments on commit d89abd2

Please sign in to comment.