public class BrickletPTC extends Device
Modifier and Type | Class and Description |
---|---|
class |
BrickletPTC.ResistanceCallbackThreshold |
static interface |
BrickletPTC.ResistanceListener
This listener is triggered periodically with the period that is set by
setResistanceCallbackPeriod(long) . |
static interface |
BrickletPTC.ResistanceReachedListener
This listener is triggered when the threshold as set by
setResistanceCallbackThreshold(char, int, int) is reached. |
static interface |
BrickletPTC.SensorConnectedListener
This listener is triggered periodically according to the configuration set by
setSensorConnectedCallbackConfiguration(boolean) . |
class |
BrickletPTC.TemperatureCallbackThreshold |
static interface |
BrickletPTC.TemperatureListener
This listener is triggered periodically with the period that is set by
setTemperatureCallbackPeriod(long) . |
static interface |
BrickletPTC.TemperatureReachedListener
This listener is triggered when the threshold as set by
setTemperatureCallbackThreshold(char, int, int) is reached. |
Device.Identity
Constructor and Description |
---|
BrickletPTC(String uid,
IPConnection ipcon)
Creates an object with the unique device ID \c uid.
|
Modifier and Type | Method and Description |
---|---|
void |
addResistanceListener(BrickletPTC.ResistanceListener listener)
Adds a Resistance listener.
|
void |
addResistanceReachedListener(BrickletPTC.ResistanceReachedListener listener)
Adds a ResistanceReached listener.
|
void |
addSensorConnectedListener(BrickletPTC.SensorConnectedListener listener)
Adds a SensorConnected listener.
|
void |
addTemperatureListener(BrickletPTC.TemperatureListener listener)
Adds a Temperature listener.
|
void |
addTemperatureReachedListener(BrickletPTC.TemperatureReachedListener listener)
Adds a TemperatureReached listener.
|
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 |
getNoiseRejectionFilter()
Returns the noise rejection filter option as set by
setNoiseRejectionFilter(short) |
int |
getResistance()
Returns the value as measured by the MAX31865 precision delta-sigma ADC.
|
long |
getResistanceCallbackPeriod()
Returns the period as set by
setResistanceCallbackPeriod(long) . |
BrickletPTC.ResistanceCallbackThreshold |
getResistanceCallbackThreshold()
Returns the threshold as set by
setResistanceCallbackThreshold(char, int, int) . |
boolean |
getSensorConnectedCallbackConfiguration()
Returns the configuration as set by
setSensorConnectedCallbackConfiguration(boolean) . |
int |
getTemperature()
Returns the temperature of connected sensor.
|
long |
getTemperatureCallbackPeriod()
Returns the period as set by
setTemperatureCallbackPeriod(long) . |
BrickletPTC.TemperatureCallbackThreshold |
getTemperatureCallbackThreshold()
Returns the threshold as set by
setTemperatureCallbackThreshold(char, int, int) . |
short |
getWireMode()
Returns the wire mode as set by
setWireMode(short) |
boolean |
isSensorConnected()
Returns *true* if the sensor is connected correctly.
|
void |
removeResistanceListener(BrickletPTC.ResistanceListener listener)
Removes a Resistance listener.
|
void |
removeResistanceReachedListener(BrickletPTC.ResistanceReachedListener listener)
Removes a ResistanceReached listener.
|
void |
removeSensorConnectedListener(BrickletPTC.SensorConnectedListener listener)
Removes a SensorConnected listener.
|
void |
removeTemperatureListener(BrickletPTC.TemperatureListener listener)
Removes a Temperature listener.
|
void |
removeTemperatureReachedListener(BrickletPTC.TemperatureReachedListener listener)
Removes a TemperatureReached listener.
|
void |
setDebouncePeriod(long debounce)
Sets the period with which the threshold listener
*
BrickletPTC.TemperatureReachedListener ,
* BrickletPTC.ResistanceReachedListener
is triggered, if the threshold
* setTemperatureCallbackThreshold(char, int, int) ,
* setResistanceCallbackThreshold(char, int, int)
keeps being reached. |
void |
setNoiseRejectionFilter(short filter)
Sets the noise rejection filter to either 50Hz (0) or 60Hz (1).
|
void |
setResistanceCallbackPeriod(long period)
Sets the period with which the
BrickletPTC.ResistanceListener listener is triggered
periodically. |
void |
setResistanceCallbackThreshold(char option,
int min,
int max)
Sets the thresholds for the
BrickletPTC.ResistanceReachedListener listener. |
void |
setSensorConnectedCallbackConfiguration(boolean enabled)
If you enable this listener, the
BrickletPTC.SensorConnectedListener listener is triggered
every time a Pt sensor is connected/disconnected. |
void |
setTemperatureCallbackPeriod(long period)
Sets the period with which the
BrickletPTC.TemperatureListener listener is triggered
periodically. |
void |
setTemperatureCallbackThreshold(char option,
int min,
int max)
Sets the thresholds for the
BrickletPTC.TemperatureReachedListener listener. |
void |
setWireMode(short mode)
Sets the wire mode of the sensor.
|
getAPIVersion, getResponseExpected, setResponseExpected, setResponseExpectedAll
public static final int DEVICE_IDENTIFIER
public static final String DEVICE_DISPLAY_NAME
public static final byte FUNCTION_GET_TEMPERATURE
public static final byte FUNCTION_GET_RESISTANCE
public static final byte FUNCTION_SET_TEMPERATURE_CALLBACK_PERIOD
public static final byte FUNCTION_GET_TEMPERATURE_CALLBACK_PERIOD
public static final byte FUNCTION_SET_RESISTANCE_CALLBACK_PERIOD
public static final byte FUNCTION_GET_RESISTANCE_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_RESISTANCE_CALLBACK_THRESHOLD
public static final byte FUNCTION_GET_RESISTANCE_CALLBACK_THRESHOLD
public static final byte FUNCTION_SET_DEBOUNCE_PERIOD
public static final byte FUNCTION_GET_DEBOUNCE_PERIOD
public static final byte FUNCTION_SET_NOISE_REJECTION_FILTER
public static final byte FUNCTION_GET_NOISE_REJECTION_FILTER
public static final byte FUNCTION_IS_SENSOR_CONNECTED
public static final byte FUNCTION_SET_WIRE_MODE
public static final byte FUNCTION_GET_WIRE_MODE
public static final byte FUNCTION_SET_SENSOR_CONNECTED_CALLBACK_CONFIGURATION
public static final byte FUNCTION_GET_SENSOR_CONNECTED_CALLBACK_CONFIGURATION
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 FILTER_OPTION_50HZ
public static final short FILTER_OPTION_60HZ
public static final short WIRE_MODE_2
public static final short WIRE_MODE_3
public static final short WIRE_MODE_4
public BrickletPTC(String uid, IPConnection ipcon)
public int getTemperature() throws TinkerforgeException
BrickletPTC.TemperatureListener
listener and set the period with
setTemperatureCallbackPeriod(long)
.TinkerforgeException
public int getResistance() throws TinkerforgeException
BrickletPTC.ResistanceListener
listener and set the period with
setResistanceCallbackPeriod(long)
.TinkerforgeException
public void setTemperatureCallbackPeriod(long period) throws TinkerforgeException
BrickletPTC.TemperatureListener
listener is triggered
periodically. A value of 0 turns the listener off.
The BrickletPTC.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 setResistanceCallbackPeriod(long period) throws TinkerforgeException
BrickletPTC.ResistanceListener
listener is triggered
periodically. A value of 0 turns the listener off.
The BrickletPTC.ResistanceListener
listener is only triggered if the resistance has changed
since the last triggering.TinkerforgeException
public long getResistanceCallbackPeriod() throws TinkerforgeException
setResistanceCallbackPeriod(long)
.TinkerforgeException
public void setTemperatureCallbackThreshold(char option, int min, int max) throws TinkerforgeException
BrickletPTC.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 BrickletPTC.TemperatureCallbackThreshold getTemperatureCallbackThreshold() throws TinkerforgeException
setTemperatureCallbackThreshold(char, int, int)
.TinkerforgeException
public void setResistanceCallbackThreshold(char option, int min, int max) throws TinkerforgeException
BrickletPTC.ResistanceReachedListener
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 BrickletPTC.ResistanceCallbackThreshold getResistanceCallbackThreshold() throws TinkerforgeException
setResistanceCallbackThreshold(char, int, int)
.TinkerforgeException
public void setDebouncePeriod(long debounce) throws TinkerforgeException
BrickletPTC.TemperatureReachedListener
,
* BrickletPTC.ResistanceReachedListener
is triggered, if the threshold
* setTemperatureCallbackThreshold(char, int, int)
,
* setResistanceCallbackThreshold(char, int, int)
keeps being reached.TinkerforgeException
public long getDebouncePeriod() throws TinkerforgeException
setDebouncePeriod(long)
.TinkerforgeException
public void setNoiseRejectionFilter(short filter) throws TinkerforgeException
TinkerforgeException
public short getNoiseRejectionFilter() throws TinkerforgeException
setNoiseRejectionFilter(short)
TinkerforgeException
public boolean isSensorConnected() throws TinkerforgeException
TinkerforgeException
public void setWireMode(short mode) throws TinkerforgeException
TinkerforgeException
public short getWireMode() throws TinkerforgeException
setWireMode(short)
TinkerforgeException
public void setSensorConnectedCallbackConfiguration(boolean enabled) throws TinkerforgeException
BrickletPTC.SensorConnectedListener
listener is triggered
every time a Pt sensor is connected/disconnected.
.. versionadded:: 2.0.2$nbsp;(Plugin)TinkerforgeException
public boolean getSensorConnectedCallbackConfiguration() throws TinkerforgeException
setSensorConnectedCallbackConfiguration(boolean)
.
.. versionadded:: 2.0.2$nbsp;(Plugin)TinkerforgeException
public Device.Identity getIdentity() throws TinkerforgeException
getIdentity
in class Device
TinkerforgeException
public void addTemperatureListener(BrickletPTC.TemperatureListener listener)
public void removeTemperatureListener(BrickletPTC.TemperatureListener listener)
public void addTemperatureReachedListener(BrickletPTC.TemperatureReachedListener listener)
public void removeTemperatureReachedListener(BrickletPTC.TemperatureReachedListener listener)
public void addResistanceListener(BrickletPTC.ResistanceListener listener)
public void removeResistanceListener(BrickletPTC.ResistanceListener listener)
public void addResistanceReachedListener(BrickletPTC.ResistanceReachedListener listener)
public void removeResistanceReachedListener(BrickletPTC.ResistanceReachedListener listener)
public void addSensorConnectedListener(BrickletPTC.SensorConnectedListener listener)
public void removeSensorConnectedListener(BrickletPTC.SensorConnectedListener listener)
Copyright © 2022 Tinkerforge GmbH. All rights reserved.