P - the peripheral type implementing this interface.public interface ModemSignalsControl<P extends Peripheral<? super P>>
ModemSignalsControl interface provides methods for controlling and monitoring modem signals.| 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<P> 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,
UnavailablePeripheralException,
ClosedPeripheralException
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 some other I/O error occurs.UnavailablePeripheralException - if this peripheral is not currently available - such as it is locked by another application.ClosedPeripheralException - if the peripheral has been closed.java.lang.UnsupportedOperationException - if the specified signal is not supported by the underlying peripheral device hardware.void setSignalChangeListener(ModemSignalListener<P> listener, int signals) throws java.io.IOException, UnavailablePeripheralException, ClosedPeripheralException
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 some other I/O error occurs.UnavailablePeripheralException - if this peripheral is not currently available - such as it is locked by another application.ClosedPeripheralException - if the peripheral has been closed.java.lang.IllegalArgumentException - if signals is not a bit-wise combination of valid signal IDs.java.lang.IllegalStateException - if listener is not null and a listener is already registered for any of the specified
signals.java.lang.UnsupportedOperationException - if the specified signal is not supported by the underlying peripheral device hardware.void setSignalState(int signalID,
boolean state)
throws java.io.IOException,
UnavailablePeripheralException,
ClosedPeripheralException
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 some other I/O error occurs.UnavailablePeripheralException - if this peripheral is not currently available - such as it is locked by another application.ClosedPeripheralException - if the peripheral has been closed.java.lang.UnsupportedOperationException - if the specified signal is not supported by the underlying peripheral device hardware.Copyright © 2012, 2013, Oracle and/or its affiliates. All rights reserved.
Legal Notices