diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 0000000..13566b8
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
diff --git a/.idea/go-scsupdate.iml b/.idea/go-scsupdate.iml
new file mode 100644
index 0000000..5e764c4
--- /dev/null
+++ b/.idea/go-scsupdate.iml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..20d488e
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go.mod b/go.mod
new file mode 100644
index 0000000..0e0dfd9
--- /dev/null
+++ b/go.mod
@@ -0,0 +1,5 @@
+module go-scsupdate
+
+go 1.17
+
+require github.com/google/gousb v1.1.1
diff --git a/go.sum b/go.sum
new file mode 100644
index 0000000..1e79240
--- /dev/null
+++ b/go.sum
@@ -0,0 +1,2 @@
+github.com/google/gousb v1.1.1 h1:2sjwXlc0PIBgDnXtNxUrHcD/RRFOmAtRq4QgnFBE6xc=
+github.com/google/gousb v1.1.1/go.mod h1:b3uU8itc6dHElt063KJobuVtcKHWEfFOysOqBNzHhLY=
diff --git a/main.go b/main.go
new file mode 100644
index 0000000..c46fc26
--- /dev/null
+++ b/main.go
@@ -0,0 +1,5 @@
+package main
+
+func main() {
+ lsusb()
+}
diff --git a/usb.go b/usb.go
new file mode 100644
index 0000000..81c5122
--- /dev/null
+++ b/usb.go
@@ -0,0 +1,54 @@
+package main
+
+import (
+ "fmt"
+ "log"
+
+ "github.com/google/gousb"
+ "github.com/google/gousb/usbid"
+)
+
+/*
+ USB Product IDs of the SCS devices:
+ 0xD010 SCS PTC-IIusb
+ 0xD011 SCS Tracker / DSP TNC
+ 0xD012 SCS P4dragon DR-7800
+ 0xD013 SCS P4dragon DR-7400
+ 0xD014 - not used
+ 0xD015 SCS PTC-IIIusb
+ 0xD016 - not used
+ 0xD017 - not used
+*/
+
+func lsusb() {
+ // Only one context should be needed for an application. It should always be closed.
+ ctx := gousb.NewContext()
+ defer ctx.Close()
+
+ // OpenDevices is used to find the devices to open.
+ devs, err := ctx.OpenDevices(func(desc *gousb.DeviceDesc) bool {
+ // The usbid package can be used to print out human readable information.
+ fmt.Printf("%03d.%03d %s:%s %s\n", desc.Bus, desc.Address, desc.Vendor, desc.Product, usbid.Describe(desc))
+ fmt.Printf(" Protocol: %s\n", usbid.Classify(desc))
+ fmt.Println(desc.Configs)
+ return false
+ })
+
+ // All Devices returned from OpenDevices must be closed.
+ defer func() {
+ for _, d := range devs {
+ d.Close()
+ }
+ }()
+
+ // OpenDevices can occasionally fail, so be sure to check its return value.
+ if err != nil {
+ log.Fatalf("list: %s", err)
+ }
+
+ for _, dev := range devs {
+ // Once the device has been selected from OpenDevices, it is opened
+ // and can be interacted with.
+ _ = dev
+ }
+}