DCT Lightfoot v3 API specification

com.dctl.j2me.io.comm
Class Connection

java.lang.Object
  |
  +--com.dctl.j2me.io.BaseConnection
        |
        +--com.dctl.j2me.io.comm.Connection
All Implemented Interfaces:
Connection, InputConnection, OutputConnection, StreamConnection

public class Connection
extends BaseConnection
implements StreamConnection

The comm connection. This allows a UART to be opened using the format:

Connector.open("comm://[;param[&optional params...]]");

For example:

Connector.open("comm://1;speed=38400&bits=6&stop=1&parity=none") opens a port at 38400 bits per second, 6 bits, 1 stop bit and no parity.

The available parameters are:


Field Summary
 
Fields inherited from class com.dctl.j2me.io.BaseConnection
protocol
 
Constructor Summary
Connection()
          Create a new connection - prevent others from doing it
 
Method Summary
 void close()
          Close the connection
 java.io.DataInputStream openDataInputStream()
          Open the data input stream
 java.io.DataOutputStream openDataOutputStream()
          Open the data output stream
 InputStream openInputStream()
          Open the input stream
 OutputStream openOutputStream()
          Open the output stream
 void setParameters(java.lang.String url, int mode, boolean timeouts)
          Set the URL, mode and timeouts
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Connection

public Connection()
Create a new connection - prevent others from doing it

Method Detail

setParameters

public void setParameters(java.lang.String url,
                          int mode,
                          boolean timeouts)
                   throws IOException
Set the URL, mode and timeouts

Specified by:
setParameters in class BaseConnection
Parameters:
url - The URL passed to connector.open
mode - The mode passed to connector.open or DEFAULT
timeouts - true if timeout exceptions should occur
Throws:
IOException - if there is a problem

openOutputStream

public OutputStream openOutputStream()
                              throws IOException
Open the output stream

Specified by:
openOutputStream in interface OutputConnection
Returns:
the output stream to use
Throws:
IOException - if there is a problem

openDataOutputStream

public java.io.DataOutputStream openDataOutputStream()
                                              throws IOException
Open the data output stream

Specified by:
openDataOutputStream in interface OutputConnection
Returns:
null (not supported)
Throws:
IOException - if there is a problem

openInputStream

public InputStream openInputStream()
                            throws IOException
Open the input stream

Specified by:
openInputStream in interface InputConnection
Returns:
the input stream to use
Throws:
IOException - if there is a problem

openDataInputStream

public java.io.DataInputStream openDataInputStream()
                                            throws IOException
Open the data input stream

Specified by:
openDataInputStream in interface InputConnection
Returns:
null (not supported)
Throws:
IOException - if there is a problem

close

public void close()
           throws IOException
Close the connection

Specified by:
close in interface Connection
Throws:
IOException - if there is an error

DCT Lightfoot v3 API specification

DCT Lightfoot v3 API specification