|
@ -49,12 +49,12 @@ class Serial(object): |
|
|
if data: |
|
|
if data: |
|
|
print(data) |
|
|
print(data) |
|
|
command = data[0] |
|
|
command = data[0] |
|
|
argument = data[2:] |
|
|
argument = data[2:].strip() |
|
|
if command in data: |
|
|
if isalnum(command) and command in self._callbacks: |
|
|
cb = self._callbacks[command] |
|
|
cb = self._callbacks[command] |
|
|
if cb: |
|
|
if cb: |
|
|
cb(argument) |
|
|
cb(argument) |
|
|
|
|
|
|
|
|
except serial.SerialException: |
|
|
except serial.SerialException: |
|
|
pass |
|
|
pass |
|
|
#self.alive = False |
|
|
#self.alive = False |
|
|