Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

plp.link
Class PLPFrame  view PLPFrame download PLPFrame.java

java.lang.Object
  extended byplp.link.PLPFrame

public class PLPFrame
extends java.lang.Object

Represents a PLPFrame for a Nokia 9210 and probrally others


Nested Class Summary
static class PLPFrame.PDU
           
 
Field Summary
private  int calculatedCRC
           
private  byte cont
           
private  byte[] crc
           
private static tools.bytestuffer.ByteStuffer crcStuffer
           
private  byte[] data
           
private static tools.bytestuffer.ByteStuffer dataStuffer
           
static byte DC1
           
static byte DC3
           
static boolean DEBUG
           
static byte DLE
           
static byte EOT
           
static byte ETB
           
static byte ETX
           
static int MIN_LENGTH
          The minimin number of bytes this frame can be
private static plp.link.plpframeparser.PLPFrameParser parser
           
private  int seq
           
private static byte[] startBytes
           
private static byte[] stopBytesWithoutCRC16
           
static byte STX
           
static byte SYN
           
 
Constructor Summary
PLPFrame()
           
PLPFrame(PLPFrame.PDU pduType, byte[] data)
           
 
Method Summary
protected  int calculateCRC()
           
protected  byte[] calculateCRCBytes()
           
 byte[] getBytes()
          I can tell you which bytes to send over a serial line, by asking me getBytes.
 byte getCont()
           
 byte[] getContSeq()
           
 byte[] getCRC()
           
protected  tools.bytestuffer.ByteStuffer getCRCStuffer()
           
 byte[] getData()
           
protected  tools.bytestuffer.ByteStuffer getDataStuffer()
           
static byte[] getEndBytes()
           
static int getMinLength()
          The minimin number of bytes this frame can be
protected static plp.link.plpframeparser.PLPFrameParser getParser()
           
 PLPFrame.PDU getPDUType()
           
 int getSeq()
           
static byte[] getStartBytes()
           
 int grabFrameFromBytes(byte[] data)
           
 int grabFrameFromBytes(byte[] data, int endIndex)
           
 boolean isCRCCorrect()
           
 void setCont(byte cont)
           
 void setCRC(byte[] crc)
           
 void setData(byte[] newData)
           
 void setPDUType(PLPFrame.PDU type)
           
 void setSeq(int seq)
           
 byte[] stuff(byte[] data)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STX

public static final byte STX
See Also:
Constant Field Values

ETX

public static final byte ETX
See Also:
Constant Field Values

EOT

public static final byte EOT
See Also:
Constant Field Values

DLE

public static final byte DLE
See Also:
Constant Field Values

DC1

public static final byte DC1
See Also:
Constant Field Values

DC3

public static final byte DC3
See Also:
Constant Field Values

SYN

public static final byte SYN
See Also:
Constant Field Values

ETB

public static final byte ETB
See Also:
Constant Field Values

startBytes

private static final byte[] startBytes

stopBytesWithoutCRC16

private static final byte[] stopBytesWithoutCRC16

seq

private int seq

cont

private byte cont

data

private byte[] data

crc

private byte[] crc

calculatedCRC

private int calculatedCRC

dataStuffer

private static tools.bytestuffer.ByteStuffer dataStuffer

crcStuffer

private static tools.bytestuffer.ByteStuffer crcStuffer

parser

private static plp.link.plpframeparser.PLPFrameParser parser

MIN_LENGTH

public static final int MIN_LENGTH
The minimin number of bytes this frame can be

See Also:
Constant Field Values

DEBUG

public static boolean DEBUG
Constructor Detail

PLPFrame

public PLPFrame()

PLPFrame

public PLPFrame(PLPFrame.PDU pduType,
                byte[] data)
Method Detail

getMinLength

public static int getMinLength()
The minimin number of bytes this frame can be


getStartBytes

public static byte[] getStartBytes()

getEndBytes

public static byte[] getEndBytes()

getData

public byte[] getData()

getCont

public byte getCont()

getSeq

public int getSeq()

setCont

public void setCont(byte cont)

setSeq

public void setSeq(int seq)

setData

public void setData(byte[] newData)

getContSeq

public byte[] getContSeq()

grabFrameFromBytes

public int grabFrameFromBytes(byte[] data)

grabFrameFromBytes

public int grabFrameFromBytes(byte[] data,
                              int endIndex)

getParser

protected static plp.link.plpframeparser.PLPFrameParser getParser()

getDataStuffer

protected tools.bytestuffer.ByteStuffer getDataStuffer()

getCRCStuffer

protected tools.bytestuffer.ByteStuffer getCRCStuffer()

stuff

public byte[] stuff(byte[] data)

getBytes

public byte[] getBytes()
I can tell you which bytes to send over a serial line, by asking me getBytes.


setCRC

public void setCRC(byte[] crc)

getCRC

public byte[] getCRC()

calculateCRC

protected int calculateCRC()

calculateCRCBytes

protected byte[] calculateCRCBytes()

isCRCCorrect

public boolean isCRCCorrect()

setPDUType

public void setPDUType(PLPFrame.PDU type)

getPDUType

public PLPFrame.PDU getPDUType()