Examples of openApplication()


Examples of org.nfctools.mf.mad.ApplicationDirectory.openApplication()

  private Application getApplication() {
    try {
      ApplicationDirectory applicationDirectory = readerWriter.getApplicationDirectory(new MadKeyConfig(Key.A,
          writeKey, writeKey));
      Application application = applicationDirectory.openApplication(MfConstants.NDEF_APP_ID);
      return application;
    }
    catch (IOException e) {
      throw new NfcException(e);
    }
View Full Code Here

Examples of org.nfctools.mf.mad.ApplicationDirectory.openApplication()

      tagInfo = readerWriter.getTagInfo();
      if (readerWriter.hasApplicationDirectory()) {
        ApplicationDirectory applicationDirectory = readerWriter.getApplicationDirectory();
        if (applicationDirectory.hasApplication(MfConstants.NDEF_APP_ID)) {
          formatted = true;
          Application application = applicationDirectory.openApplication(MfConstants.NDEF_APP_ID);
          writable = ClassicHandler.isFormattedWritable(application, MfClassicConstants.NDEF_KEY);
        }
        else {
          throw new NfcException("Unknown tag contents");
        }
View Full Code Here

Examples of org.nfctools.mf.mad.ApplicationDirectory.openApplication()

  @Test
  public void testIsFormattedWritable() throws Exception {
    ApplicationDirectory applicationDirectory = ReaderWriterCreator.createReadWriter("mfstd1k_ndef.txt",
        MemoryLayout.CLASSIC_1K).getApplicationDirectory();
    assertTrue(ClassicHandler.isFormattedWritable(applicationDirectory.openApplication(MfConstants.NDEF_APP_ID),
        MfClassicConstants.TRANSPORT_KEY));
    ApplicationDirectory applicationDirectory2 = ReaderWriterCreator.createReadWriter("mfstd4k_ndef.txt",
        MemoryLayout.CLASSIC_4K).getApplicationDirectory();
    assertTrue(ClassicHandler.isFormattedWritable(applicationDirectory2.openApplication(MfConstants.NDEF_APP_ID),
        MfClassicConstants.NDEF_KEY));
View Full Code Here

Examples of org.nfctools.mf.mad.ApplicationDirectory.openApplication()

        MemoryLayout.CLASSIC_1K).getApplicationDirectory();
    assertTrue(ClassicHandler.isFormattedWritable(applicationDirectory.openApplication(MfConstants.NDEF_APP_ID),
        MfClassicConstants.TRANSPORT_KEY));
    ApplicationDirectory applicationDirectory2 = ReaderWriterCreator.createReadWriter("mfstd4k_ndef.txt",
        MemoryLayout.CLASSIC_4K).getApplicationDirectory();
    assertTrue(ClassicHandler.isFormattedWritable(applicationDirectory2.openApplication(MfConstants.NDEF_APP_ID),
        MfClassicConstants.NDEF_KEY));
  }
}
View Full Code Here

Examples of org.nfctools.mf.mad.ApplicationDirectory.openApplication()

    ApplicationDirectory applicationDirectory = MadUtils.getApplicationDirectory(card, readerWriter);

    if (applicationDirectory.hasApplication(MfNdefConstants.NDEF_APP_ID)) {

      Application application = applicationDirectory.openApplication(MfNdefConstants.NDEF_APP_ID);

      byte[] tlvWrappedNdefMessage = application.read(new KeyValue(Key.A, MfConstants.NDEF_KEY));

      if (log.isDebugEnabled())
        log.debug(NfcUtils.convertBinToASCII(tlvWrappedNdefMessage));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.