Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
7063de6
wip: start supporting boards with iConfiguration field
facchinm Apr 17, 2026
3b593d8
darwin: implement iConfiguration retrieve
facchinm Apr 20, 2026
c97a88e
windows: implement iConfiguration retrieve
facchinm Apr 20, 2026
524cfb5
Removed constants now present in x/sys
cmaglie May 13, 2026
a1619e7
Use windows.GUID instead of handmade guid struct
cmaglie May 13, 2026
fe1a23e
Use setupapi.SetupDiClassGuidsFromName from x/sys package.
cmaglie May 13, 2026
5b05858
Use windows.DEVINST instead of custom type
cmaglie May 13, 2026
041d570
Use windows.DevInfo instead of internal implementation
cmaglie May 13, 2026
2086dcb
Use windows.DevInfoData instead of internal implementation
cmaglie May 13, 2026
3e1c30d
Use windows.SetupDiGetDeviceInstanceId instead of internal implementa…
cmaglie May 13, 2026
bc1648a
Simplified initialization
cmaglie May 13, 2026
3a2a676
Some code move, no functional changes
cmaglie May 14, 2026
1d9a621
windows: Added USB iManufacturer and iProduct support
cmaglie May 14, 2026
fecd106
windows: refactoring code to make USB search more straighforward
cmaglie May 14, 2026
ce3f1af
linux: Added iManufacturer and iProduct
cmaglie May 14, 2026
cb07293
Convert most of the C code into go.
cmaglie May 15, 2026
9699dbf
Fix memory leak of device handlers not released
cmaglie May 15, 2026
11ec9d1
Fix memory leak of device handlers not released in case of error
cmaglie May 15, 2026
acc7e2f
Updated docs
cmaglie May 15, 2026
2e187de
Updated examples
cmaglie May 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions enumerator/enumerator.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,21 @@ package enumerator
// PortDetails contains detailed information about USB serial port.
// Use GetDetailedPortsList function to retrieve it.
type PortDetails struct {
Name string
IsUSB bool
VID string
PID string
// Name is the port address, like COM1 on Windows or /dev/ttyUSB0 on Linux.
Name string
// IsUSB is true if the port is a USB serial port, false otherwise.
IsUSB bool
// VID is the USB Vendor ID, when available.
VID string
// PID is the USB Product ID, when available.
PID string
// SerialNumber is the USB serial number, when available.
SerialNumber string

// Manufacturer string

// Product is an OS-dependent string that describes the serial port, it may
// be not always available and it may be different across OS.
// Configuration is the USB configuration string, when available.
Configuration string
// Manufacturer is the USB iManufacturer string, when available.
Manufacturer string
// Product is the USB iProduct string, when available.
Product string
}

Expand Down
3 changes: 3 additions & 0 deletions enumerator/example_getdetailedportlist_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ func ExampleGetDetailedPortsList() {
fmt.Printf("Found port: %s\n", port.Name)
if port.IsUSB {
fmt.Printf(" USB ID %s:%s\n", port.VID, port.PID)
fmt.Printf(" USB vendor %s\n", port.Manufacturer)
fmt.Printf(" USB prod. %s\n", port.Product)
fmt.Printf(" USB serial %s\n", port.SerialNumber)
fmt.Printf(" USB config %s\n", port.Configuration)
}
}
}
136 changes: 42 additions & 94 deletions enumerator/syscall_windows.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading