Fix USB class/subclass IDs on darwin (#4363)

This commit is contained in:
barn-stripe 2018-05-03 13:56:04 -07:00 committed by Filipe Manco
parent 81751e5526
commit 2e72f9f20a

View File

@ -51,6 +51,9 @@ void genUSBDevice(const io_service_t& device, QueryData& results) {
r["vendor_id"] = getIOKitProperty(details, "idVendor");
r["version"] = decodeUSBBCD(getNumIOKitProperty(details, "bcdDevice"));
r["class"] = std::to_string(getNumIOKitProperty(details, "bDeviceClass") & 0xFF);
r["subclass"] = std::to_string(getNumIOKitProperty(details, "bDeviceSubClass") & 0xFF);
r["serial"] = getIOKitProperty(details, "USB Serial Number");
if (r.at("serial").size() == 0) {
r["serial"] = getIOKitProperty(details, "iSerialNumber");