Package twisted :: Package internet :: Package serialport :: Module posixserialport :: Class SerialPort |
[frames | no frames]

## Class SerialPort

    BaseSerialPort --+
                     |
     Ephemeral --+   |
                 |   |
        Logger --+   |
                 |   |
    FileDescriptor --+
                     |
                    SerialPort

A select()able serial device, acting as a transport.

Method Summary
| `__init__(self, protocol, deviceNameOrPortNumber, reactor, baudrate, bytesize, parity, stopbits, timeout, xonxoff, rtscts)`
| ``connectionLost`(self, reason)` The connection was lost.
| ``doRead`(self)` Some data's readable from serial device.
| ``fileno`(self)` File Descriptor number for select().
| ``writeSomeData`(self, data)` Write some data to the serial device.
Inherited from BaseSerialPort
| ``flushInput`(self)`
| ``flushOutput`(self)`
| ``getCD`(self)`
| ``getCTS`(self)`
| ``getDSR`(self)`
| ``getRI`(self)`
| ``inWaiting`(self)`
| ``sendBreak`(self)`
| ``setBaudRate`(self, baudrate)`
| ``setDTR`(self, on)`
| ``setRTS`(self, on)`
Inherited from FileDescriptor
| ``_postLoseConnection`(self)` Called after a loseConnection(), when all data has been written.
| ``doWrite`(self)` Called when data is available for writing.
| ``loseConnection`(self)` Close the connection at the next available opportunity.
| ``pauseProducing`(self)`
| ``registerProducer`(self, producer, streaming)` Register to receive data from a producer.
| ``resumeProducing`(self)`
| ``startReading`(self)` Start waiting for read availability.
| ``startWriting`(self)` Start waiting for write availability.
| ``stopConsuming`(self)` Stop consuming data.
| ``stopProducing`(self)`
| ``stopReading`(self)` Stop waiting for read availability.
| ``stopWriting`(self)` Stop waiting for write availability.
| ``unregisterProducer`(self)` Stop consuming data from a producer, without disconnecting.
| ``write`(self, data)` Reliably write some data.
| ``writeSequence`(self, iovec)`
Inherited from Logger
| ``logPrefix`(self)` Override this method to insert custom logging behavior.
Inherited from Ephemeral
| ``__getstate__`(self)`
| ``__setstate__`(self, state)`

Class Variable Summary
`int` | `connected` = 1
Inherited from FileDescriptor
`tuple` | `__implements__` = `(<class twisted.internet.interfaces.IPr...`
`int` | `bufferSize` = 65536
`str` | `dataBuffer` = `''`
`int` | `disconnected` = 0
`int` | `disconnecting` = 0
`int` | `offset` = 0
`NoneType` | `producer` = None
`int` | `producerPaused` = 0
`int` | `streamingProducer` = 0

Method Details

### connectionLost(self, reason) The connection was lost. This is called when the connection on a selectable object has been lost. It will be called whether the connection was closed explicitly, an exception occurred in an event handler, or the other end of the connection closed it first. Clean up state here, but make sure to call back up to FileDescriptor. Overrides: `twisted.internet.abstract.FileDescriptor.connectionLost` (inherited documentation)

### doRead(self) Some data's readable from serial device.

### fileno(self) File Descriptor number for select(). This method must be overridden or assigned in subclasses to indicate a valid file descriptor for the operating system. Overrides: `twisted.internet.abstract.FileDescriptor.fileno` (inherited documentation)

### writeSomeData(self, data) Write some data to the serial device. Overrides: `twisted.internet.abstract.FileDescriptor.writeSomeData`

Class Variable Details

    ### connected Type: `int` Value:
        1

Generated by Epydoc 2.0 on Sat Oct 25 00:55:04 2003 | http://epydoc.sf.net