Skip to main content

Crate viva_gige

Crate viva_gige 

Source
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.
ActionParams
Parameters used to construct an action command.
ActionRefusal
A device’s error answer to an action command: an Allied Vision Manta G-125B, whose GVCP Capability lacks the action bit, answered NOT_IMPLEMENTED under the command’s own opcode, 0x0100, rather than under ACTION_ACK.
ChunkRaw
One chunk of a GVSP chunk payload, borrowing the payload.
DeviceInfo
Information returned by GVCP discovery packets.
DiscoveryOptions
How discover_with looks for cameras.
EventPacket
Parsed representation of a single GVCP event.
EventSocket
A GVCP message channel: the socket a device sends its events to.
EventStats
What a GVCP message channel has received, counted by its receive thread.
GigeDevice
GVCP device handle.
GvcpCapability
GVCP Capability (0x0934): which optional commands and behaviours the device implements, one bit each.
GvspHeader
The header every GVSP packet starts with, in either layout.
GvspLeader
The fields of a data leader.
GvspPacketRef
A GVSP packet borrowing the datagram it was parsed from.
GvspTrailer
The fields of a data trailer.
Iface
Representation of a host network interface.
ImageLeader
Image fields of a leader whose payload type is an image.
McOptions
Multicast socket options applied while binding.
PacketBitmap
Bitmap tracking received packets within a block.
RecvBuffer
A socket receive buffer: what was asked for and what the kernel granted.
StreamConfig
Stream configuration shared between the control plane and GVSP receiver.
StreamParams
Stream negotiation outcome describing the values written to the device.
TimeSync
Maintain a linear mapping between device ticks and host time.

Enums§

ChunkError
A chunk payload that does not tile into tagged chunks.
GigeError
Errors that can occur when operating the GVCP control path.
GigeStatus
A GigE Vision status: a GVCP acknowledgement’s, or a GVSP packet’s.
GvspContent
What a GVSP packet carries after its header.
GvspError
Errors raised while handling GVSP packets.
IfaceSelector
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.
StreamDest
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 GigeDevice on 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’s dissect_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 with ChunkModeActive on. Layout corroborated by Wireshark’s dissect_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, so 0x4001 is an image with chunks (TC-05). aravis masks the same way (payload_type & 0x3fff, & 0x4000 for chunks in arvgvspprivate.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 ip directly: a unicast DISCOVERY_CMD to its GVCP port, for a camera that broadcast discovery does not reach — across a router, say. None when nothing answers within timeout.
discover_on_interface
Discover devices only on the specified interface name.
discover_with
Discover devices as options say.
encode_packet_resend
Encode a PACKETRESEND_CMD asking the device to send packets first_packet..=last_packet of block block_id on stream channel channel again.
force_ip
Send a FORCEIP command to temporarily assign an IP address to a device.
has_extended_chunks
Whether payload_type carries extended chunk data: it has the chunk flag (bit 14), or is GigE Vision 1.x’s PAYLOAD_TYPE_EXTENDED_CHUNK_DATA.
is_chunk_data_payload
Whether payload_type is chunk data, with or without the chunk flag.
is_image_payload
Whether payload_type is an image, with or without extended chunk data: GigE Vision 1.x’s PAYLOAD_TYPE_EXTENDED_CHUNK_DATA is 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 timeout for socket to have a datagram — or a pending error — to read. Ok(false) when the time ran out.