OptrisOptrisDocumentation

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

optris::sdk::DeviceNetworkConfig

How the camera is addressed on a network.

These are the camera's own settings, stored in the camera, and they are all it has: an Optris camera has no default gateway and no DHCP client. It answers control on its address and sends its frames to one destination it is told about, which is the whole of its networking. The struct used to claim otherwise -- a gateway that was really the stream destination under another name, and a dhcp_enabled flag that was never read on the way in and never filled in on the way out, so otc_net show reported "dhcp: no" for every camera whatever its state and --dhcp quietly did nothing.

Public attributes

ip_address

std::string ip_address

The camera's own address, e.g. "10.0.0.21".

subnet_mask

std::string subnet_mask

The mask for that address, e.g. "255.255.248.0". It has to cover the host the camera streams to, because the camera cannot route.

stream_destination

std::string stream_destination

Where the camera sends its frames. Normally the address of the host running the SDK; the SDK rewrites it on connect when it differs from the host that is actually connecting.

It must differ from ip_address. The SDK checks that itself and throws before it writes anything, so the camera never sees a configuration in which the two are equal -- the refusal is ours, the whole configuration is rejected rather than the one field, and nothing reached the device. Do not report it to an operator as the camera rejecting the settings; it never saw them.

port

uint16_t port = 0

The UDP port it sends them to. 50101 from the factory.

Two cameras streaming to one host must not share it. Every camera ships on 50101, so two of them pointed at this host both send there, one receiver holds the port and the other cannot bind it. Give the second camera a port of its own -- a port-only change here keeps the connection (kAppliedConnectionKept), so it can be done on a camera that is already open. An open that would collide with a camera already receiving in this process is refused with a DeviceException naming the port and the holder, and neither camera is touched.

On Windows this is also a firewall matter: a rule written for one port stops matching the moment a camera is moved to another. See Ethernet Cameras for the program-scoped rule that does not have to be rewritten.