From e528abe5e13db6f36453b24cf0573e4c45da6faa Mon Sep 17 00:00:00 2001 From: Kevin Matz Date: Sat, 19 Nov 2022 15:43:02 -0500 Subject: [PATCH] make the ACN EPI 19 Fixed name only asignable at initilization --- platform/qt/qsacnnode.cpp | 7 +++---- platform/qt/qsacnnode.h | 3 ++- protocol/acn/component.h | 15 +++++++-------- protocol/dmp/appliance.cpp | 7 +++---- protocol/dmp/appliance.h | 2 +- protocol/dmp/controller.cpp | 7 +++---- protocol/dmp/controller.h | 2 +- protocol/llrp/manager.cpp | 7 +++---- protocol/llrp/manager.h | 2 +- protocol/rdmnet/broker.cpp | 7 +++---- protocol/rdmnet/broker.h | 3 ++- protocol/rdmnet/controller.cpp | 7 +++---- protocol/rdmnet/controller.h | 3 ++- protocol/rdmnet/device.cpp | 7 +++---- protocol/rdmnet/device.h | 5 ++--- protocol/rdmnet/implementation.cpp | 7 +++---- protocol/rdmnet/implementation.h | 2 +- protocol/rlp/component.cpp | 6 +++--- protocol/rlp/component.h | 2 +- protocol/sacn/node.cpp | 6 +++--- protocol/sacn/node.h | 2 +- protocol/sacn/receiver.cpp | 7 +++---- protocol/sacn/receiver.h | 2 +- protocol/sacn/source.cpp | 6 +++--- protocol/sacn/source.h | 2 +- protocol/sdt/leader.cpp | 7 +++---- protocol/sdt/leader.h | 2 +- protocol/sdt/member.cpp | 7 +++---- protocol/sdt/member.h | 2 +- 29 files changed, 67 insertions(+), 77 deletions(-) diff --git a/platform/qt/qsacnnode.cpp b/platform/qt/qsacnnode.cpp index 452494f..3b36a58 100644 --- a/platform/qt/qsacnnode.cpp +++ b/platform/qt/qsacnnode.cpp @@ -10,14 +10,13 @@ * @brief QSacnNode::QSacnNode * @param parent * @param cid + * @param fctn */ -QSacnNode::QSacnNode(QObject *parent, QUuid cid) - : Component(UUID::uuid(cid.toString().toStdString())) +QSacnNode::QSacnNode(QObject *parent, QUuid cid, QString fctn) + : Component(UUID::uuid(cid.toString().toStdString()), fctn.toStdString()) , QUdpSocket(parent) , is_discovering_(false) { - fctn_ = "OpenLCP QSacnNode"; - bind(QHostAddress::AnyIPv4, sACN::ACN_SDT_MULTICAST_PORT); connect(this, &QUdpSocket::readyRead, diff --git a/platform/qt/qsacnnode.h b/platform/qt/qsacnnode.h index 60e0844..86b4fa0 100644 --- a/platform/qt/qsacnnode.h +++ b/platform/qt/qsacnnode.h @@ -20,7 +20,8 @@ class QT_EXPORT QSacnNode Q_OBJECT public: - explicit QSacnNode(QObject *parent = nullptr, QUuid = QUuid::createUuid()); + explicit QSacnNode(QObject *parent = nullptr, + QUuid = QUuid::createUuid(), QString fctn = "OpenLCP QSacnNode"); ~QSacnNode(); // rlp component diff --git a/protocol/acn/component.h b/protocol/acn/component.h index 73189b7..8494b33 100644 --- a/protocol/acn/component.h +++ b/protocol/acn/component.h @@ -49,12 +49,13 @@ class Component { public: /** * @brief Component - * @param cid the Component Identifier + * @param cid + * @param fctn */ - Component(UUID::uuid cid = UUID::uuid()) - : fctn_(std::string("OpenLCP ACN Component")) + Component(UUID::uuid cid = UUID::uuid(), std::string fctn = "OpenLCP ACN Component") + : cid_(cid) + , fctn_(fctn) , uacn_(std::string()) - , cid_(cid) {}; /** @@ -95,12 +96,10 @@ public: */ void assignUserName(const std::string s) { uacn_ = s; } -protected: - std::string fctn_; //!< Fixed Component Type Name (FCTN) - std::string uacn_; //!< User Assigned Component Name (UACN) - private: const UUID::uuid cid_; + const std::string fctn_; //!< Fixed Component Type Name (FCTN) + std::string uacn_; //!< User Assigned Component Name (UACN) }; }; // ACN diff --git a/protocol/dmp/appliance.cpp b/protocol/dmp/appliance.cpp index 2dda3e8..a724c86 100644 --- a/protocol/dmp/appliance.cpp +++ b/protocol/dmp/appliance.cpp @@ -30,13 +30,12 @@ namespace ACN::DMP { /** * @brief Appliance::Appliance * @param cid + * @param fctn */ -Appliance::Appliance(UUID::uuid cid) - : SDT::Member(cid) +Appliance::Appliance(UUID::uuid cid, std::string fctn) + : SDT::Member(cid, fctn) , DMP::Device() { - fctn_ = "OpenLCP DMP Component"; - RlpRegisterVector(DMP_PROTOCOL_ID, std::bind(&Appliance::RlpReceiver, this, std::placeholders::_1)); } diff --git a/protocol/dmp/appliance.h b/protocol/dmp/appliance.h index 70ba181..e255d32 100644 --- a/protocol/dmp/appliance.h +++ b/protocol/dmp/appliance.h @@ -39,7 +39,7 @@ class Appliance , public DMP::Device { public: - Appliance(UUID::uuid = UUID::uuid()); + Appliance(UUID::uuid = UUID::uuid(), std::string fctn = "OpenLCP DMP Component"); virtual void RlpReceiver(PDU::Message); }; diff --git a/protocol/dmp/controller.cpp b/protocol/dmp/controller.cpp index 0f7c171..dc853b3 100644 --- a/protocol/dmp/controller.cpp +++ b/protocol/dmp/controller.cpp @@ -30,12 +30,11 @@ namespace ACN::DMP { /** * @brief Controller::Controller * @param cid + * @param fctn */ -Controller::Controller(UUID::uuid cid) - : SDT::Leader(cid) +Controller::Controller(UUID::uuid cid, std::string fctn) + : SDT::Leader(cid, fctn) { - fctn_ = "OpenLCP DMP Controller"; - RlpRegisterVector(DMP_PROTOCOL_ID, std::bind(&Controller::RlpReceiver, this, std::placeholders::_1)); } diff --git a/protocol/dmp/controller.h b/protocol/dmp/controller.h index 52c2f20..4b8b337 100644 --- a/protocol/dmp/controller.h +++ b/protocol/dmp/controller.h @@ -34,7 +34,7 @@ class Controller : public SDT::Leader { public: - Controller(UUID::uuid = UUID::uuid()); + Controller(UUID::uuid = UUID::uuid(), std::string fctn = "OpenLCP DMP Controller"); virtual void RlpReceiver(PDU::Message); }; diff --git a/protocol/llrp/manager.cpp b/protocol/llrp/manager.cpp index 80fc59f..e21deb2 100644 --- a/protocol/llrp/manager.cpp +++ b/protocol/llrp/manager.cpp @@ -30,14 +30,13 @@ namespace RDMnet::LLRP { /** * @brief Manager::Manager * @param cid + * @param fctn */ -Manager::Manager(UUID::uuid cid) - : ACN::RLP::Component(cid) +Manager::Manager(UUID::uuid cid, std::string fctn) + : ACN::RLP::Component(cid, fctn) , transactionNumber(0) , probeInactiveOnly(true) { - fctn_ = "OpenLCP LLRP Manager"; - RlpRegisterVector(VECTOR_ROOT_LLRP, std::bind(&Manager::rlpLlrpReceiver, this, std::placeholders::_1)); } diff --git a/protocol/llrp/manager.h b/protocol/llrp/manager.h index 677a687..2880c5f 100644 --- a/protocol/llrp/manager.h +++ b/protocol/llrp/manager.h @@ -38,7 +38,7 @@ class Manager : public ACN::RLP::Component { public: - Manager(UUID::uuid = UUID::uuid()); + Manager(UUID::uuid = UUID::uuid(), std::string fctn = "OpenLCP LLRP Manager"); void rlpLlrpReceiver(ACN::PDU::Message); diff --git a/protocol/rdmnet/broker.cpp b/protocol/rdmnet/broker.cpp index 40f56f6..ab9c409 100644 --- a/protocol/rdmnet/broker.cpp +++ b/protocol/rdmnet/broker.cpp @@ -29,15 +29,14 @@ namespace RDMnet { /** * @brief Broker::Broker * @param cid + * @param fctn * @param uid */ -Broker::Broker(UUID::uuid cid, RDM::UID uid) - : Implementation(cid, uid) +Broker::Broker(UUID::uuid cid, std::string fctn, RDM::UID uid) + : Implementation(cid, fctn, uid) , EPT::Broker() , RPT::Broker() { - fctn_ = "OpenLCP RDMnet Broker"; - RlpRegisterVector(VECTOR_ROOT_BROKER, std::bind(&Broker::rlpBrokerReceiver, this, std::placeholders::_1)); } diff --git a/protocol/rdmnet/broker.h b/protocol/rdmnet/broker.h index 804fdb3..ccf99f8 100644 --- a/protocol/rdmnet/broker.h +++ b/protocol/rdmnet/broker.h @@ -38,7 +38,8 @@ class Broker , public RPT::Broker { public: - Broker(UUID::uuid = UUID::uuid(), RDM::UID = RDM::UID()); + Broker(UUID::uuid = UUID::uuid(), std::string ftcn = "OpenLCP RDMnet Broker", + RDM::UID = RDM::UID()); void rlpBrokerReceiver(ACN::PDU::Message); diff --git a/protocol/rdmnet/controller.cpp b/protocol/rdmnet/controller.cpp index 7f5b887..02c11c3 100644 --- a/protocol/rdmnet/controller.cpp +++ b/protocol/rdmnet/controller.cpp @@ -28,15 +28,14 @@ namespace RDMnet { /** * @brief Controller::Controller * @param cid + * @param fctn * @param uid */ -Controller::Controller(UUID::uuid cid, RDM::UID uid) - : Implementation(cid, uid) +Controller::Controller(UUID::uuid cid, std::string fctn, RDM::UID uid) + : Implementation(cid, fctn, uid) , RDM::Controller() , RPT::Controller() { - fctn_ = "OpenLCP RDMnet Controller"; - RlpRegisterVector(VECTOR_ROOT_RPT, std::bind(&Controller::rlpRptReceiver, this, std::placeholders::_1)); } diff --git a/protocol/rdmnet/controller.h b/protocol/rdmnet/controller.h index 63f66dc..da3f47b 100644 --- a/protocol/rdmnet/controller.h +++ b/protocol/rdmnet/controller.h @@ -38,7 +38,8 @@ class Controller , public RPT::Controller { public: - Controller(UUID::uuid = UUID::uuid(), RDM::UID = RDM::UID()); + Controller(UUID::uuid = UUID::uuid(), std::string fctn = "OpenLCP RDMnet Controller", + RDM::UID = RDM::UID()); void rlpRptReceiver(ACN::PDU::Message); }; diff --git a/protocol/rdmnet/device.cpp b/protocol/rdmnet/device.cpp index 5a18329..1ad2f9c 100644 --- a/protocol/rdmnet/device.cpp +++ b/protocol/rdmnet/device.cpp @@ -28,16 +28,15 @@ namespace RDMnet { /** * @brief Device::Device * @param cid + * @param fctn * @param uid * @param rid */ -Device::Device(UUID::uuid cid, RDM::UID uid, UUID::uuid rid) - : Implementation(cid, uid) +Device::Device(UUID::uuid cid, std::string fctn, RDM::UID uid, UUID::uuid rid) + : Implementation(cid, fctn, uid) , RPT::Device() , rid_(rid) { - fctn_ = "OpenLCP RDMnet Device"; - RlpRegisterVector(VECTOR_ROOT_RPT, std::bind(&Device::rlpRptReceiver, this, std::placeholders::_1)); } diff --git a/protocol/rdmnet/device.h b/protocol/rdmnet/device.h index 987ac7c..26dbaf6 100644 --- a/protocol/rdmnet/device.h +++ b/protocol/rdmnet/device.h @@ -36,9 +36,8 @@ class Device , public RPT::Device { public: - Device(UUID::uuid cid = UUID::uuid(), - RDM::UID uid = RDM::UID(), - UUID::uuid rid = UUID::uuid()); + Device(UUID::uuid cid = UUID::uuid(), std::string fctn = "OpenLCP RDMnet Device", + RDM::UID uid = RDM::UID(), UUID::uuid rid = UUID::uuid()); void rlpRptReceiver(ACN::PDU::Message); diff --git a/protocol/rdmnet/implementation.cpp b/protocol/rdmnet/implementation.cpp index b2f1104..f85e29b 100644 --- a/protocol/rdmnet/implementation.cpp +++ b/protocol/rdmnet/implementation.cpp @@ -29,15 +29,14 @@ namespace RDMnet { /** * @brief Implementation::Implementation * @param cid + * @param fctn * @param uid */ -Implementation::Implementation(UUID::uuid cid, RDM::UID uid) - : ACN::RLP::Component(cid) +Implementation::Implementation(UUID::uuid cid, std::string fctn, RDM::UID uid) + : ACN::RLP::Component(cid, fctn) , RDM::Responder(uid) , LLRP::Target() { - fctn_ = "OpenLCP RDMnet Implementation"; - RlpRegisterVector(VECTOR_ROOT_LLRP, std::bind(&Implementation::rlpLlrpReceiver, this, std::placeholders::_1)); RlpRegisterVector(VECTOR_ROOT_EPT, std::bind(&Implementation::rlpEptReceiver, diff --git a/protocol/rdmnet/implementation.h b/protocol/rdmnet/implementation.h index 99f84d2..8b12531 100644 --- a/protocol/rdmnet/implementation.h +++ b/protocol/rdmnet/implementation.h @@ -40,7 +40,7 @@ class Implementation , public EPT::Client { public: - Implementation(UUID::uuid = UUID::uuid(), + Implementation(UUID::uuid = UUID::uuid(), std::string fctn = "OpenLCP RDMnet Implementation", RDM::UID = RDM::UID()); protected: diff --git a/protocol/rlp/component.cpp b/protocol/rlp/component.cpp index b0092b4..ac2cf37 100644 --- a/protocol/rlp/component.cpp +++ b/protocol/rlp/component.cpp @@ -31,11 +31,11 @@ namespace ACN::RLP { /** * @brief Component::Component * @param cid + * @param fctn */ -Component::Component(UUID::uuid cid) - : ACN::Component(cid) +Component::Component(UUID::uuid cid, std::string fctn) + : ACN::Component(cid, fctn) { - fctn_ = "OpenLCP RLP Component"; }; diff --git a/protocol/rlp/component.h b/protocol/rlp/component.h index a1c6657..3d21c5a 100644 --- a/protocol/rlp/component.h +++ b/protocol/rlp/component.h @@ -46,7 +46,7 @@ class Component : public ACN::Component { public: - Component(UUID::uuid = UUID::uuid()); + Component(UUID::uuid = UUID::uuid(), std::string fctn = "OpenLCP RLP Component"); // EPI 17 - ACN RLP on UDP virtual void UdpPayloadReceiver(PDU::Stream); diff --git a/protocol/sacn/node.cpp b/protocol/sacn/node.cpp index a1452dd..8b2bd65 100644 --- a/protocol/sacn/node.cpp +++ b/protocol/sacn/node.cpp @@ -5,11 +5,11 @@ namespace sACN { /** * @brief Node::Node * @param cid + * @param fctn */ -Node::Node(UUID::uuid cid) - : Component(cid) +Node::Node(UUID::uuid cid, std::string fctn) + : Component(cid, fctn) { - fctn_ = "OpenLCP sACN Node"; } } // SACN diff --git a/protocol/sacn/node.h b/protocol/sacn/node.h index a25c8a7..f6a46ad 100644 --- a/protocol/sacn/node.h +++ b/protocol/sacn/node.h @@ -36,7 +36,7 @@ class Node , public Source { public: - Node(UUID::uuid = UUID::uuid()); + Node(UUID::uuid = UUID::uuid(), std::string fctn = "OpenLCP sACN Node"); }; } // SACN diff --git a/protocol/sacn/receiver.cpp b/protocol/sacn/receiver.cpp index ca72097..98c00b4 100644 --- a/protocol/sacn/receiver.cpp +++ b/protocol/sacn/receiver.cpp @@ -30,15 +30,14 @@ namespace sACN { /** * @brief Receiver::Receiver * @param cid + * @param fctn * * Constructor. Register RLP vector callbacks. */ -Receiver::Receiver(UUID::uuid cid) - : Component(cid) +Receiver::Receiver(UUID::uuid cid, std::string fctn) + : Component(cid, fctn) , HoldLastLook(true) { - fctn_ = "OpenLCP sACN Receiver"; - RlpRegisterVector(VECTOR_ROOT_E131_DATA, std::bind(&Receiver::dataReceiver, this, std::placeholders::_1)); RlpRegisterVector(VECTOR_ROOT_E131_EXTENDED, std::bind(&Receiver::extendedReceiver, diff --git a/protocol/sacn/receiver.h b/protocol/sacn/receiver.h index afc3ead..825c002 100644 --- a/protocol/sacn/receiver.h +++ b/protocol/sacn/receiver.h @@ -65,7 +65,7 @@ class Receiver : public virtual ACN::RLP::Component { public: - Receiver(UUID::uuid = UUID::uuid()); + Receiver(UUID::uuid = UUID::uuid(), std::string fctn = "OpenLCP sACN Receiver"); ~Receiver(); void setHoldLastLook(const bool); diff --git a/protocol/sacn/source.cpp b/protocol/sacn/source.cpp index 9fb333e..3c821e4 100644 --- a/protocol/sacn/source.cpp +++ b/protocol/sacn/source.cpp @@ -30,14 +30,14 @@ namespace sACN { /** * @brief Source::Source * @param cid + * @param fctn */ -Source::Source(UUID::uuid cid) - : Component(cid) +Source::Source(UUID::uuid cid, std::string fctn) + : Component(cid, fctn) , discovery_future_(discovery_exitSignal_.get_future()) , discovery_worker_(&Source::discovery_loop_, this) , sendNullDiscovery(false) { - fctn_ = "OpenLCP sACN Source"; } diff --git a/protocol/sacn/source.h b/protocol/sacn/source.h index f4148ca..7d075ad 100644 --- a/protocol/sacn/source.h +++ b/protocol/sacn/source.h @@ -47,7 +47,7 @@ class Source : public virtual ACN::RLP::Component { public: - Source(UUID::uuid = UUID::uuid()); + Source(UUID::uuid = UUID::uuid(), std::string fctn = "OpenLCP sACN Source"); ~Source(); virtual void create(const uint16_t); diff --git a/protocol/sdt/leader.cpp b/protocol/sdt/leader.cpp index 3c2da65..a60281b 100644 --- a/protocol/sdt/leader.cpp +++ b/protocol/sdt/leader.cpp @@ -29,12 +29,11 @@ namespace ACN::SDT { /** * @brief Leader::Leader * @param cid + * @param fctn */ -Leader::Leader(UUID::uuid cid) - : ACN::RLP::Component(cid) +Leader::Leader(UUID::uuid cid, std::string fctn) + : ACN::RLP::Component(cid, fctn) { - fctn_ = "OpenLCP SDT Leader"; - /** * 1.3.1. Recursive use of PDU Format in Other Protocols * ... within ACN as currently specified, there is just one higher layer diff --git a/protocol/sdt/leader.h b/protocol/sdt/leader.h index 3df2574..5688542 100644 --- a/protocol/sdt/leader.h +++ b/protocol/sdt/leader.h @@ -38,7 +38,7 @@ class Leader : public ACN::RLP::Component { public: - Leader(UUID::uuid = UUID::uuid()); + Leader(UUID::uuid = UUID::uuid(), std::string fctn = "OpenLCP SDT Leader"); // RLP->SDT frames virtual void SdtReceiver(PDU::Message); diff --git a/protocol/sdt/member.cpp b/protocol/sdt/member.cpp index 60f5b05..d87625f 100644 --- a/protocol/sdt/member.cpp +++ b/protocol/sdt/member.cpp @@ -30,12 +30,11 @@ namespace ACN::SDT { /** * @brief Member::Member * @param cid + * @param fctn */ -Member::Member(UUID::uuid cid) - : ACN::RLP::Component(cid) +Member::Member(UUID::uuid cid, std::string fctn) + : ACN::RLP::Component(cid, fctn) { - fctn_ = "OpenLCP SDT Member"; - RlpRegisterVector(SDT_PROTOCOL_ID, std::bind(&Member::SdtReceiver, this, std::placeholders::_1)); } diff --git a/protocol/sdt/member.h b/protocol/sdt/member.h index dec7dfc..72ee526 100644 --- a/protocol/sdt/member.h +++ b/protocol/sdt/member.h @@ -34,7 +34,7 @@ class Member : public ACN::RLP::Component { public: - Member(UUID::uuid = UUID::uuid()); + Member(UUID::uuid = UUID::uuid(), std::string fctn = "OpenLCP SDT Member"); virtual void SdtReceiver(PDU::Message); };