summaryrefslogtreecommitdiff
path: root/backend/genesys/usb_device.cpp
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2020-08-24 18:45:34 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2020-08-24 18:45:34 +0200
commit2b3e02411ecc09e7d41741b5587655c9b2f955b7 (patch)
treed839746371ecb8ed64ac81d2e37c11fcd25a00ac /backend/genesys/usb_device.cpp
parent787fb1d54ec9ee5fb941ae897fb201feb9cb2fd1 (diff)
parentad38bc6ecb80ddeb562841b33258dd53659b1da6 (diff)
Update upstream source from tag 'upstream/1.0.31'
Update to upstream version '1.0.31' with Debian dir aa7a39fe56343f5e164eec83783f4c923a394865
Diffstat (limited to 'backend/genesys/usb_device.cpp')
-rw-r--r--backend/genesys/usb_device.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/backend/genesys/usb_device.cpp b/backend/genesys/usb_device.cpp
index 2d02219..d6cbaed 100644
--- a/backend/genesys/usb_device.cpp
+++ b/backend/genesys/usb_device.cpp
@@ -101,11 +101,33 @@ void UsbDevice::close()
sanei_usb_close(device_num);
}
-void UsbDevice::get_vendor_product(int& vendor, int& product)
+std::uint16_t UsbDevice::get_vendor_id()
{
DBG_HELPER(dbg);
assert_is_open();
+ int vendor = 0;
+ int product = 0;
TIE(sanei_usb_get_vendor_product(device_num_, &vendor, &product));
+ return static_cast<std::uint16_t>(vendor);
+}
+
+std::uint16_t UsbDevice::get_product_id()
+{
+ DBG_HELPER(dbg);
+ assert_is_open();
+ int vendor = 0;
+ int product = 0;
+ TIE(sanei_usb_get_vendor_product(device_num_, &vendor, &product));
+ return static_cast<std::uint16_t>(product);
+}
+
+std::uint16_t UsbDevice::get_bcd_device()
+{
+ DBG_HELPER(dbg);
+ assert_is_open();
+ sanei_usb_dev_descriptor desc;
+ TIE(sanei_usb_get_descriptor(device_num_, &desc));
+ return desc.bcd_dev;
}
void UsbDevice::control_msg(int rtype, int reg, int value, int index, int length,