org.openmuc.jmbus
Class VariableDataBlock

java.lang.Object
  extended by org.openmuc.jmbus.VariableDataBlock

public class VariableDataBlock
extends java.lang.Object

Representation of a Variable Data Block. A variable data block is the basic data entity in the M-Bus application layer. They form parts of different types of M-Bus messages (e.g. a VariableDataResponse - RESP-UD). It encodes information on the data type, status, meaning, unit and value of a date. Data type and status are encoded in the DIB (Data Information Block) whilst meaning and unit are encoded in the VIB (Value Information Block).


Nested Class Summary
static class VariableDataBlock.DataType
           
static class VariableDataBlock.Description
           
static class VariableDataBlock.FunctionField
           
 
Constructor Summary
VariableDataBlock(byte[] dib, byte[] vib, byte[] data, java.lang.Integer lvar)
           
 
Method Summary
 java.lang.Object getData()
           
 byte[] getDataBytes()
           
 byte getDataField()
           
 VariableDataBlock.DataType getDataType()
           
 VariableDataBlock.Description getDescription()
           
 short getDeviceUnit()
           
 byte[] getDIB()
           
 VariableDataBlock.FunctionField getFunctionField()
           
 java.lang.Integer getLvar()
           
 byte getMultiplier()
           
 java.lang.Double getScaledValue()
          Returns the data (value) multiplied by the multiplier as a Double.
 long getStorageNumber()
           
 int getTariff()
           
 int getUnit()
           
 byte[] getVIB()
           
 void parse()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VariableDataBlock

public VariableDataBlock(byte[] dib,
                         byte[] vib,
                         byte[] data,
                         java.lang.Integer lvar)
Method Detail

getLvar

public java.lang.Integer getLvar()

getDIB

public byte[] getDIB()

getVIB

public byte[] getVIB()

getDataBytes

public byte[] getDataBytes()

getData

public java.lang.Object getData()

getDataType

public VariableDataBlock.DataType getDataType()

getScaledValue

public java.lang.Double getScaledValue()
Returns the data (value) multiplied by the multiplier as a Double. If the data is not a number than null is returned.

Returns:
the data (value) multiplied by the multiplier as a Double

getFunctionField

public VariableDataBlock.FunctionField getFunctionField()

getDataField

public byte getDataField()

getStorageNumber

public long getStorageNumber()

getTariff

public int getTariff()

getDeviceUnit

public short getDeviceUnit()

getDescription

public VariableDataBlock.Description getDescription()

getMultiplier

public byte getMultiplier()

getUnit

public int getUnit()

parse

public void parse()
           throws java.text.ParseException
Throws:
java.text.ParseException