public class BrickletIndustrialDual020mA extends Device
Modifier and Type | Class and Description |
---|---|
class |
BrickletIndustrialDual020mA.CurrentCallbackThreshold |
static interface |
BrickletIndustrialDual020mA.CurrentListener
This listener is triggered periodically with the period that is set by
setCurrentCallbackPeriod(short, long) . |
static interface |
BrickletIndustrialDual020mA.CurrentReachedListener
This listener is triggered when the threshold as set by
setCurrentCallbackThreshold(short, char, int, int) is reached. |
Device.Identity
Modifier and Type | Field and Description |
---|---|
static String |
DEVICE_DISPLAY_NAME |
static int |
DEVICE_IDENTIFIER |
static byte |
FUNCTION_GET_CURRENT |
static byte |
FUNCTION_GET_CURRENT_CALLBACK_PERIOD |
static byte |
FUNCTION_GET_CURRENT_CALLBACK_THRESHOLD |
static byte |
FUNCTION_GET_DEBOUNCE_PERIOD |
static byte |
FUNCTION_GET_IDENTITY |
static byte |
FUNCTION_GET_SAMPLE_RATE |
static byte |
FUNCTION_SET_CURRENT_CALLBACK_PERIOD |
static byte |
FUNCTION_SET_CURRENT_CALLBACK_THRESHOLD |
static byte |
FUNCTION_SET_DEBOUNCE_PERIOD |
static byte |
FUNCTION_SET_SAMPLE_RATE |
static short |
SAMPLE_RATE_15_SPS |
static short |
SAMPLE_RATE_240_SPS |
static short |
SAMPLE_RATE_4_SPS |
static short |
SAMPLE_RATE_60_SPS |
static char |
THRESHOLD_OPTION_GREATER |
static char |
THRESHOLD_OPTION_INSIDE |
static char |
THRESHOLD_OPTION_OFF |
static char |
THRESHOLD_OPTION_OUTSIDE |
static char |
THRESHOLD_OPTION_SMALLER |
Constructor and Description |
---|
BrickletIndustrialDual020mA(String uid,
IPConnection ipcon)
Creates an object with the unique device ID \c uid.
|
Modifier and Type | Method and Description |
---|---|
void |
addCurrentListener(BrickletIndustrialDual020mA.CurrentListener listener)
Adds a Current listener.
|
void |
addCurrentReachedListener(BrickletIndustrialDual020mA.CurrentReachedListener listener)
Adds a CurrentReached listener.
|
int |
getCurrent(short sensor)
Returns the current of the specified sensor.
|
long |
getCurrentCallbackPeriod(short sensor)
Returns the period as set by
setCurrentCallbackPeriod(short, long) . |
BrickletIndustrialDual020mA.CurrentCallbackThreshold |
getCurrentCallbackThreshold(short sensor)
Returns the threshold as set by
setCurrentCallbackThreshold(short, char, int, int) . |
long |
getDebouncePeriod()
Returns the debounce period as set by
setDebouncePeriod(long) . |
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.
|
short |
getSampleRate()
Returns the sample rate as set by
setSampleRate(short) . |
void |
removeCurrentListener(BrickletIndustrialDual020mA.CurrentListener listener)
Removes a Current listener.
|
void |
removeCurrentReachedListener(BrickletIndustrialDual020mA.CurrentReachedListener listener)
Removes a CurrentReached listener.
|
void |
setCurrentCallbackPeriod(short sensor,
long period)
Sets the period with which the
BrickletIndustrialDual020mA.CurrentListener listener is triggered
periodically for the given sensor. |
void |
setCurrentCallbackThreshold(short sensor,
char option,
int min,
int max)
Sets the thresholds for the
BrickletIndustrialDual020mA.CurrentReachedListener listener for the given
sensor. |
void |
setDebouncePeriod(long debounce)
Sets the period with which the threshold listener
*
BrickletIndustrialDual020mA.CurrentReachedListener
is triggered, if the threshold
* setCurrentCallbackThreshold(short, char, int, int)
keeps being reached. |
void |
setSampleRate(short rate)
Sets the sample rate to either 240, 60, 15 or 4 samples per second.
|
getAPIVersion, getResponseExpected, setResponseExpected, setResponseExpectedAll
public static final int DEVICE_IDENTIFIER
public static final String DEVICE_DISPLAY_NAME
public static final byte FUNCTION_GET_CURRENT
public static final byte FUNCTION_SET_CURRENT_CALLBACK_PERIOD
public static final byte FUNCTION_GET_CURRENT_CALLBACK_PERIOD
public static final byte FUNCTION_SET_CURRENT_CALLBACK_THRESHOLD
public static final byte FUNCTION_GET_CURRENT_CALLBACK_THRESHOLD
public static final byte FUNCTION_SET_DEBOUNCE_PERIOD
public static final byte FUNCTION_GET_DEBOUNCE_PERIOD
public static final byte FUNCTION_SET_SAMPLE_RATE
public static final byte FUNCTION_GET_SAMPLE_RATE
public static final byte FUNCTION_GET_IDENTITY
public static final char THRESHOLD_OPTION_OFF
public static final char THRESHOLD_OPTION_OUTSIDE
public static final char THRESHOLD_OPTION_INSIDE
public static final char THRESHOLD_OPTION_SMALLER
public static final char THRESHOLD_OPTION_GREATER
public static final short SAMPLE_RATE_240_SPS
public static final short SAMPLE_RATE_60_SPS
public static final short SAMPLE_RATE_15_SPS
public static final short SAMPLE_RATE_4_SPS
public BrickletIndustrialDual020mA(String uid, IPConnection ipcon)
public int getCurrent(short sensor) throws TinkerforgeException
BrickletIndustrialDual020mA.CurrentListener
listener and set the period with
setCurrentCallbackPeriod(short, long)
.TinkerforgeException
public void setCurrentCallbackPeriod(short sensor, long period) throws TinkerforgeException
BrickletIndustrialDual020mA.CurrentListener
listener is triggered
periodically for the given sensor. A value of 0 turns the listener off.
The BrickletIndustrialDual020mA.CurrentListener
listener is only triggered if the current has changed since the
last triggering.TinkerforgeException
public long getCurrentCallbackPeriod(short sensor) throws TinkerforgeException
setCurrentCallbackPeriod(short, long)
.TinkerforgeException
public void setCurrentCallbackThreshold(short sensor, char option, int min, int max) throws TinkerforgeException
BrickletIndustrialDual020mA.CurrentReachedListener
listener for the given
sensor.
The following options are possible:
\verbatim
"Option", "Description"
"'x'", "Listener is turned off"
"'o'", "Listener is triggered when the current is *outside* the min and max values"
"'i'", "Listener is triggered when the current is *inside* the min and max values"
"'<'", "Listener is triggered when the current is smaller than the min value (max is ignored)"
"'>'", "Listener is triggered when the current is greater than the min value (max is ignored)"
\endverbatimTinkerforgeException
public BrickletIndustrialDual020mA.CurrentCallbackThreshold getCurrentCallbackThreshold(short sensor) throws TinkerforgeException
setCurrentCallbackThreshold(short, char, int, int)
.TinkerforgeException
public void setDebouncePeriod(long debounce) throws TinkerforgeException
BrickletIndustrialDual020mA.CurrentReachedListener
is triggered, if the threshold
* setCurrentCallbackThreshold(short, char, int, int)
keeps being reached.TinkerforgeException
public long getDebouncePeriod() throws TinkerforgeException
setDebouncePeriod(long)
.TinkerforgeException
public void setSampleRate(short rate) throws TinkerforgeException
TinkerforgeException
public short getSampleRate() throws TinkerforgeException
setSampleRate(short)
.TinkerforgeException
public Device.Identity getIdentity() throws TinkerforgeException
getIdentity
in class Device
TinkerforgeException
public void addCurrentListener(BrickletIndustrialDual020mA.CurrentListener listener)
public void removeCurrentListener(BrickletIndustrialDual020mA.CurrentListener listener)
public void addCurrentReachedListener(BrickletIndustrialDual020mA.CurrentReachedListener listener)
public void removeCurrentReachedListener(BrickletIndustrialDual020mA.CurrentReachedListener listener)
Copyright © 2022 Tinkerforge GmbH. All rights reserved.