aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-09-24 03:18:42 +0200
committerDimitri Sokolyuk <demon@dim13.org>2016-09-24 03:18:42 +0200
commit90716ee069dd0f400a60896ae438c13745531dba (patch)
tree5bf872ed23f0454eb4f9c47523107b7f0ac73b35
parenta3a737d8102107cb30fa129c5b85ff17f89908f7 (diff)
rename files
-rw-r--r--dev.go (renamed from lp.go)0
-rw-r--r--dev_darwin.go (renamed from usb_darwin.go)4
-rw-r--r--dev_linux.go7
-rw-r--r--dev_openbsd.go8
-rw-r--r--device.go7
-rw-r--r--device_darwin.go5
-rw-r--r--device_linux.go5
-rw-r--r--device_openbsd.go6
8 files changed, 19 insertions, 23 deletions
diff --git a/lp.go b/dev.go
index b10ba2a..b10ba2a 100644
--- a/lp.go
+++ b/dev.go
diff --git a/usb_darwin.go b/dev_darwin.go
index e0b1503..9363dc9 100644
--- a/usb_darwin.go
+++ b/dev_darwin.go
@@ -7,6 +7,10 @@ import (
"github.com/kylelemons/gousb/usb"
)
+func Open() (io.ReadWriteCloser, error) {
+ return NewUSB()
+}
+
type USB struct {
ctx *usb.Context
dev *usb.Device
diff --git a/dev_linux.go b/dev_linux.go
new file mode 100644
index 0000000..66cb3f1
--- /dev/null
+++ b/dev_linux.go
@@ -0,0 +1,7 @@
+package robo
+
+import "io"
+
+func Open() (io.ReadWriteCloser, error) {
+ return NewLP("/dev/usb/lp0")
+}
diff --git a/dev_openbsd.go b/dev_openbsd.go
new file mode 100644
index 0000000..cb35e8e
--- /dev/null
+++ b/dev_openbsd.go
@@ -0,0 +1,8 @@
+package robo
+
+import "io"
+
+func Open() (io.ReadWriteCloser, error) {
+ // note: ulpt* doesn't support read(), thus this dev is broken atm.
+ return NewLP("/dev/ulpt0")
+}
diff --git a/device.go b/device.go
deleted file mode 100644
index 001b8de..0000000
--- a/device.go
+++ /dev/null
@@ -1,7 +0,0 @@
-package robo
-
-import "io"
-
-type Device interface {
- io.ReadWriteCloser
-}
diff --git a/device_darwin.go b/device_darwin.go
deleted file mode 100644
index f0fcf45..0000000
--- a/device_darwin.go
+++ /dev/null
@@ -1,5 +0,0 @@
-package robo
-
-func Open() (Device, error) {
- return NewUSB()
-}
diff --git a/device_linux.go b/device_linux.go
deleted file mode 100644
index 66ab472..0000000
--- a/device_linux.go
+++ /dev/null
@@ -1,5 +0,0 @@
-package robo
-
-func Open() (Device, error) {
- return NewLP("/dev/usb/lp0")
-}
diff --git a/device_openbsd.go b/device_openbsd.go
deleted file mode 100644
index 8621b4e..0000000
--- a/device_openbsd.go
+++ /dev/null
@@ -1,6 +0,0 @@
-// note: ulpt* doesn't support read(), thus this dev is broken atm.
-package robo
-
-func Open() (Device, error) {
- return NewLP("/dev/ulpt0")
-}