From fa24d64c72eedc1b3ba4faae8af6d9c345bfb5db Mon Sep 17 00:00:00 2001 From: Kevin Matz Date: Sat, 4 Jun 2022 10:52:42 -0400 Subject: [PATCH] receive a ProbeRequest --- protocol/rdmnet/device.cpp | 29 +++++++++++++++++++++++++++++ protocol/rdmnet/device.h | 4 ++++ 2 files changed, 33 insertions(+) diff --git a/protocol/rdmnet/device.cpp b/protocol/rdmnet/device.cpp index e60c95d..5a18329 100644 --- a/protocol/rdmnet/device.cpp +++ b/protocol/rdmnet/device.cpp @@ -53,4 +53,33 @@ void Device::rlpRptReceiver(ACN::PDU::Message root) } +/** + * @brief Device::receiveProbeRequest + * @param pdu + */ +void Device::receiveProbeRequest(ACN::PDU::Message pdu) +{ + /** + * > \cite RDMnet 5.4.2.1 Probe Request PDU + * > Cient TCP connection inactive. If this bit is set, an LLRP Target shall + * > only reply if its associated RPT Client is not currently connected to + * > a Broker. + */ + auto data = std::static_pointer_cast(pdu->data()); + if (data->filter.client_tcp_inactive && RPT::Device::connectedToBroker) + return; + + /** + * > \cite RDMnet 5.4.2.1 Probe Request PDU + * > Brokers only. If this bit is set, an LLRP Target shall only reply if + * > it is also associated with a Broker. + */ + if (data->filter.brokers_only) + return; + + LLRP::Target::receiveProbeRequest(pdu); +} + + + } // namespace RDMnet diff --git a/protocol/rdmnet/device.h b/protocol/rdmnet/device.h index 6714bf3..987ac7c 100644 --- a/protocol/rdmnet/device.h +++ b/protocol/rdmnet/device.h @@ -42,6 +42,10 @@ public: void rlpRptReceiver(ACN::PDU::Message); +protected: + // 5.4.2.1 Probe Request PDU + void receiveProbeRequest(ACN::PDU::Message) override; + private: UUID::uuid rid_; };