Expand description
GigE Vision transport: discovery and control (GVCP), streaming (GVSP), events and action commands.
The modules are private; what is public is re-exported here (ADR-0030).
consts is the one public namespace: GVCP’s opcodes, bootstrap register
addresses and protocol limits, the vocabulary the fake camera shares.
Re-exports§
pub use gvcp::DeviceInfo;pub use gvcp::DiscoveryOptions;pub use gvcp::FORCE_READMEM_ENV;pub use gvcp::GVCP_PORT;pub use gvcp::GigeDevice;pub use gvcp::GigeError;pub use gvcp::GvcpCapability;pub use gvcp::StreamParams;pub use gvcp::discover;pub use gvcp::discover_all;pub use gvcp::discover_ip;pub use gvcp::discover_on_interface;pub use gvcp::discover_with;pub use gvcp::encode_packet_resend;pub use gvcp::force_ip;
Modules§
- consts
- GigE Vision’s vocabulary: GVCP opcodes and header fields, bootstrap register addresses and bits, and the protocol’s limits.
Structs§
- AckSummary
- Summary of the broadcast performed by
send_action. - Action
Params - Parameters used to construct an action command.
- Action
Refusal - A device’s error answer to an action command: an Allied Vision Manta
G-125B, whose GVCP Capability lacks the action bit, answered
NOT_IMPLEMENTEDunder the command’s own opcode,0x0100, rather than underACTION_ACK. - Chunk
Raw - One chunk of a GVSP chunk payload, borrowing the payload.
- Device
Info - Information returned by GVCP discovery packets.
- Discovery
Options - How
discover_withlooks for cameras. - Event
Packet - Parsed representation of a single GVCP event.
- Event
Socket - A GVCP message channel: the socket a device sends its events to.
- Event
Stats - What a GVCP message channel has received, counted by its receive thread.
- Gige
Device - GVCP device handle.
- Gvcp
Capability - GVCP Capability (
0x0934): which optional commands and behaviours the device implements, one bit each. - Gvsp
Header - The header every GVSP packet starts with, in either layout.
- Gvsp
Leader - The fields of a data leader.
- Gvsp
Packet Ref - A GVSP packet borrowing the datagram it was parsed from.
- Gvsp
Trailer - The fields of a data trailer.
- Iface
- Representation of a host network interface.
- Image
Leader - Image fields of a leader whose payload type is an image.
- McOptions
- Multicast socket options applied while binding.
- Packet
Bitmap - Bitmap tracking received packets within a block.
- Recv
Buffer - A socket receive buffer: what was asked for and what the kernel granted.
- Stream
Config - Stream configuration shared between the control plane and GVSP receiver.
- Stream
Params - Stream negotiation outcome describing the values written to the device.
- Time
Sync - Maintain a linear mapping between device ticks and host time.
Enums§
- Chunk
Error - A chunk payload that does not tile into tagged chunks.
- Gige
Error - Errors that can occur when operating the GVCP control path.
- Gige
Status - A GigE Vision status: a GVCP acknowledgement’s, or a GVSP packet’s.
- Gvsp
Content - What a GVSP packet carries after its header.
- Gvsp
Error - Errors raised while handling GVSP packets.
- Iface
Selector - How a user names a host interface on a command line or in an API call.
- Mtu
- An interface MTU, and whether the operating system reported it.
- Stream
Dest - Destination for GVSP packets received by the stream.
Constants§
- ASSUMED_
MTU - The MTU assumed when the operating system does not report one.
- DEFAULT_
RCVBUF_ BYTES - Default socket receive buffer size used when the caller does not provide a custom value. The number mirrors what many operating systems allow without requiring elevated privileges.
- DEFAULT_
TIME_ WINDOW - Default maximum number of samples kept for linear regression.
- EVENT_
QUEUE_ CAPACITY - Events kept for the application before the oldest is dropped.
- FORCE_
READMEM_ ENV - Environment variable that starts every
GigeDeviceon READMEM/WRITEMEM. - GVSP_
EXTENDED_ HEADER_ SIZE - Size of the extended-ID GVSP header (GigE Vision 2.0).
- GVSP_
HEADER_ SIZE - Size of the standard GVSP header.
- PAYLOAD_
TYPE_ CHUNK_ DATA - GVSP payload type for chunk data: a block made only of chunks, whose
leader carries no image geometry (
reserved | payload type | timestamp) and whose trailer reports the payload data length where an image’s reports Size Y. Layout corroborated by Wireshark’sdissect_chunk_data_leader/_trailer. - PAYLOAD_
TYPE_ EXTENDED_ CHUNK - Bit 14 of the payload type: the block carries extended chunk data.
- PAYLOAD_
TYPE_ EXTENDED_ CHUNK_ DATA - GVSP payload type for GigE Vision 1.x’s extended chunk data, deprecated
by GigE Vision 2.0 for an image with the chunk flag (
0x4001), whose layout it shares: an image leader, a payload of chunks with the image first, and a trailer of reserved | payload type | payload data length | Size Y | chunk layout ID. An Allied Vision Manta G-125B (GigE Vision 1.2) sends it withChunkModeActiveon. Layout corroborated by Wireshark’sdissect_extended_chunk_data_leader/_trailer; aravis treats it as an image with chunks. - PAYLOAD_
TYPE_ IMAGE - GVSP payload type for image data. Bits 13..0 of the 16-bit field carry the
type; bit 14 (
PAYLOAD_TYPE_EXTENDED_CHUNK) flags extended chunk data, so0x4001is an image with chunks (TC-05). aravis masks the same way (payload_type & 0x3fff,& 0x4000for chunks inarvgvspprivate.h).
Functions§
- best_
packet_ size - Compute an optimal GVSP packet size from the link MTU.
- bind_
multicast - Bind a UDP socket subscribed to the provided multicast group on the interface.
- bind_
udp - Bind a UDP socket configured for GVSP traffic.
- discover
- Discover GigE Vision devices on the local network by broadcasting a GVCP discovery command.
- discover_
all - Discover devices on all interfaces including loopback.
- discover_
ip - Ask the camera at
ipdirectly: a unicastDISCOVERY_CMDto its GVCP port, for a camera that broadcast discovery does not reach — across a router, say.Nonewhen nothing answers withintimeout. - discover_
on_ interface - Discover devices only on the specified interface name.
- discover_
with - Discover devices as
optionssay. - encode_
packet_ resend - Encode a
PACKETRESEND_CMDasking the device to send packetsfirst_packet..=last_packetof blockblock_idon stream channelchannelagain. - force_
ip - Send a FORCEIP command to temporarily assign an IP address to a device.
- has_
extended_ chunks - Whether
payload_typecarries extended chunk data: it has the chunk flag (bit 14), or is GigE Vision 1.x’sPAYLOAD_TYPE_EXTENDED_CHUNK_DATA. - is_
chunk_ data_ payload - Whether
payload_typeis chunk data, with or without the chunk flag. - is_
image_ payload - Whether
payload_typeis an image, with or without extended chunk data: GigE Vision 1.x’sPAYLOAD_TYPE_EXTENDED_CHUNK_DATAis one too. - mtu
- Read the MTU configured for the provided interface.
- parse_
chunks - Split a GigE Vision chunk payload into its chunks, in payload order.
- parse_
header - Parse only the header of a GVSP datagram.
- parse_
packet_ ref - Parse one GVSP datagram without copying it.
- send_
action - Send a GVCP action command and collect acknowledgements.
- set_
recv_ buffer - Size a stream socket’s receive buffer and report what the kernel granted.
- wait_
readable - Wait up to
timeoutforsocketto have a datagram — or a pending error — to read.Ok(false)when the time ran out.