Package org.nfctools.api

Examples of org.nfctools.api.TagType


      tagScannerListener.onScanningEnded();
  }

  private void handleCard(Card card) {
    byte[] historicalBytes = card.getATR().getHistoricalBytes();
    TagType tagType = AcsTagUtils.identifyTagType(historicalBytes);
    AcsTag acsTag = new AcsTag(tagType, historicalBytes, card);
    if (tagType.equals(TagType.NFCIP)) {
      connectAsInitiator(acsTag);
    }
    else {
      tagListener.onTag(acsTag);
    }
View Full Code Here


      try {
        Card card = cardTerminal.connect("direct");

        byte[] historicalBytes = card.getATR().getHistoricalBytes();
        TagType tagType = AcsTagUtils.identifyTagType(historicalBytes);

        ApduTagReaderWriter readerWriter = new ApduTagReaderWriter(new AcsDirectChannelTag(tagType,
            historicalBytes, card));

        try {
View Full Code Here

import org.nfctools.utils.NfcUtils;

public class AcsTagUtils {

  public static TagType identifyTagType(byte[] historicalBytes) {
    TagType tagType = TagType.UNKNOWN;
    if (historicalBytes.length >= 11) {
      int tagId = (historicalBytes[9] & 0xff) << 8 | historicalBytes[10];
      switch (tagId) {
        case 0x0001:
          return TagType.MIFARE_CLASSIC_1K;
View Full Code Here

TOP

Related Classes of org.nfctools.api.TagType

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.