optris::sdk::NetworkConfig
Where an Ethernet camera is, and how long to wait for it.
Everything here is optional. Leaving it untouched and setting only ImagerConfig::serial is the supported way to open a network camera: the SDK finds it by broadcast and connects to wherever it answers from.
Public attributes
address
std::string address
The camera's address, e.g. "10.0.0.99". Empty means "find it by serial with a discovery broadcast".
Naming an address skips discovery entirely, which is what a camera on another subnet needs -- discovery is a broadcast and does not cross a router. An address must be accompanied by ImagerConfig::serial; without one there is nothing to check that the camera answering is the camera you meant.
port
uint16_t port = 0
Local UDP port the camera streams frames to. Zero uses the camera's own configured port (50101 from the factory).
The camera has the last word, so this is not a way to keep two cameras apart. Whenever the camera answers the address probe, the open replaces whatever is set here with the port the camera itself is configured for -- which is the only port it is actually sending to. The port belongs to the camera, not to the application.
Two cameras streaming to one host must not share a port. Both leave the factory on 50101, so two of them pointed at this host collide, and the second open is refused by name -- it says which port, which camera holds it, and how to move this one. Change the camera's own port instead: otc_net set --port, or DeviceControl::SetNetworkConfig() on a camera that is already open, where a port-only change keeps the connection.
discovery_timeout
std::chrono::milliseconds discovery_timeout {3000}
How long a discovery broadcast waits for cameras to answer. Cameras reply to the next broadcast rather than one already in flight, so this needs to span more than one sweep.
connect_timeout
std::chrono::milliseconds connect_timeout {5000}
How long to wait for the camera's control channel to answer before giving up.
This is what a mistyped address costs. Without a bound the operating system decides, and on Linux that is a little over two minutes per attempt.