-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MessageTransport Network Send and Recv Events handled
NetworkMessage class has been added Temporary code for publishloop has been added unit test for MessageTransport has been added NetworkMessageProcessor class has been added
- Loading branch information
Showing
15 changed files
with
1,036 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
Copyright 2022 Kai Huebl (kai@huebl-sgh.de) | ||
Lizenziert gemäß Apache Licence Version 2.0 (die „Lizenz“); Nutzung dieser | ||
Datei nur in Übereinstimmung mit der Lizenz erlaubt. | ||
Eine Kopie der Lizenz erhalten Sie auf http://www.apache.org/licenses/LICENSE-2.0. | ||
Sofern nicht gemäß geltendem Recht vorgeschrieben oder schriftlich vereinbart, | ||
erfolgt die Bereitstellung der im Rahmen der Lizenz verbreiteten Software OHNE | ||
GEWÄHR ODER VORBEHALTE – ganz gleich, ob ausdrücklich oder stillschweigend. | ||
Informationen über die jeweiligen Bedingungen für Genehmigungen und Einschränkungen | ||
im Rahmen der Lizenz finden Sie in der Lizenz. | ||
Autor: Kai Huebl (kai@huebl-sgh.de), Aleksey Timin (atimin@gmail.com) | ||
*/ | ||
|
||
#include "OpcUaStackPubSub/DataSetReader/DataSetReaderBase.h" | ||
|
||
namespace OpcUaStackPubSub | ||
{ | ||
|
||
DataSetReaderBase::DataSetReaderBase(void) | ||
{ | ||
} | ||
|
||
DataSetReaderBase::~DataSetReaderBase(void) | ||
{ | ||
} | ||
|
||
void | ||
DataSetReaderBase::dataSetReaderId(uint32_t dataSetReaderId) | ||
{ | ||
dataSetReaderId_ = dataSetReaderId; | ||
} | ||
|
||
uint32_t | ||
DataSetReaderBase::dataSetReaderId(void) | ||
{ | ||
return dataSetReaderId_; | ||
} | ||
|
||
bool | ||
DataSetReaderBase::encodeDataSet(boost::asio::streambuf& dataSet, uint16_t& size) | ||
{ | ||
// FIXME: todo | ||
return true; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
Copyright 2022 Kai Huebl (kai@huebl-sgh.de) | ||
Lizenziert gemäß Apache Licence Version 2.0 (die „Lizenz“); Nutzung dieser | ||
Datei nur in Übereinstimmung mit der Lizenz erlaubt. | ||
Eine Kopie der Lizenz erhalten Sie auf http://www.apache.org/licenses/LICENSE-2.0. | ||
Sofern nicht gemäß geltendem Recht vorgeschrieben oder schriftlich vereinbart, | ||
erfolgt die Bereitstellung der im Rahmen der Lizenz verbreiteten Software OHNE | ||
GEWÄHR ODER VORBEHALTE – ganz gleich, ob ausdrücklich oder stillschweigend. | ||
Informationen über die jeweiligen Bedingungen für Genehmigungen und Einschränkungen | ||
im Rahmen der Lizenz finden Sie in der Lizenz. | ||
Autor: Kai Huebl (kai@huebl-sgh.de), Aleksey Timin (atimin@gmail.com) | ||
*/ | ||
|
||
#ifndef __OpcUaStackPubSub_DataSetReaderBase_h__ | ||
#define __OpcUaStackPubSub_DataSetReaderBase_h__ | ||
|
||
#include <boost/asio.hpp> | ||
|
||
#include <map> | ||
|
||
#include "OpcUaStackCore/Base/os.h" | ||
|
||
namespace OpcUaStackPubSub | ||
{ | ||
|
||
class DLLEXPORT DataSetReaderBase | ||
{ | ||
public: | ||
typedef boost::shared_ptr<DataSetReaderBase> SPtr; | ||
typedef std::map<uint16_t, SPtr> Map; | ||
|
||
DataSetReaderBase(void); | ||
virtual ~DataSetReaderBase(void); | ||
|
||
void dataSetReaderId(uint32_t dataSetReaderId); | ||
uint32_t dataSetReaderId(void); | ||
|
||
bool encodeDataSet(boost::asio::streambuf& dataSet, uint16_t& size); | ||
|
||
public: | ||
uint32_t dataSetReaderId_ = 0; // unique data set writer id | ||
}; | ||
|
||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
#include "OpcUaStackPubSub/NetworkMessage/GroupHeader.h" | ||
|
||
namespace OpcUaStackPubSub | ||
{ | ||
|
||
OpcUaByte& GroupHeader::groupFlags() | ||
{ | ||
return groupFlags_; | ||
} | ||
void GroupHeader::groupFlags(OpcUaByte& groupFlags) | ||
{ | ||
groupFlags_ = groupFlags; | ||
} | ||
|
||
OpcUaUInt16& GroupHeader::writerGroupId() | ||
{ | ||
return writerGroupId_; | ||
} | ||
void GroupHeader::writerGroupId(OpcUaUInt16& writerGroupId) | ||
{ | ||
writerGroupId_ = writerGroupId; | ||
} | ||
|
||
OpcUaByte& GroupHeader::groupVersion() | ||
{ | ||
return groupVersion_; | ||
} | ||
|
||
void GroupHeader::groupVersion(OpcUaByte& groupVersion) | ||
{ | ||
groupVersion_ = groupVersion; | ||
} | ||
|
||
OpcUaUInt16& GroupHeader::networkMessageNumber() | ||
{ | ||
return networkMessageNumber_; | ||
} | ||
void GroupHeader::networkMessageNumber(OpcUaUInt16& networkMessageNumber) | ||
{ | ||
networkMessageNumber_ = networkMessageNumber; | ||
} | ||
OpcUaUInt16& GroupHeader::sequenceNumber() | ||
{ | ||
return sequenceNumber_; | ||
} | ||
void GroupHeader::sequenceNumber(OpcUaUInt16& sequenceNumber) | ||
{ | ||
sequenceNumber_ = sequenceNumber; | ||
} | ||
// ------------------------------------------------------------------------ | ||
// ------------------------------------------------------------------------ | ||
// | ||
// GroupHeader Encoding and Decoding | ||
// | ||
// ------------------------------------------------------------------------ | ||
// ------------------------------------------------------------------------ | ||
bool | ||
GroupHeader::opcUaBinaryEncode(std::ostream& os) const | ||
{ | ||
bool rc = true; | ||
rc &= OpcUaNumber::opcUaBinaryEncode(os, groupFlags_); | ||
rc &= OpcUaNumber::opcUaBinaryEncode(os, writerGroupId_); | ||
rc &= OpcUaNumber::opcUaBinaryEncode(os, groupVersion_); | ||
rc &= OpcUaNumber::opcUaBinaryEncode(os, networkMessageNumber_); | ||
rc &= OpcUaNumber::opcUaBinaryEncode(os, sequenceNumber_); | ||
|
||
return rc; | ||
} | ||
bool | ||
GroupHeader::opcUaBinaryDecode(std::istream& is) | ||
{ | ||
bool rc = true; | ||
rc &= OpcUaNumber::opcUaBinaryDecode(is, groupFlags_); | ||
rc &= OpcUaNumber::opcUaBinaryDecode(is, writerGroupId_); | ||
rc &= OpcUaNumber::opcUaBinaryDecode(is, groupVersion_); | ||
rc &= OpcUaNumber::opcUaBinaryDecode(is, networkMessageNumber_); | ||
rc &= OpcUaNumber::opcUaBinaryDecode(is, sequenceNumber_); | ||
return rc; | ||
} | ||
|
||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#ifndef __OpcUaStackPubSub_GroupHeader_h__ | ||
#define __OpcUaStackPubSub_GroupHeader_h__ | ||
|
||
#include "OpcUaStackCore/Base/os.h" | ||
#include "OpcUaStackCore/BuildInTypes/OpcUaGuid.h" | ||
#include "OpcUaStackCore/Base/Utility.h" | ||
#include <vector> | ||
|
||
using namespace OpcUaStackCore; | ||
|
||
namespace OpcUaStackPubSub | ||
{ | ||
|
||
class GroupHeader | ||
{ | ||
public: | ||
using SPtr = boost::shared_ptr<GroupHeader>; | ||
GroupHeader() = default; | ||
virtual ~GroupHeader() = default; | ||
bool opcUaBinaryEncode(std::ostream& os) const; | ||
bool opcUaBinaryDecode(std::istream& is); | ||
|
||
OpcUaByte& groupFlags(); | ||
void groupFlags(OpcUaByte& groupFlags); | ||
|
||
OpcUaUInt16& writerGroupId(); | ||
void writerGroupId(OpcUaUInt16& writerGroupId); | ||
|
||
OpcUaByte& groupVersion(); | ||
void groupVersion(OpcUaByte& groupVersion); | ||
|
||
OpcUaUInt16& networkMessageNumber(); | ||
void networkMessageNumber(OpcUaUInt16& networkMessageNumber); | ||
|
||
OpcUaUInt16& sequenceNumber(); | ||
void sequenceNumber(OpcUaUInt16& sequenceNumber); | ||
|
||
private: | ||
OpcUaByte groupFlags_; | ||
OpcUaUInt16 writerGroupId_; | ||
OpcUaByte groupVersion_; | ||
OpcUaUInt16 networkMessageNumber_; | ||
OpcUaUInt16 sequenceNumber_; | ||
}; | ||
|
||
} | ||
|
||
#endif |
Oops, something went wrong.