public class PortEvent extends PeripheralEvent
PortEvent
class encapsulates GPIO port value changes. When/if value change events for the same GPIO port
are coalesced the value retained is that of the last occurrence.GPIOPort
,
PortListener
count, lastTimeStamp, lastTimeStampMicros, peripheral, timeStamp, timeStampMicros
Constructor and Description |
---|
PortEvent(GPIOPort port,
int value)
Creates a new
PortEvent with the specified value and time-stamped with the current time. |
PortEvent(GPIOPort port,
int value,
long timeStamp,
int timeStampMicros)
Creates a new
PortEvent with the specified value and timestamp. |
Modifier and Type | Method and Description |
---|---|
int |
getValue()
Returns the new GPIO port's value.
|
getCount, getLastTimeStamp, getLastTimeStampMicros, getPeripheral, getTimeStamp, getTimeStampMicros
public PortEvent(GPIOPort port, int value)
PortEvent
with the specified value and time-stamped with the current time.port
- the source GPIO port.value
- the new value.java.lang.NullPointerException
- if port
is null
.public PortEvent(GPIOPort port, int value, long timeStamp, int timeStampMicros)
PortEvent
with the specified value and timestamp.port
- the source GPIO port.value
- the new value.timeStamp
- the timestamp (in milliseconds).timeStampMicros
- the additional microseconds to the timestamp.java.lang.NullPointerException
- if port
is null
.java.lang.IllegalArgumentException
- if timeStamp
or timeStampMicros
is negative.Copyright (c) 2012, Oracle and/or its affiliates. All Rights Reserved. Use of this specification is subject to license terms.