Package twisted :: Package internet :: Package serialport :: Module posixserialport :: Class SerialPort

[show private | hide private]
[frames | no frames]

## Class SerialPort

    BaseSerialPort --+
                     |
        Logger --+   |
                 |   |
     Ephemeral --+   |
                 |   |
    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)`
| `__getstate__(self)` (inherited from `Ephemeral`)
| `__setstate__(self, state)` (inherited from `Ephemeral`)
| ``connectionLost`(self, reason)` The connection was lost.
| ``doRead`(self)` Some data's readable from serial device.
| ``doWrite`(self)` Called when data is available for writing. (inherited from `FileDescriptor`)
| ``fileno`(self)` File Descriptor number for select().
| `flushInput(self)` (inherited from `BaseSerialPort`)
| `flushOutput(self)` (inherited from `BaseSerialPort`)
| `getCD(self)` (inherited from `BaseSerialPort`)
| `getCTS(self)` (inherited from `BaseSerialPort`)
| `getDSR(self)` (inherited from `BaseSerialPort`)
| `getRI(self)` (inherited from `BaseSerialPort`)
| `inWaiting(self)` (inherited from `BaseSerialPort`)
| ``logPrefix`(self)` Override this method to insert custom logging behavior. (inherited from `Logger`)
| ``loseConnection`(self)` Close the connection at the next available opportunity. (inherited from `FileDescriptor`)
| `pauseProducing(self)` (inherited from `FileDescriptor`)
| ``registerProducer`(self, producer, streaming)` Register to receive data from a producer. (inherited from `FileDescriptor`)
| `resumeProducing(self)` (inherited from `FileDescriptor`)
| `sendBreak(self)` (inherited from `BaseSerialPort`)
| `setBaudRate(self, baudrate)` (inherited from `BaseSerialPort`)
| `setDTR(self, on)` (inherited from `BaseSerialPort`)
| `setRTS(self, on)` (inherited from `BaseSerialPort`)
| ``startReading`(self)` Start waiting for read availability. (inherited from `FileDescriptor`)
| ``startWriting`(self)` Start waiting for write availability. (inherited from `FileDescriptor`)
| ``stopConsuming`(self)` Stop consuming data. (inherited from `FileDescriptor`)
| `stopProducing(self)` (inherited from `FileDescriptor`)
| ``stopReading`(self)` Stop waiting for read availability. (inherited from `FileDescriptor`)
| ``stopWriting`(self)` Stop waiting for write availability. (inherited from `FileDescriptor`)
| ``unregisterProducer`(self)` Stop consuming data from a producer, without disconnecting. (inherited from `FileDescriptor`)
| ``write`(self, data)` Reliably write some data. (inherited from `FileDescriptor`)
| `writeSequence(self, iovec)` (inherited from `FileDescriptor`)
| ``writeSomeData`(self, data)` Write some data to the serial device.

Class Variable Summary
`int` | `connected`

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.

Class Variable Details

### connected

  Type:
    `int`
  Value:

        1

Generated by Epydoc 1.1 on Thu May 8 13:16:29 2003 | http://epydoc.sf.net