|
IM Profile | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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;
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 |
public void addListener(CommConnectionControlLinesListener listener)
listener
- of CommControlLines object to be registeredATCommandListener
,
#removeListener
public boolean getDTR() throws IOException
IOException
- if reading signal fails
because of some internal reasons.CommControlLinesListener
public void setRING(boolean signalState) throws IOException
IOException
- if setting signal failed
because of some internal reasons.public void setDCD(boolean signalState) throws IOException
IOException
- if setting signal failed
because of some internal reasons.public void setDSR(boolean signalState) throws IOException
IOException
- if setting signal failed
because of some internal reasons.
|
IM Profile | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |