Skip to main content

connect_gige

Function connect_gige 

Source
pub async fn connect_gige(
    device: &DeviceInfo,
) -> Result<Camera<GigeRegisterIo>, GenicamError>
Expand description

Connect to a GigE Vision camera and return a fully configured Camera.

This convenience function handles all connection boilerplate:

  1. Opens a GVCP control connection to the device
  2. Fetches and parses the GenApi XML from the camera
  3. Builds the nodemap
  4. Creates the transport adapter

§Example

use std::time::Duration;
use viva_genicam::{gige, connect_gige};

let devices = gige::discover(Duration::from_millis(500)).await?;
let device = devices.into_iter().next().expect("no camera found");
let mut camera = connect_gige(&device).await?;
camera.set("ExposureTime", "5000")?;