public class BrickletRemoteSwitch extends Device
Modifier and Type | Class and Description |
---|---|
static interface |
BrickletRemoteSwitch.SwitchingDoneListener
This listener is triggered whenever the switching state changes
from busy to ready, see
getSwitchingState() . |
Device.Identity
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEVICE_DISPLAY_NAME |
static int |
DEVICE_IDENTIFIER |
static byte |
FUNCTION_DIM_SOCKET_B |
static byte |
FUNCTION_GET_IDENTITY |
static byte |
FUNCTION_GET_REPEATS |
static byte |
FUNCTION_GET_SWITCHING_STATE |
static byte |
FUNCTION_SET_REPEATS |
static byte |
FUNCTION_SWITCH_SOCKET |
static byte |
FUNCTION_SWITCH_SOCKET_A |
static byte |
FUNCTION_SWITCH_SOCKET_B |
static byte |
FUNCTION_SWITCH_SOCKET_C |
static short |
SWITCH_TO_OFF |
static short |
SWITCH_TO_ON |
static short |
SWITCHING_STATE_BUSY |
static short |
SWITCHING_STATE_READY |
Constructor and Description |
---|
BrickletRemoteSwitch(java.lang.String uid,
IPConnection ipcon)
Creates an object with the unique device ID \c uid.
|
Modifier and Type | Method and Description |
---|---|
void |
addSwitchingDoneListener(BrickletRemoteSwitch.SwitchingDoneListener listener)
Adds a SwitchingDone listener.
|
void |
dimSocketB(long address,
short unit,
short dimValue)
To control a type B dimmer you have to give the address, unit and the
dim value you want to set the dimmer to.
|
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 |
getRepeats()
Returns the number of repeats as set by
setRepeats(short) . |
short |
getSwitchingState()
Returns the current switching state.
|
void |
removeSwitchingDoneListener(BrickletRemoteSwitch.SwitchingDoneListener listener)
Removes a SwitchingDone listener.
|
void |
setRepeats(short repeats)
Sets the number of times the code is sent when one of the switch socket
functions is called.
|
void |
switchSocket(short houseCode,
short receiverCode,
short switchTo)
This function is deprecated, use
switchSocketA(short, short, short) instead. |
void |
switchSocketA(short houseCode,
short receiverCode,
short switchTo)
To switch a type A socket you have to give the house code, receiver code and the
state (on or off) you want to switch to.
|
void |
switchSocketB(long address,
short unit,
short switchTo)
To switch a type B socket you have to give the address, unit and the state
(on or off) you want to switch to.
|
void |
switchSocketC(char systemCode,
short deviceCode,
short switchTo)
To switch a type C socket you have to give the system code, device code and the
state (on or off) you want to switch to.
|
getAPIVersion, getResponseExpected, setResponseExpected, setResponseExpectedAll
public static final int DEVICE_IDENTIFIER
public static final java.lang.String DEVICE_DISPLAY_NAME
public static final byte FUNCTION_SWITCH_SOCKET
public static final byte FUNCTION_GET_SWITCHING_STATE
public static final byte FUNCTION_SET_REPEATS
public static final byte FUNCTION_GET_REPEATS
public static final byte FUNCTION_SWITCH_SOCKET_A
public static final byte FUNCTION_SWITCH_SOCKET_B
public static final byte FUNCTION_DIM_SOCKET_B
public static final byte FUNCTION_SWITCH_SOCKET_C
public static final byte FUNCTION_GET_IDENTITY
public static final short SWITCH_TO_OFF
public static final short SWITCH_TO_ON
public static final short SWITCHING_STATE_READY
public static final short SWITCHING_STATE_BUSY
public BrickletRemoteSwitch(java.lang.String uid, IPConnection ipcon)
public void switchSocket(short houseCode, short receiverCode, short switchTo) throws TinkerforgeException
switchSocketA(short, short, short)
instead.TinkerforgeException
public short getSwitchingState() throws TinkerforgeException
setRepeats(short)
.TinkerforgeException
public void setRepeats(short repeats) throws TinkerforgeException
TinkerforgeException
public short getRepeats() throws TinkerforgeException
setRepeats(short)
.TinkerforgeException
public void switchSocketA(short houseCode, short receiverCode, short switchTo) throws TinkerforgeException
TinkerforgeException
public void switchSocketB(long address, short unit, short switchTo) throws TinkerforgeException
TinkerforgeException
public void dimSocketB(long address, short unit, short dimValue) throws TinkerforgeException
TinkerforgeException
public void switchSocketC(char systemCode, short deviceCode, short switchTo) throws TinkerforgeException
TinkerforgeException
public Device.Identity getIdentity() throws TinkerforgeException
getIdentity
in class Device
TinkerforgeException
public void addSwitchingDoneListener(BrickletRemoteSwitch.SwitchingDoneListener listener)
public void removeSwitchingDoneListener(BrickletRemoteSwitch.SwitchingDoneListener listener)
Copyright © 2020 Tinkerforge GmbH. All rights reserved.