Package org.nfctools.llcp.parameter

Examples of org.nfctools.llcp.parameter.Miux


    Version version = (Version)parameter[pId++];
    assertEquals(0, version.getMinor());
    assertEquals(1, version.getMajor());

    Miux miux = (Miux)parameter[pId++];
    assertEquals(1023, miux.getValue());

    WellKnownServiceList wks = (WellKnownServiceList)parameter[pId++];
    assertEquals(0xffff, wks.getValue());

    LinkTimeOut lto = (LinkTimeOut)parameter[pId++];
View Full Code Here


            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

        else if (version.getMinor() == 0) {
          oldAndroidQuirck();
        }
      }
      else if (param instanceof Miux) {
        Miux miux = (Miux)param;
        miuExtension = Math.min(PREFERRED_MIUX, miux.getValue());
        log.info("LLCP Miux: " + miux.getValue() + ", agreed on " + miuExtension);
      }
      else if (param instanceof LinkTimeOut) {
        LinkTimeOut lto = (LinkTimeOut)param;
        linkTimeOut = lto.getValue() * 10;
        log.info("LLCP Link Timeout: " + linkTimeOut + " ms");
View Full Code Here

          String serviceName = new String(pduData, offset + 2, pduData[offset + 1]);
          params.add(new ServiceName(serviceName));
          break;
        case PduConstants.PARAM_MIUX:
          int miux = (pduData[offset + 2] & 0x03) << 8 | (pduData[offset + 3] & 0xFF);
          params.add(new Miux(miux));
          break;
        case PduConstants.PARAM_WKS:
          int wks = (pduData[offset + 2] & 0xFF) << 8 | (pduData[offset + 3] & 0xFF);
          params.add(new WellKnownServiceList(wks));
          break;
View Full Code Here

        baos.write(PduConstants.PARAM_SN);
        baos.write(serviceName.length);
        appendData(baos, serviceName);
      }
      else if (object instanceof Miux) {
        Miux miux = (Miux)object;
        baos.write(PduConstants.PARAM_MIUX);
        baos.write(2);
        baos.write((miux.getValue() >> 8) & 0x03);
        baos.write(miux.getValue() & 0xff);
      }
    }

    return baos.toByteArray();
  }
View Full Code Here

TOP

Related Classes of org.nfctools.llcp.parameter.Miux

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.