Browse Source

Merge branch 'reader-tweaks'

pyserial_fix
Scott Petersen 11 years ago
parent
commit
edcd5a09e0
2 changed files with 8 additions and 8 deletions
  1. +2
    -2
      pyad2usb/ad2usb.py
  2. +6
    -6
      pyad2usb/devices.py

+ 2
- 2
pyad2usb/ad2usb.py View File

@@ -188,12 +188,12 @@ class AD2USB(object):
""" """
pass pass


def open(self, baudrate=None, interface=None, index=None, no_read_thread=False):
def open(self, baudrate=None, interface=None, index=None, no_reader_thread=False):
""" """
Opens the device. Opens the device.
""" """
self._wire_events() self._wire_events()
self._device.open(baudrate=baudrate, interface=interface, index=index, no_read_thread=no_read_thread)
self._device.open(baudrate=baudrate, interface=interface, index=index, no_reader_thread=no_reader_thread)


def close(self): def close(self):
""" """


+ 6
- 6
pyad2usb/devices.py View File

@@ -110,7 +110,7 @@ class USBDevice(Device):


self._read_thread = Device.ReadThread(self) self._read_thread = Device.ReadThread(self)


def open(self, baudrate=BAUDRATE, interface=None, index=0, no_read_thread=False):
def open(self, baudrate=BAUDRATE, interface=None, index=0, no_reader_thread=False):
""" """
Opens the device. Opens the device.
""" """
@@ -143,7 +143,7 @@ class USBDevice(Device):
raise util.CommError('Error opening AD2USB device: {0}'.format(str(err))) raise util.CommError('Error opening AD2USB device: {0}'.format(str(err)))
else: else:
self._running = True self._running = True
if not no_read_thread:
if not no_reader_thread:
self._read_thread.start() self._read_thread.start()


self.on_open((self._serial_number, self._description)) self.on_open((self._serial_number, self._description))
@@ -273,7 +273,7 @@ class SerialDevice(Device):
""" """
pass pass


def open(self, baudrate=BAUDRATE, interface=None, index=None, no_read_thread=False):
def open(self, baudrate=BAUDRATE, interface=None, index=None, no_reader_thread=False):
""" """
Opens the device. Opens the device.
""" """
@@ -301,7 +301,7 @@ class SerialDevice(Device):
self._running = True self._running = True
self.on_open((None, "AD2SERIAL")) # TODO: Fixme. self.on_open((None, "AD2SERIAL")) # TODO: Fixme.


if not no_read_thread:
if not no_reader_thread:
self._read_thread.start() self._read_thread.start()


def close(self): def close(self):
@@ -412,7 +412,7 @@ class SocketDevice(Device):
""" """
pass pass


def open(self, baudrate=None, interface=None, index=0, no_read_thread=False):
def open(self, baudrate=None, interface=None, index=0, no_reader_thread=False):
""" """
Opens the device. Opens the device.
""" """
@@ -431,7 +431,7 @@ class SocketDevice(Device):


self.on_open((None, "AD2SOCKET")) # TEMP: Change me. self.on_open((None, "AD2SOCKET")) # TEMP: Change me.


if not no_read_thread:
if not no_reader_thread:
self._read_thread.start() self._read_thread.start()


def close(self): def close(self):


Loading…
Cancel
Save