| Modifier and Type | Field and Description |
|---|---|
static int |
CTS_SIGNAL
Clear To Send (CTS) signal.
|
static int |
DCD_SIGNAL
Data Carrier Detect (DCD) signal.
|
static int |
DSR_SIGNAL
Data Set Ready (DSR) signal.
|
static int |
DTR_SIGNAL
Data Terminal Ready (DTR) signal.
|
static int |
RI_SIGNAL
Ring Indicator (RI) signal.
|
static int |
RTS_SIGNAL
Ready To Send (RTS) signal.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
getSignalState(int signalID)
Gets the state of the designated signal.
|
void |
setSignalChangeListener(ModemSignalListener listener,
int signals)
Registers a
ModemSignalListener instance which will get asynchronously notified when one of the
designated signals changes. |
void |
setSignalState(int signalID,
boolean state)
Sets or clears the designated signal.
|
static final int CTS_SIGNAL
static final int DCD_SIGNAL
static final int DSR_SIGNAL
static final int DTR_SIGNAL
static final int RI_SIGNAL
static final int RTS_SIGNAL
boolean getSignalState(int signalID)
throws java.io.IOException,
PeripheralNotAvailableException
signalID - the ID of the signal (DCD_SIGNAL, DSR_SIGNAL , RI_SIGNAL or
CTS_SIGNAL).true for set; false for cleared.java.lang.IllegalArgumentException - if signalID is not one of the defined values.java.io.IOException - if an IO error occurred.PeripheralNotAvailableException - if the peripheral is not currently available (has been closed).com.oracle.deviceaccess.InvalidOperationException - if the specified signal is not supported by the underlying peripheral device hardware.void setSignalChangeListener(ModemSignalListener listener, int signals) throws java.io.IOException, PeripheralNotAvailableException
ModemSignalListener instance which will get asynchronously notified when one of the
designated signals changes. Notification will automatically begin after registration completes.
If listener is null then the previously registered listener will be removed.
Only one listener can be registered at a particular time.listener - the ModemSignalListener instance to be notified when a signal state changes.signals - the signals to monitor (bit-wise combination of the signal IDs: DCD_SIGNAL,
DSR_SIGNAL, RI_SIGNAL or CTS_SIGNAL).java.io.IOException - if an IO error occurred.PeripheralNotAvailableException - if the peripheral is not currently available (has been closed).java.lang.IllegalArgumentException - if signals is not a bit-wise combination of valid signal IDs.InvalidStateException - if listener is not null and a listener is already registered for any of the specified
signals.com.oracle.deviceaccess.InvalidOperationException - if the specified signal is not supported by the underlying peripheral device hardware.void setSignalState(int signalID,
boolean state)
throws java.io.IOException,
PeripheralNotAvailableException
signalID - the ID of the signal (DTR_SIGNAL or RTS_SIGNAL).state - true to set; false to clear.java.lang.IllegalArgumentException - if signalID is not one of the defined values.java.io.IOException - if an IO error occurred.PeripheralNotAvailableException - if the peripheral is not currently available (has been closed).com.oracle.deviceaccess.InvalidOperationException - if the specified signal is not supported by the underlying peripheral device hardware.Copyright (c) 1990, 2013, Oracle and/or its affiliates. All rights reserved.