|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttuwien.auto.calimero.mgmt.KnIPDeviceMgmtAdapter
public class KnIPDeviceMgmtAdapter
Property adapter for KNXnet/IP local device management.
This adapter is based on a KNXnetIPDevMgmt
connection.
The object instance used is always the first one, i.e. object instance 1.
Constructor Summary | |
---|---|
KnIPDeviceMgmtAdapter(java.net.InetSocketAddress localEP,
java.net.InetSocketAddress serverCtrlEP,
boolean useNAT,
PropertyAdapterListener l,
boolean queryWriteEnable)
Creates a new property adapter for local device management. |
Method Summary | |
---|---|
void |
close()
Closes the adapter. |
byte[] |
getDescription(int objIndex,
int pid,
int propIndex)
Reads the description of a property of an interface object. |
java.lang.String |
getName()
Returns the name for identifying this adapter and its destination. |
byte[] |
getProperty(int objIndex,
int pid,
int start,
int elements)
Gets property value elements in an interface object property. |
boolean |
isOpen()
Returns whether this adapter can be used for property access and is not closed. |
void |
setProperty(int objIndex,
int pid,
int start,
int elements,
byte[] data)
Sets property value elements in an interface object property. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public KnIPDeviceMgmtAdapter(java.net.InetSocketAddress localEP, java.net.InetSocketAddress serverCtrlEP, boolean useNAT, PropertyAdapterListener l, boolean queryWriteEnable) throws KNXException
The server to do management for is specified with the server control endpoint.
A note on write enabled / read only properties:
The check whether a property is read only or write enabled, is done by issuing a
write request for that property. Due to the memory layout, write cycles of a memory
location and similar, this might not always be desired. To enable or skip this
check, the queryWriteEnable
option has to be set appropriately.
Currently, the write enabled check is only of interest when getting a property
description getDescription(int, int, int)
.
localEP
- the local endpoint of the connection, use null
for
assigning the default local host and an unused (ephemeral) portserverCtrlEP
- the remote server control endpoint used for connect requestuseNAT
- true
to use a network address translation aware
communication mechanism, false
to use the default wayl
- property adapter listener to get notified about adapter events, use
null
for no listenerqueryWriteEnable
- true
to check whether a property is write
enabled or read only, false
to skip the check
KNXException
- on failure establishing local device management connection or
failure while initializing property adapterMethod Detail |
---|
public void close()
PropertyAdapter
Depending on the adapter, necessary steps to terminate a connection might be done
and owned resources will be freed.
A closed adapter can't be used for property access anymore.
Currently, this method does not invoke
PropertyAdapterListener.adapterClosed(tuwien.auto.calimero.CloseEvent)
.
close
in interface PropertyAdapter
public byte[] getDescription(int objIndex, int pid, int propIndex) throws KNXTimeoutException, KNXConnectionClosedException, KNXRemoteException
PropertyAdapter
The property description layout is according the application layer property description service.
getDescription
in interface PropertyAdapter
objIndex
- interface object indexpid
- property identifier, specify 0 to use the property indexpropIndex
- property index, starts with index 0 for the first property
KNXTimeoutException
KNXConnectionClosedException
KNXRemoteException
public java.lang.String getName()
The name for this adapter starts with "local DM " + KNXnet/IP server control endpoint, allowing easier distinction of adapter types.
getName
in interface PropertyAdapter
public byte[] getProperty(int objIndex, int pid, int start, int elements) throws KNXTimeoutException, KNXRemoteException, KNXConnectionClosedException
PropertyAdapter
getProperty
in interface PropertyAdapter
objIndex
- interface object indexpid
- property identifierstart
- start index in the property value to start reading fromelements
- number of elements to get
KNXTimeoutException
KNXRemoteException
KNXConnectionClosedException
public boolean isOpen()
PropertyAdapter
isOpen
in interface PropertyAdapter
true
if adapter open, false
if closedpublic void setProperty(int objIndex, int pid, int start, int elements, byte[] data) throws KNXTimeoutException, KNXRemoteException, KNXConnectionClosedException
PropertyAdapter
setProperty
in interface PropertyAdapter
objIndex
- interface object indexpid
- property identifierstart
- start index in the property value to start writing toelements
- number of elements to setdata
- byte array containing the property value data
KNXTimeoutException
KNXRemoteException
KNXConnectionClosedException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |