From f0d9402db9ff79ddeae85d5231810a11c46a0f8b Mon Sep 17 00:00:00 2001 From: Kevin Matz Date: Mon, 30 Aug 2021 13:32:20 -0400 Subject: [PATCH] transmit sACN EXTENDED frames --- protocols/sacn/source.cpp | 26 ++++++++++++++++++++++++++ protocols/sacn/source.h | 5 +++++ 2 files changed, 31 insertions(+) diff --git a/protocols/sacn/source.cpp b/protocols/sacn/source.cpp index 51eea08..9b437e7 100644 --- a/protocols/sacn/source.cpp +++ b/protocols/sacn/source.cpp @@ -21,6 +21,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "extended.h" #include "source.h" namespace sACN { @@ -86,6 +88,30 @@ void Source::end(const uint16_t num) } +/** + * @brief Source::sendExtendedFrame + * @param vector + * @param header + * @param data + * @param ip + */ +void Source::sendExtendedFrame(const uint16_t vector, + ACN::PDU::pdu_header* header, + ACN::PDU::pdu_data* data, + const ACN::SDT::UDP::ipAddress& ip) const +{ + if (!(vector == VECTOR_E131_EXTENDED_DISCOVERY || + vector == VECTOR_E131_EXTENDED_SYNCHRONIZATION)) + return; + + auto framepdu = std::shared_ptr(new EXTENDED::Pdu); + framepdu->setVector(vector); + framepdu->setHeader(header); + framepdu->setData(data); + rlpSendUdp(VECTOR_ROOT_E131_EXTENDED, framepdu, ip); +} + + /** * @brief Source::universe * @param num diff --git a/protocols/sacn/source.h b/protocols/sacn/source.h index 8882b79..f3bef02 100644 --- a/protocols/sacn/source.h +++ b/protocols/sacn/source.h @@ -52,6 +52,11 @@ public: protected: virtual void end(const uint16_t); + void sendExtendedFrame(const uint16_t vector, + ACN::PDU::pdu_header *header, + ACN::PDU::pdu_data *data, + const ACN::SDT::UDP::ipAddress&) const; + private: std::unordered_map universes_;