Skip to content

Commit a21ae9e

Browse files
committed
remove BlockUntilReady because it was unused
1 parent a86a61a commit a21ae9e

5 files changed

+8
-40
lines changed

bufferflow.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package main
22

33
type Bufferflow interface {
44
Init()
5-
BlockUntilReady(cmd string, id string) (bool, bool) // implement this method
6-
OnIncomingData(data string) // implement this method
7-
Close() // implement this method
5+
OnIncomingData(data string) // implement this method
6+
Close() // implement this method
87
}

bufferflow_default.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ Loop:
4242
close(b.input) // close the input channel at the end of the computation
4343
}
4444

45-
func (b *BufferflowDefault) BlockUntilReady(cmd string, id string) (bool, bool) {
46-
//log.Printf("BlockUntilReady() start\n")
47-
return true, false
48-
}
49-
5045
func (b *BufferflowDefault) OnIncomingData(data string) {
5146
b.input <- data
5247
}

bufferflow_timed.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,6 @@ Loop:
5757
close(b.input)
5858
}
5959

60-
func (b *BufferflowTimed) BlockUntilReady(cmd string, id string) (bool, bool) {
61-
//log.Printf("BlockUntilReady() start\n")
62-
return true, false
63-
}
64-
6560
func (b *BufferflowTimed) OnIncomingData(data string) {
6661
b.input <- data
6762
}

bufferflow_timedraw.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,6 @@ Loop:
5858
close(b.input)
5959
}
6060

61-
func (b *BufferflowTimedRaw) BlockUntilReady(cmd string, id string) (bool, bool) {
62-
//log.Printf("BlockUntilReady() start\n")
63-
return true, false
64-
}
65-
6661
func (b *BufferflowTimedRaw) OnIncomingData(data string) {
6762
b.input <- data
6863
}

serialport.go

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -174,18 +174,10 @@ func (p *serport) writerBuffered() {
174174
// sees something come in
175175
for data := range p.sendBuffered {
176176

177-
// we want to block here if we are being asked to pause.
178-
goodToGo, _ := p.bufferwatcher.BlockUntilReady(string(data), "")
179-
180-
if goodToGo == false {
181-
log.Println("We got back from BlockUntilReady() but apparently we must cancel this cmd")
182-
// since we won't get a buffer decrement in p.sendNoBuf, we must do it here
183-
p.itemsInBuffer--
184-
} else {
185-
// send to the non-buffered serial port writer
186-
//log.Println("About to send to p.sendNoBuf channel")
187-
p.sendNoBuf <- []byte(data)
188-
}
177+
// send to the non-buffered serial port writer
178+
//log.Println("About to send to p.sendNoBuf channel")
179+
p.sendNoBuf <- []byte(data)
180+
189181
}
190182
msgstr := "writerBuffered just got closed. make sure you make a new one. port:" + p.portConf.Name
191183
log.Println(msgstr)
@@ -249,17 +241,9 @@ func (p *serport) writerRaw() {
249241
}
250242
log.Println(string(sDec))
251243

252-
// we want to block here if we are being asked to pause.
253-
goodToGo, _ := p.bufferwatcher.BlockUntilReady(string(data), "")
244+
// send to the non-buffered serial port writer
245+
p.sendNoBuf <- sDec
254246

255-
if goodToGo == false {
256-
log.Println("We got back from BlockUntilReady() but apparently we must cancel this cmd")
257-
// since we won't get a buffer decrement in p.sendNoBuf, we must do it here
258-
p.itemsInBuffer--
259-
} else {
260-
// send to the non-buffered serial port writer
261-
p.sendNoBuf <- sDec
262-
}
263247
}
264248
msgstr := "writerRaw just got closed. make sure you make a new one. port:" + p.portConf.Name
265249
log.Println(msgstr)

0 commit comments

Comments
 (0)