Browse Source

Documentation fixes.

pyserial_fix
Scott Petersen 11 years ago
parent
commit
02f803ea84
2 changed files with 16 additions and 6 deletions
  1. +14
    -4
      pyad2/ad2.py
  2. +2
    -2
      pyad2/devices.py

+ 14
- 4
pyad2/ad2.py View File

@@ -257,10 +257,6 @@ class AD2(object):


:param baudrate: The baudrate used for the device. :param baudrate: The baudrate used for the device.
:type baudrate: int :type baudrate: int
:param interface: The interface used for the device.
:type interface: varies depends on device type.. FIXME
:param index: Interface index.. can probably remove. FIXME
:type index: int
:param no_reader_thread: Specifies whether or not the automatic reader thread should be started or not :param no_reader_thread: Specifies whether or not the automatic reader thread should be started or not
:type no_reader_thread: bool :type no_reader_thread: bool
""" """
@@ -278,6 +274,12 @@ class AD2(object):
self._device = None self._device = None


def send(self, data): def send(self, data):
"""
Sends data to the AD2 device.

:param data: The data to send.
:type data: str
"""
if self._device: if self._device:
self._device.write(data) self._device.write(data)


@@ -404,6 +406,14 @@ class AD2(object):
return msg return msg


def _handle_rfx(self, data): def _handle_rfx(self, data):
"""
Handle RF messages.

:param data: RF message to parse.
:type data: str

:returns: An object representing the RF message.
"""
msg = RFMessage(data) msg = RFMessage(data)


self.on_rfx_message(msg) self.on_rfx_message(msg)


+ 2
- 2
pyad2/devices.py View File

@@ -223,7 +223,7 @@ class USBDevice(Device):
""" """
Constructor Constructor


:param interface: Tuple containing the device number and endpoint number to use.
:param interface: Tuple containing the serial number and endpoint number to use.
:type interface: tuple :type interface: tuple
""" """
Device.__init__(self) Device.__init__(self)
@@ -629,7 +629,7 @@ class SocketDevice(Device):
""" """
Sets the interface used to connect to the device. Sets the interface used to connect to the device.


:param value: Tuple containing the device number and endpoint number to use.
:param value: Tuple containing the host and port to use.
:type value: tuple :type value: tuple
""" """
self._host = value[0] self._host = value[0]


Loading…
Cancel
Save