Examples of InMemoryTag


Examples of org.nfctools.test.InMemoryTag

public class TagInputStreamTest {

  @Test
  public void testAvailable() throws Exception {
    InMemoryTag tag = new InMemoryTag(FileMfUlReader.loadCardFromFile("mful_formatted.txt"));
    MfUlReaderWriter readerWriter = new AcrMfUlReaderWriter(tag);

    TagInputStream in = new TagInputStream(MemoryLayout.ULTRALIGHT, readerWriter);

    for (int x = 0; x < 48; x++) {
View Full Code Here

Examples of org.nfctools.test.InMemoryTag

      new Config("mful_formatted.txt", MemoryLayout.ULTRALIGHT, true, true, null),
      new Config("mfulc_formatted.txt", MemoryLayout.ULTRALIGHT_C, true, true, null) };

  private void init(Config config) {
    try {
      tag = new InMemoryTag(FileMfUlReader.loadCardFromFile(config.fileName));
      readerWriter = new AcrMfUlReaderWriter(tag);
      ndefOperations = new Type2NdefOperations(config.memoryLayout, readerWriter, readerWriter.getTagInfo(),
          config.formatted, config.writeable);
      if (config.expectedFileName != null)
        expectedTag = new InMemoryTag(FileMfUlReader.loadCardFromFile(config.expectedFileName));
    }
    catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

Examples of org.nfctools.test.InMemoryTag

public class MfClassicNfcTagListenerTest {

  @Test
  public void testCreateNdefOperations() throws Exception {
    MemoryMap memoryMap = FileMfClassicReader.loadCardFromFile("mfstd1k_blank.txt");
    InMemoryTag tag = new InMemoryTag(memoryMap);

    MfClassicNfcTagListener nfcTagListener = new MfClassicNfcTagListener();

    MfClassicNdefOperations ndefOperations = nfcTagListener.createNdefOperations(tag, MemoryLayout.CLASSIC_1K);
    assertNotNull(ndefOperations);
View Full Code Here

Examples of org.nfctools.test.InMemoryTag

  }

  protected MfClassicReaderWriter loadData(String fileName) {
    try {
      MemoryMap memoryMap = FileMfClassicReader.loadCardFromFile(fileName);
      InMemoryTag tag = new InMemoryTag(memoryMap);

      AcrMfClassicReaderWriter mfClassicReaderWriter = new AcrMfClassicReaderWriter(tag, memoryLayout);
      return mfClassicReaderWriter;
    }
    catch (IOException e) {
View Full Code Here

Examples of org.nfctools.test.InMemoryTag

      new Config("mfstd1k_formatted.txt", MemoryLayout.CLASSIC_1K, true, true, "mfstd1k_formatted_readonly.txt"),
      new Config("mfstd4k_formatted.txt", MemoryLayout.CLASSIC_4K, true, true, "mfstd4k_formatted_readonly.txt") };

  private void init(Config config) throws IOException {
    MemoryMap memoryMap = FileMfClassicReader.loadCardFromFile(config.fileName);
    tag = new InMemoryTag(memoryMap);
    readerWriter = new AcrMfClassicReaderWriter(tag, config.memoryLayout);
    ndefOperations = new MfClassicNdefOperations(readerWriter, readerWriter.getTagInfo(), config.formatted,
        config.writeable);
    if (config.expected != null && config.expected.startsWith("mfstd")) {
      expectedTag = new InMemoryTag(FileMfClassicReader.loadCardFromFile(config.expected));
    }
  }
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.