|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttuwien.auto.calimero.datapoint.Datapoint
tuwien.auto.calimero.datapoint.StateDP
public class StateDP
Represents a state based KNX datapoint.
State based datapoint interaction leads to transitions between states (so a datapoint
value associated to a certain datapoint represents a particular state over an amount of
time). The state of such a datapoint can be updated/invalidated by different (i.e. more
than one) KNX group addresses. An address marked as updating the state of this
datapoint will allow KNX indication and response messages with that destination address
to set a new datapoint state value. An address marked as invalidating the state of this
datapoint will allow KNX indication messages with that destination address to delete
any state value information of the datapoint.
This datapoint does not check for mutually exclusive containment of an address in one
of those both categories. The behavior when adding a KNX group address to both updating
and invalidating the datapoint state is undefined.
Constructor Summary | |
---|---|
StateDP(GroupAddress main,
java.lang.String name)
Creates a new state based datapoint with a name. |
|
StateDP(GroupAddress main,
java.lang.String name,
java.util.Collection invalidatingAddresses,
java.util.Collection updatingAddresses)
Creates a new state based datapoint and adds invalidating and updating addresses. |
|
StateDP(GroupAddress main,
java.lang.String name,
int mainNumber,
java.lang.String dptID)
Creates a new datapoint with a name and specifies datapoint translation type. |
|
StateDP(XMLReader r)
Creates a new state based datapoint from XML input. |
Method Summary | |
---|---|
void |
add(GroupAddress a,
boolean isUpdating)
Adds a group address to this datapoint to indicate that KNX messages with that address are allowed to alter the associated datapoint state (i.e. a state value related to this datapoint). |
java.util.Collection |
getAddresses(boolean updatingAddresses)
Returns the collection of KNX group addresses which are allowed to alter the state of this datapoint. |
int |
getExpirationTimeout()
Returns the expiration timeout for datapoint state values related to this datapoint. |
boolean |
isInvalidating(GroupAddress a)
Returns whether KNX indication messages with destination group address a will invalidate the associated datapoint state of this datapoint. |
boolean |
isUpdating(GroupAddress a)
Returns whether KNX indication or response messages with destination address a will update the associated datapoint state of this datapoint. |
void |
remove(GroupAddress a,
boolean fromUpdating)
Removes a state updating/invalidating group address from this datapoint. |
void |
setExpirationTimeout(int timeout)
Sets the expiration timeout for datapoint state values related to this datapoint. |
java.lang.String |
toString()
|
Methods inherited from class tuwien.auto.calimero.datapoint.Datapoint |
---|
create, getDPT, getMainAddress, getMainNumber, getName, getPriority, isStateBased, save, setDPT, setName, setPriority |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public StateDP(GroupAddress main, java.lang.String name)
main
- the group address used to identify this datapointname
- user defined datapoint namepublic StateDP(GroupAddress main, java.lang.String name, java.util.Collection invalidatingAddresses, java.util.Collection updatingAddresses)
main
- the group address used to identify this datapointname
- user defined datapoint nameinvalidatingAddresses
- KNX group addresses, whose indication messages
invalidate this datapoint stateupdatingAddresses
- KNX group addresses, whose indication and response
messages lead to an update of this datapoint statepublic StateDP(GroupAddress main, java.lang.String name, int mainNumber, java.lang.String dptID)
main
- the group address used to identify this datapointname
- user defined datapoint namemainNumber
- main number of the data type used for translation of a datapoint
value; if the used dptID
argument unambiguously identifies a
DPT translator, main number might be left 0dptID
- the datapoint type ID used for translation in a DPT translatorpublic StateDP(XMLReader r) throws KNXMLException
If the current XML element position is no start tag, the next element tag is read. The datapoint element is then expected to be the current element in the reader.
r
- a XML reader
KNXMLException
- if the XML element is no datapoint or could not be read
correctlyMethod Detail |
---|
public final void add(GroupAddress a, boolean isUpdating)
A group address can be marked as updating a state or invalidating a state. An address is added at most once to each category.
a
- the KNX group address to addisUpdating
- true
to mark the address as updating this
datapoint state, false
to mark it as state invalidatingpublic java.util.Collection getAddresses(boolean updatingAddresses)
updatingAddresses
- true
if the updating addresses should be
returned, false
for the invalidating addresses
GroupAddress
public final int getExpirationTimeout()
If no timeout limit is set, 0 is returned.
public final boolean isInvalidating(GroupAddress a)
a
will invalidate the associated datapoint state of this datapoint.
a
- the address to check
true
iff address is invalidating, false
otherwisepublic final boolean isUpdating(GroupAddress a)
a
will update the associated datapoint state of this datapoint.
a
- the address to check
true
iff address is updating, false
otherwisepublic final void remove(GroupAddress a, boolean fromUpdating)
The group address is no longer contained in the corresponding updating/invalidating category.
a
- the KNX group address to removefromUpdating
- true
to remove from updating this datapoint
state, false
to remove from invalidating this datapoint statepublic final void setExpirationTimeout(int timeout)
This timeout specifies how long a local datapoint value is considered valid since
it was received or got updated the last time inside Calimero.
When working with state values related to this datapoint, this timeout should be
queried using getExpirationTimeout()
to check whether there is a timeout
set, and a value can still be considered valid / up to date. An expired state value
is not intended to be used anymore, it should be discarded and requested/updated
from the KNX network.
A timeout of 0 indicates no timeout limit set.
timeout
- timeout in seconds, 0 for no timeout limitpublic java.lang.String toString()
toString
in class Datapoint
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |