The com.oracle.deviceaccess.modem
package contains interfaces and classes for controlling modem signals.
The ModemSignalListener
interface defines methods for being notified of modem signal changes.
The ModemSignalListener
interface contains one method.
The ModemSignalsControl
interface provides methods for controlling and monitoring modem signals.
The ModemSignalsControl
class consists of six constants:
This constant represents the Data Terminal Ready (DTR) signal. This bit flag can be bitwise-combined (OR) with other signal bit flags.
This constant represents the Data Carrier Detect (DCD) signal. This bit flag can be bitwise-combined (OR) with other signal bit flags.
This constant represents the Data Set Ready (DSR) signal. This bit flag can be bitwise-combined (OR) with other signal bit flags.
This constant represents the Ring Indicator (RI) signal. This bit flag can be bitwise-combined (OR) with other signal bit flags.
This constant represents the Ready To Send (RTS) signal. This bit flag can be bitwise-combined (OR) with other signal bit flags.
This constant represents the Clear To Send (CTS) signal. This bit flag can be bitwise-combined (OR) with other signal bit flags.
The ModemSignalsControl
class also consists of three methods:
void setSignalState(int signalID, boolean state) throws java.io.IOException,PeripheralNotAvailableException
This method sets or clears the designated signal.
boolean getSignalState(int signalID) throws java.io.IOException, PeripheralNotAvailableException
This method returns the state of the designated signal.
void setSignalChangeListener(ModemSignalListener listener, int signals) throws java.io.IOException, PeripheralNotAvailableException
This method registers a 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.
The ModemSignalEvent
class encapsulates modem signal state changes. If signal state change events for the same peripheral are coalesced the value retained is that of the last occurrence.
The ModemSignalEvent
class consists of two constants:
This constant represents the signal ID.
This constant represents the signal state.
The ModemSignalEvent
class also consists of two constructors and several methods:
public ModemSignalEvent(Peripheral peripheral, int signalID, boolean signalState)
This constructor creates a new ModemSignalEvent
with the specified value. It is then time-stamped with the current time.
public ModemSignalEvent(Peripheral peripheral, int signalID, boolean signalState, long timeStamp, int timeStampMicros)
This constructor creates a new ModemSignalEvent
with the specified value and timestamp.
This method returns the signal ID.
public boolean getSignalState()
This method returns the new signal state.