tuwien.auto.calimero.link.medium
Class RawFrameFactory

java.lang.Object
  extended by tuwien.auto.calimero.link.medium.RawFrameFactory

public final class RawFrameFactory
extends java.lang.Object

Factory for raw frames on medium.

Supports creation of raw frames out of byte arrays for now.


Method Summary
static RawFrame create(int mediumType, byte[] data, int offset)
          Creates a raw frame out of a byte array for the specified communication medium.
static RawFrame createPL110(byte[] data, int offset)
          Creates a raw frame out of a byte array for the PL110 communication medium.
static RawFrame createPL132(byte[] data, int offset)
          Creates a raw frame out of a byte array for the PL132 communication medium.
static RawFrame createTP1(byte[] data, int offset)
          Creates a raw frame out of a byte array for the TP1 communication medium.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static RawFrame create(int mediumType,
                              byte[] data,
                              int offset)
                       throws KNXFormatException
Creates a raw frame out of a byte array for the specified communication medium.

This method just invokes one of the other medium type specific creation methods according the given medium type.

Parameters:
mediumType - KNX communication medium, one of the media types declared in KNXMediumSettings
data - byte array containing the raw frame structure
offset - start offset of frame structure in data, 0 <= offset < data.length
Returns:
the created raw frame for the specified medium
Throws:
KNXFormatException - on unknown/not supported KNX medium or no valid frame structure

createPL110

public static RawFrame createPL110(byte[] data,
                                   int offset)
                            throws KNXFormatException
Creates a raw frame out of a byte array for the PL110 communication medium.

Parameters:
data - byte array containing the PL110 raw frame structure
offset - start offset of frame structure in data, 0 <= offset < data.length
Returns:
the created PL110 raw frame
Throws:
KNXFormatException - on no valid frame structure

createPL132

public static RawFrame createPL132(byte[] data,
                                   int offset)
                            throws KNXFormatException
Creates a raw frame out of a byte array for the PL132 communication medium.

Parameters:
data - byte array containing the PL132 raw frame structure
offset - start offset of frame structure in data, 0 <= offset < data.length
Returns:
the created PL132 raw frame
Throws:
KNXFormatException - on no valid frame structure

createTP1

public static RawFrame createTP1(byte[] data,
                                 int offset)
                          throws KNXFormatException
Creates a raw frame out of a byte array for the TP1 communication medium.

Parameters:
data - byte array containing the TP1 raw frame structure
offset - start offset of frame structure in data, 0 <= offset < data.length
Returns:
the created TP1 raw frame
Throws:
KNXFormatException - on no valid frame structure