Skip to content

Commit

Permalink
remove timedbinary: it's the same as timedraw except for the casting
Browse files Browse the repository at this point in the history
  • Loading branch information
umbynos committed Aug 5, 2021
1 parent 37cf997 commit 724de59
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 88 deletions.
75 changes: 0 additions & 75 deletions bufferflow_timedbinary.go

This file was deleted.

4 changes: 1 addition & 3 deletions serialport.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func (p *serport) reader(buftype string) {

data := ""
switch buftype {
case "timedraw", "timed", "timedbinary":
case "timedraw", "timed":
data = string(bufferPart[:n])
// give the data to our bufferflow so it can do it's work
// to read/translate the data to see if it wants to block
Expand Down Expand Up @@ -301,8 +301,6 @@ func spHandlerOpen(portname string, baud int, buftype string) {
bw = NewBufferflowTimed(portname, h.broadcastSys)
case "timedraw":
bw = NewBufferflowTimedRaw(portname, h.broadcastSys)
case "timedbinary":
bw = NewBufferflowTimedBinary(portname, h.broadcastSys)
case "default":
bw = NewBufferflowDefault(portname, h.broadcastSys)
default:
Expand Down
12 changes: 2 additions & 10 deletions test/test_ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,6 @@ def test_open_serial_timedraw(socketio):
general_test_serial(socketio, "timedraw")


@pytest.mark.skipif(
running_on_ci(),
reason="VMs have no serial ports",
)
def test_open_serial_timedbinary(socketio):
general_test_serial(socketio, "timedbinary")


def general_test_serial(socketio, buffertype):
port = "/dev/ttyACM0"
global message
Expand All @@ -75,7 +67,7 @@ def general_test_serial(socketio, buffertype):
# check if the send command has been registered
assert any("send " + port + " /\"ciao/\"" in i for i in message)
#check if message has been sent back by the connected board
if buffertype in ("timedbinary", "timedraw"):
if buffertype == "timedraw":
output = decode_output(extract_serial_data(message))
elif buffertype in ("default", "timed"):
output = extract_serial_data(message)
Expand All @@ -89,7 +81,7 @@ def general_test_serial(socketio, buffertype):
print(message)
# check if the send command has been registered
assert any("send " + port + " /\"πŸ§€πŸ§€πŸ§€πŸ§€πŸ§€πŸ§€πŸ§€πŸ§€πŸ§€πŸ§€/\"" in i for i in message)
if buffertype in ("timedbinary", "timedraw"):
if buffertype == "timedraw":
output = decode_output(extract_serial_data(message))
elif buffertype in ("default", "timed"):
output = extract_serial_data(message)
Expand Down

0 comments on commit 724de59

Please sign in to comment.