Skip to main content

u3v_device_id

Function u3v_device_id 

Source
pub fn u3v_device_id(
    vendor_id: u16,
    product_id: u16,
    serial: Option<&str>,
    bus: &str,
    address: u8,
) -> String
Expand description

Device id for a USB3 Vision camera: cam-u3v-, its vendor and product ids as eight hex digits, then its serial number.

The serial is the USB serial string the operating system caches, which a rescan reads without opening the device — so it does not change while the camera is in use — and which stays the same when the camera is plugged in again, wherever (backlog UV-03). On the one camera this has met, a MATRIX VISION mvBlueFOX3-2004G, it is the serial its bootstrap registers report too. A camera without one is named by its bus and address, and may get a new id when plugged in again.

Letters, digits, - and . are kept; every other byte of the serial’s UTF-8, _ included, becomes _ and two lowercase hex digits (/ is _2f, _ is _5f). The escape is reversible, so two serials never share an id: replacing each by a bare _ made a/b and a*b one camera (Codex review of #205).