optris::sdk::DeviceInfo
Device information from enumeration.
Public attributes
serial
std::string serial
The number on the camera. This is what identifies it to the SDK, and what names its calibration files.
model
std::string model
marketing name, e.g. "PI 640i"
metadata
DeviceMetadata metadata
What the user has written down about this camera -- its name above all. Read from the host's metadata store during enumeration, keyed by serial, without opening the camera.
Empty for a camera nobody has named. Changing it here changes nothing on disk: this is a copy of a value. Use SetDeviceName() or WriteDeviceMetadata() to record a change, or Imager::Device() on a camera you have open.
video_path
std::string video_path
Where the frame stream comes from, as the operating system names it. Diagnostic; nothing needs to pass it back in.
control_path
std::string control_path
likewise, for the control channel
type
DeviceType type = DeviceType::kUnknown
which family
connection
ConnectionType connection = ConnectionType::kUsb
How this camera is attached: USB, network, or simulated.
Filled by enumeration, and also on the record of a camera that is already open, from the transport the open actually used. The SDK's own reconnect presence gate reads this field.
address
std::string address
Where the camera is, when connection is kNetwork: the address it answered discovery from, e.g. "10.0.0.99". Empty for USB, whose addressing is the operating system's business.
This is what makes a network camera openable. Passing the whole DeviceInfo to Imager::Create() carries it across; a caller that keeps only the serial loses the address and the transport with it.
port
uint16_t port = 0
The UDP port the camera streams to, when connection is kNetwork. Zero for USB.
is_claimed
bool is_claimed = false
Some process has this camera open, as far as enumeration could tell -- including this one.
It is not "another process". A claim is exclusive against every client, this process included: opening a camera a second time from the same program is refused exactly as another program's open would be. So "claimed" is the right answer to "can this be opened", which is what this field is for, and reporting a camera this program holds as free would make it a lie in the one place it is read.
Use claimed_by_this_process to tell the two apart.
A hint for a device list, never a promise. Nothing is reserved to answer it and nothing keeps it true: a camera can be claimed between the sweep that set this and the Imager::Create() that follows, so is_claimed == false does not mean an open will succeed, and an open must still be allowed to fail. What it is good for is showing a camera as busy without opening it, which is the only alternative and is not a side-effect-free probe.
claimed_by_this_process
bool claimed_by_this_process = false
The holder is this process.
Only meaningful when is_claimed is true. It separates "in use
by me" from "in use by somebody else", which a user interface needs in order to grey out the cameras it cannot have and leave its own alone.
Before this existed the only way to ask was to parse claimed_by for this process's pid -- which the documentation on that field forbids, and which otc_studio did anyway for want of an alternative. Nothing needs to parse anything now.
False for a camera nobody holds, and false on one path even for a camera this process is using: an Ethernet camera's claim state starts from the camera's own busy word, which says that someone is streaming and cannot say who. A sweep that reads that word while this process streams, and reaches the claim file after this process has let it go, reports a claim with this false. Treat it as "known to be ours" rather than as "not ours".
claimed_by
std::string claimed_by
Who holds it, e.g. optris-relay (pid 4711). Empty when nobody does and when the holder cannot be identified.
Both platforms can name a holder, by different means. On Linux it comes from the kernel's flock table; on Windows, where a sharing violation names nobody, it comes from a small file the claiming process writes beside the lock. A claim taken by an older build of the SDK, or by another program, leaves no owner file, so this can still be empty for a camera that is definitely claimed -- on either platform.
Read it as an optional detail on top of is_claimed, never as the test for whether the camera is free, and never as the test for whether the holder is you -- that is claimed_by_this_process.
capabilities
DeviceCapabilities capabilities
what this camera can do
vendor_id
uint16_t vendor_id = 0
USB vendor id.
product_id
uint16_t product_id = 0
USB product id.
width
uint32_t width = 0
sensor width in pixels
height
uint32_t height = 0
sensor height in pixels
frame_rate
uint32_t frame_rate = 0
Filled in by Imager::GetDeviceInfo() for a connected camera. Enumeration leaves them at zero: they can only be read from the device once it is open.
hardware_revision
uint32_t hardware_revision = 0
The camera's hardware revision as a bare number -- 602, never "6.0.2". There is no dotted form and no major/minor split; the device reports 16 bits and they are widened here. This is what the model is derived from: 600-601 is a PI 640, 602-698 a PI 640i, 3800-3989 a Xi 410. Prefer type and model, which are this number already resolved; read the raw value when the exact unit matters, as it does for a support case.
firmware_revision
uint32_t firmware_revision = 0
The camera's firmware revision, likewise a bare 16-bit number. Within one model this is what gates abilities the hardware has but an older firmware does not expose, which is why the SDK always resolves the two revisions together and neither alone. Zero is also what an unopened camera reports, so it is not a usable "has this been read yet" flag.
connection_interface
std::string connection_interface
"USB", "Network", "Simulated" -- how this camera is attached.
operation_modes
std::vector< OperationMode > operation_modes
Every way this camera can be operated, and the distinct temperature ranges those modes offer (deduped -- several optics modes can share a range).
These are facts about the device, so they live with the rest of them rather than being asked for separately.
No two entries share the matching key. optics_fov, optics_text, temp_min, temp_max, width, height and framerate together identify exactly one entry of this list, so Imager::GetOperationMode() has one place in it and a mode handed back to SetOperationMode() resolves to the entry it came from.
It is stated because it was not always true and the consequence was invisible. A PI 400 on hal-mf listed every 80 Hz mode twice -- 21 entries where 14 exist -- because two of the camera's native media types read as the same size and whole-Hz rate. Both copies were equal in every field here, nothing in the public record told them apart, and every lookup resolved to the first, so the second of each pair could not be selected: a mode picker showed seven entries that did nothing, and stepping to the next mode never got past the first pair.
available_ranges
std::vector< std::pair< int, int > > available_ranges
Distinct temperature ranges, as {min, max} pairs in whole degrees of the SDK's temperature unit (Celsius unless SetTemperatureUnit() chose Fahrenheit; -20..100 C reads -4..212). A pair read in one unit is a valid TemperatureRange in that unit.