C++ Based OPC UA Client/Server SDK
1.6.0.389
|
The UaDiscovery class manages a UA Client side discovery functionality. More...
#include <uadiscovery.h>
Public Member Functions | |
UaDiscovery () | |
Creates a UaDiscovery client object. | |
~UaDiscovery () | |
Destroys the UaDiscovery object. | |
UaStatus | findServers (const UaString &sDiscoveryURL, UaApplicationDescriptions &applicationDescriptions) |
Get a list of servers known by the discovery server. More... | |
UaStatus | findServers (ServiceSettings &serviceSettings, const UaString &sDiscoveryURL, ClientSecurityInfo &clientSecurityInfo, UaApplicationDescriptions &applicationDescriptions) |
Get a list of servers known by the discovery server. More... | |
UaStatus | findServers (ServiceSettings &serviceSettings, const UaString &sDiscoveryURL, ClientSecurityInfo &clientSecurityInfo, const UaStringArray &localIds, const UaStringArray &serverUris, UaApplicationDescriptions &applicationDescriptions) |
Gets a list of servers known by the discovery server. More... | |
UaStatus | getEndpoints (const UaString &sDiscoveryURL, UaEndpointDescriptions &endpointDescriptions) |
Gets a list of endpoints supported by the server. More... | |
UaStatus | getEndpoints (ServiceSettings &serviceSettings, const UaString &sDiscoveryURL, ClientSecurityInfo &clientSecurityInfo, UaEndpointDescriptions &endpointDescriptions) |
Gets a list of endpoints supported by the server. More... | |
UaStatus | getEndpoints (ServiceSettings &serviceSettings, const UaString &sDiscoveryURL, ClientSecurityInfo &clientSecurityInfo, const UaStringArray &localIds, const UaStringArray &transportProfileUris, UaEndpointDescriptions &endpointDescriptions) |
Gets a list of endpoints supported by the server. More... | |
UaStatus | findServersOnNetwork (ServiceSettings &serviceSettings, const UaString &sDiscoveryURL, ClientSecurityInfo &clientSecurityInfo, OpcUa_UInt32 startingRecordId, const UaStringArray &serverCapabilities, OpcUa_UInt32 maxRecordsToReturn, UaDateTime &lastCounterResetTime, UaServerOnNetworks &servers) |
Gets a list of discovery URLs of servers known in the cache of the discovery server. More... | |
UaStatus | findServersOnNetwork (ServiceSettings &serviceSettings, const UaString &sDiscoveryURL, ClientSecurityInfo &clientSecurityInfo, OpcUa_UInt32 startingRecordId, UaDateTime &lastCounterResetTime, UaServerOnNetworks &servers) |
Gets a list of discovery URLs of servers known in the cache of the discovery server. More... | |
UaStatus | queryDirectory (ServiceSettings &serviceSettings, const UaString &sGdsURL, OpcUa_UInt32 startingRecordId, UaDateTime &lastCounterResetTime, UaServerOnNetworks &servers) |
Get a list of servers known by the Directory in a global discovery server. More... | |
UaStatus | queryDirectory (ServiceSettings &serviceSettings, UaSession *pSession, OpcUa_UInt32 startingRecordId, UaDateTime &lastCounterResetTime, UaServerOnNetworks &servers) |
Get a list of servers known by the Directory in a global discovery server. More... | |
UaStatus | queryDirectory (ServiceSettings &serviceSettings, UaSession *pSession, OpcUa_UInt32 startingRecordId, OpcUa_UInt32 maxRecordsToReturn, const UaString &applicationName, const UaString &applicationUri, const UaString &productUri, const UaStringArray &serverCapabilities, UaDateTime &lastCounterResetTime, UaServerOnNetworks &servers) |
Get a filtered list of servers known by the Directory in a global discovery server. More... | |
UaStatus | queryDirectory (ServiceSettings &serviceSettings, const UaString &sGdsURL, SessionConnectInfo &sessionConnectInfo, SessionSecurityInfo &sessionSecurityInfo, OpcUa_UInt32 startingRecordId, OpcUa_UInt32 maxRecordsToReturn, const UaString &applicationName, const UaString &applicationUri, const UaString &productUri, const UaStringArray &serverCapabilities, UaDateTime &lastCounterResetTime, UaServerOnNetworks &servers) |
Get a filtered list of servers known by the Directory in a global discovery server. More... | |
UaStatus | startReverseDiscovery (const UaString &sClientEndpointUrl, UaReverseDiscoveryCallback *pReverseConnectCallback) |
Start reverse connect discovery option. More... | |
UaStatus | stopReverseDiscovery () |
Stop reverse connect discovery option. | |
The UaDiscovery class manages a UA Client side discovery functionality.
Discovery is a two-step approach. In the first step, the available servers are discovered and in the second step the selected server is asked for its available Endpoints, describing combinations of protocols and security settings available to connect to the server.
UaStatus UaClientSdk::UaDiscovery::findServers | ( | const UaString & | sDiscoveryURL, |
UaApplicationDescriptions & | applicationDescriptions | ||
) |
Get a list of servers known by the discovery server.
The discovery server is typically a Local Discovery Server (LDS) running on a host with OPC UA servers. It returns the servers available on this host.
The DiscoveryUrls contained in the returned ApplicationDescriptions can be used to call getEndpoints for the server of interest to get all information necessary to connect to this server.
[in] | sDiscoveryURL | The URL identifying an OPC UA Discovery Server.
|
[out] | applicationDescriptions | Array of OpcUa_ApplicationDescription with the following information.
|
UaStatus UaClientSdk::UaDiscovery::findServers | ( | ServiceSettings & | serviceSettings, |
const UaString & | sDiscoveryURL, | ||
ClientSecurityInfo & | clientSecurityInfo, | ||
UaApplicationDescriptions & | applicationDescriptions | ||
) |
Get a list of servers known by the discovery server.
The discovery server is typically a Local Discovery Server (LDS) running on a host with OPC UA servers. It returns the servers available on this host.
The DiscoveryUrls contained in the returned ApplicationDescriptions can be used to call getEndpoints for the server of interest to get all information necessary to connect to this server.
[in,out] | serviceSettings | The general service settings like timeout. See ServiceSettings for more details. |
[in] | sDiscoveryURL | The URL identifying an OPC UA Discovery Server.
|
[in] | clientSecurityInfo | The client defined security settings. See ClientSecurityInfo for more information. |
[out] | applicationDescriptions | Array of OpcUa_ApplicationDescription with the following information.
|
UaStatus UaClientSdk::UaDiscovery::findServers | ( | ServiceSettings & | serviceSettings, |
const UaString & | sDiscoveryURL, | ||
ClientSecurityInfo & | clientSecurityInfo, | ||
const UaStringArray & | localIds, | ||
const UaStringArray & | serverUris, | ||
UaApplicationDescriptions & | applicationDescriptions | ||
) |
Gets a list of servers known by the discovery server.
The discovery server is typically a Local Discovery Server (LDS) running on a host with OPC UA servers. It returns the servers available on this host.
The DiscoveryUrls contained in the returned ApplicationDescriptions can be used to call getEndpoints for the server of interest to get all information necessary to connect to this server.
[in,out] | serviceSettings | The general service settings like timeout. See ServiceSettings for more details. |
[in] | sDiscoveryURL | The URL identifying an OPC UA Discovery Server.
|
[in] | clientSecurityInfo | The client defined security settings. See ClientSecurityInfo for more information. |
[in] | localIds | List of locales to use. The server should return the ServerName using one of locales specified. If the server supports more than one of the requested locales, then the server will use the locale that appears first in this list. If the server does not support any of the requested locales, it chooses an appropriate default locale. The server chooses an appropriate default locale if this list is empty. |
[in] | serverUris | List of servers to return. All known servers are returned if the list is empty. |
[out] | applicationDescriptions | Array of OpcUa_ApplicationDescription with the following information
|
UaStatus UaClientSdk::UaDiscovery::findServersOnNetwork | ( | ServiceSettings & | serviceSettings, |
const UaString & | sDiscoveryURL, | ||
ClientSecurityInfo & | clientSecurityInfo, | ||
OpcUa_UInt32 | startingRecordId, | ||
const UaStringArray & | serverCapabilities, | ||
OpcUa_UInt32 | maxRecordsToReturn, | ||
UaDateTime & | lastCounterResetTime, | ||
UaServerOnNetworks & | servers | ||
) |
Gets a list of discovery URLs of servers known in the cache of the discovery server.
The discovery server is typically a Local Discovery Server with multicast extension (LDS-ME) running on a host with OPC UA servers. It returns the servers in the mDNS cache of the LDS-ME. This cache is created from the servers announcing themselves through mDNS multicast messages in the local network.
The DiscoveryUrls contained in the returned ServerOnNetworks can be used to call getEndpoints for the server of interest to get all information necessary to connect to this server.
[in,out] | serviceSettings | The general service settings like timeout. See ServiceSettings for more details. |
[in] | sDiscoveryURL | The URL identifying an OPC UA Discovery Server.
|
[in] | clientSecurityInfo | The client defined security settings. See ClientSecurityInfo for more information. |
[in] | startingRecordId | Only records with an identifier greater than this number will be returned. Specify 0 to start with the first record in the database. |
[in] | serverCapabilities | The Servers returned shall support all of the server capabilities specified. If no server capabilities are provided this filter is not used. |
[in] | maxRecordsToReturn | The maximum number of records to return in the response. 0 indicates that there is no limit. |
[out] | lastCounterResetTime | The last time the counters were reset. |
[out] | servers | A list of Servers which meet the filter criteria. The ServerOnNetwork structure contains the following information:
|
UaStatus UaClientSdk::UaDiscovery::findServersOnNetwork | ( | ServiceSettings & | serviceSettings, |
const UaString & | sDiscoveryURL, | ||
ClientSecurityInfo & | clientSecurityInfo, | ||
OpcUa_UInt32 | startingRecordId, | ||
UaDateTime & | lastCounterResetTime, | ||
UaServerOnNetworks & | servers | ||
) |
Gets a list of discovery URLs of servers known in the cache of the discovery server.
The discovery server is typically a Local Discovery Server with multicast extension (LDS-ME) running on a host with OPC UA servers. It returns the servers in the mDNS cache of the LDS-ME. This cache is created from the servers announcing themselves through mDNS multicast messages in the local network.
The DiscoveryUrls contained in the returned ServerOnNetworks can be used to call getEndpoints for the server of interest to get all information necessary to connect to this server.
[in,out] | serviceSettings | The general service settings like timeout. See ServiceSettings for more details. |
[in] | sDiscoveryURL | The URL identifying an OPC UA Discovery Server.
|
[in] | clientSecurityInfo | The client defined security settings. See ClientSecurityInfo for more information. |
[in] | startingRecordId | Only records with an identifier greater than this number will be returned. Specify 0 to start with the first record in the database. |
[out] | lastCounterResetTime | The last time the counters were reset. |
[out] | servers | A list of Servers which meet the filter criteria. The ServerOnNetwork structure contains the following information:
|
UaStatus UaClientSdk::UaDiscovery::getEndpoints | ( | const UaString & | sDiscoveryURL, |
UaEndpointDescriptions & | endpointDescriptions | ||
) |
Gets a list of endpoints supported by the server.
The discovery URL used to connect to the server and to get the endpoints is typically returned from findServers or other discovery methods like findServersOnNetwork or queryDirectory.
The EndpointDescriptions returned from the server provide all information like EnpointUrl, security settings and types of user authentication necessary to connect to the server.
[in] | sDiscoveryURL | The discovery URL of an OPC UA Server.
|
[out] | endpointDescriptions | Array of OpcUa_EndpointDescription with the following information
|
UaStatus UaClientSdk::UaDiscovery::getEndpoints | ( | ServiceSettings & | serviceSettings, |
const UaString & | sDiscoveryURL, | ||
ClientSecurityInfo & | clientSecurityInfo, | ||
UaEndpointDescriptions & | endpointDescriptions | ||
) |
Gets a list of endpoints supported by the server.
The discovery URL used to connect to the server and to get the endpoints is typically returned from findServers or other discovery methods like findServersOnNetwork or queryDirectory.
The EndpointDescriptions returned from the server provide all information like EnpointUrl, security settings and types of user authentication necessary to connect to the server.
[in,out] | serviceSettings | The general service settings like timeout. See ServiceSettings for more details. |
[in] | sDiscoveryURL | The discovery URL of an OPC UA Server.
|
[in] | clientSecurityInfo | The client defined security settings. See ClientSecurityInfo for more info. |
[out] | endpointDescriptions | Array of OpcUa_EndpointDescription with the following information
|
UaStatus UaClientSdk::UaDiscovery::getEndpoints | ( | ServiceSettings & | serviceSettings, |
const UaString & | sDiscoveryURL, | ||
ClientSecurityInfo & | clientSecurityInfo, | ||
const UaStringArray & | localIds, | ||
const UaStringArray & | transportProfileUris, | ||
UaEndpointDescriptions & | endpointDescriptions | ||
) |
Gets a list of endpoints supported by the server.
The discovery URL used to connect to the server and to get the endpoints is typically returned from findServers or other discovery methods like findServersOnNetwork or queryServersOnDirectory.
The EndpointDescriptions returned from the server provide all information like EnpointUrl, security settings and types of user authentication necessary to connect to the server.
[in,out] | serviceSettings | The general service settings like timeout. See ServiceSettings for more details. |
[in] | sDiscoveryURL | The discovery URL of an OPC UA Server.
|
[in] | clientSecurityInfo | The client defined security settings. See ClientSecurityInfo for more info. |
[in] | localIds | List of locales to use. Specifies the locale to use when returning human readable strings. |
[in] | transportProfileUris | List of Transport Profile that the returned Endpoints shall support. All Endpoints are returned if the list is empty. The transport profile URIs are defined as part of the OPC UA profiles. A complete list can be found at http://opcfoundation.org/profilereporting/ in the Transport Category. Commonly used profiles are |
[out] | endpointDescriptions | Array of OpcUa_EndpointDescription with the following information
|
UaStatus UaClientSdk::UaDiscovery::queryDirectory | ( | ServiceSettings & | serviceSettings, |
const UaString & | sGdsURL, | ||
OpcUa_UInt32 | startingRecordId, | ||
UaDateTime & | lastCounterResetTime, | ||
UaServerOnNetworks & | servers | ||
) |
Get a list of servers known by the Directory in a global discovery server.
Used to access the method QueryServers of the Directory object in a Global Discovery Server (GDS). The method is defined by the DirectoryType in the GDS information model.
The URL used to connected to the GDS must be passed in. Any Client is able to call the method on the GDS, however, the set of results returned may be restricted based on the Client’s user credentials. One of the overloads taking a UaSession or full security configuration must be used if user credentials are necessary.
It may be necessary to call this method several times to get all results from the GDS. The behaviour can be controlled with the parameters startingRecordId and maxRecordsToReturn. The ServerOnNetwork structure returned in the parameter servers contains the RecordId of the returned server. It can be used to calculate the startingRecordId for the next call to queryDirectory. If the returned value in lastCounterResetTime is after the first call to queryDirectory, it may make sense to start over from beginning since the list of registered servers was changed. The startingRecordId for the first call is 0.
This overload function does not apply any filters.
[in,out] | serviceSettings | The general service settings like timeout. See ServiceSettings for more details. |
[in] | sGdsURL | The URL identifying an OPC UA GDS Directory Server.
|
[in] | startingRecordId | Only records with an identifier greater than this number will be returned. Specify 0 to start with the first record in the database. |
[out] | lastCounterResetTime | The last time the counters were reset. |
[out] | servers | A list of Servers which meet the filter criteria. The ServerOnNetwork structure contains the following information:
|
UaStatus UaClientSdk::UaDiscovery::queryDirectory | ( | ServiceSettings & | serviceSettings, |
UaSession * | pSession, | ||
OpcUa_UInt32 | startingRecordId, | ||
UaDateTime & | lastCounterResetTime, | ||
UaServerOnNetworks & | servers | ||
) |
Get a list of servers known by the Directory in a global discovery server.
Used to access the method QueryServers of the Directory object in a Global Discovery Server (GDS). The method is defined by the DirectoryType in the GDS information model.
A UaSession connected to the GDS must be passed in. Any Client is able to call the method on the GDS, however, the set of results returned may be restricted based on the Client’s user credentials. Therefore it may be required to configure the UaSession object with the right user token.
It may be necessary to call this method several times to get all results from the GDS. The behaviour can be controlled with the parameters startingRecordId and maxRecordsToReturn. The ServerOnNetwork structure returned in the parameter servers contains the RecordId of the returned server. It can be used to calculate the startingRecordId for the next call to queryDirectory. If the returned value in lastCounterResetTime is after the first call to queryDirectory, it may make sense to start over from beginning since the list of registered servers was changed. The startingRecordId for the first call is 0.
This overload function does not apply any filters.
[in,out] | serviceSettings | The general service settings like timeout. See ServiceSettings for more details. |
[in] | pSession | Session object used to call the QueryServers method on the GDS. The session must be connected. |
[in] | startingRecordId | Only records with an identifier greater than this number will be returned. Specify 0 to start with the first record in the database. |
[out] | lastCounterResetTime | The last time the counters were reset. |
[out] | servers | A list of Servers which meet the filter criteria. The ServerOnNetwork structure contains the following information:
|
UaStatus UaClientSdk::UaDiscovery::queryDirectory | ( | ServiceSettings & | serviceSettings, |
UaSession * | pSession, | ||
OpcUa_UInt32 | startingRecordId, | ||
OpcUa_UInt32 | maxRecordsToReturn, | ||
const UaString & | applicationName, | ||
const UaString & | applicationUri, | ||
const UaString & | productUri, | ||
const UaStringArray & | serverCapabilities, | ||
UaDateTime & | lastCounterResetTime, | ||
UaServerOnNetworks & | servers | ||
) |
Get a filtered list of servers known by the Directory in a global discovery server.
Used to access the method QueryServers of the Directory object in a Global Discovery Server (GDS). The method is defined by the DirectoryType in the GDS information model.
A UaSession connected to the GDS must be passed in. Any Client is able to call the method on the GDS, however, the set of results returned may be restricted based on the Client’s user credentials. Therefore it may be required to configure the UaSession object with the right user token.
It may be necessary to call this method several times to get all results from the GDS. The behaviour can be controlled with the parameters startingRecordId and maxRecordsToReturn. The ServerOnNetwork structure returned in the parameter servers contains the RecordId of the returned server. It can be used to calculate the startingRecordId for the next call to queryDirectory. If the returned value in lastCounterResetTime is after the first call to queryDirectory, it may make sense to start over from beginning since the list of registered servers was changed. The startingRecordId for the first call is 0.
The results can be filtered with the parameters applicationName, applicationUri, productUri and serverCapabilities. Filters are combined in an AND operation. The serverCapabilities parameter is an array and a Server will pass this filter if it supports all of the specified capabilities. The other filter parameters are strings where the syntax of the LIKE FilterOperator can be used. See UaString::like() for more details.
[in,out] | serviceSettings | The general service settings like timeout. See ServiceSettings for more details. |
[in] | pSession | Session object used to call the QueryServers method on the GDS. The session must be connected. |
[in] | startingRecordId | Only records with an identifier greater than this number will be returned. Specify 0 to start with the first record in the database. |
[in] | maxRecordsToReturn | The maximum number of records to return in the response. 0 indicates that there is no limit. |
[in] | applicationName | The ApplicationName of the Applications to return. Supports the syntax used by the LIKE FilterOperator. See UaString::like() for more details. Not used as filter if an empty string is specified. The filter is only applied to the default ApplicationName. |
[in] | applicationUri | The ApplicationUri of the Servers to return. Supports the syntax used by the LIKE FilterOperator. See UaString::like() for more details. Not used as filter if an empty string is specified. |
[in] | productUri | The ProductUri of the Servers to return. Supports the syntax used by the LIKE FilterOperator. See UaString::like() for more details. Not used as filter if an empty string is specified. |
[in] | serverCapabilities | The Servers returned shall support all of the server capabilities specified. If no server capabilities are provided this filter is not used. |
[out] | lastCounterResetTime | The last time the counters were reset. |
[out] | servers | A list of Servers which meet the filter criteria. The ServerOnNetwork structure contains the following information:
|
UaStatus UaClientSdk::UaDiscovery::queryDirectory | ( | ServiceSettings & | serviceSettings, |
const UaString & | sGdsURL, | ||
SessionConnectInfo & | sessionConnectInfo, | ||
SessionSecurityInfo & | sessionSecurityInfo, | ||
OpcUa_UInt32 | startingRecordId, | ||
OpcUa_UInt32 | maxRecordsToReturn, | ||
const UaString & | applicationName, | ||
const UaString & | applicationUri, | ||
const UaString & | productUri, | ||
const UaStringArray & | serverCapabilities, | ||
UaDateTime & | lastCounterResetTime, | ||
UaServerOnNetworks & | servers | ||
) |
Get a filtered list of servers known by the Directory in a global discovery server.
Used to access the method QueryServers of the Directory object in a Global Discovery Server (GDS). The method is defined by the DirectoryType in the GDS information model.
The necessary information to connected to the GDS must be passed in. Any Client is able to call the method on the GDS, however, the set of results returned may be restricted based on the Client’s user credentials. Therefore it may be required to configure the sessionSecurityInfo with the right user token.
It may be necessary to call this method several times to get all results from the GDS. The behaviour can be controlled with the parameters startingRecordId and maxRecordsToReturn. The ServerOnNetwork structure returned in the parameter servers contains the RecordId of the returned server. It can be used to calculate the startingRecordId for the next call to queryDirectory. If the returned value in lastCounterResetTime is after the first call to queryDirectory, it may make sense to start over from beginning since the list of registered servers was changed. The startingRecordId for the first call is 0.
The results can be filtered with the parameters applicationName, applicationUri, productUri and serverCapabilities. Filters are combined in an AND operation. The serverCapabilities parameter is an array and a Server will pass this filter if it supports all of the specified capabilities. The other filter parameters are strings where the syntax of the LIKE FilterOperator can be used. See UaString::like() for more details.
[in,out] | serviceSettings | The general service settings like timeout. See ServiceSettings for more details. |
[in] | sGdsURL | The URL identifying an OPC UA GDS Directory Server.
|
[in,out] | sessionConnectInfo | The client defined session connect settings. See SessionConnectInfo for more info. |
[in,out] | sessionSecurityInfo | The client defined session security settings. See SessionSecurityInfo for more info. |
[in] | startingRecordId | Only records with an identifier greater than this number will be returned. Specify 0 to start with the first record in the database. |
[in] | maxRecordsToReturn | The maximum number of records to return in the response. 0 indicates that there is no limit. |
[in] | applicationName | The ApplicationName of the Applications to return. Supports the syntax used by the LIKE FilterOperator. See UaString::like() for more details. Not used if an empty string is specified. The filter is only applied to the default ApplicationName. |
[in] | applicationUri | The ApplicationUri of the Servers to return. Supports the syntax used by the LIKE FilterOperator. See UaString::like() for more details. Not used if an empty string is specified. |
[in] | productUri | The ProductUri of the Servers to return. Supports the syntax used by the LIKE FilterOperator. See UaString::like() for more details. Not used if an empty string is specified. |
[in] | serverCapabilities | The Servers returned shall support all of the server capabilities specified. If no server capabilities are provided this filter is not used. |
[out] | lastCounterResetTime | The last time the counters were reset. |
[out] | servers | A list of Servers which meet the filter criteria. The ServerOnNetwork structure contains the following information:
|
UaStatus UaClientSdk::UaDiscovery::startReverseDiscovery | ( | const UaString & | sClientEndpointUrl, |
UaReverseDiscoveryCallback * | pReverseConnectCallback | ||
) |
Start reverse connect discovery option.
[in] | sClientEndpointUrl | Client side endpoint URL used to accept reverse UA TCP connections from servers. |
[in] | pReverseConnectCallback | Callback used to inform the application about a new reverse connect. |