diff options
author | Dimitri Sokolyuk <demon@dim13.org> | 2015-05-16 18:56:01 +0200 |
---|---|---|
committer | Dimitri Sokolyuk <demon@dim13.org> | 2015-05-16 18:56:01 +0200 |
commit | d421ff27df0ad189bbd245ec3000eea5d8030da8 (patch) | |
tree | 00e8e42ea9d1937a8f337b7166faad57113cfdcc /robo.go | |
parent | 8b10757e325f8c3247afa830fa4a456041688ade (diff) |
Generalize return string cmd
Diffstat (limited to 'robo.go')
-rw-r--r-- | robo.go | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -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 ( |