diff --git a/bufferflow.go b/bufferflow.go index 8f17cf592..07d34698b 100644 --- a/bufferflow.go +++ b/bufferflow.go @@ -2,7 +2,6 @@ package main type Bufferflow interface { Init() - BlockUntilReady(cmd string, id string) (bool, bool) // implement this method - OnIncomingData(data string) // implement this method - Close() // implement this method + OnIncomingData(data string) // implement this method + Close() // implement this method } diff --git a/bufferflow_default.go b/bufferflow_default.go index 715c9443e..2d6d6d281 100644 --- a/bufferflow_default.go +++ b/bufferflow_default.go @@ -42,11 +42,6 @@ Loop: close(b.input) // close the input channel at the end of the computation } -func (b *BufferflowDefault) BlockUntilReady(cmd string, id string) (bool, bool) { - //log.Printf("BlockUntilReady() start\n") - return true, false -} - func (b *BufferflowDefault) OnIncomingData(data string) { b.input <- data } diff --git a/bufferflow_timed.go b/bufferflow_timed.go index d1950775c..b89427f37 100644 --- a/bufferflow_timed.go +++ b/bufferflow_timed.go @@ -57,11 +57,6 @@ Loop: close(b.input) } -func (b *BufferflowTimed) BlockUntilReady(cmd string, id string) (bool, bool) { - //log.Printf("BlockUntilReady() start\n") - return true, false -} - func (b *BufferflowTimed) OnIncomingData(data string) { b.input <- data } diff --git a/bufferflow_timedraw.go b/bufferflow_timedraw.go index 20a2a0b8b..ab238bfe8 100644 --- a/bufferflow_timedraw.go +++ b/bufferflow_timedraw.go @@ -58,11 +58,6 @@ Loop: close(b.input) } -func (b *BufferflowTimedRaw) BlockUntilReady(cmd string, id string) (bool, bool) { - //log.Printf("BlockUntilReady() start\n") - return true, false -} - func (b *BufferflowTimedRaw) OnIncomingData(data string) { b.input <- data } diff --git a/serialport.go b/serialport.go index f29d90dee..b427e1d2e 100755 --- a/serialport.go +++ b/serialport.go @@ -174,18 +174,10 @@ func (p *serport) writerBuffered() { // sees something come in for data := range p.sendBuffered { - // we want to block here if we are being asked to pause. - goodToGo, _ := p.bufferwatcher.BlockUntilReady(string(data), "") - - if goodToGo == false { - log.Println("We got back from BlockUntilReady() but apparently we must cancel this cmd") - // since we won't get a buffer decrement in p.sendNoBuf, we must do it here - p.itemsInBuffer-- - } else { - // send to the non-buffered serial port writer - //log.Println("About to send to p.sendNoBuf channel") - p.sendNoBuf <- []byte(data) - } + // send to the non-buffered serial port writer + //log.Println("About to send to p.sendNoBuf channel") + p.sendNoBuf <- []byte(data) + } msgstr := "writerBuffered just got closed. make sure you make a new one. port:" + p.portConf.Name log.Println(msgstr) @@ -249,17 +241,9 @@ func (p *serport) writerRaw() { } log.Println(string(sDec)) - // we want to block here if we are being asked to pause. - goodToGo, _ := p.bufferwatcher.BlockUntilReady(string(data), "") + // send to the non-buffered serial port writer + p.sendNoBuf <- sDec - if goodToGo == false { - log.Println("We got back from BlockUntilReady() but apparently we must cancel this cmd") - // since we won't get a buffer decrement in p.sendNoBuf, we must do it here - p.itemsInBuffer-- - } else { - // send to the non-buffered serial port writer - p.sendNoBuf <- sDec - } } msgstr := "writerRaw just got closed. make sure you make a new one. port:" + p.portConf.Name log.Println(msgstr)