tuwien.auto.calimero.process
Interface ProcessCommunicator

All Known Implementing Classes:
ProcessCommunicatorImpl

public interface ProcessCommunicator

Provides process communication with a KNX network.

The process communicator uses application layer group services for communication. Its interface uses high level interaction based on Java data types and blocking read/write functionality.


Field Summary
static java.lang.String ANGLE
          Represents the scaling format of datapoint type Angle (DPT ID 5.003).
static boolean BOOL_DECREASE
          Represents "decrease" of datapoint type Step (DPT ID 1.007), value = false.
static boolean BOOL_DOWN
          Represents "down" of datapoint type Up/Down (DPT ID 1.008), value = true.
static boolean BOOL_INCREASE
          Represents "increase" of datapoint type Step (DPT ID 1.007), value = true.
static boolean BOOL_OFF
          Represents "off" of datapoint type Switch (DPT ID 1.001), value = false.
static boolean BOOL_ON
          Represents "on" of datapoint type Switch (DPT ID 1.001), value = true.
static boolean BOOL_START
          Represents "start" of datapoint type Start (DPT ID 1.010), value = true.
static boolean BOOL_STOP
          Represents "stop" of datapoint type Start (DPT ID 1.010), value = false.
static boolean BOOL_UP
          Represents "up" of datapoint type Up/Down (DPT ID 1.008), value = false.
static java.lang.String SCALING
          Represents the scaling format of datapoint type Scaling (DPT ID 5.001).
static java.lang.String UNSCALED
          Represents the unscaled format, no scaling is used (like in datapoint types Unsigned count (DPT ID 5.010) or Decimal factor (DPT ID 5.005) ).
 
Method Summary
 void addProcessListener(ProcessListener l)
          Adds the specified event listener l to receive events from this process communicator.
 KNXNetworkLink detach()
          Detaches the network link from this process communicator.
 Priority getPriority()
          Returns the current used KNX message priority for KNX messages.
 int getResponseTimeout()
          Returns the response timeout used when waiting for a KNX response message to arrive.
 java.lang.String read(Datapoint dp)
          Reads a datapoint value from a group destination.
 boolean readBool(GroupAddress dst)
          Reads a boolean datapoint value from a group destination.
 byte readControl(GroupAddress dst)
          Reads a 3 Bit controlled datapoint value from a group destination.
 float readFloat(GroupAddress dst)
          Reads a 2 byte KNX float datapoint value from a group destination.
 java.lang.String readString(GroupAddress dst)
          Reads a string datapoint value from a group destination.
 short readUnsigned(GroupAddress dst, java.lang.String scale)
          Reads an unsigned 8 bit datapoint value from a group destination.
 void removeProcessListener(ProcessListener l)
          Removes the specified event listener l, so it does no longer receive events from this process communicator.
 void setPriority(Priority p)
          Sets the KNX message priority for KNX messages to send.
 void setResponseTimeout(int timeout)
          Sets the response timeout to wait for a KNX response message to arrive to complete a message exchange.
 void write(Datapoint dp, java.lang.String value)
          Writes a datapoint value to a group destination.
 void write(GroupAddress dst, boolean value)
          Writes a boolean datapoint value to a group destination.
 void write(GroupAddress dst, boolean control, byte stepcode)
          Writes a 3 bit controlled datapoint value to a group destination.
 void write(GroupAddress dst, float value)
          Writes a 2 byte KNX float datapoint value to a group destination.
 void write(GroupAddress dst, int value, java.lang.String scale)
          Writes a 8 bit unsigned datapoint value to a group destination.
 void write(GroupAddress dst, java.lang.String value)
          Writes a string datapoint value to a group destination.
 

Field Detail

ANGLE

static final java.lang.String ANGLE
Represents the scaling format of datapoint type Angle (DPT ID 5.003).

This format scales the 8 Bit unsigned value range from 0 to 360.

See Also:
readUnsigned(GroupAddress, String), write(GroupAddress, int, String), Constant Field Values

BOOL_DECREASE

static final boolean BOOL_DECREASE
Represents "decrease" of datapoint type Step (DPT ID 1.007), value = false.

See Also:
write(GroupAddress, boolean), write(GroupAddress, boolean, byte), Constant Field Values

BOOL_DOWN

static final boolean BOOL_DOWN
Represents "down" of datapoint type Up/Down (DPT ID 1.008), value = true.

See Also:
write(GroupAddress, boolean), write(GroupAddress, boolean, byte), Constant Field Values

BOOL_INCREASE

static final boolean BOOL_INCREASE
Represents "increase" of datapoint type Step (DPT ID 1.007), value = true.

See Also:
write(GroupAddress, boolean), write(GroupAddress, boolean, byte), Constant Field Values

BOOL_OFF

static final boolean BOOL_OFF
Represents "off" of datapoint type Switch (DPT ID 1.001), value = false.

See Also:
write(GroupAddress, boolean), write(GroupAddress, boolean, byte), Constant Field Values

BOOL_ON

static final boolean BOOL_ON
Represents "on" of datapoint type Switch (DPT ID 1.001), value = true.

See Also:
write(GroupAddress, boolean), write(GroupAddress, boolean, byte), Constant Field Values

BOOL_START

static final boolean BOOL_START
Represents "start" of datapoint type Start (DPT ID 1.010), value = true.

See Also:
write(GroupAddress, boolean), write(GroupAddress, boolean, byte), Constant Field Values

BOOL_STOP

static final boolean BOOL_STOP
Represents "stop" of datapoint type Start (DPT ID 1.010), value = false.

See Also:
write(GroupAddress, boolean), write(GroupAddress, boolean, byte), Constant Field Values

BOOL_UP

static final boolean BOOL_UP
Represents "up" of datapoint type Up/Down (DPT ID 1.008), value = false.

See Also:
write(GroupAddress, boolean), write(GroupAddress, boolean, byte), Constant Field Values

SCALING

static final java.lang.String SCALING
Represents the scaling format of datapoint type Scaling (DPT ID 5.001).

This format scales the 8 Bit unsigned value range from 0 to 100.

See Also:
readUnsigned(GroupAddress, String), write(GroupAddress, int, String), Constant Field Values

UNSCALED

static final java.lang.String UNSCALED
Represents the unscaled format, no scaling is used (like in datapoint types Unsigned count (DPT ID 5.010) or Decimal factor (DPT ID 5.005) ).

See Also:
readUnsigned(GroupAddress, String), write(GroupAddress, int, String), Constant Field Values
Method Detail

addProcessListener

void addProcessListener(ProcessListener l)
Adds the specified event listener l to receive events from this process communicator.

If l was already added as listener, no action is performed.

Parameters:
l - the listener to add

detach

KNXNetworkLink detach()
Detaches the network link from this process communicator.

If no network link is attached, no action is performed.

Note that a detach does not trigger a close of the used network link.

Returns:
the formerly attached KNX network link, or null if already detached

getPriority

Priority getPriority()
Returns the current used KNX message priority for KNX messages.

Returns:
message Priority

getResponseTimeout

int getResponseTimeout()
Returns the response timeout used when waiting for a KNX response message to arrive.

Returns:
timeout in seconds

read

java.lang.String read(Datapoint dp)
                      throws KNXException
Reads a datapoint value from a group destination.

The used KNX message priority is according the supplied datapoint priority.

Parameters:
dp - the datapoint for read
Returns:
the read value in textual representation according the datapoint its type
Throws:
KNXTimeoutException - on a timeout during send or no read response was received
KNXInvalidResponseException - on invalid read response message
KNXLinkClosedException - if network link to KNX network is closed
KNXFormatException - on translation problem of the response data
KNXException - if no appropriate DPT translator for the datapoint type is available

readBool

boolean readBool(GroupAddress dst)
                 throws KNXException
Reads a boolean datapoint value from a group destination.

Parameters:
dst - group destination to read from
Returns:
the read value of type boolean
Throws:
KNXTimeoutException - on a timeout during send or no read response was received
KNXInvalidResponseException - on invalid read response message
KNXLinkClosedException - if network link to KNX network is closed
KNXFormatException - on translation problem of the response data
KNXException - on other read problems

readControl

byte readControl(GroupAddress dst)
                 throws KNXException
Reads a 3 Bit controlled datapoint value from a group destination.

The returned value is either positive or negative according to the read control information. For control bit orientation, the DPT Dimming (DPT ID 3.007) is used (i.e. control bit type Step). A control value of "decrease" results in a negative value return, a control value of "increase" results in a positive value return. The possible value range is -7 (decrease 7) to +7 (increase 7).

Parameters:
dst - group destination to read from
Returns:
the read value of type 3 Bit controlled
Throws:
KNXTimeoutException - on a timeout during send or no read response was received
KNXInvalidResponseException - on invalid read response message
KNXLinkClosedException - if network link to KNX network is closed
KNXFormatException - on translation problem of the response data
KNXException - on other read problems

readFloat

float readFloat(GroupAddress dst)
                throws KNXException
Reads a 2 byte KNX float datapoint value from a group destination.

Parameters:
dst - group destination to read from
Returns:
the read value of type float
Throws:
KNXTimeoutException - on a timeout during send or no read response was received
KNXInvalidResponseException - on invalid read response message
KNXLinkClosedException - if network link to KNX network is closed
KNXFormatException - on translation problem of the response data
KNXException - on other read problems

readString

java.lang.String readString(GroupAddress dst)
                            throws KNXException
Reads a string datapoint value from a group destination.

The supported character set covers at least ISO-8859-1 (Latin 1), with an allowed string length of 14 characters.

Parameters:
dst - group destination to read from
Returns:
the read value of type string
Throws:
KNXTimeoutException - on a timeout during send or no read response was received
KNXInvalidResponseException - on invalid read response message
KNXLinkClosedException - if network link to KNX network is closed
KNXFormatException - on translation problem of the response data
KNXException - on other read problems

readUnsigned

short readUnsigned(GroupAddress dst,
                   java.lang.String scale)
                   throws KNXException
Reads an unsigned 8 bit datapoint value from a group destination.

The predefined scaling format constants are equal to DPT identifiers of the 8 Bit DPT translator, any other suiting IDs of that type might be specified as well.

Parameters:
dst - group destination to read from
scale - scaling of the read value before return, one of SCALING, UNSCALED, ANGLE
Returns:
the read value of type unsigned byte
Throws:
KNXTimeoutException - on a timeout during send or no read response was received
KNXInvalidResponseException - on invalid read response message
KNXLinkClosedException - if network link to KNX network is closed
KNXFormatException - on translation problem of the response data
KNXException - on other read problems

removeProcessListener

void removeProcessListener(ProcessListener l)
Removes the specified event listener l, so it does no longer receive events from this process communicator.

If l was not added in the first place, no action is performed.

Parameters:
l - the listener to remove

setPriority

void setPriority(Priority p)
Sets the KNX message priority for KNX messages to send.

Parameters:
p - new priority to use

setResponseTimeout

void setResponseTimeout(int timeout)
Sets the response timeout to wait for a KNX response message to arrive to complete a message exchange.

Parameters:
timeout - time in seconds

write

void write(Datapoint dp,
           java.lang.String value)
           throws KNXException
Writes a datapoint value to a group destination.

The used KNX message priority is according the supplied datapoint priority.

Parameters:
dp - the datapoint for write
value - datapoint value in textual representation according the datapoint its type
Throws:
KNXTimeoutException - on a timeout during send
KNXFormatException - on translation problem of the supplied datapoint value
KNXLinkClosedException - if network link to KNX network is closed
KNXException - if no appropriate DPT translator for the datapoint type is available

write

void write(GroupAddress dst,
           boolean value)
           throws KNXTimeoutException,
                  KNXLinkClosedException
Writes a boolean datapoint value to a group destination.

Parameters:
dst - group destination to write to
value - boolean value to write, consider the predefined BOOL_* constants (e.g. BOOL_ON)
Throws:
KNXTimeoutException - on a timeout during send
KNXLinkClosedException - if network link to KNX network is closed

write

void write(GroupAddress dst,
           boolean control,
           byte stepcode)
           throws KNXException
Writes a 3 bit controlled datapoint value to a group destination.

Parameters:
dst - group destination to write to
control - control information, one of the predefined BOOL_* constants of DPT Step and DPT Up/Down
stepcode - stepcode value, 0 <= value <= 7
Throws:
KNXTimeoutException - on a timeout during send
KNXFormatException - on translation problem of the supplied datapoint value
KNXLinkClosedException - if network link to KNX network is closed
KNXException - on other write problems

write

void write(GroupAddress dst,
           float value)
           throws KNXException
Writes a 2 byte KNX float datapoint value to a group destination.

Parameters:
dst - group destination to write to
value - float value to write
Throws:
KNXTimeoutException - on a timeout during send
KNXFormatException - on translation problem of the supplied datapoint value
KNXLinkClosedException - if network link to KNX network is closed
KNXException - on other write problems

write

void write(GroupAddress dst,
           int value,
           java.lang.String scale)
           throws KNXException
Writes a 8 bit unsigned datapoint value to a group destination.

The predefined scaling format constants are equal to DPT identifiers of the 8 Bit DPT translator, any other suiting IDs of that type might be specified as well.

Parameters:
dst - group destination to write to
value - unsigned scaled value to write, 0 <= value <= scale format specific upper value
scale - scaling of the read value before return, one of SCALING, UNSCALED, ANGLE
Throws:
KNXTimeoutException - on a timeout during send
KNXFormatException - on translation problem of the supplied datapoint value
KNXLinkClosedException - if network link to KNX network is closed
KNXException - on other write problems

write

void write(GroupAddress dst,
           java.lang.String value)
           throws KNXException
Writes a string datapoint value to a group destination.

The supported character set covers at least ISO-8859-1 (Latin 1), with an allowed string length of 14 characters.

Parameters:
dst - group destination to write to
value - string value to write
Throws:
KNXTimeoutException - on a timeout during send
KNXFormatException - on translation problem of the supplied datapoint value
KNXLinkClosedException - if network link to KNX network is closed
KNXException - on other write problems