org.mobicents.media.server.impl.resource.ss7.stream
Class HDLCHandler

java.lang.Object
  extended by org.mobicents.media.server.impl.resource.ss7.stream.HDLCHandler

public class HDLCHandler
extends java.lang.Object

Util class to handle hdlc stuff.

Author:
baranowb

Constructor Summary
HDLCHandler()
           
 
Method Summary
 void addToTxBuffer(java.nio.ByteBuffer bb)
           
 void clearTxBuffer()
           
 boolean isTxBufferEmpty()
           
static int PPP_FCS(int fcs, int c)
           
 java.nio.ByteBuffer[] processRx(java.nio.ByteBuffer rxBuffer)
          Method which process received data.
 void processTx(java.nio.ByteBuffer txBufferToFill)
          Method which should be invoked to process tx.
 void setRxBufferSize(int rxBufferSize)
          Sets RX buffer size, this generaly limits one ByteBuffer msg size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HDLCHandler

public HDLCHandler()
Method Detail

PPP_FCS

public static final int PPP_FCS(int fcs,
                                int c)

addToTxBuffer

public void addToTxBuffer(java.nio.ByteBuffer bb)

setRxBufferSize

public void setRxBufferSize(int rxBufferSize)
Sets RX buffer size, this generaly limits one ByteBuffer msg size.

Parameters:
rxBufferSize -

isTxBufferEmpty

public boolean isTxBufferEmpty()

clearTxBuffer

public void clearTxBuffer()

processTx

public void processTx(java.nio.ByteBuffer txBufferToFill)
Method which should be invoked to process tx. HDLCHandler will fetch contents of internal tx buffer, perform hdlc and fill passed object After that its valid to pass to network. Passed buffer should not be used afterwards.
NOTE: it should be big enough to store hdlc processed data passed in addToTxBuffer(ByteBuffer)

Parameters:
txBufferToFill - - buffer which will be filled with hdlc processed bytes

processRx

public java.nio.ByteBuffer[] processRx(java.nio.ByteBuffer rxBuffer)
Method which process received data. Once full msg is received it is returned, in other case, returns null. Returned buffers may be used freely.

Parameters:
rxBuffer -
Returns:


Copyright © 2010. All Rights Reserved.