public class ModemSignalEvent extends PeripheralEvent
ModemSignalEvent class encapsulates modem signal state changes. When/if signal state change events for
the same peripheral are coalesced the value retained is that of the last occurrence.ModemSignalListener,
ModemSignalsControl| Modifier and Type | Field and Description |
|---|---|
protected int |
signalID
The signal ID.
|
protected boolean |
signalState
The signal state.
|
count, lastTimeStamp, lastTimeStampMicros, peripheral, timeStamp, timeStampMicros| Constructor and Description |
|---|
ModemSignalEvent(Peripheral peripheral,
int signalID,
boolean signalState)
Creates a new
ModemSignalEvent with the specified value and time-stamped with the current time. |
ModemSignalEvent(Peripheral peripheral,
int signalID,
boolean signalState,
long timeStamp,
int timeStampMicros)
Creates a new
ModemSignalEvent with the specified value and timestamp. |
| Modifier and Type | Method and Description |
|---|---|
int |
getSignalID()
Returns the signal ID.
|
boolean |
getSignalState()
Returns the new signal state.
|
getCount, getLastTimeStamp, getLastTimeStampMicros, getPeripheral, getTimeStamp, getTimeStampMicrosprotected int signalID
protected boolean signalState
public ModemSignalEvent(Peripheral peripheral, int signalID, boolean signalState)
ModemSignalEvent with the specified value and time-stamped with the current time.peripheral - the source peripheral.signalID - the ID of the signal that changed ( ModemSignalsControl.DCD_SIGNAL,
ModemSignalsControl.DSR_SIGNAL, ModemSignalsControl.RI_SIGNAL or
ModemSignalsControl.CTS_SIGNAL).signalState - the new signal state.java.lang.NullPointerException - if peripheral is null.java.lang.IllegalArgumentException - if signalID is not a valid signal ID.public ModemSignalEvent(Peripheral peripheral, int signalID, boolean signalState, long timeStamp, int timeStampMicros)
ModemSignalEvent with the specified value and timestamp.peripheral - the source peripheral.signalID - the ID of the signal that changed ( ModemSignalsControl.DCD_SIGNAL,
ModemSignalsControl.DSR_SIGNAL, ModemSignalsControl.RI_SIGNAL or
ModemSignalsControl.CTS_SIGNAL).signalState - the new signal state.timeStamp - the timestamp (in milliseconds).timeStampMicros - the additional microseconds to the timestamp.java.lang.NullPointerException - if peripheral is null.java.lang.IllegalArgumentException - if signalID is not a valid signal ID or if timeStamp or timeStampMicros is
negative.public int getSignalID()
ModemSignalsControl.DCD_SIGNAL, ModemSignalsControl.DSR_SIGNAL,
ModemSignalsControl.RI_SIGNAL or ModemSignalsControl.CTS_SIGNAL).public boolean getSignalState()
Copyright (c) 2012, Oracle and/or its affiliates. All Rights Reserved. Use of this specification is subject to license terms.