Expand description
High level GenICam facade that re-exports the workspace crates and provides convenience wrappers.
use genicam::{gige, genapi, Camera, GenicamError};
use std::time::Duration;
let timeout = Duration::from_millis(500);
let devices = gige::discover(timeout)
.await
.expect("discover cameras");
println!("found {} cameras", devices.len());
let mut camera = Camera::new(open_transport().await?, load_nodemap());
camera.set("ExposureTime", "5000")?;use std::net::Ipv4Addr;
let ids = ["FrameStart", "ExposureEnd"];
let iface = Ipv4Addr::new(127, 0, 0, 1);
camera.configure_events(iface, 10020, &ids).await?;
let stream = camera.open_event_stream(iface, 10020).await?;
let event = stream.next().await?;
println!("event id=0x{:04X} payload={} bytes", event.id, event.data.len());use genicam::gige::action::{send_action, ActionParams};
use std::net::SocketAddr;
let params = ActionParams {
device_key: 0,
group_key: 1,
group_mask: 0xFFFF_FFFF,
scheduled_time: None,
channel: 0,
};
let dest: SocketAddr = "255.255.255.255:3956".parse().unwrap();
let summary = send_action(dest, ¶ms, 200).await?;
println!("acks={}", summary.acks);
Ok(())Re-exports§
pub use chunks::parse_chunk_bytes;pub use chunks::ChunkKind;pub use chunks::ChunkMap;pub use chunks::ChunkValue;pub use events::Event;pub use events::EventStream;pub use frame::Frame;pub use stream::Stream;pub use stream::StreamBuilder;pub use time::TimeSync;pub use genapi_core as genapi;pub use genicp;pub use pfnc;pub use sfnc;pub use tl_gige as gige;
Modules§
- chunks
- Decode GVSP chunk payloads into typed values.
- events
- High-level helpers for the GVCP message/event channel.
- frame
- Frame representation combining pixel data with optional chunk metadata.
- stream
- Streaming builder and configuration helpers bridging
tl-gigewith higher-level GenICam consumers. - time
- Helpers for synchronising device tick counters with host wall-clock time.
Structs§
- AckSummary
- Summary of the broadcast performed by
send_action. - Action
Params - Parameters used to construct an action command.
- Camera
- Camera facade combining a nodemap with a transport implementing
RegisterIo. - Chunk
Config - Configuration for enabling chunk data via SFNC features.
- Gige
Register Io - Blocking adapter turning an asynchronous
GigeDeviceinto aRegisterIoimplementation.
Enums§
- Genicam
Error - Error type produced by the high level GenICam facade.
- Stream
Dest - Destination for GVSP packets received by the stream.