public class BrickletSolidStateRelay extends Device
Modifier and Type | Class and Description |
---|---|
class |
BrickletSolidStateRelay.Monoflop |
static interface |
BrickletSolidStateRelay.MonoflopDoneListener
This listener is triggered whenever the monoflop timer reaches 0.
|
Device.Identity
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEVICE_DISPLAY_NAME |
static int |
DEVICE_IDENTIFIER |
static byte |
FUNCTION_GET_IDENTITY |
static byte |
FUNCTION_GET_MONOFLOP |
static byte |
FUNCTION_GET_STATE |
static byte |
FUNCTION_SET_MONOFLOP |
static byte |
FUNCTION_SET_STATE |
Constructor and Description |
---|
BrickletSolidStateRelay(java.lang.String uid,
IPConnection ipcon)
Creates an object with the unique device ID \c uid.
|
Modifier and Type | Method and Description |
---|---|
void |
addMonoflopDoneListener(BrickletSolidStateRelay.MonoflopDoneListener listener)
Adds a MonoflopDone listener.
|
Device.Identity |
getIdentity()
Returns the UID, the UID where the Bricklet is connected to,
the position, the hardware and firmware version as well as the
device identifier.
|
BrickletSolidStateRelay.Monoflop |
getMonoflop()
Returns the current state and the time as set by
setMonoflop(boolean, long) as well as the remaining time until the state flips. |
boolean |
getState()
Returns the state of the relay, *true* means on and *false* means off.
|
void |
removeMonoflopDoneListener(BrickletSolidStateRelay.MonoflopDoneListener listener)
Removes a MonoflopDone listener.
|
void |
setMonoflop(boolean state,
long time)
The first parameter is the desired state of the relay (*true* means on
and *false* means off).
|
void |
setState(boolean state)
Sets the state of the relays *true* means on and *false* means off.
|
getAPIVersion, getResponseExpected, setResponseExpected, setResponseExpectedAll
public static final int DEVICE_IDENTIFIER
public static final java.lang.String DEVICE_DISPLAY_NAME
public static final byte FUNCTION_SET_STATE
public static final byte FUNCTION_GET_STATE
public static final byte FUNCTION_SET_MONOFLOP
public static final byte FUNCTION_GET_MONOFLOP
public static final byte FUNCTION_GET_IDENTITY
public BrickletSolidStateRelay(java.lang.String uid, IPConnection ipcon)
public void setState(boolean state) throws TinkerforgeException
TinkerforgeException
public boolean getState() throws TinkerforgeException
TinkerforgeException
public void setMonoflop(boolean state, long time) throws TinkerforgeException
TinkerforgeException
public BrickletSolidStateRelay.Monoflop getMonoflop() throws TinkerforgeException
setMonoflop(boolean, long)
as well as the remaining time until the state flips.
If the timer is not running currently, the remaining time will be returned
as 0.TinkerforgeException
public Device.Identity getIdentity() throws TinkerforgeException
getIdentity
in class Device
TinkerforgeException
public void addMonoflopDoneListener(BrickletSolidStateRelay.MonoflopDoneListener listener)
public void removeMonoflopDoneListener(BrickletSolidStateRelay.MonoflopDoneListener listener)
Copyright © 2021 Tinkerforge GmbH. All rights reserved.