Package com.tinkerforge
Class DeviceBase
- java.lang.Object
-
- com.tinkerforge.DeviceBase
-
- Direct Known Subclasses:
Device
public abstract class DeviceBase extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description DeviceBase(java.lang.String uid, IPConnection ipcon)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description short[]
getAPIVersion()
Returns the API version (major, minor, revision) of the bindings for this device.boolean
getResponseExpected(byte functionId)
Returns the response expected flag for the function specified by the \c functionId parameter.void
setResponseExpected(byte functionId, boolean responseExpected)
Changes the response expected flag of the function specified by the \c functionId parameter.void
setResponseExpectedAll(boolean responseExpected)
Changes the response expected flag for all setter and callback configuration functions of this device at once.
-
-
-
Constructor Detail
-
DeviceBase
public DeviceBase(java.lang.String uid, IPConnection ipcon)
-
-
Method Detail
-
getAPIVersion
public short[] getAPIVersion()
Returns the API version (major, minor, revision) of the bindings for this device.
-
getResponseExpected
public boolean getResponseExpected(byte functionId)
Returns the response expected flag for the function specified by the \c functionId parameter. It is *true* if the function is expected to send a response, *false* otherwise. For getter functions this is enabled by default and cannot be disabled, because those functions will always send a response. For callback configuration functions it is enabled by default too, but can be disabled via the SetResponseExpected function. For setter functions it is disabled by default and can be enabled. Enabling the response expected flag for a setter function allows to detect timeouts and other error conditions calls of this setter as well. The device will then send a response for this purpose. If this flag is disabled for a setter function then no response is sent and errors are silently ignored, because they cannot be detected.
-
setResponseExpected
public void setResponseExpected(byte functionId, boolean responseExpected)
Changes the response expected flag of the function specified by the \c functionId parameter. This flag can only be changed for setter (default value: *false*) and callback configuration functions (default value: *true*). For getter functions it is always enabled. Enabling the response expected flag for a setter function allows to detect timeouts and other error conditions calls of this setter as well. The device will then send a response for this purpose. If this flag is disabled for a setter function then no response is sent and errors are silently ignored, because they cannot be detected.
-
setResponseExpectedAll
public void setResponseExpectedAll(boolean responseExpected)
Changes the response expected flag for all setter and callback configuration functions of this device at once.
-
-