summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/device_enumerator.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libcamera/device_enumerator.cpp b/src/libcamera/device_enumerator.cpp
index 1fde7367..0d983032 100644
--- a/src/libcamera/device_enumerator.cpp
+++ b/src/libcamera/device_enumerator.cpp
@@ -271,4 +271,18 @@ std::shared_ptr<MediaDevice> DeviceEnumerator::search(const MediaDeviceMatch &dm
return nullptr;
}
+std::shared_ptr<USBDevice> DeviceEnumerator::search(const USBDeviceMatch &dm)
+{
+ for (std::shared_ptr<USBDevice> &usb : usbDevices_) {
+ if (dm.match(usb.get())) {
+ LOG(DeviceEnumerator, Debug)
+ << "Successful match for USB device "
+ << usb->vid() << "-" << usb->pid();
+ return usb;
+ }
+ }
+
+ return nullptr;
+}
+
} /* namespace libcamera */