Device Scanner

The device scanner enumerates devices across multiple device manager plugins, reporting each device’s availability without permanently claiming it.

struct DeviceFound

A device that is reachable and not in use by another process.

Public Members

std::string device_manager_path

Path of the device manager plugin that enumerated the device.

std::string device_config_json

JSON configuration to pass to DeviceManager::create_device to open this device.

std::string serial_number

Serial number of the device.

std::string api_version

API version reported by the device manager.

std::string info_json

Device information in JSON format.

std::string status_json

Device status in JSON format.

struct DeviceOccupied

A device that is currently held open by another process.

Public Members

std::string device_manager_path

Path of the device manager plugin that enumerated the device.

std::string device_config_json

JSON configuration identifying the device.

struct DeviceQueryFailed

A device that is visible but whose info/status query failed.

Public Members

std::string device_manager_path

Path of the device manager plugin that enumerated the device.

std::string device_config_json

JSON configuration identifying the device.

std::string error

Description of the failure.

using xdaq::ScanResult = std::variant<DeviceFound, DeviceOccupied, DeviceQueryFailed>

Result of scanning a single device.

std::vector<ScanResult> xdaq::scan_devices(const std::vector<std::filesystem::path> &manager_paths)

Scans for devices using the given device manager plugins.

Parameters:

manager_paths – Device manager plugin paths (.so/.dll).

Returns:

One ScanResult per enumerated device:

std::vector<ScanResult> xdaq::scan_devices_dir(const std::filesystem::path &manager_dir)

Scans for devices using all device manager plugins found in a directory.

Parameters:

manager_dir – Directory containing device manager plugins.

Returns:

One ScanResult per enumerated device. Filters for standard shared library extensions (.so, .dll, .dylib) and optionally a specific pattern.