|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttuwien.auto.calimero.process.ProcessCommunicatorImpl
public class ProcessCommunicatorImpl
This implementation of the process communicator uses in any case the DPT translators
DPTXlatorBoolean
, DPTXlator3BitControlled
,
DPTXlator8BitUnsigned
, DPTXlator2ByteFloat
, DPTXlatorString
.
Other translator types are loaded through TranslatorTypes
.
Field Summary |
---|
Fields inherited from interface tuwien.auto.calimero.process.ProcessCommunicator |
---|
ANGLE, BOOL_DECREASE, BOOL_DOWN, BOOL_INCREASE, BOOL_OFF, BOOL_ON, BOOL_START, BOOL_STOP, BOOL_UP, SCALING, UNSCALED |
Constructor Summary | |
---|---|
ProcessCommunicatorImpl(KNXNetworkLink link)
Creates a new process communicator attached to the supplied KNX network link. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ProcessCommunicatorImpl(KNXNetworkLink link) throws KNXLinkClosedException
The log service used by this process communicator is named "process " +
link.getName()
.
link
- network link used for communication with a KNX network
KNXLinkClosedException
- if the network link is closedMethod Detail |
---|
public void addProcessListener(ProcessListener l)
ProcessCommunicator
l
to receive events from this
process communicator.
If l
was already added as listener, no action is performed.
addProcessListener
in interface ProcessCommunicator
l
- the listener to addpublic KNXNetworkLink detach()
ProcessCommunicator
If no network link is attached, no action is performed.
Note that a detach does not trigger a close of the used network link.
detach
in interface ProcessCommunicator
null
if already
detachedpublic Priority getPriority()
ProcessCommunicator
getPriority
in interface ProcessCommunicator
public int getResponseTimeout()
ProcessCommunicator
getResponseTimeout
in interface ProcessCommunicator
public java.lang.String read(Datapoint dp) throws KNXException
ProcessCommunicator
The used KNX message priority is according the supplied datapoint priority.
read
in interface ProcessCommunicator
dp
- the datapoint for read
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
availablepublic boolean readBool(GroupAddress dst) throws KNXTimeoutException, KNXRemoteException, KNXLinkClosedException, KNXFormatException
ProcessCommunicator
readBool
in interface ProcessCommunicator
dst
- group destination to read from
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
KNXRemoteException
public byte readControl(GroupAddress dst) throws KNXTimeoutException, KNXRemoteException, KNXLinkClosedException, KNXFormatException
ProcessCommunicator
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).
readControl
in interface ProcessCommunicator
dst
- group destination to read from
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
KNXRemoteException
public float readFloat(GroupAddress dst) throws KNXTimeoutException, KNXRemoteException, KNXLinkClosedException, KNXFormatException
ProcessCommunicator
readFloat
in interface ProcessCommunicator
dst
- group destination to read from
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
KNXRemoteException
public java.lang.String readString(GroupAddress dst) throws KNXTimeoutException, KNXRemoteException, KNXLinkClosedException, KNXFormatException
ProcessCommunicator
The supported character set covers at least ISO-8859-1 (Latin 1), with an allowed string length of 14 characters.
readString
in interface ProcessCommunicator
dst
- group destination to read from
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
KNXRemoteException
public short readUnsigned(GroupAddress dst, java.lang.String scale) throws KNXTimeoutException, KNXRemoteException, KNXLinkClosedException, KNXFormatException
ProcessCommunicator
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.
readUnsigned
in interface ProcessCommunicator
dst
- group destination to read fromscale
- scaling of the read value before return, one of ProcessCommunicator.SCALING
,
ProcessCommunicator.UNSCALED
, ProcessCommunicator.ANGLE
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
KNXRemoteException
public void removeProcessListener(ProcessListener l)
ProcessCommunicator
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.
removeProcessListener
in interface ProcessCommunicator
l
- the listener to removepublic void setPriority(Priority p)
ProcessCommunicator
setPriority
in interface ProcessCommunicator
p
- new priority to usepublic void setResponseTimeout(int timeout)
ProcessCommunicator
setResponseTimeout
in interface ProcessCommunicator
timeout
- time in secondspublic void write(Datapoint dp, java.lang.String value) throws KNXException
ProcessCommunicator
The used KNX message priority is according the supplied datapoint priority.
write
in interface ProcessCommunicator
dp
- the datapoint for writevalue
- datapoint value in textual representation according the datapoint its
type
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
availablepublic void write(GroupAddress dst, boolean value) throws KNXTimeoutException, KNXLinkClosedException
ProcessCommunicator
write
in interface ProcessCommunicator
dst
- group destination to write tovalue
- boolean value to write, consider the predefined BOOL_* constants (e.g.
ProcessCommunicator.BOOL_ON
)
KNXTimeoutException
- on a timeout during send
KNXLinkClosedException
- if network link to KNX network is closedpublic void write(GroupAddress dst, boolean control, byte stepcode) throws KNXTimeoutException, KNXFormatException, KNXLinkClosedException
ProcessCommunicator
write
in interface ProcessCommunicator
dst
- group destination to write tocontrol
- control information, one of the predefined BOOL_* constants of DPT
Step and DPT Up/Downstepcode
- stepcode value, 0 <= value <= 7
KNXTimeoutException
- on a timeout during send
KNXFormatException
- on translation problem of the supplied datapoint value
KNXLinkClosedException
- if network link to KNX network is closedpublic void write(GroupAddress dst, float value) throws KNXTimeoutException, KNXFormatException, KNXLinkClosedException
ProcessCommunicator
write
in interface ProcessCommunicator
dst
- group destination to write tovalue
- float value to write
KNXTimeoutException
- on a timeout during send
KNXFormatException
- on translation problem of the supplied datapoint value
KNXLinkClosedException
- if network link to KNX network is closedpublic void write(GroupAddress dst, int value, java.lang.String scale) throws KNXTimeoutException, KNXFormatException, KNXLinkClosedException
ProcessCommunicator
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.
write
in interface ProcessCommunicator
dst
- group destination to write tovalue
- unsigned scaled value to write, 0 <= value <= scale format
specific upper valuescale
- scaling of the read value before return, one of ProcessCommunicator.SCALING
,
ProcessCommunicator.UNSCALED
, ProcessCommunicator.ANGLE
KNXTimeoutException
- on a timeout during send
KNXFormatException
- on translation problem of the supplied datapoint value
KNXLinkClosedException
- if network link to KNX network is closedpublic void write(GroupAddress dst, java.lang.String value) throws KNXTimeoutException, KNXFormatException, KNXLinkClosedException
ProcessCommunicator
The supported character set covers at least ISO-8859-1 (Latin 1), with an allowed string length of 14 characters.
write
in interface ProcessCommunicator
dst
- group destination to write tovalue
- string value to write
KNXTimeoutException
- on a timeout during send
KNXFormatException
- on translation problem of the supplied datapoint value
KNXLinkClosedException
- if network link to KNX network is closed
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |