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

Quick Search    Search Deep

com.synchrona.jred.irlap
Class AsyncFrameWrapper  view AsyncFrameWrapper download AsyncFrameWrapper.java

java.lang.Object
  extended bycom.synchrona.jred.irlap.AsyncFrameWrapper
All Implemented Interfaces:
iFrameWrapper

class AsyncFrameWrapper
extends java.lang.Object
implements iFrameWrapper

Implements asynchronous frame wrapping, which IrLAP uses at 9600bps - 115200bps


Field Summary
private static byte BOF
           
private static byte CE
           
private static int DEFAULT_BOF_COUNT
           
private static byte EOF
           
private  byte[] m_ayInputFrame
           
private  byte[] m_ayOutputFrame
           
private  CheckCRC m_crc
           
private  java.io.DataInputStream m_in
           
private  com.synchrona.util.Log m_log
           
private  int m_nBOFCount
           
private  java.io.DataOutputStream m_out
           
static int MAX_FRAME_LENGTH
          Users of AsyncFrameWrapper can safely size frame buffers at MAX_FRAME_LENGTH (255 bytes).
private static byte XBOF
           
 
Constructor Summary
AsyncFrameWrapper(com.synchrona.util.Log log, java.io.DataInputStream in, java.io.DataOutputStream out)
           
 
Method Summary
private  int reallyReceive(byte[] ayDestination, int nOffset, int nLength)
           
private  void reallySend(byte[] ayFrame, int nOffset, int nLength)
           
 int receive(byte[] ayDestination, int nOffset, int nLength)
           
 void send(byte[] aySource, int nOffset, int nLength)
           
 void setLog(java.io.PrintWriter log)
           
 void setLogging(boolean bDoLogging)
           
 void setNumberOfBOFs(int nBOFCount)
           
private  void verifyFrameArgs(byte[] ayFrame, int nOffset, int nLength)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_FRAME_LENGTH

public static final int MAX_FRAME_LENGTH
Users of AsyncFrameWrapper can safely size frame buffers at MAX_FRAME_LENGTH (255 bytes).

See Also:
Constant Field Values

BOF

private static final byte BOF
See Also:
Constant Field Values

CE

private static final byte CE
See Also:
Constant Field Values

DEFAULT_BOF_COUNT

private static final int DEFAULT_BOF_COUNT
See Also:
Constant Field Values

EOF

private static final byte EOF
See Also:
Constant Field Values

XBOF

private static final byte XBOF
See Also:
Constant Field Values

m_ayInputFrame

private byte[] m_ayInputFrame

m_ayOutputFrame

private byte[] m_ayOutputFrame

m_crc

private CheckCRC m_crc

m_in

private java.io.DataInputStream m_in

m_log

private com.synchrona.util.Log m_log

m_nBOFCount

private int m_nBOFCount

m_out

private java.io.DataOutputStream m_out
Constructor Detail

AsyncFrameWrapper

public AsyncFrameWrapper(com.synchrona.util.Log log,
                         java.io.DataInputStream in,
                         java.io.DataOutputStream out)
Method Detail

receive

public int receive(byte[] ayDestination,
                   int nOffset,
                   int nLength)
            throws java.lang.Exception
Specified by:
receive in interface iFrameWrapper

send

public void send(byte[] aySource,
                 int nOffset,
                 int nLength)
          throws java.lang.Exception
Specified by:
send in interface iFrameWrapper

setLog

public void setLog(java.io.PrintWriter log)
Specified by:
setLog in interface iFrameWrapper

setLogging

public void setLogging(boolean bDoLogging)
Specified by:
setLogging in interface iFrameWrapper

setNumberOfBOFs

public void setNumberOfBOFs(int nBOFCount)

reallyReceive

private int reallyReceive(byte[] ayDestination,
                          int nOffset,
                          int nLength)
                   throws java.lang.Exception

reallySend

private void reallySend(byte[] ayFrame,
                        int nOffset,
                        int nLength)
                 throws java.lang.Exception

verifyFrameArgs

private void verifyFrameArgs(byte[] ayFrame,
                             int nOffset,
                             int nLength)
                      throws java.lang.Exception