public class BrickletThermocouple extends Device
Modifier and Type | Class and Description |
---|---|
class |
BrickletThermocouple.Configuration |
class |
BrickletThermocouple.ErrorState |
static interface |
BrickletThermocouple.ErrorStateListener
This Listener is triggered every time the error state changes
(see
getErrorState() ). |
class |
BrickletThermocouple.TemperatureCallbackThreshold |
static interface |
BrickletThermocouple.TemperatureListener
This listener is triggered periodically with the period that is set by
setTemperatureCallbackPeriod(long) . |
static interface |
BrickletThermocouple.TemperatureReachedListener
This listener is triggered when the threshold as set by
setTemperatureCallbackThreshold(char, int, int) is reached. |
Device.Identity
Constructor and Description |
---|
BrickletThermocouple(java.lang.String uid,
IPConnection ipcon)
Creates an object with the unique device ID \c uid.
|
Modifier and Type | Method and Description |
---|---|
void |
addErrorStateListener(BrickletThermocouple.ErrorStateListener listener)
Adds a ErrorState listener.
|
void |
addTemperatureListener(BrickletThermocouple.TemperatureListener listener)
Adds a Temperature listener.
|
void |
addTemperatureReachedListener(BrickletThermocouple.TemperatureReachedListener listener)
Adds a TemperatureReached listener.
|
BrickletThermocouple.Configuration |
getConfiguration()
Returns the configuration as set by
setConfiguration(short, short, short) . |
long |
getDebouncePeriod()
Returns the debounce period as set by
setDebouncePeriod(long) . |
BrickletThermocouple.ErrorState |
getErrorState()
Returns the current error state.
|
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.
|
int |
getTemperature()
Returns the temperature of the thermocouple.
|
long |
getTemperatureCallbackPeriod()
Returns the period as set by
setTemperatureCallbackPeriod(long) . |
BrickletThermocouple.TemperatureCallbackThreshold |
getTemperatureCallbackThreshold()
Returns the threshold as set by
setTemperatureCallbackThreshold(char, int, int) . |
void |
removeErrorStateListener(BrickletThermocouple.ErrorStateListener listener)
Removes a ErrorState listener.
|
void |
removeTemperatureListener(BrickletThermocouple.TemperatureListener listener)
Removes a Temperature listener.
|
void |
removeTemperatureReachedListener(BrickletThermocouple.TemperatureReachedListener listener)
Removes a TemperatureReached listener.
|
void |
setConfiguration(short averaging,
short thermocoupleType,
short filter)
You can configure averaging size, thermocouple type and frequency
filtering.
|
void |
setDebouncePeriod(long debounce)
Sets the period with which the threshold listener
*
BrickletThermocouple.TemperatureReachedListener
is triggered, if the threshold
* setTemperatureCallbackThreshold(char, int, int)
keeps being reached. |
void |
setTemperatureCallbackPeriod(long period)
Sets the period with which the
BrickletThermocouple.TemperatureListener listener is triggered
periodically. |
void |
setTemperatureCallbackThreshold(char option,
int min,
int max)
Sets the thresholds for the
BrickletThermocouple.TemperatureReachedListener listener. |
getAPIVersion, getResponseExpected, setResponseExpected, setResponseExpectedAll
public static final int DEVICE_IDENTIFIER
public static final java.lang.String DEVICE_DISPLAY_NAME
public static final byte FUNCTION_GET_TEMPERATURE
public static final byte FUNCTION_SET_TEMPERATURE_CALLBACK_PERIOD
public static final byte FUNCTION_GET_TEMPERATURE_CALLBACK_PERIOD
public static final byte FUNCTION_SET_TEMPERATURE_CALLBACK_THRESHOLD
public static final byte FUNCTION_GET_TEMPERATURE_CALLBACK_THRESHOLD
public static final byte FUNCTION_SET_DEBOUNCE_PERIOD
public static final byte FUNCTION_GET_DEBOUNCE_PERIOD
public static final byte FUNCTION_SET_CONFIGURATION
public static final byte FUNCTION_GET_CONFIGURATION
public static final byte FUNCTION_GET_ERROR_STATE
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 AVERAGING_1
public static final short AVERAGING_2
public static final short AVERAGING_4
public static final short AVERAGING_8
public static final short AVERAGING_16
public static final short TYPE_B
public static final short TYPE_E
public static final short TYPE_J
public static final short TYPE_K
public static final short TYPE_N
public static final short TYPE_R
public static final short TYPE_S
public static final short TYPE_T
public static final short TYPE_G8
public static final short TYPE_G32
public static final short FILTER_OPTION_50HZ
public static final short FILTER_OPTION_60HZ
public BrickletThermocouple(java.lang.String uid, IPConnection ipcon)
public int getTemperature() throws TinkerforgeException
BrickletThermocouple.TemperatureListener
listener and set the period with
setTemperatureCallbackPeriod(long)
.TinkerforgeException
public void setTemperatureCallbackPeriod(long period) throws TinkerforgeException
BrickletThermocouple.TemperatureListener
listener is triggered
periodically. A value of 0 turns the listener off.
The BrickletThermocouple.TemperatureListener
listener is only triggered if the temperature has changed
since the last triggering.TinkerforgeException
public long getTemperatureCallbackPeriod() throws TinkerforgeException
setTemperatureCallbackPeriod(long)
.TinkerforgeException
public void setTemperatureCallbackThreshold(char option, int min, int max) throws TinkerforgeException
BrickletThermocouple.TemperatureReachedListener
listener.
The following options are possible:
\verbatim
"Option", "Description"
"'x'", "Listener is turned off"
"'o'", "Listener is triggered when the temperature is *outside* the min and max values"
"'i'", "Listener is triggered when the temperature is *inside* the min and max values"
"'<'", "Listener is triggered when the temperature is smaller than the min value (max is ignored)"
"'>'", "Listener is triggered when the temperature is greater than the min value (max is ignored)"
\endverbatimTinkerforgeException
public BrickletThermocouple.TemperatureCallbackThreshold getTemperatureCallbackThreshold() throws TinkerforgeException
setTemperatureCallbackThreshold(char, int, int)
.TinkerforgeException
public void setDebouncePeriod(long debounce) throws TinkerforgeException
BrickletThermocouple.TemperatureReachedListener
is triggered, if the threshold
* setTemperatureCallbackThreshold(char, int, int)
keeps being reached.TinkerforgeException
public long getDebouncePeriod() throws TinkerforgeException
setDebouncePeriod(long)
.TinkerforgeException
public void setConfiguration(short averaging, short thermocoupleType, short filter) throws TinkerforgeException
TinkerforgeException
public BrickletThermocouple.Configuration getConfiguration() throws TinkerforgeException
setConfiguration(short, short, short)
.TinkerforgeException
public BrickletThermocouple.ErrorState getErrorState() throws TinkerforgeException
BrickletThermocouple.ErrorStateListener
listener to automatically get triggered
when the error state changes.TinkerforgeException
public Device.Identity getIdentity() throws TinkerforgeException
getIdentity
in class Device
TinkerforgeException
public void addTemperatureListener(BrickletThermocouple.TemperatureListener listener)
public void removeTemperatureListener(BrickletThermocouple.TemperatureListener listener)
public void addTemperatureReachedListener(BrickletThermocouple.TemperatureReachedListener listener)
public void removeTemperatureReachedListener(BrickletThermocouple.TemperatureReachedListener listener)
public void addErrorStateListener(BrickletThermocouple.ErrorStateListener listener)
public void removeErrorStateListener(BrickletThermocouple.ErrorStateListener listener)
Copyright © 2021 Tinkerforge GmbH. All rights reserved.