public class FHZ1000PC extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
FHZ1000PC.FHZ1000Device
An interface to the "raw" FHZ1000 device where you can read and write
data to it.
|
class |
FHZ1000PC.FHZ1000SerialDevice
When running on Linux, we access the USB-device via generic serial
drivers for FTDI-chips.
|
class |
FHZ1000PC.JD2XXFHZ1000Device
When running on Windows, we access the USB-device via FTDI-specific
drivers to access the device.
|
Modifier and Type | Field and Description |
---|---|
static byte |
COMMAND_DELIVERY_STATE |
static byte |
COMMAND_DIM_DOWN |
static byte |
COMMAND_DIM_LOOP |
static byte |
COMMAND_DIM_UP |
static byte |
COMMAND_DIM1 |
static byte |
COMMAND_OFF |
static byte |
COMMAND_ON |
static byte |
COMMAND_TIMER_PROG |
static byte |
COMMAND_TOGGLE |
protected FHZ1000PC.FHZ1000Device |
m_Device |
protected FS20EventListener |
m_EventListener |
protected String |
m_PortName |
Modifier and Type | Method and Description |
---|---|
static String |
binFS20ByteToString(int value,
int bits)
Converts an integer address to the "base 4 + 1" format used by FS20 to
denote the addresses for buttons and devices.
|
void |
deviceEvent() |
void |
fs20Init()
Send FS20Init command to the FHZ1000PC device.
|
protected byte[] |
read()
Reads a complete message from the FHZ1000PC device and returns the
payload of the message including telegram type and checksum.
|
void |
registerEventListener(FS20EventListener ev) |
void |
sendFS20Command(int houseCode,
byte button,
byte command)
Send a command (for example COMMAND_DIM_DOWN) to a FS20 device (for
example a dimmer) via the FHZ1000PC.
|
static int |
StringFS20ToInt(String value)
Converts an address string in the "base 4 + 1" format used by FS20 to a
binary byte format actually used on the protocol.
|
void |
unregisterEventListener() |
protected int |
write(byte[] data,
byte telegramType)
Sends an string of bytes to the FHZ1000PC device.
|
public static final byte COMMAND_OFF
public static final byte COMMAND_DIM1
public static final byte COMMAND_ON
public static final byte COMMAND_DIM_LOOP
public static final byte COMMAND_DIM_DOWN
public static final byte COMMAND_DIM_UP
public static final byte COMMAND_TOGGLE
public static final byte COMMAND_TIMER_PROG
public static final byte COMMAND_DELIVERY_STATE
protected FHZ1000PC.FHZ1000Device m_Device
protected FS20EventListener m_EventListener
protected String m_PortName
public FHZ1000PC(String portName) throws IOException
IOException
public void fs20Init() throws IOException
IOException
public void sendFS20Command(int houseCode, byte button, byte command) throws IOException
houseCode
- 16 bit House Code of the FS20 device in binary form, not the
1111 2222-form.button
- 8 bit button idcommand
- FS20 Command (for example COMMAND_DIM_DOWN)IOException
public void registerEventListener(FS20EventListener ev)
public void unregisterEventListener() throws IOException
IOException
public void deviceEvent()
protected int write(byte[] data, byte telegramType) throws IOException
data
- Array of bytes to send to devicetelegramType
- Type of messageIOException
protected byte[] read() throws IOException
IOException
public static String binFS20ByteToString(int value, int bits)
value
- The binary value to convertbits
- Number of bits to convert, usually 8 or 16.public static int StringFS20ToInt(String value)
value
- The address string to convertCopyright © 2018 universAAL Consortium. All rights reserved.