OptrisOptrisDocumentation

Documentation/OTC SDK/OTC SDK — C API referencev12.0

optris_sdk_network_target

Which camera to open over the network, and where to look for it.

Initialise with optris_sdk_network_target_init(), which fills in the struct size and the default timeouts, then set what you need.

These two timeouts also appear on optris_sdk_camera_options, and the ones here are the operative pair for every call that takes this record -- including optris_sdk_imager_create_network_with_options(), where the pair on the options is ignored. See connect_timeout_ms below.

Public attributes

struct_size

uint32_t struct_size

Set to sizeof(optris_sdk_network_target).

connect_timeout_ms

uint32_t connect_timeout_ms

How long to wait for the camera's control channel to answer before giving up, in milliseconds. Zero uses the SDK default of

  1. This is what a mistyped address costs.

This field, and discovery_timeout_ms below, are the bounds an open through this record uses -- including optris_sdk_imager_create_network_with_options(), which takes both records and reads the timeouts from this one. The options struct's identically named fields are ignored by that call: this record's are always set, because optris_sdk_network_target_init() writes the defaults in explicitly, so there is no state in which the options' pair could be preferred.

discovery_timeout_ms

uint32_t discovery_timeout_ms

How long the SDK waits for the camera to answer discovery, in milliseconds. Zero uses the SDK default of 3000.

Ignored by an open only when address and serial are both set -- then there is nothing to discover. With an address and no serial, which is the "add camera by address" case this record exists for, the SDK asks that address who is there to learn the serial, and this field is then the whole cost of a failed open: measured against an address in the documentation range, 200 ms here costs 608 ms and 3000 ms costs 3040 ms, while connect_timeout_ms is never reached. (This line read "Ignored when ::address is set", which was false for that case and is why a binding test asked for a bound it could not get.)

It also bounds optris_sdk_probe_network(), which is that same exchange without the open.

port

uint16_t port

The UDP port the camera streams to. Zero uses the camera's own configured port.

reserved0

uint16_t reserved0

Reserved; always zero.

serial

char serial[OPTRIS_SDK_MAX_SERIAL]

Which camera to accept, UTF-8, NUL-terminated.

An address says where to look; the serial says which camera to accept, which matters because an address on a plant gets reassigned. Leaving it empty alongside an address is allowed and is what an operator typing an address into an "add camera" box needs: the SDK probes the address, takes the serial of whatever answers, and opens that. The check is not skipped, it is just answered by the camera instead of by the caller.

address

char address[OPTRIS_SDK_MAX_ADDRESS]

The camera's address, UTF-8, NUL-terminated, e.g. "10.0.0.21". Empty means "find it by serial with a discovery broadcast", which is what a camera on this host's own segment needs. An address is what a camera behind a router needs, because a broadcast does not cross one.