C++ Based OPC UA Client/Server/PubSub SDK
1.7.2.493
|
Management object for PubSubConfig. More...
#include <pubsubconfiguration.h>
Inherits PubSubBase::PubSubObject.
Public Member Functions | |
PubSubConfiguration () | |
Creates an instance of the PubSubConfig. | |
UaStatus | loadConfiguration (const UaString &sConfigurationFile, bool initializeStack) |
Loads the PubSub configuration from a OPC UA Binary encoded file. More... | |
UaStatus | loadConfiguration (const UaByteString &bsConfiguration, bool initializeStack) |
Loads the PubSub configuration from a OPC UA Binary encoded ByteString. | |
UaStatus | saveConfiguration (const UaString &sConfigurationFile) |
Saves the PubSub configuration to a OPC UA Binary encoded file. More... | |
UaStatus | saveConfiguration (UaByteString &bsConfiguration) |
Saves the PubSub configuration to a binary blob. More... | |
UaStatus | applyChanges () |
Apply all configuration changes to the current configuration. | |
void | clear () |
Clears the configuration. | |
UaStringArray | namespaceTable () const |
Returns the namespace table currently used by the configuration. More... | |
void | setNamespaceTable (const UaStringArray &namespaces) |
Sets the namespace table used by the configuration. More... | |
UaStatus | mapNamespaceTable (const UaStringArray &newNamespaceTable) |
Map the namespace indices of the configuration from the existing namespace table to the passed namespace table. More... | |
PubSubConnection * | addConnection (TransportFacet transportFacet) |
Adds a PubSub connection to the configuration. | |
PubSubConnection * | addConnection_Datagram (const UaString &name, bool enabled, const UaVariant &publisherId, const UaString &address, const UaString &networkInterface, const UaString &discoveryAddress, TransportFacet transportFacet=PubSubObject::TransportFacet_PubSub_UDP_UADP) |
Adds a PubSub connection for a Datagram related transport to the configuration. More... | |
PubSubConnection * | addConnection_Broker (const UaString &name, bool enabled, const UaVariant &publisherId, const UaString &address, TransportFacet transportFacet) |
Adds a PubSub connection for a Broker related transport to the configuration. More... | |
OpcUa_UInt32 | connectionCount () const |
Returns the number of connection. | |
PubSubConnection * | getConnection (OpcUa_UInt32 index) |
Returns the connection at index or NULL if index is outside the valid range. | |
UaStatus | removeConnection (PubSubConnection *pConnection) |
Removes the passed connection. | |
PublishedDataSet * | addDataSet (const UaString &name, const UaStringArray &fieldNames, const UaNodeIdArray &publishedVariableNodeIds, const UaByteArray &publishedVariableBuiltInTypes, const UaInt32Array &publishedVariableValueRanks) |
Adds a PublishedDataSet to the configuration. More... | |
PublishedDataSet * | addDataSet (const UaString &name, const UaStringArray &fieldNames, const UaNodeIdArray &publishedVariableNodeIds, const UaByteArray &publishedVariableBuiltInTypes, const UaNodeIdArray &publishedVariableDataTypes, const UaInt32Array &publishedVariableValueRanks) |
Adds a PublishedDataSet to the configuration. More... | |
PublishedDataSet * | addDataSet (const UaString &name, const UaVersionTime &minorVersion, const UaVersionTime &majorVersion, const UaStringArray &fieldNames, const UaGuidArray &fieldIds, const UaNodeIdArray &publishedVariableNodeIds, const UaByteArray &publishedVariableBuiltInTypes, const UaNodeIdArray &publishedVariableDataTypes, const UaInt32Array &publishedVariableValueRanks) |
Adds a PublishedDataSet to the configuration. More... | |
OpcUa_UInt32 | dataSetCount () const |
Returns the number of DataSets. | |
PublishedDataSet * | getDataSet (OpcUa_UInt32 index) |
Returns the DataSet at index or NULL if index is outside the valid range. | |
UaStatus | removeDataSet (PublishedDataSet *pDataSet) |
Removes the passed DataSet. | |
void | setPubSubControlCallback (PubSubControlCallback *pPubSubControlCallback) |
Set PubSubControlCallback. | |
Public Member Functions inherited from PubSubBase::PubSubObject | |
PubSubObject (PubSubResources *pPubSubResources, TransportFacet transportFacet, ConfigurationState configurationState) | |
Creates an instance of the PubSubObject. | |
UaMutex * | pConfigMutex () const |
Get the shared mutex for the complete configuration. | |
void | incrementErrorCounter () |
Increments the error counter for the PubSub object. | |
void | decrementErrorCounter () |
Decrements the error counter for the PubSub object. | |
Public Member Functions inherited from ReferenceCounter | |
ReferenceCounter () | |
construction | |
virtual | ~ReferenceCounter () |
destruction | |
Static Public Member Functions | |
static UaStatus | saveConfiguration (const UaString &sConfigurationFile, OpcUa_PubSubConfigurationDataType *pConfiguration, const UaStringArray &namespaces) |
Saves the PubSub configuration to an OPC UA Binary encoded file. More... | |
static UaStatus | saveConfiguration (UaByteString &bsConfiguration, OpcUa_PubSubConfigurationDataType *pConfiguration, const UaStringArray &namespaces) |
Saves the PubSub configuration to a binary blob. More... | |
Protected Member Functions | |
virtual | ~PubSubConfiguration () |
Destroys the PubSubConfig object. | |
Protected Member Functions inherited from PubSubBase::PubSubObject | |
virtual | ~PubSubObject () |
Destroys the PubSubObject object. | |
Additional Inherited Members | |
Public Types inherited from PubSubBase::PubSubObject | |
enum | PubSubObjectType |
PubSub transport facet reflecting the defined TransportProfileUris. | |
enum | TransportFacet { TransportFacet_None = 0x0, TransportFacet_PubSub_UDP_UADP = 0x11, TransportFacet_PubSub_ETH_UADP = 0x21, TransportFacet_PubSub_AMQP_UADP = 0x31, TransportFacet_PubSub_MQTT_UADP = 0x41 } |
PubSub transport facet reflecting the defined TransportProfileUris. More... | |
enum | ConfigurationState { ConfigurationState_None, ConfigurationState_Deleted, ConfigurationState_InSyncWithStruct, ConfigurationState_New, ConfigurationState_Modified } |
PubSub configuration object state. More... | |
enum | PubSubHeaderLayout { PubSubHeaderLayout_Custom, PubSubHeaderLayout_UADP_PeriodicFixed, PubSubHeaderLayout_UADP_Dynamic } |
PubSub header configuration. More... | |
Management object for PubSubConfig.
PubSubConnection * PubSubBase::PubSubConfiguration::addConnection_Broker | ( | const UaString & | name, |
bool | enabled, | ||
const UaVariant & | publisherId, | ||
const UaString & | address, | ||
TransportFacet | transportFacet | ||
) |
Adds a PubSub connection for a Broker related transport to the configuration.
Fills a PubSubConnectionDataType with TransportSettings initialized to BrokerConnectionTransportDataType. The broker TransportSettings are initialized with empty strings.
The Address.NetworkInterface setting is initialized with an empty string.
[in] | name | Name of the connection |
[in] | enabled | Enable state of the connection |
[in] | publisherId | PublisherId for the connection |
[in] | address | Address used for the connection |
[in] | transportFacet | Transport facet for the connection. Valid options are AMQP-UADP and MQTT-UADP. |
PubSubConnection * PubSubBase::PubSubConfiguration::addConnection_Datagram | ( | const UaString & | name, |
bool | enabled, | ||
const UaVariant & | publisherId, | ||
const UaString & | address, | ||
const UaString & | networkInterface, | ||
const UaString & | discoveryAddress, | ||
TransportFacet | transportFacet = PubSubObject::TransportFacet_PubSub_UDP_UADP |
||
) |
Adds a PubSub connection for a Datagram related transport to the configuration.
Fills a PubSubConnectionDataType with TransportSettings initialized to DatagramConnectionTransportDataType. The Datagram TransportSetting DiscoveryAddress.NetworkInterface is configured with the networkInterface setting that is also used for the Connection Address.NetworkInterface.
[in] | name | Name of the connection |
[in] | enabled | Enable state of the connection |
[in] | publisherId | PublisherId for the connection |
[in] | address | Address used for the connection |
[in] | networkInterface | Network interface used for the Address and for Datagram transpor DiscoveryAddress |
[in] | discoveryAddress | Discovery address used for the Datagram transport settings |
[in] | transportFacet | Transport facet for the connection. Valid options are UDP-UADP and ETH-UADP. |
PublishedDataSet * PubSubBase::PubSubConfiguration::addDataSet | ( | const UaString & | name, |
const UaStringArray & | fieldNames, | ||
const UaNodeIdArray & | publishedVariableNodeIds, | ||
const UaByteArray & | publishedVariableBuiltInTypes, | ||
const UaInt32Array & | publishedVariableValueRanks | ||
) |
Adds a PublishedDataSet to the configuration.
[in] | name | Name of the DataSet |
[in] | fieldNames | Array of field names |
[in] | publishedVariableNodeIds | Array of NodeIds representing the published Variables wich are the source for the DataSet. The size of the array must match fieldNames. |
[in] | publishedVariableBuiltInTypes | Array of built-in types for the variables. The size of the array must match fieldNames. |
[in] | publishedVariableValueRanks | Array of value ranks for the variables. The size of the array must match fieldNames. |
PublishedDataSet * PubSubBase::PubSubConfiguration::addDataSet | ( | const UaString & | name, |
const UaStringArray & | fieldNames, | ||
const UaNodeIdArray & | publishedVariableNodeIds, | ||
const UaByteArray & | publishedVariableBuiltInTypes, | ||
const UaNodeIdArray & | publishedVariableDataTypes, | ||
const UaInt32Array & | publishedVariableValueRanks | ||
) |
Adds a PublishedDataSet to the configuration.
[in] | name | Name of the DataSet |
[in] | fieldNames | Array of field names |
[in] | publishedVariableNodeIds | Array of NodeIds representing the published Variables wich are the source for the DataSet. The size of the array must match fieldNames. |
[in] | publishedVariableBuiltInTypes | Array of built-in types for the variables. The size of the array must match fieldNames. |
[in] | publishedVariableDataTypes | Array of DataTypes. The size of the array must match fieldNames. If the array is empty, built-in types are used. |
[in] | publishedVariableValueRanks | Array of value ranks for the variables. The size of the array must match fieldNames. |
PublishedDataSet * PubSubBase::PubSubConfiguration::addDataSet | ( | const UaString & | name, |
const UaVersionTime & | minorVersion, | ||
const UaVersionTime & | majorVersion, | ||
const UaStringArray & | fieldNames, | ||
const UaGuidArray & | fieldIds, | ||
const UaNodeIdArray & | publishedVariableNodeIds, | ||
const UaByteArray & | publishedVariableBuiltInTypes, | ||
const UaNodeIdArray & | publishedVariableDataTypes, | ||
const UaInt32Array & | publishedVariableValueRanks | ||
) |
Adds a PublishedDataSet to the configuration.
[in] | name | Name of the DataSet |
[in] | minorVersion | Minor version for the DataSet |
[in] | majorVersion | Major version for the DataSet |
[in] | fieldNames | Array of field names |
[in] | fieldIds | Array of field IDs. The size of the array must match fieldNames. If the array is empty, the field IDs are generated. |
[in] | publishedVariableNodeIds | Array of NodeIds representing the published Variables wich are the source for the DataSet. The size of the array must match fieldNames. |
[in] | publishedVariableBuiltInTypes | Array of built-in types for the variables. The size of the array must match fieldNames. |
[in] | publishedVariableDataTypes | Array of DataTypes. The size of the array must match fieldNames. If the array is empty, built-in types are used. |
[in] | publishedVariableValueRanks | Array of value ranks for the variables. The size of the array must match fieldNames. |
UaStatus PubSubBase::PubSubConfiguration::loadConfiguration | ( | const UaString & | sConfigurationFile, |
bool | initializeStack | ||
) |
Loads the PubSub configuration from a OPC UA Binary encoded file.
[in] | sConfigurationFile | Path and name of PubSub configuration file |
[in] | initializeStack | Flag indicating if the PubSub stack should be initialized with the configuration |
UaStatus PubSubBase::PubSubConfiguration::mapNamespaceTable | ( | const UaStringArray & | newNamespaceTable | ) |
Map the namespace indices of the configuration from the existing namespace table to the passed namespace table.
The index into the array is referred to as NamespaceIndex. The NamespaceIndex is used in NodeIds and QualifiedNames, rather than the longer namespace URI. NamespaceIndex 0 is reserved for the OPC UA namespace and it is not included in this array.
[in] | newNamespaceTable | New namespace array for the namespace table |
UaStringArray PubSubBase::PubSubConfiguration::namespaceTable | ( | ) | const |
Returns the namespace table currently used by the configuration.
The index into the array is referred to as NamespaceIndex. The NamespaceIndex is used in NodeIds and QualifiedNames, rather than the longer namespace URI. NamespaceIndex 0 is reserved for the OPC UA namespace and it is not included in this array.
Saves the PubSub configuration to a OPC UA Binary encoded file.
[in] | sConfigurationFile | Path and name of PubSub configuration file |
UaStatus PubSubBase::PubSubConfiguration::saveConfiguration | ( | UaByteString & | bsConfiguration | ) |
Saves the PubSub configuration to a binary blob.
[out] | bsConfiguration | The UaByteString to store the config to |
|
static |
Saves the PubSub configuration to an OPC UA Binary encoded file.
[in] | sConfigurationFile | Path and name of PubSub configuration file |
[in] | pConfiguration | Configuration structure to save |
[in] | namespaces | Namespaces for the configuration structure to save |
|
static |
Saves the PubSub configuration to a binary blob.
[out] | bsConfiguration | The UaByteString to store the config to |
[in] | pConfiguration | Configuration structure to save |
[in] | namespaces | Namespaces for the configuration structure to save |
void PubSubBase::PubSubConfiguration::setNamespaceTable | ( | const UaStringArray & | namespaces | ) |
Sets the namespace table used by the configuration.
The index into the array is referred to as NamespaceIndex. The NamespaceIndex is used in NodeIds and QualifiedNames, rather than the longer namespace URI. NamespaceIndex 0 is reserved for the OPC UA namespace and it is not included in this array.
[in] | namespaces | New namespace array for the namespace table |