@ -4,7 +4,7 @@ import threading
import serial
class Serial(object):
self._callbacks = dict()
_callbacks = dict()
def __init__(self, devicename='/dev/ttyUSB0', baudrate=115200):
self.devicename = devicename
@ -50,6 +50,7 @@ class Serial(object):
print(data)
command = data[0]
argument = data[2:]
if command in data:
cb = self._callbacks[command]
if cb:
cb(argument)