org.nfctools.snep
Class AbstractSnepImpl

java.lang.Object
  extended by org.nfctools.snep.AbstractSnepImpl
All Implemented Interfaces:
ServiceAccessPoint
Direct Known Subclasses:
SnepClient, SnepServer

public abstract class AbstractSnepImpl
extends Object
implements ServiceAccessPoint


Field Summary
protected  SnepMessage continueMessage
           
protected  FragmentIterator fragmentIterator
           
protected  int maxInformationUnit
           
protected  FragmentReader reader
           
protected  byte snepVersion
           
 
Constructor Summary
protected AbstractSnepImpl(byte continueMessageCode)
           
 
Method Summary
 void onConnectFailed()
          Called if a connection failed/timed out.
 void onConnectionActive(LlcpSocket llcpSocket)
          Called if this Service has an active connection.
 void onConnectSucceeded(LlcpSocket llcpSocket)
          Called if a connection succeeded and the other party is ready to receive data.
 void onDisconnect()
          Called if the other party ended the connection or the LLCP stack ended.
 byte[] onInformation(byte[] serviceDataUnit)
          Called if the other party has send a message or as a response to a send message from this implementation.
 void onLlcpActive(Llcp llcp)
          Called if there is a device in range and the LLCP stack is active.
 void onSendFailed()
          Called if a sendMessage failed.
protected abstract  byte[] processMessage(SnepMessage snepMessage)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.nfctools.llcp.ServiceAccessPoint
canAcceptConnection, onSendSucceeded
 

Field Detail

snepVersion

protected byte snepVersion

maxInformationUnit

protected int maxInformationUnit

reader

protected FragmentReader reader

fragmentIterator

protected FragmentIterator fragmentIterator

continueMessage

protected SnepMessage continueMessage
Constructor Detail

AbstractSnepImpl

protected AbstractSnepImpl(byte continueMessageCode)
Method Detail

onLlcpActive

public void onLlcpActive(Llcp llcp)
Description copied from interface: ServiceAccessPoint
Called if there is a device in range and the LLCP stack is active.

Specified by:
onLlcpActive in interface ServiceAccessPoint

onConnectFailed

public void onConnectFailed()
Description copied from interface: ServiceAccessPoint
Called if a connection failed/timed out.

Specified by:
onConnectFailed in interface ServiceAccessPoint

onConnectSucceeded

public void onConnectSucceeded(LlcpSocket llcpSocket)
Description copied from interface: ServiceAccessPoint
Called if a connection succeeded and the other party is ready to receive data.

Specified by:
onConnectSucceeded in interface ServiceAccessPoint

onSendFailed

public void onSendFailed()
Description copied from interface: ServiceAccessPoint
Called if a sendMessage failed.

Specified by:
onSendFailed in interface ServiceAccessPoint

onDisconnect

public void onDisconnect()
Description copied from interface: ServiceAccessPoint
Called if the other party ended the connection or the LLCP stack ended.

Specified by:
onDisconnect in interface ServiceAccessPoint

onConnectionActive

public void onConnectionActive(LlcpSocket llcpSocket)
Description copied from interface: ServiceAccessPoint
Called if this Service has an active connection. If the implementation does not invoke any method on the LlcpSocket the LLCP stack will send a Symmetry packet,

Specified by:
onConnectionActive in interface ServiceAccessPoint

onInformation

public byte[] onInformation(byte[] serviceDataUnit)
Description copied from interface: ServiceAccessPoint
Called if the other party has send a message or as a response to a send message from this implementation. If this implementation has something to respond this data has to be returned here. If the returned byte array is null the LLCP stack will answer with receive ready.

Specified by:
onInformation in interface ServiceAccessPoint
Returns:
nullable byte array as response

processMessage

protected abstract byte[] processMessage(SnepMessage snepMessage)


Copyright © 2012. All Rights Reserved.