IM Profile

com.siemens.icm.io
Interface CommConnectionControlLines

All Superinterfaces:
CommConnection, Connection, InputConnection, OutputConnection, StreamConnection

public interface CommConnectionControlLines
extends CommConnection

The CommConnectionControlLines interface extends CommConnection with the capabilities of actuating on the control lines of a device, which is connected through a CommConnection port.

Implementations of the CommConnectionControlLines interface are able to get the current state of DTR (Data Terminal Ready) signal and to receive its state changes. To receive the new states of the signal an implementation class for the CommConnectionControlLinesListener is necessary.

The state of the signals RING, DCD (Data Carrier Detect) and DSR (Data Set Ready) can be set calling the corresponding setting methods defined in this interface.

To access the control lines through a serial port there are two possibilities. One is to open a connection with an object of CommConnectionControlLines, for example like:
CommConnectionControlLines cc = (CommConnectionControlLines) Connector.open("comm:com0;baudrate=19200");
But you can use as well a CommConnection object and cast it to a CommConnectionControlLines one as in the following example:
CommConnection cc = (CommConnection) Connector.open("comm:com0;baudrate=19200");
CommConnectionControlLines ccControlLines = (CommConnectionControlLines)cc;

See Also:
CommControlLinesListener

Method Summary
 void addListener(CommConnectionControlLinesListener listener)
          Registers listeners to receive state changes of COM control lines (DTR).
 boolean getDTR()
          Get the state of the DTR (Data Terminal Ready) signal of the connected COM port.
 void setDCD(boolean signalState)
          Set the state of the DCD (Data Carrier Detect) signal of the connected COM port channel.
 void setDSR(boolean signalState)
          Set the state of the DSR (Data Set Ready) signal of the connected COM port channel.
 void setRING(boolean signalState)
          Set the state of the RING signal of the connected COM port channel.
 
Methods inherited from interface javax.microedition.io.CommConnection
getBaudRate, setBaudRate
 
Methods inherited from interface javax.microedition.io.InputConnection
openDataInputStream, openInputStream
 
Methods inherited from interface javax.microedition.io.Connection
close
 
Methods inherited from interface javax.microedition.io.OutputConnection
openDataOutputStream, openOutputStream
 

Method Detail

addListener

public void addListener(CommConnectionControlLinesListener listener)
Registers listeners to receive state changes of COM control lines (DTR). The listener object is an implementation of CommControlLinesListener interface. When associated to a specific instance of CommConnection interface, this object's callback methods will be called each time when interface signal changes occur on the corresponding connected COM port. Registered listener instances are stored in an internal table but are not guaranteed to be called in the order they has been registered.

Parameters:
listener - of CommControlLines object to be registered
See Also:
ATCommandListener, #removeListener

getDTR

public boolean getDTR()
               throws IOException
Get the state of the DTR (Data Terminal Ready) signal of the connected COM port. Additional changes of the signal will be reported to the CommControlLinesListener callback class.

Returns:
The current state of the DTR signal.
Throws:
IOException - if reading signal fails because of some internal reasons.
See Also:
CommControlLinesListener

setRING

public void setRING(boolean signalState)
             throws IOException
Set the state of the RING signal of the connected COM port channel.

Throws:
IOException - if setting signal failed because of some internal reasons.

setDCD

public void setDCD(boolean signalState)
            throws IOException
Set the state of the DCD (Data Carrier Detect) signal of the connected COM port channel.

Throws:
IOException - if setting signal failed because of some internal reasons.

setDSR

public void setDSR(boolean signalState)
            throws IOException
Set the state of the DSR (Data Set Ready) signal of the connected COM port channel.

Throws:
IOException - if setting signal failed because of some internal reasons.

IM Profile

Submit a comment or suggestion Version 2.0 of IM Profile Specification
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries. Copyright (c) 1993-2002 Sun Microsystems, Inc. 901 San Antonio Road,Palo Alto, California, 94303, U.S.A. All Rights Reserved.