Module cameleon::u3v

source ·
Expand description

This module provides low level API for U3V compatible devices.

Examples

use cameleon::Camera;
use cameleon::u3v;
use cameleon::genapi;

// Enumerates cameras connected to the host.
let mut cameras = u3v::enumerate_cameras().unwrap();

// If no camera is found, return.
if cameras.is_empty() {
    return;
}

let mut camera = cameras.pop().unwrap();
// Opens the camera.
camera.open();

let ctrl = &mut camera.ctrl;
// Get Abrm.
let abrm = ctrl.abrm().unwrap();

// Read serial number from ABRM.
let serial_number = abrm.serial_number(ctrl).unwrap();
println!("{}", serial_number);

// Check user defined name feature is supported.
// If it is suppoted, read from and write to the register.
let device_capability = abrm.device_capability().unwrap();
if device_capability.is_user_defined_name_supported() {
    // Read from user defined name register.
    let user_defined_name = abrm.user_defined_name(ctrl).unwrap().unwrap();
    println!("{}", user_defined_name);

    // Write new name to the register.
    abrm.set_user_defined_name(ctrl, "cameleon").unwrap();
}

Re-exports

Modules

  • This module contains low level device control implementation for U3V device.
  • U3V device register classes.
  • This module contains low level streaming implementation for U3V device.

Structs

  • Device information in class-specific device descriptor.

Functions