public class BrickletCO2 extends Device
Modifier and Type | Class and Description |
---|---|
class |
BrickletCO2.CO2ConcentrationCallbackThreshold |
static interface |
BrickletCO2.CO2ConcentrationListener
This listener is triggered periodically with the period that is set by
setCO2ConcentrationCallbackPeriod(long) . |
static interface |
BrickletCO2.CO2ConcentrationReachedListener
This listener is triggered when the threshold as set by
setCO2ConcentrationCallbackThreshold(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_CO2_CONCENTRATION |
static byte |
FUNCTION_GET_CO2_CONCENTRATION_CALLBACK_PERIOD |
static byte |
FUNCTION_GET_CO2_CONCENTRATION_CALLBACK_THRESHOLD |
static byte |
FUNCTION_GET_DEBOUNCE_PERIOD |
static byte |
FUNCTION_GET_IDENTITY |
static byte |
FUNCTION_SET_CO2_CONCENTRATION_CALLBACK_PERIOD |
static byte |
FUNCTION_SET_CO2_CONCENTRATION_CALLBACK_THRESHOLD |
static byte |
FUNCTION_SET_DEBOUNCE_PERIOD |
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 |
---|
BrickletCO2(String uid,
IPConnection ipcon)
Creates an object with the unique device ID \c uid.
|
Modifier and Type | Method and Description |
---|---|
void |
addCO2ConcentrationListener(BrickletCO2.CO2ConcentrationListener listener)
Adds a CO2Concentration listener.
|
void |
addCO2ConcentrationReachedListener(BrickletCO2.CO2ConcentrationReachedListener listener)
Adds a CO2ConcentrationReached listener.
|
int |
getCO2Concentration()
Returns the measured CO2 concentration.
|
long |
getCO2ConcentrationCallbackPeriod()
Returns the period as set by
setCO2ConcentrationCallbackPeriod(long) . |
BrickletCO2.CO2ConcentrationCallbackThreshold |
getCO2ConcentrationCallbackThreshold()
Returns the threshold as set by
setCO2ConcentrationCallbackThreshold(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.
|
void |
removeCO2ConcentrationListener(BrickletCO2.CO2ConcentrationListener listener)
Removes a CO2Concentration listener.
|
void |
removeCO2ConcentrationReachedListener(BrickletCO2.CO2ConcentrationReachedListener listener)
Removes a CO2ConcentrationReached listener.
|
void |
setCO2ConcentrationCallbackPeriod(long period)
Sets the period with which the
BrickletCO2.CO2ConcentrationListener listener is
triggered periodically. |
void |
setCO2ConcentrationCallbackThreshold(char option,
int min,
int max)
Sets the thresholds for the
BrickletCO2.CO2ConcentrationReachedListener listener. |
void |
setDebouncePeriod(long debounce)
Sets the period with which the threshold listeners
*
BrickletCO2.CO2ConcentrationReachedListener ,
are triggered, if the thresholds
* setCO2ConcentrationCallbackThreshold(char, int, int) ,
keep being reached. |
getAPIVersion, getResponseExpected, setResponseExpected, setResponseExpectedAll
public static final int DEVICE_IDENTIFIER
public static final String DEVICE_DISPLAY_NAME
public static final byte FUNCTION_GET_CO2_CONCENTRATION
public static final byte FUNCTION_SET_CO2_CONCENTRATION_CALLBACK_PERIOD
public static final byte FUNCTION_GET_CO2_CONCENTRATION_CALLBACK_PERIOD
public static final byte FUNCTION_SET_CO2_CONCENTRATION_CALLBACK_THRESHOLD
public static final byte FUNCTION_GET_CO2_CONCENTRATION_CALLBACK_THRESHOLD
public static final byte FUNCTION_SET_DEBOUNCE_PERIOD
public static final byte FUNCTION_GET_DEBOUNCE_PERIOD
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 BrickletCO2(String uid, IPConnection ipcon)
public int getCO2Concentration() throws TinkerforgeException
BrickletCO2.CO2ConcentrationListener
listener and set the period with
setCO2ConcentrationCallbackPeriod(long)
.TinkerforgeException
public void setCO2ConcentrationCallbackPeriod(long period) throws TinkerforgeException
BrickletCO2.CO2ConcentrationListener
listener is
triggered periodically. A value of 0 turns the listener off.
The BrickletCO2.CO2ConcentrationListener
listener is only triggered if the CO2 concentration
has changed since the last triggering.TinkerforgeException
public long getCO2ConcentrationCallbackPeriod() throws TinkerforgeException
setCO2ConcentrationCallbackPeriod(long)
.TinkerforgeException
public void setCO2ConcentrationCallbackThreshold(char option, int min, int max) throws TinkerforgeException
BrickletCO2.CO2ConcentrationReachedListener
listener.
The following options are possible:
\verbatim
"Option", "Description"
"'x'", "Listener is turned off"
"'o'", "Listener is triggered when the CO2 concentration is *outside* the min and max values"
"'i'", "Listener is triggered when the CO2 concentration is *inside* the min and max values"
"'<'", "Listener is triggered when the CO2 concentration is smaller than the min value (max is ignored)"
"'>'", "Listener is triggered when the CO2 concentration is greater than the min value (max is ignored)"
\endverbatimTinkerforgeException
public BrickletCO2.CO2ConcentrationCallbackThreshold getCO2ConcentrationCallbackThreshold() throws TinkerforgeException
setCO2ConcentrationCallbackThreshold(char, int, int)
.TinkerforgeException
public void setDebouncePeriod(long debounce) throws TinkerforgeException
BrickletCO2.CO2ConcentrationReachedListener
,
are triggered, if the thresholds
* setCO2ConcentrationCallbackThreshold(char, int, int)
,
keep being reached.TinkerforgeException
public long getDebouncePeriod() throws TinkerforgeException
setDebouncePeriod(long)
.TinkerforgeException
public Device.Identity getIdentity() throws TinkerforgeException
getIdentity
in class Device
TinkerforgeException
public void addCO2ConcentrationListener(BrickletCO2.CO2ConcentrationListener listener)
public void removeCO2ConcentrationListener(BrickletCO2.CO2ConcentrationListener listener)
public void addCO2ConcentrationReachedListener(BrickletCO2.CO2ConcentrationReachedListener listener)
public void removeCO2ConcentrationReachedListener(BrickletCO2.CO2ConcentrationReachedListener listener)
Copyright © 2022 Tinkerforge GmbH. All rights reserved.