Temporarily remove USB manufacturer/product info
I need to find a better way to obtain those infos.
This commit is contained in:
@@ -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.
|
||||
|
||||
20
usb_linux.go
20
usb_linux.go
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user