Browse Source

Bit of cleanup

pyserial_fix
Scott Petersen 11 years ago
parent
commit
260a59151b
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      pyad2usb/devices.py

+ 4
- 2
pyad2usb/devices.py View File

@@ -437,7 +437,7 @@ class SocketDevice(Device):
"""
Stops the reader thread.
"""
self._read_thread.stop() # TODO: make this actually work with socket code.
self._read_thread.stop()

def write(self, data):
"""
@@ -450,6 +450,8 @@ class SocketDevice(Device):
else:
self.on_write(data)

return data_sent

def read(self):
"""
Reads a single character from the device.
@@ -468,7 +470,7 @@ class SocketDevice(Device):
while self._running:
buf = self._socket.recv(1)

if buf != '': # AD2SERIAL specifically apparently sends down \xFF on boot.
if buf != '':
self._buffer += buf

if buf == "\n":


Loading…
Cancel
Save