1
0
Fork 0

implement a separate sender for each transport protocol

This commit is contained in:
Kevin Matz 2022-11-20 15:09:03 -05:00
parent 2d93bbe709
commit 10031d3a05
4 changed files with 45 additions and 9 deletions

View File

@ -164,11 +164,11 @@ void QSacnNode::udpReceive()
/**
* @brief QSacnNode::rlpSend
* @brief QSacnNode::sendUDP
* @param stream
* @param ip
*/
void QSacnNode::rlpSend(const ACN::PDU::Stream stream,
void QSacnNode::sendUDP(const ACN::PDU::Stream stream,
const ACN::SDT::UDP::ipAddress& ip)
{
QHostAddress addr;
@ -188,6 +188,20 @@ void QSacnNode::rlpSend(const ACN::PDU::Stream stream,
}
/**
* @brief QSacnNode::sendTCP
* @param stream
* @param ip
*/
void QSacnNode::sendTCP(const ACN::PDU::Stream stream,
const ACN::SDT::UDP::ipAddress& ip)
{
Q_UNUSED(stream)
Q_UNUSED(ip)
qDebug() << "sACN uses UDP only. Stop trying to send TCP!";
}
/**
* @brief QSacnNode::universe
* @param u

View File

@ -24,8 +24,9 @@ public:
QUuid = QUuid::createUuid(), QString fctn = "OpenLCP QSacnNode");
~QSacnNode();
// rlp component
void rlpSend(const ACN::PDU::Stream, const ACN::SDT::UDP::ipAddress&) override;
// sACN::RLP::Component
void sendUDP(const ACN::PDU::Stream, const ACN::SDT::UDP::ipAddress&) override;
void sendTCP(const ACN::PDU::Stream, const ACN::SDT::UDP::ipAddress&) override;
QSacnUniverse* universe(const uint16_t u);
QSacnUniverse* source(const uint16_t u);

View File

@ -167,19 +167,21 @@ void Component::rlpSend(ACN::RLP::message_transport& transport,
// write message
*stream << transport;
rlpSend(stream, ip);
sendUDP(stream, ip);
}
/**
* @brief Component::rlpSend
* @brief Component::sendUDP
* @param stream
* @param ip
*
* \attention Override this method in the derived platform class that can
* write to the network.
* write the datagram to the network.
*
* The base class behavior is to do nothing.
*/
void Component::rlpSend(const PDU::Stream stream,
void Component::sendUDP(const PDU::Stream stream,
const SDT::UDP::ipAddress& ip)
{
(void)stream;
@ -187,4 +189,22 @@ void Component::rlpSend(const PDU::Stream stream,
}
/**
* @brief Component::sendTCP
* @param stream
* @param ip
*
* \attention Override this method in the derived platform class that can
* write the packet to the network.
*
* The base class behavior is to do nothing.
*/
void Component::sendTCP(const PDU::Stream stream,
const SDT::UDP::ipAddress& ip)
{
(void)stream;
(void)ip;
}
}; // ACN::RLP

View File

@ -66,7 +66,8 @@ protected:
const PDU::Message<PDU::pdu_data> data,
const SDT::UDP::ipAddress&);
virtual void rlpSend(const PDU::Stream, const SDT::UDP::ipAddress&);
virtual void sendUDP(const PDU::Stream, const SDT::UDP::ipAddress&);
virtual void sendTCP(const PDU::Stream, const SDT::UDP::ipAddress&);
private:
std::map<uint32_t, std::vector<PDU::Handler<RLP::Pdu>>> rlp_vectors_;