Package org.nfctools.llcp.pdu

Examples of org.nfctools.llcp.pdu.DisconnectedMode


    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);

    assertEquals(0, connectionManager.getOpenConnectionsSize());
    assertFalse(serviceAccessPoint.isConnected());
    assertSymmetryState();
View Full Code Here


    serviceAccessPoint.onConnectSucceeded(this);
  }

  public void onDisconnect() {
    serviceAccessPoint.onDisconnect();
    messageToSend = new DisconnectedMode(addressPair.getRemote(), addressPair.getLocal(), 0);
  }
View Full Code Here

  public AbstractProtocolDataUnit onConnect(int remoteAddress, int localAddress, Object[] parameters) {
    ServiceAccessPoint serviceAccessPoint = getServiceAccessPoint(localAddress,
        LlcpUtils.getServiceNameFromParameters(parameters));
    if (serviceAccessPoint == null) {
      return new DisconnectedMode(remoteAddress, localAddress, 2);
    }
    else {
      if (serviceAccessPoint.canAcceptConnection(parameters)) {
        Integer outgoingAddress = getFreeOutgoingAddress();
        LlcpSocket llcpSocket = new LlcpSocket(new AddressPair(remoteAddress, outgoingAddress),
            serviceAccessPoint);
        openConnections.put(outgoingAddress, llcpSocket);
        int aggreeOnMiux = aggreeOnMiux(parameters, llcpSocket);
        List<Object> parameter = new ArrayList<Object>(getParameter());
        if (aggreeOnMiux != 0)
          parameter.add(new Miux(aggreeOnMiux));
        return new ConnectComplete(remoteAddress, outgoingAddress, parameter.toArray());
      }
      else {
        return new DisconnectedMode(remoteAddress, localAddress, 3);
      }
    }
  }
View Full Code Here

TOP

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

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.