public class BrickletTilt extends Device
Modifier and Type | Class and Description |
---|---|
static interface |
BrickletTilt.TiltStateListener
This listener provides the current tilt state.
|
Device.Identity
Modifier and Type | Field and Description |
---|---|
static String |
DEVICE_DISPLAY_NAME |
static int |
DEVICE_IDENTIFIER |
static byte |
FUNCTION_DISABLE_TILT_STATE_CALLBACK |
static byte |
FUNCTION_ENABLE_TILT_STATE_CALLBACK |
static byte |
FUNCTION_GET_IDENTITY |
static byte |
FUNCTION_GET_TILT_STATE |
static byte |
FUNCTION_IS_TILT_STATE_CALLBACK_ENABLED |
static short |
TILT_STATE_CLOSED |
static short |
TILT_STATE_CLOSED_VIBRATING |
static short |
TILT_STATE_OPEN |
Constructor and Description |
---|
BrickletTilt(String uid,
IPConnection ipcon)
Creates an object with the unique device ID \c uid.
|
Modifier and Type | Method and Description |
---|---|
void |
addTiltStateListener(BrickletTilt.TiltStateListener listener)
Adds a TiltState listener.
|
void |
disableTiltStateCallback()
Disables the
BrickletTilt.TiltStateListener listener. |
void |
enableTiltStateCallback()
Enables the
BrickletTilt.TiltStateListener listener. |
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 |
getTiltState()
Returns the current tilt state.
|
boolean |
isTiltStateCallbackEnabled()
Returns *true* if the
BrickletTilt.TiltStateListener listener is enabled. |
void |
removeTiltStateListener(BrickletTilt.TiltStateListener listener)
Removes a TiltState listener.
|
getAPIVersion, getResponseExpected, setResponseExpected, setResponseExpectedAll
public static final int DEVICE_IDENTIFIER
public static final String DEVICE_DISPLAY_NAME
public static final byte FUNCTION_GET_TILT_STATE
public static final byte FUNCTION_ENABLE_TILT_STATE_CALLBACK
public static final byte FUNCTION_DISABLE_TILT_STATE_CALLBACK
public static final byte FUNCTION_IS_TILT_STATE_CALLBACK_ENABLED
public static final byte FUNCTION_GET_IDENTITY
public static final short TILT_STATE_CLOSED
public static final short TILT_STATE_OPEN
public static final short TILT_STATE_CLOSED_VIBRATING
public BrickletTilt(String uid, IPConnection ipcon)
public short getTiltState() throws TinkerforgeException
TinkerforgeException
public void enableTiltStateCallback() throws TinkerforgeException
BrickletTilt.TiltStateListener
listener.TinkerforgeException
public void disableTiltStateCallback() throws TinkerforgeException
BrickletTilt.TiltStateListener
listener.TinkerforgeException
public boolean isTiltStateCallbackEnabled() throws TinkerforgeException
BrickletTilt.TiltStateListener
listener is enabled.TinkerforgeException
public Device.Identity getIdentity() throws TinkerforgeException
getIdentity
in class Device
TinkerforgeException
public void addTiltStateListener(BrickletTilt.TiltStateListener listener)
public void removeTiltStateListener(BrickletTilt.TiltStateListener listener)
Copyright © 2022 Tinkerforge GmbH. All rights reserved.