aboutsummaryrefslogtreecommitdiff
path: root/robo.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-05-16 18:56:01 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-05-16 18:56:01 +0200
commitd421ff27df0ad189bbd245ec3000eea5d8030da8 (patch)
tree00e8e42ea9d1937a8f337b7166faad57113cfdcc /robo.go
parent8b10757e325f8c3247afa830fa4a456041688ade (diff)
Generalize return string cmd
Diffstat (limited to 'robo.go')
-rw-r--r--robo.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/robo.go b/robo.go
index d7757ce..c705020 100644
--- a/robo.go
+++ b/robo.go
@@ -126,11 +126,6 @@ func Raw(c *bufio.Writer, a ...interface{}) {
}
}
-func Version(c *bufio.ReadWriter) string {
- send(c.Writer, "FG")
- return recv(c.Reader)
-}
-
func GoHome(c *bufio.Writer) { send(c, "TT") }
func Home(c *bufio.Writer) { send(c, "H") }
func Origin(c *bufio.Writer) { send(c, "FJ") }
@@ -147,9 +142,16 @@ func Calibration(c *bufio.ReadWriter) Point { return point(c, "TB71") }
func Offset(c *bufio.ReadWriter) Point { return point(c, "?") }
func LowerLeft(c *bufio.ReadWriter) Point { return point(c, "[") }
func UpperRight(c *bufio.ReadWriter) Point { return point(c, "U") }
-func StatusWord(c *bufio.ReadWriter) Point { return point(c, "@") }
func DistanceCorrection(c *bufio.ReadWriter) Point { return point(c, "FA") }
+func str(c *bufio.ReadWriter, cmd string) string {
+ send(c.Writer, cmd)
+ return recv(c.Reader)
+}
+
+func Version(c *bufio.ReadWriter) string { return str(c, "FG") }
+func StatusWord(c *bufio.ReadWriter) string { return str(c, "@") }
+
type Orientation int
const (