public class BrickletSoundIntensity extends Device
Modifier and Type | Class and Description |
---|---|
class |
BrickletSoundIntensity.IntensityCallbackThreshold |
static interface |
BrickletSoundIntensity.IntensityListener
This listener is triggered periodically with the period that is set by
setIntensityCallbackPeriod(long) . |
static interface |
BrickletSoundIntensity.IntensityReachedListener
This listener is triggered when the threshold as set by
setIntensityCallbackThreshold(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_DEBOUNCE_PERIOD |
static byte |
FUNCTION_GET_IDENTITY |
static byte |
FUNCTION_GET_INTENSITY |
static byte |
FUNCTION_GET_INTENSITY_CALLBACK_PERIOD |
static byte |
FUNCTION_GET_INTENSITY_CALLBACK_THRESHOLD |
static byte |
FUNCTION_SET_DEBOUNCE_PERIOD |
static byte |
FUNCTION_SET_INTENSITY_CALLBACK_PERIOD |
static byte |
FUNCTION_SET_INTENSITY_CALLBACK_THRESHOLD |
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 |
---|
BrickletSoundIntensity(String uid,
IPConnection ipcon)
Creates an object with the unique device ID \c uid.
|
Modifier and Type | Method and Description |
---|---|
void |
addIntensityListener(BrickletSoundIntensity.IntensityListener listener)
Adds a Intensity listener.
|
void |
addIntensityReachedListener(BrickletSoundIntensity.IntensityReachedListener listener)
Adds a IntensityReached 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.
|
int |
getIntensity()
Returns the current sound intensity.
|
long |
getIntensityCallbackPeriod()
Returns the period as set by
setIntensityCallbackPeriod(long) . |
BrickletSoundIntensity.IntensityCallbackThreshold |
getIntensityCallbackThreshold()
Returns the threshold as set by
setIntensityCallbackThreshold(char, int, int) . |
void |
removeIntensityListener(BrickletSoundIntensity.IntensityListener listener)
Removes a Intensity listener.
|
void |
removeIntensityReachedListener(BrickletSoundIntensity.IntensityReachedListener listener)
Removes a IntensityReached listener.
|
void |
setDebouncePeriod(long debounce)
Sets the period with which the threshold listener
*
BrickletSoundIntensity.IntensityReachedListener
is triggered, if the thresholds
* setIntensityCallbackThreshold(char, int, int)
keeps being reached. |
void |
setIntensityCallbackPeriod(long period)
Sets the period with which the
BrickletSoundIntensity.IntensityListener listener is triggered
periodically. |
void |
setIntensityCallbackThreshold(char option,
int min,
int max)
Sets the thresholds for the
BrickletSoundIntensity.IntensityReachedListener listener. |
getAPIVersion, getResponseExpected, setResponseExpected, setResponseExpectedAll
public static final int DEVICE_IDENTIFIER
public static final String DEVICE_DISPLAY_NAME
public static final byte FUNCTION_GET_INTENSITY
public static final byte FUNCTION_SET_INTENSITY_CALLBACK_PERIOD
public static final byte FUNCTION_GET_INTENSITY_CALLBACK_PERIOD
public static final byte FUNCTION_SET_INTENSITY_CALLBACK_THRESHOLD
public static final byte FUNCTION_GET_INTENSITY_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 BrickletSoundIntensity(String uid, IPConnection ipcon)
public int getIntensity() throws TinkerforgeException
BrickletSoundIntensity.IntensityListener
listener and set the period with
setIntensityCallbackPeriod(long)
.TinkerforgeException
public void setIntensityCallbackPeriod(long period) throws TinkerforgeException
BrickletSoundIntensity.IntensityListener
listener is triggered
periodically. A value of 0 turns the listener off.
The BrickletSoundIntensity.IntensityListener
listener is only triggered if the intensity has changed
since the last triggering.TinkerforgeException
public long getIntensityCallbackPeriod() throws TinkerforgeException
setIntensityCallbackPeriod(long)
.TinkerforgeException
public void setIntensityCallbackThreshold(char option, int min, int max) throws TinkerforgeException
BrickletSoundIntensity.IntensityReachedListener
listener.
The following options are possible:
\verbatim
"Option", "Description"
"'x'", "Listener is turned off"
"'o'", "Listener is triggered when the intensity is *outside* the min and max values"
"'i'", "Listener is triggered when the intensity is *inside* the min and max values"
"'<'", "Listener is triggered when the intensity is smaller than the min value (max is ignored)"
"'>'", "Listener is triggered when the intensity is greater than the min value (max is ignored)"
\endverbatimTinkerforgeException
public BrickletSoundIntensity.IntensityCallbackThreshold getIntensityCallbackThreshold() throws TinkerforgeException
setIntensityCallbackThreshold(char, int, int)
.TinkerforgeException
public void setDebouncePeriod(long debounce) throws TinkerforgeException
BrickletSoundIntensity.IntensityReachedListener
is triggered, if the thresholds
* setIntensityCallbackThreshold(char, int, int)
keeps being reached.TinkerforgeException
public long getDebouncePeriod() throws TinkerforgeException
setDebouncePeriod(long)
.TinkerforgeException
public Device.Identity getIdentity() throws TinkerforgeException
getIdentity
in class Device
TinkerforgeException
public void addIntensityListener(BrickletSoundIntensity.IntensityListener listener)
public void removeIntensityListener(BrickletSoundIntensity.IntensityListener listener)
public void addIntensityReachedListener(BrickletSoundIntensity.IntensityReachedListener listener)
public void removeIntensityReachedListener(BrickletSoundIntensity.IntensityReachedListener listener)
Copyright © 2022 Tinkerforge GmbH. All rights reserved.