sfnc/
lib.rs

1#![cfg_attr(docsrs, feature(doc_cfg))]
2//! Standard Feature Naming Convention (SFNC) helpers.
3
4#![allow(dead_code)]
5
6/// Exposure time feature name (`ExposureTime`).
7pub const EXPOSURE_TIME: &str = "ExposureTime";
8/// Gain feature name (`Gain`).
9pub const GAIN: &str = "Gain";
10/// Gain selector feature name (`GainSelector`).
11pub const GAIN_SELECTOR: &str = "GainSelector";
12/// Pixel format feature name (`PixelFormat`).
13pub const PIXEL_FORMAT: &str = "PixelFormat";
14/// Chunk mode enable feature name (`ChunkModeActive`).
15pub const CHUNK_MODE_ACTIVE: &str = "ChunkModeActive";
16/// Chunk selector enumeration feature name (`ChunkSelector`).
17pub const CHUNK_SELECTOR: &str = "ChunkSelector";
18/// Chunk enable boolean feature name (`ChunkEnable`).
19pub const CHUNK_ENABLE: &str = "ChunkEnable";
20/// Acquisition start command feature name (`AcquisitionStart`).
21pub const ACQUISITION_START: &str = "AcquisitionStart";
22/// Acquisition stop command feature name (`AcquisitionStop`).
23pub const ACQUISITION_STOP: &str = "AcquisitionStop";
24/// Acquisition mode enumeration feature name (`AcquisitionMode`).
25pub const ACQUISITION_MODE: &str = "AcquisitionMode";
26/// Device temperature float feature name (`DeviceTemperature`).
27pub const DEVICE_TEMPERATURE: &str = "DeviceTemperature";
28
29/// Event selector enumeration feature name (`EventSelector`).
30pub const EVENT_SELECTOR: &str = "EventSelector";
31/// Event notification mode enumeration feature (`EventNotification`).
32pub const EVENT_NOTIFICATION: &str = "EventNotification";
33/// Event notification value used to enable delivery (`On`).
34pub const EVENT_NOTIF_ON: &str = "On";
35
36/// Message channel selector aliases ordered by preference.
37pub const MSG_SEL: &[&str] = &["GevMessageChannelSelector", "MessageChannelSelector"];
38/// Message channel IP address aliases ordered by preference.
39pub const MSG_IP: &[&str] = &["GevMessageChannelIPAddress", "MessageChannelIPAddress"];
40/// Message channel UDP port aliases ordered by preference.
41pub const MSG_PORT: &[&str] = &["GevMessageChannelPort", "MessageChannelPort"];
42/// Message channel enable aliases ordered by preference.
43pub const MSG_EN: &[&str] = &["GevMessageChannelEnable", "MessageChannelEnable"];
44
45/// Stream channel selector feature name (`GevStreamChannelSelector`).
46pub const STREAM_CH_SELECTOR: &str = "GevStreamChannelSelector";
47/// Stream channel destination UDP port aliases ordered by preference.
48pub const SCP_HOST_PORT: &[&str] = &["GevSCPHostPort", "SCPHostPort"];
49/// Stream channel destination address aliases ordered by preference.
50pub const SCP_DEST_ADDR: &[&str] = &["GevSCPDA", "SCPDestinationAddress"];
51/// Multicast enable aliases ordered by preference.
52pub const MULTICAST_ENABLE: &[&str] = &["GevSCPSDoNotFragment", "GevMulticastEnable"];
53
54/// Timestamp latch commands ordered by preference.
55///
56/// Different vendors expose the SFNC timestamp latch using slightly different
57/// identifiers. Consumers should iterate the list and execute the first command
58/// present in the nodemap.
59pub const TS_LATCH_CMDS: &[&str] = &[
60    "GevTimestampControlLatch",
61    "TimestampControlLatch",
62    "TimestampLatch",
63];
64
65/// Timestamp value nodes ordered by preference.
66///
67/// Reading the node immediately after executing the latch command returns the
68/// device tick counter captured at the time of the latch.
69pub const TS_VALUE_NODES: &[&str] = &["GevTimestampValue", "TimestampValue", "TimestampLatchValue"];
70
71/// Timestamp frequency nodes ordered by preference.
72///
73/// Returns the number of device ticks per second when present. Some cameras
74/// omit the SFNC name in favour of a shortened alias, hence the list of
75/// fallbacks.
76pub const TS_FREQ_NODES: &[&str] = &["GevTimestampTickFrequency", "TimestampTickFrequency"];
77
78/// Timestamp reset commands ordered by preference.
79///
80/// Executing any of these commands restarts the device tick counter when the
81/// camera supports it. Not every device exposes a reset capability.
82pub const TS_RESET_CMDS: &[&str] = &[
83    "GevTimestampControlReset",
84    "TimestampControlReset",
85    "TimestampReset",
86];