public class InputFormat
extends java.lang.Object
GenericService
documentation for an example.Modifier and Type | Class and Description |
---|---|
static class |
InputFormat.InputFormatUnit
The input format unit
|
Modifier and Type | Field and Description |
---|---|
static int |
INPUT_FORMAT_PACKAGE_SIZE |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
int |
getConnectId() |
long |
getDeltaInterval() |
int |
getMode() |
int |
getNumberOfBytes() |
int |
getRevision() |
ConnectInfo.IOType |
getType() |
InputFormat.InputFormatUnit |
getUnit() |
int |
hashCode() |
static InputFormat |
inputFormat(byte[] data) |
static InputFormat |
inputFormat(int connectId,
ConnectInfo.IOType type,
int mode,
int deltaInterval,
InputFormat.InputFormatUnit unit,
boolean notificationsEnabled)
Create a new instance of an InputFormat.
|
InputFormat |
inputFormatBySettingDeltaInterval(byte deltaInterval)
Creates a copy of this input format with a new delta interval
|
InputFormat |
inputFormatBySettingMode(int mode)
Creates a copy of this input format with a new mode
|
InputFormat |
inputFormatBySettingModeAndUnit(int mode,
InputFormat.InputFormatUnit unit)
Creates a copy of this input format with a new mode and unit
|
InputFormat |
inputFormatBySettingNotificationsEnabled(boolean notificationsEnabled)
Creates a copy of this input format with a new value for notifications enabled
|
boolean |
isNotificationsEnabled() |
java.lang.String |
toString() |
byte[] |
writeFormatData() |
public static final int INPUT_FORMAT_PACKAGE_SIZE
public static InputFormat inputFormat(byte[] data)
public static InputFormat inputFormat(int connectId, ConnectInfo.IOType type, int mode, int deltaInterval, InputFormat.InputFormatUnit unit, boolean notificationsEnabled)
connectId
- The connectId of the service, see LegoService.connectInfo
type
- The type of the IO, see LegoService.connectInfo
mode
- The mode of the IO (Inputs/Senors may support a number of different modes)deltaInterval
- The delta intervalunit
- The unit the sensor should return values innotificationsEnabled
- true if the device should send updates when the value changes, otherwise falsepublic InputFormat inputFormatBySettingMode(int mode)
mode
- The new modepublic InputFormat inputFormatBySettingModeAndUnit(int mode, InputFormat.InputFormatUnit unit)
mode
- The new modeunit
- The new unitpublic InputFormat inputFormatBySettingDeltaInterval(byte deltaInterval)
deltaInterval
- The new delta intervalpublic InputFormat inputFormatBySettingNotificationsEnabled(boolean notificationsEnabled)
notificationsEnabled
- true if the sensor should send updates when the value changes, otherwise falsepublic int getRevision()
public int getConnectId()
public ConnectInfo.IOType getType()
public int getMode()
public long getDeltaInterval()
public InputFormat.InputFormatUnit getUnit()
public boolean isNotificationsEnabled()
public int getNumberOfBytes()
public byte[] writeFormatData()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object