Temporarily remove USB manufacturer/product info

I need to find a better way to obtain those infos.
This commit is contained in:
Cristian Maglie
2016-12-11 23:46:15 +01:00
parent 3d6dd00ccb
commit 5769f96804
3 changed files with 14 additions and 13 deletions

View File

@@ -63,8 +63,9 @@ type PortDetails struct {
VID string
PID string
SerialNumber string
Manufacturer string
Product string
// Manufacturer string
// Product string
}
// GetDetailedPortsList retrieve ports details like USB VID/PID.

View File

@@ -74,21 +74,21 @@ func parseUSBSysFS(usbDevicePath string, details *PortDetails) error {
if err != nil {
return err
}
manufacturer, err := readLine(filepath.Join(usbDevicePath, "manufacturer"))
if err != nil {
return err
}
product, err := readLine(filepath.Join(usbDevicePath, "product"))
if err != nil {
return err
}
//manufacturer, err := readLine(filepath.Join(usbDevicePath, "manufacturer"))
//if err != nil {
// return err
//}
//product, err := readLine(filepath.Join(usbDevicePath, "product"))
//if err != nil {
// return err
//}
details.IsUSB = true
details.VID = vid
details.PID = pid
details.SerialNumber = serial
details.Manufacturer = manufacturer
details.Product = product
//details.Manufacturer = manufacturer
//details.Product = product
return nil
}

View File

@@ -295,7 +295,7 @@ func retrievePortDetailsFromDevInfo(device *deviceInfo, details *PortDetails) er
friendlyNameP := (*byte)(unsafe.Pointer(&friendlyName[0]))
friendlyNameSize := uint32(len(friendlyName) * 2)
if setupDiGetDeviceRegistryProperty(device.set, &device.data, spdrpDeviceDesc /* spdrpFriendlyName */, nil, friendlyNameP, &friendlyNameSize, nil) {
details.Product = syscall.UTF16ToString(friendlyName[:])
//details.Product = syscall.UTF16ToString(friendlyName[:])
}
return nil