org.nfctools.ndefpush
Class NdefPushLlcpService

java.lang.Object
  extended by org.nfctools.ndefpush.NdefPushLlcpService
All Implemented Interfaces:
ServiceAccessPoint

public class NdefPushLlcpService
extends Object
implements ServiceAccessPoint


Constructor Summary
NdefPushLlcpService(NdefListener ndefListener)
           
 
Method Summary
 void addMessages(Collection<Record> ndefRecords, NdefPushFinishListener finishListener)
           
 boolean canAcceptConnection(Object[] parameters)
          Called if the other party wants to connect to this service.
 boolean hasMessagesToSend()
           
 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.
 void onSendSucceeded(LlcpSocket llcpSocket)
          Called if a sendMessage was successful and the other party responded with receive ready.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NdefPushLlcpService

public NdefPushLlcpService(NdefListener ndefListener)
Method Detail

addMessages

public void addMessages(Collection<Record> ndefRecords,
                        NdefPushFinishListener finishListener)

hasMessagesToSend

public boolean hasMessagesToSend()

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

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

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

onSendSucceeded

public void onSendSucceeded(LlcpSocket llcpSocket)
Description copied from interface: ServiceAccessPoint
Called if a sendMessage was successful and the other party responded with receive ready.

Specified by:
onSendSucceeded in interface ServiceAccessPoint

onSendFailed

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

Specified by:
onSendFailed in interface ServiceAccessPoint

canAcceptConnection

public boolean canAcceptConnection(Object[] parameters)
Description copied from interface: ServiceAccessPoint
Called if the other party wants to connect to this service.

Specified by:
canAcceptConnection in interface ServiceAccessPoint
Returns:

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

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


Copyright © 2012. All Rights Reserved.