introduce ACN::PDU::Message
This commit is contained in:
parent
dee458bf88
commit
883dbc7f8c
|
@ -32,6 +32,79 @@ namespace ACN::PDU {
|
|||
|
||||
class Pdu; // forward declare
|
||||
|
||||
/**
|
||||
* @brief The pdu_header struct
|
||||
*/
|
||||
struct pdu_header : public pdu_stream_object {};
|
||||
|
||||
|
||||
/**
|
||||
* @brief The pdu_data struct
|
||||
*/
|
||||
struct pdu_data : public pdu_stream_object {};
|
||||
|
||||
|
||||
/**
|
||||
* @brief Definitions: Message - A valid PDU.
|
||||
* @tparam T PDU derived class
|
||||
*/
|
||||
template <class T>
|
||||
using Message = std::shared_ptr<T>;
|
||||
|
||||
|
||||
/**
|
||||
* @brief Callback that understands how to proccess a PDU type.
|
||||
* @tparam T PDU derived class
|
||||
*/
|
||||
template <class T>
|
||||
using Handler = std::function<void(Message<T>)>;
|
||||
|
||||
|
||||
/**
|
||||
* @brief PDU::pdu_data subclass that encapsulates other PDU.
|
||||
* @tparam T PDU decendant subclass
|
||||
*/
|
||||
template<class T>
|
||||
struct Block
|
||||
: public pdu_data
|
||||
{
|
||||
Block() {
|
||||
static_assert(std::is_base_of<Pdu, T>::value,
|
||||
"type parameter of ACN::PDU::Block must derive from ACN::PDU::Pdu");
|
||||
}
|
||||
std::shared_ptr<std::vector<Message<T>>> pdu
|
||||
= std::shared_ptr<std::vector<Message<T>>>
|
||||
(new std::vector<Message<T>>);
|
||||
void setParent(Message<Pdu> parent) {
|
||||
for (auto p : *pdu)
|
||||
p->setParent(parent);
|
||||
}
|
||||
size_t streamSize() const override {
|
||||
size_t s = 0;
|
||||
for (auto &child : *pdu)
|
||||
s += child->streamSize();
|
||||
return s;
|
||||
}
|
||||
void iStream(Stream s) override {
|
||||
while(s->good()) {
|
||||
Message<T> p(new T());
|
||||
p->iStream(s);
|
||||
if (s->fail()) // stream failed during pdu read
|
||||
break;
|
||||
if (p->stream()->fail()) // pdu buffer failed
|
||||
continue;
|
||||
if (!pdu->empty()) // set inheritee
|
||||
p->setInherit(pdu->back());
|
||||
pdu->push_back(p); // add to block
|
||||
}
|
||||
}
|
||||
void oStream(Stream s) const override {
|
||||
for ( const auto & child : *pdu )
|
||||
child->oStream(s);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @brief 2.4.1. Flags
|
||||
*
|
||||
|
@ -57,73 +130,6 @@ struct pdu_flags
|
|||
};
|
||||
|
||||
|
||||
/**
|
||||
* @brief The pdu_header struct
|
||||
*/
|
||||
struct pdu_header : public pdu_stream_object {};
|
||||
// C++20
|
||||
//template <class T>
|
||||
//concept header = std::is_base_of<pdu_header, T>::value;
|
||||
|
||||
/**
|
||||
* @brief The pdu_data struct
|
||||
*/
|
||||
struct pdu_data : public pdu_stream_object {};
|
||||
// C++20
|
||||
//template <class T>
|
||||
//concept data = std::is_base_of<pdu_data, T>::value;
|
||||
|
||||
// C++20
|
||||
//template <class T>
|
||||
//concept pdu = std::is_base_of<Pdu, T>::value;
|
||||
|
||||
/**
|
||||
* @brief PDU::pdu_data subclass that encapsulates other PDU.
|
||||
* @tparam T PDU decendant subclass
|
||||
*/
|
||||
//template<pdu T> // C++20
|
||||
template<class T>
|
||||
struct Block
|
||||
: public pdu_data
|
||||
{
|
||||
Block() {
|
||||
static_assert(std::is_base_of<Pdu, T>::value,
|
||||
"type parameter of ACN::PDU::Block must derive from ACN::PDU::Pdu");
|
||||
}
|
||||
std::shared_ptr<std::vector<std::shared_ptr<T>>> pdu
|
||||
= std::shared_ptr<std::vector<std::shared_ptr<T>>>
|
||||
(new std::vector<std::shared_ptr<T>>);
|
||||
void setParent(std::shared_ptr<Pdu> parent) {
|
||||
for (auto p : *pdu)
|
||||
p->setParent(parent);
|
||||
}
|
||||
size_t streamSize() const override {
|
||||
size_t s = 0;
|
||||
for (auto &child : *pdu)
|
||||
s += child->streamSize();
|
||||
return s;
|
||||
}
|
||||
void iStream(Stream s) override {
|
||||
while(s->good()) {
|
||||
std::shared_ptr<T> p(new T());
|
||||
p->iStream(s);
|
||||
if (s->fail()) // stream failed during pdu read
|
||||
break;
|
||||
if (p->stream()->fail()) // pdu buffer failed
|
||||
continue;
|
||||
if (!pdu->empty()) // set inheritee
|
||||
p->setInherit(pdu->back());
|
||||
pdu->push_back(p); // add to block
|
||||
}
|
||||
}
|
||||
void oStream(Stream s) const override {
|
||||
for ( const auto & child : *pdu )
|
||||
child->oStream(s);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief The Pdu class
|
||||
*
|
||||
|
@ -147,7 +153,7 @@ public:
|
|||
uint32_t vector(); // may inherit
|
||||
pdu_header * header(); // may inherit
|
||||
pdu_data * data(); // may inherit
|
||||
std::shared_ptr<Pdu> parent() {return parent_;}
|
||||
Message<Pdu> parent() {return parent_;}
|
||||
Stream stream() {return stream_;}
|
||||
virtual size_t streamSize() const override;
|
||||
virtual void iStream(Stream) override;
|
||||
|
@ -157,11 +163,10 @@ public:
|
|||
void setVector (const uint32_t v) { vector_ = v; flags_.hasVector = true; }
|
||||
void setHeader (pdu_header * h) { header_ = h; flags_.hasHeader = true; }
|
||||
void setData (pdu_data * d) { data_ = d; flags_.hasData = true; }
|
||||
void setParent (std::shared_ptr<Pdu> pdu) {parent_ = pdu;}
|
||||
void setInherit(std::shared_ptr<Pdu> pdu) {inherit_ = pdu;}
|
||||
void setParent (Message<Pdu> pdu) { parent_ = pdu; }
|
||||
void setInherit(Message<Pdu> pdu) { inherit_ = pdu; }
|
||||
|
||||
// protocol payloads
|
||||
//template<header T> // C++20
|
||||
template<class T>
|
||||
void createHeader()
|
||||
{
|
||||
|
@ -172,8 +177,6 @@ public:
|
|||
header_->iStream(stream_);
|
||||
}
|
||||
}
|
||||
|
||||
//template<data T> // C++20
|
||||
template<class T>
|
||||
void createData()
|
||||
{
|
||||
|
@ -184,10 +187,9 @@ public:
|
|||
data_->iStream(stream_);
|
||||
}
|
||||
}
|
||||
//template<pdu T> // C++20
|
||||
template<class T>
|
||||
void createDataBlock() {
|
||||
auto block = new PDU::Block<T>();
|
||||
auto block = new Block<T>();
|
||||
if (stream_)
|
||||
block->iStream(stream_);
|
||||
block->setParent(shared_from_this());
|
||||
|
@ -195,24 +197,15 @@ public:
|
|||
}
|
||||
|
||||
protected:
|
||||
pdu_flags flags_;
|
||||
uint32_t vector_ = 0;
|
||||
size_t vector_size_;
|
||||
std::shared_ptr<Pdu> parent_;
|
||||
std::shared_ptr<Pdu> inherit_;
|
||||
pdu_header * header_ = nullptr;
|
||||
pdu_data * data_ = nullptr;
|
||||
Stream stream_;
|
||||
pdu_flags flags_;
|
||||
uint32_t vector_ = 0;
|
||||
size_t vector_size_;
|
||||
Message<Pdu> parent_;
|
||||
Message<Pdu> inherit_;
|
||||
pdu_header * header_ = nullptr;
|
||||
pdu_data * data_ = nullptr;
|
||||
Stream stream_;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @brief Callback that understands how to proccess a PDU type.
|
||||
* @tparam T PDU decendant subclass
|
||||
*/
|
||||
//template<pdu T> // C++20
|
||||
template <class T>
|
||||
using Handler = std::function<void(std::shared_ptr<T>)>;
|
||||
|
||||
|
||||
} // ACN::PDU
|
||||
|
|
|
@ -39,4 +39,14 @@ Controller::Controller(UUID::uuid cid)
|
|||
std::placeholders::_1));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Controller::DmpReceiver
|
||||
* @param rlp
|
||||
*/
|
||||
void Controller::DmpReceiver(PDU::Message<RLP::Pdu> rlp)
|
||||
{
|
||||
(void)rlp;
|
||||
}
|
||||
|
||||
|
||||
} // namespace ACN::DMP
|
||||
|
|
|
@ -36,7 +36,7 @@ class Controller
|
|||
public:
|
||||
Controller(UUID::uuid = UUID::uuid());
|
||||
|
||||
virtual void DmpReceiver(std::shared_ptr<RLP::Pdu>);
|
||||
virtual void DmpReceiver(PDU::Message<RLP::Pdu>);
|
||||
};
|
||||
|
||||
} // namespace ACN::DMP
|
||||
|
|
|
@ -44,7 +44,7 @@ Manager::Manager(UUID::uuid cid)
|
|||
* @brief Broker::rlpBrokerReceiver
|
||||
* @param root
|
||||
*/
|
||||
void Manager::rlpLlrpReceiver(std::shared_ptr<ACN::RLP::Pdu> root)
|
||||
void Manager::rlpLlrpReceiver(ACN::PDU::Message<ACN::RLP::Pdu> root)
|
||||
{
|
||||
(void)root;
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
*/
|
||||
#pragma once
|
||||
|
||||
#include "llrp.h"
|
||||
#include "rlp/appliance.h"
|
||||
|
||||
namespace RDMnet::LLRP {
|
||||
|
@ -39,7 +40,7 @@ class Manager
|
|||
public:
|
||||
Manager(UUID::uuid = UUID::uuid());
|
||||
|
||||
void rlpLlrpReceiver(std::shared_ptr<ACN::RLP::Pdu>);
|
||||
void rlpLlrpReceiver(ACN::PDU::Message<ACN::RLP::Pdu>);
|
||||
|
||||
virtual void sendProbeRequest() {};
|
||||
virtual void receiveProbeReply() {};
|
||||
|
|
|
@ -34,19 +34,11 @@ Target::Target()
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Target::~Target
|
||||
*/
|
||||
Target::~Target()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Target::receiveLLRP
|
||||
* @param frame
|
||||
*/
|
||||
void Target::receiveLLRP(std::shared_ptr<Pdu> frame)
|
||||
void Target::receiveLLRP(ACN::PDU::Message<Pdu> frame)
|
||||
{
|
||||
auto data = static_cast<llrp_data*>(frame->data());
|
||||
switch (frame->vector()) {
|
||||
|
@ -66,7 +58,7 @@ void Target::receiveLLRP(std::shared_ptr<Pdu> frame)
|
|||
* @brief Target::receiveProbeRequest
|
||||
* @param pdu
|
||||
*/
|
||||
void Target::receiveProbeRequest(std::shared_ptr<LLRP::ProbeRequest::Pdu>)
|
||||
void Target::receiveProbeRequest(ACN::PDU::Message<ProbeRequest::Pdu>)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -75,7 +67,7 @@ void Target::receiveProbeRequest(std::shared_ptr<LLRP::ProbeRequest::Pdu>)
|
|||
* @brief Target::receiveRdmCommand
|
||||
* @param pdu
|
||||
*/
|
||||
void Target::receiveRdmCommand(std::shared_ptr<RPT::COMMAND::Pdu> pdu)
|
||||
void Target::receiveRdmCommand(ACN::PDU::Message<RPT::COMMAND::Pdu> pdu)
|
||||
{
|
||||
auto data = static_cast<RPT::COMMAND::command_data*>(pdu->data());
|
||||
for ( auto& pid : LLRP::COMMAND::allowed_pids )
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
*/
|
||||
#pragma once
|
||||
|
||||
#include "rpt/rpt.h"
|
||||
#include "llrp.h"
|
||||
#include "rpt/rpt.h"
|
||||
|
||||
namespace RDMnet::LLRP {
|
||||
|
||||
|
@ -38,15 +38,14 @@ class Target
|
|||
{
|
||||
public:
|
||||
Target();
|
||||
virtual ~Target();
|
||||
|
||||
virtual void setup() = 0; //!< listens on LLRP_PORT
|
||||
virtual void LLRPsetup() = 0; //!< listens on LLRP_PORT
|
||||
|
||||
void receiveLLRP(std::shared_ptr<LLRP::Pdu> frame);
|
||||
void receiveLLRP(ACN::PDU::Message<LLRP::Pdu> frame);
|
||||
|
||||
virtual void receiveProbeRequest(std::shared_ptr<LLRP::ProbeRequest::Pdu> pdu);
|
||||
virtual void receiveProbeRequest(ACN::PDU::Message<LLRP::ProbeRequest::Pdu> pdu);
|
||||
virtual void sendProbeReply() {};
|
||||
virtual void receiveRdmCommand(std::shared_ptr<RPT::COMMAND::Pdu> pdu);
|
||||
virtual void receiveRdmCommand(ACN::PDU::Message<RPT::COMMAND::Pdu> pdu);
|
||||
virtual void receiveRDM(const RDM::MsgPtr) = 0;
|
||||
};
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ Broker::Broker(UUID::uuid cid, RDM::UID uid)
|
|||
* @brief Broker::rlpBrokerReceiver
|
||||
* @param root
|
||||
*/
|
||||
void Broker::rlpBrokerReceiver(std::shared_ptr<ACN::RLP::Pdu> root)
|
||||
void Broker::rlpBrokerReceiver(ACN::PDU::Message<ACN::RLP::Pdu> root)
|
||||
{
|
||||
root->createDataBlock<BrokerProtocol::Pdu>();
|
||||
auto block = static_cast<ACN::PDU::Block<BrokerProtocol::Pdu>*>(root->data());
|
||||
|
|
|
@ -40,7 +40,7 @@ class Broker
|
|||
public:
|
||||
Broker(UUID::uuid = UUID::uuid(), RDM::UID = RDM::UID());
|
||||
|
||||
void rlpBrokerReceiver(std::shared_ptr<ACN::RLP::Pdu>);
|
||||
void rlpBrokerReceiver(ACN::PDU::Message<ACN::RLP::Pdu>);
|
||||
|
||||
private:
|
||||
/// @brief 6.2.1.1 Broker Scope
|
||||
|
|
|
@ -44,7 +44,7 @@ Controller::Controller(UUID::uuid cid, RDM::UID uid)
|
|||
* @brief Controller::rlpRptReceiver
|
||||
* @param root
|
||||
*/
|
||||
void Controller::rlpRptReceiver(std::shared_ptr<ACN::RLP::Pdu> root)
|
||||
void Controller::rlpRptReceiver(ACN::PDU::Message<ACN::RLP::Pdu> root)
|
||||
{
|
||||
(void)root;
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ class Controller
|
|||
public:
|
||||
Controller(UUID::uuid = UUID::uuid(), RDM::UID = RDM::UID());
|
||||
|
||||
void rlpRptReceiver(std::shared_ptr<ACN::RLP::Pdu>);
|
||||
void rlpRptReceiver(ACN::PDU::Message<ACN::RLP::Pdu>);
|
||||
};
|
||||
|
||||
} // namespace RDMnet
|
||||
|
|
|
@ -44,7 +44,7 @@ Device::Device(UUID::uuid cid, RDM::UID uid, UUID::uuid rid)
|
|||
* @brief Device::rlpRptReceiver
|
||||
* @param root
|
||||
*/
|
||||
void Device::rlpRptReceiver(std::shared_ptr<ACN::RLP::Pdu> root)
|
||||
void Device::rlpRptReceiver(ACN::PDU::Message<ACN::RLP::Pdu> root)
|
||||
{
|
||||
(void)root;
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ public:
|
|||
RDM::UID uid = RDM::UID(),
|
||||
UUID::uuid rid = UUID::uuid());
|
||||
|
||||
void rlpRptReceiver(std::shared_ptr<ACN::RLP::Pdu>);
|
||||
void rlpRptReceiver(ACN::PDU::Message<ACN::RLP::Pdu>);
|
||||
|
||||
private:
|
||||
UUID::uuid rid_;
|
||||
|
|
|
@ -48,7 +48,7 @@ Implementation::Implementation(UUID::uuid cid, RDM::UID uid)
|
|||
* @brief Implementation::rlpLlrpReceiver
|
||||
* @param root
|
||||
*/
|
||||
void Implementation::rlpLlrpReceiver(std::shared_ptr<ACN::RLP::Pdu> root)
|
||||
void Implementation::rlpLlrpReceiver(ACN::PDU::Message<ACN::RLP::Pdu> root)
|
||||
{
|
||||
(void)root;
|
||||
}
|
||||
|
|
|
@ -38,8 +38,8 @@ public:
|
|||
Implementation(UUID::uuid = UUID::uuid(),
|
||||
RDM::UID = RDM::UID());
|
||||
|
||||
void rlpLlrpReceiver(std::shared_ptr<ACN::RLP::Pdu>);
|
||||
virtual void rlpEptReceiver(std::shared_ptr<ACN::RLP::Pdu>) {};
|
||||
void rlpLlrpReceiver(ACN::PDU::Message<ACN::RLP::Pdu>);
|
||||
virtual void rlpEptReceiver(ACN::PDU::Message<ACN::RLP::Pdu>) {};
|
||||
};
|
||||
|
||||
} // namespace RDMnet
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace ACN::RLP {
|
|||
* @param cid
|
||||
*/
|
||||
Appliance::Appliance(UUID::uuid cid)
|
||||
: Component(cid)
|
||||
: ACN::Component(cid)
|
||||
{
|
||||
fctn_ = "OpenLCP ACN Appliance";
|
||||
};
|
||||
|
@ -80,7 +80,7 @@ void Appliance::TcpPacketReceiver(PDU::Stream stream)
|
|||
*
|
||||
* Dispatch a recieved RLP PDU to the appropriate vector handlers.
|
||||
*/
|
||||
void Appliance::RlpReceiver(std::shared_ptr<RLP::Pdu> root)
|
||||
void Appliance::RlpReceiver(PDU::Message<RLP::Pdu> root)
|
||||
{
|
||||
/// To this point, the data segment of the RLP PDU will not have been read.
|
||||
/// The root PDU must have not failed, and still have bytes available to read.
|
||||
|
|
|
@ -39,15 +39,9 @@ namespace ACN::RLP {
|
|||
|
||||
/**
|
||||
* @brief The Appliance class
|
||||
* In DDL an appliance is a piece of equipment described by a root device and
|
||||
* all its children and descendents. In DMP systems an appliance corresponds
|
||||
* to a component that exposes one or more devices (since the rules require
|
||||
* that all devices are descendants of a single root device).
|
||||
*
|
||||
* See also root device.
|
||||
*/
|
||||
class Appliance
|
||||
: public Component
|
||||
: public ACN::Component
|
||||
{
|
||||
public:
|
||||
Appliance(UUID::uuid = UUID::uuid());
|
||||
|
@ -59,7 +53,7 @@ public:
|
|||
virtual void TcpPacketReceiver(PDU::Stream);
|
||||
|
||||
protected:
|
||||
void RlpReceiver(std::shared_ptr<RLP::Pdu>);
|
||||
void RlpReceiver(PDU::Message<RLP::Pdu>);
|
||||
void RlpRegisterVector(uint32_t, PDU::Handler<RLP::Pdu>);
|
||||
|
||||
private:
|
||||
|
|
|
@ -123,7 +123,7 @@ void Receiver::onDiscovered(const EXTENDED::DISCOVERY::Watcher cb) {
|
|||
*
|
||||
* Receive VECTOR_ROOT_E131_DATA vector'd packets.
|
||||
*/
|
||||
void Receiver::dataReceiver(std::shared_ptr<ACN::RLP::Pdu> root)
|
||||
void Receiver::dataReceiver(ACN::PDU::Message<ACN::RLP::Pdu> root)
|
||||
{
|
||||
root->createDataBlock<DATA::Pdu>();
|
||||
// a PDU::Block is guaranteed to have been instantiated, but if the input
|
||||
|
@ -153,7 +153,7 @@ void Receiver::dataReceiver(std::shared_ptr<ACN::RLP::Pdu> root)
|
|||
*
|
||||
* Receive VECTOR_ROOT_E131_EXTENDED vector'd packets.
|
||||
*/
|
||||
void Receiver::extendedReceiver(std::shared_ptr<ACN::RLP::Pdu> root)
|
||||
void Receiver::extendedReceiver(ACN::PDU::Message<ACN::RLP::Pdu> root)
|
||||
{
|
||||
root->createDataBlock<EXTENDED::Pdu>();
|
||||
// a PDU::Block is guaranteed to have been instantiated, but if the input
|
||||
|
@ -188,7 +188,7 @@ void Receiver::extendedReceiver(std::shared_ptr<ACN::RLP::Pdu> root)
|
|||
* DMP PDUs and passed to the universe.
|
||||
*
|
||||
*/
|
||||
void Receiver::dataFrameHandler(std::shared_ptr<DATA::Pdu> frame) {
|
||||
void Receiver::dataFrameHandler(ACN::PDU::Message<DATA::Pdu> frame) {
|
||||
auto source = std::shared_ptr<Provenance>(new Provenance(frame));
|
||||
|
||||
if (!universes_.count(source->universe()))
|
||||
|
@ -250,7 +250,7 @@ void Receiver::dataFrameHandler(std::shared_ptr<DATA::Pdu> frame) {
|
|||
* @brief Receiver::syncFrameHandler
|
||||
* @param frame
|
||||
*/
|
||||
void Receiver::syncFrameHandler(std::shared_ptr<EXTENDED::Pdu> frame)
|
||||
void Receiver::syncFrameHandler(ACN::PDU::Message<EXTENDED::Pdu> frame)
|
||||
{
|
||||
auto header = static_cast<EXTENDED::sync_header*>(frame->header());
|
||||
universes_.at(header->sync_address)->synchronize();
|
||||
|
@ -261,7 +261,7 @@ void Receiver::syncFrameHandler(std::shared_ptr<EXTENDED::Pdu> frame)
|
|||
* @brief Receiver::discoveryFrameHandler
|
||||
* @param frame
|
||||
*/
|
||||
void Receiver::discoveryFrameHandler(std::shared_ptr<EXTENDED::Pdu> frame) {
|
||||
void Receiver::discoveryFrameHandler(ACN::PDU::Message<EXTENDED::Pdu> frame) {
|
||||
auto block = static_cast<ACN::PDU::Block<EXTENDED::DISCOVERY::Pdu>*>(frame->data());
|
||||
for(auto const &pdu : *block->pdu)
|
||||
{
|
||||
|
@ -284,7 +284,7 @@ void Receiver::discoveryFrameHandler(std::shared_ptr<EXTENDED::Pdu> frame) {
|
|||
* @brief Receiver::discoveryListHanlder
|
||||
* @param pdu
|
||||
*/
|
||||
void Receiver::discoveryListHanlder(std::shared_ptr<EXTENDED::DISCOVERY::Pdu> pdu) {
|
||||
void Receiver::discoveryListHanlder(ACN::PDU::Message<EXTENDED::DISCOVERY::Pdu> pdu) {
|
||||
auto data = static_cast<EXTENDED::DISCOVERY::discovery_list_data*>(pdu->data());
|
||||
for (auto& f : data->found)
|
||||
for (const auto &cb : discoveryCallbacks_)
|
||||
|
|
|
@ -51,19 +51,19 @@ public:
|
|||
|
||||
protected:
|
||||
// 5 - E1.31 use of the ACN Root Layer Protocol
|
||||
void dataReceiver(std::shared_ptr<ACN::RLP::Pdu>);
|
||||
void extendedReceiver(std::shared_ptr<ACN::RLP::Pdu>);
|
||||
void dataReceiver(ACN::PDU::Message<ACN::RLP::Pdu>);
|
||||
void extendedReceiver(ACN::PDU::Message<ACN::RLP::Pdu>);
|
||||
|
||||
// 6.2 E1.31 Data Packet Framing Layer
|
||||
void dataFrameHandler(std::shared_ptr<DATA::Pdu>);
|
||||
void dataFrameHandler(ACN::PDU::Message<DATA::Pdu>);
|
||||
|
||||
// 6.3 E1.31 Synchronization Packet Framing Layer
|
||||
void syncFrameHandler(std::shared_ptr<EXTENDED::Pdu>);
|
||||
void syncFrameHandler(ACN::PDU::Message<EXTENDED::Pdu>);
|
||||
|
||||
// 6.4 E1.31 Universe Discovery Packet Framing Layer
|
||||
void discoveryFrameHandler(std::shared_ptr<EXTENDED::Pdu>);
|
||||
void discoveryFrameHandler(ACN::PDU::Message<EXTENDED::Pdu>);
|
||||
// 8 Universe Discovery Layer
|
||||
void discoveryListHanlder(std::shared_ptr<EXTENDED::DISCOVERY::Pdu>);
|
||||
void discoveryListHanlder(ACN::PDU::Message<EXTENDED::DISCOVERY::Pdu>);
|
||||
|
||||
private:
|
||||
std::unordered_map<uint16_t, MergeProxyUniverse*> universes_;
|
||||
|
|
|
@ -50,7 +50,7 @@ Leader::Leader(UUID::uuid cid)
|
|||
* @brief Leader::SdtReceiver
|
||||
* @param rlp
|
||||
*/
|
||||
void Leader::SdtReceiver(std::shared_ptr<RLP::Pdu> root)
|
||||
void Leader::SdtReceiver(PDU::Message<RLP::Pdu> root)
|
||||
{
|
||||
root->createDataBlock<SDT::Pdu>();
|
||||
auto block = static_cast<PDU::Block<SDT::Pdu>*>(root->data());
|
||||
|
|
|
@ -38,7 +38,7 @@ public:
|
|||
Leader(UUID::uuid = UUID::uuid());
|
||||
|
||||
// RLP->SDT frames
|
||||
virtual void SdtReceiver(std::shared_ptr<RLP::Pdu>);
|
||||
virtual void SdtReceiver(PDU::Message<RLP::Pdu>);
|
||||
// SDT 4.4 SDT Base Layer Messages
|
||||
// Join, Get Sessions, and Sessions are ad-hoc messages, that is, they are
|
||||
// not sent within channels. These messages identify their intended recipient
|
||||
|
|
|
@ -40,4 +40,14 @@ Member::Member(UUID::uuid cid)
|
|||
std::placeholders::_1));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Member::SdtReceiver
|
||||
* @param rlp
|
||||
*/
|
||||
void Member::SdtReceiver(PDU::Message<RLP::Pdu> rlp)
|
||||
{
|
||||
(void)rlp;
|
||||
}
|
||||
|
||||
} // namespace ACN::SDT
|
||||
|
|
|
@ -33,7 +33,7 @@ class Member
|
|||
public:
|
||||
Member(UUID::uuid = UUID::uuid());
|
||||
|
||||
virtual void SdtReceiver(std::shared_ptr<RLP::Pdu>);
|
||||
virtual void SdtReceiver(PDU::Message<RLP::Pdu>);
|
||||
};
|
||||
|
||||
} // namespace ACN::SDT
|
||||
|
|
Loading…
Reference in New Issue