summaryrefslogtreecommitdiffstats
path: root/src/sysinfo.cpp
diff options
context:
space:
mode:
authorNiklas Goby2011-04-12 14:58:37 +0200
committerNiklas Goby2011-04-12 14:58:37 +0200
commitbc9fed6cbd13aa1b9172cbbcc5912c343c250af8 (patch)
tree928407400894166fda8a0fa2aa1b54c8e93122c7 /src/sysinfo.cpp
parentstarted inline documentation (diff)
downloadfbgui-bc9fed6cbd13aa1b9172cbbcc5912c343c250af8.tar.gz
fbgui-bc9fed6cbd13aa1b9172cbbcc5912c343c250af8.tar.xz
fbgui-bc9fed6cbd13aa1b9172cbbcc5912c343c250af8.zip
changes in the method getVendorProductSerialNumber() in class sysInfo
now we can see the product name and the manufacturer as well TOTO:: determine a usb flash drive / stick cause until now we get informations about every usb device which is connected to the client pc
Diffstat (limited to 'src/sysinfo.cpp')
-rw-r--r--src/sysinfo.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/sysinfo.cpp b/src/sysinfo.cpp
index af649ed..135db11 100644
--- a/src/sysinfo.cpp
+++ b/src/sysinfo.cpp
@@ -140,8 +140,8 @@ const QString SysInfo::getUsbVendorIdProductIdSerialNumber()
qxtLog->debug()<< tag + "failed to get device descriptor";
return "error";
}
- infos.insert("vendorId",QString(desc.idVendor));
- infos.insert("productId",QString(desc.idProduct));
+ infos.insert("vendorId",desc.idVendor);
+ infos.insert("productId",desc.idProduct);
unsigned char string[256];
libusb_device_handle *handle;
re = libusb_open(dev, &handle);
@@ -155,6 +155,19 @@ const QString SysInfo::getUsbVendorIdProductIdSerialNumber()
return "error";
}
infos.insert("serialnumber",QString((const char *)string));
+ re = libusb_get_string_descriptor_ascii(handle,desc.iProduct, string, sizeof(string));
+ if (re < 0) {
+ qxtLog->debug()<< tag + "failed to get Product";
+ return "error";
+ }
+ infos.insert("product",QString((const char *)string));
+ re = libusb_get_string_descriptor_ascii(handle,desc.iManufacturer, string, sizeof(string));
+ if (re < 0) {
+ qxtLog->debug()<< tag + "failed to get Product";
+ return "error";
+ }
+ infos.insert("manuacturer",QString((const char *)string));
+
list << infos;
libusb_close(handle);
}
@@ -162,6 +175,7 @@ const QString SysInfo::getUsbVendorIdProductIdSerialNumber()
libusb_exit(ctx); //close the session
QByteArray json = serializer.serialize(list);
+ qxtLog->debug()<< tag + "json object: " + json;
return json;
}