Package org.nfctools.llcp.parameter

Examples of org.nfctools.llcp.parameter.Version


        0x70, 0x70 };

    Object[] parameter = pduDecoder.decodeParameter(data, 0);
    int pId = 0;

    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++];
View Full Code Here


  }

  @Test
  public void testEncodeParams() throws Exception {
    Version version = new Version(1, 1);
    byte[] bs = pduDecoder.encodeParameter(new Object[] { version });
    assertArrayEquals(new byte[] { 0x01, 0x01, 0x11 }, bs);
  }
View Full Code Here

  }

  public void init(Object[] parameters) {
    for (Object param : parameters) {
      if (param instanceof Version) {
        Version version = (Version)param;
        log.info("LLCP Version: " + version.getMajor() + "." + version.getMinor());
        if (version.getMajor() != VERSION_MAJOR) {
          throw new RuntimeException("Cannot handle Version " + version.getMajor());
        }
        else if (version.getMinor() == 0) {
          oldAndroidQuirck();
        }
      }
      else if (param instanceof Miux) {
        Miux miux = (Miux)param;
View Full Code Here

    while (offset < pduData.length) {
      switch (pduData[offset]) {
        case PduConstants.PARAM_VERSION:
          byte major = (byte)((pduData[offset + 2] >> 4) & 0x0F);
          byte minor = (byte)(pduData[offset + 2] & 0x0F);
          params.add(new Version(major, minor));
          break;
        case PduConstants.PARAM_SN:
          String serviceName = new String(pduData, offset + 2, pduData[offset + 1]);
          params.add(new ServiceName(serviceName));
          break;
View Full Code Here

TOP

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

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.