From 8b10757e325f8c3247afa830fa4a456041688ade Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sat, 16 May 2015 18:47:15 +0200 Subject: Adjust easteregg, add Raw command --- easteregg.go | 9 ++++----- robo.go | 6 ++++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/easteregg.go b/easteregg.go index f7f5adf..64800b7 100644 --- a/easteregg.go +++ b/easteregg.go @@ -1,5 +1,7 @@ package robo +import "bufio" + // found in firmware V2.30 var easteregg = []string{ `FU5440,4000`, @@ -321,9 +323,6 @@ var easteregg = []string{ `FO0`, } -func (c Cutter) EasterEgg() { - for _, cmd := range easteregg { - c.Send(cmd) - c.Wait() - } +func EasterEgg(c *bufio.Writer) { + Raw(c, easteregg) } diff --git a/robo.go b/robo.go index 2344a50..d7757ce 100644 --- a/robo.go +++ b/robo.go @@ -120,6 +120,12 @@ func send(c *bufio.Writer, a ...interface{}) { etx(c) } +func Raw(c *bufio.Writer, a ...interface{}) { + for _, cmd := range a { + send(c, cmd) + } +} + func Version(c *bufio.ReadWriter) string { send(c.Writer, "FG") return recv(c.Reader) -- cgit v1.2.3