/* receiver.h Copyright (c) 2020 Kevin Matz (kevin.matz@gmail.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #pragma once #include "rlp/component.h" #include "data.h" #include "extended.h" #include "sacn.h" #include "mergeproxyuniverse.h" #include #include namespace sACN { /** * @brief \cite sACN 3.6 Receiver: A receiver is the intended target of * information from a source. * * A receiver may listen on multiple universes. */ class Receiver : public virtual ACN::RLP::Component { public: Receiver(UUID::uuid = UUID::uuid()); ~Receiver(); virtual void subscribe(const uint16_t); virtual void unsubscribe(const uint16_t); Universe * universe(const uint16_t); void discoveryStart(); void discoveryStop(); void onDiscovered(const EXTENDED::DISCOVERY::Watcher); protected: // 5 - E1.31 use of the ACN Root Layer Protocol void dataReceiver(ACN::PDU::Message); void extendedReceiver(ACN::PDU::Message); // 6.2 E1.31 Data Packet Framing Layer void dataFrameHandler(ACN::PDU::Message); // 6.3 E1.31 Synchronization Packet Framing Layer void syncFrameHandler(ACN::PDU::Message); // 6.4 E1.31 Universe Discovery Packet Framing Layer void discoveryFrameHandler(ACN::PDU::Message); // 8 Universe Discovery Layer void discoveryListHanlder(ACN::PDU::Message); private: std::unordered_map universes_; std::vector discoveryCallbacks_; }; };