pdcomm_opcua_discover
Function
Reads the endpoints of a server (GetEndpoints).
int32_t pdcomm_opcua_discover(const uint8_t *endpoint, size_t size, uint32_t timeout_ms, pdcomm_opcua_handle *out)Opens a SecurityPolicy None secure channel to endpoint, sends GetEndpoints with that endpoint URL and closes the channel. Discovery is unauthenticated: no certificate is validated here, so verify a returned server certificate before you trust it.
The result is an owned buffer with a UA Binary GetEndpointsResponse (encoding ID 431), including its namespace zero encoding NodeId prefix (Part 6, 5.2.9). It holds the server's EndpointDescriptions with an empty ResponseHeader.
Parameters
| Name | Description |
|---|---|
endpoint | opc.tcp://host[:port][/path] URL in UTF-8, 1 to 4096 bytes. The default port is 4840. |
size | Size of endpoint in bytes. |
timeout_ms | Timeout of each network exchange, 1 to 300000 ms. |
out | Receives the response buffer handle. |
Returns
#PDCOMM_OPCUA_OK, #PDCOMM_OPCUA_INVALID_INPUT, #PDCOMM_OPCUA_RUNTIME_ERROR for a URL that is not opc.tcp://, a network failure or a protocol failure, #PDCOMM_OPCUA_LIMIT, or #PDCOMM_OPCUA_LICENSE_REQUIRED without an opcua-client license.
Notes
- Blocks the calling thread for up to the timeout per exchange.