Skip to content

Commit

Permalink
Fix a presumed broken merge and a lint issue
Browse files Browse the repository at this point in the history
  • Loading branch information
peternewman committed Apr 21, 2024
1 parent 1eec20a commit 05404c7
Showing 1 changed file with 0 additions and 50 deletions.
50 changes: 0 additions & 50 deletions libs/acn/LLRPProbeRequestPDU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,56 +31,6 @@ using ola::io::OutputStream;
using ola::network::HostToNetwork;
using ola::rdm::UID;

unsigned int LLRPProbeRequestPDU::DataSize() const {
llrp_probe_request_pdu_data data;
return static_cast<unsigned int>(sizeof(llrp_probe_request_pdu_data) -
sizeof(data.known_uids) +
(m_known_uids.Size() * UID::LENGTH));

}

bool LLRPProbeRequestPDU::PackData(uint8_t *data, unsigned int *length) const {
llrp_probe_request_pdu_data pdu_data;
m_lower_uid.Pack(pdu_data.lower_uid, sizeof(pdu_data.lower_uid));
m_upper_uid.Pack(pdu_data.upper_uid, sizeof(pdu_data.upper_uid));
uint16_t filter = 0;
if (m_client_tcp_connection_inactive) {
filter |= FILTER_CLIENT_TCP_CONNECTION_INACTIVE;
}
if (m_brokers_only) {
filter |= FILTER_BROKERS_ONLY;
}
pdu_data.filter = HostToNetwork(filter);
// TODO(Peter): We need to check we've got <= 200 UIDs here
m_known_uids.Pack(pdu_data.known_uids, sizeof(pdu_data.known_uids));
*length = static_cast<unsigned int>(sizeof(llrp_probe_request_pdu_data) -
sizeof(pdu_data.known_uids) +
(m_known_uids.Size() * UID::LENGTH));

memcpy(data, &pdu_data, *length);
return true;
}

void LLRPProbeRequestPDU::PackData(ola::io::OutputStream *stream) const {
llrp_probe_request_pdu_data data;
m_lower_uid.Pack(data.lower_uid, sizeof(data.lower_uid));
m_upper_uid.Pack(data.upper_uid, sizeof(data.upper_uid));
uint16_t filter = 0;
if (m_client_tcp_connection_inactive) {
filter |= FILTER_CLIENT_TCP_CONNECTION_INACTIVE;
}
if (m_brokers_only) {
filter |= FILTER_BROKERS_ONLY;
}
data.filter = HostToNetwork(filter);
// TODO(Peter): We need to check we've got <= 200 UIDs here
m_known_uids.Pack(data.known_uids, sizeof(data.known_uids));
stream->Write(reinterpret_cast<uint8_t*>(&data),
static_cast<unsigned int>(sizeof(llrp_probe_request_pdu_data) -
sizeof(data.known_uids) +
(m_known_uids.Size() * UID::LENGTH)));
}

unsigned int LLRPProbeRequestPDU::DataSize() const {
llrp_probe_request_pdu_data data;
return static_cast<unsigned int>(sizeof(llrp_probe_request_pdu_data) -
Expand Down

0 comments on commit 05404c7

Please sign in to comment.