Package org.nfctools.llcp.pdu

Examples of org.nfctools.llcp.pdu.Information


        connect.getDestinationServiceAccessPoint()).processPdu(connectionManager);

    assertEquals(1, connectionManager.getOpenConnectionsSize());
    assertTrue(processPdu.toString(), processPdu instanceof Information);

    Information information = (Information)processPdu;
    assertEquals("Hello", new String(information.getServiceDataUnit()));
    processPdu = new ReceiveReady(information.getSourceServiceAccessPoint(),
        information.getDestinationServiceAccessPoint(), 1).processPdu(connectionManager);
    assertTrue(processPdu.toString(), processPdu instanceof Disconnect);

    Disconnect disconnect = (Disconnect)processPdu;
    processPdu = new DisconnectedMode(disconnect.getSourceServiceAccessPoint(),
        disconnect.getDestinationServiceAccessPoint(), 0).processPdu(connectionManager);
View Full Code Here


    AbstractProtocolDataUnit processPdu = new Connect(1, 32, new ServiceName(COM_ANDROID_NPP))
        .processPdu(connectionManager);
    assertTrue(processPdu.toString(), processPdu instanceof ConnectComplete);
    assertEquals(1, connectionManager.getOpenConnectionsSize());

    processPdu = new Information(32, 32, 0, 0, "Hello".getBytes()).processPdu(connectionManager);
    assertTrue(processPdu.toString(), processPdu instanceof ReceiveReady);
    ReceiveReady receiveReady = (ReceiveReady)processPdu;
    assertEquals(1, receiveReady.getReceived());
    assertEquals(0, receiveReady.getSend());
View Full Code Here

  public void sendMessage(byte[] message) {
    if (message.length > getMaximumInformationUnit())
      throw new IllegalArgumentException("Message too long. Maximum Information Unit is "
          + getMaximumInformationUnit());

    messageToSend = new Information(addressPair.getRemote(), addressPair.getLocal(), getReceivedSequence(),
        getSendSequence(), message);
    incSendSequence();
  }
View Full Code Here

TOP

Related Classes of org.nfctools.llcp.pdu.Information

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.