Mifare SDK Lite filterIntent

Forum / MIFARE SDK / Mifare SDK Lite filterIntent

  • 15. July 2015 at 11:32
    I have a question for the forum, so I will really appreciate it if anyone can help me here.

    I managed to get an initial Android app started and loaded on my test device.
    When I tap a Mifare Classis 1k card (bring near the NFC reader of the phone) I do get a response (I also put the Vibrate option on the Intent). However None of the Auto handlers in the Mifare Android lib ( Auto handlers using the libInstance.filterIntent (..)) are triggered when I tap the card.

    When I read the card with a Omnikey 5321 PCSC reader The ATR of the card is (ATR: 3B8F8001804F0CA000000306030001000000006A ).


    My Assumtion is that the handler function / method below would have been entered /executed when I tapped the card on the phone. But actually none of the intent filter methods are called.. I also tried this card on your sample app, the same result.

    @Override
    public void onMifareClassicCardDetected(MFClassic objMFCCard) {
    Log.i(TAG,"Classic Card Detected" );
    objMFCCard.connect();
    }


    is my card an actual Mifare? Can you provide me some assistance? What am I missing.

    I'll send any code you want..
    + 0  |  - 0

    Re: Mifare SDK Lite filterIntent

    16. July 2015 at 7:55
    Hey Philip,

    Could you tell me what Android device are using for your App ?
    And if you have any Error / Warnings in LogCat of your Android Studio or in Eclipse ?

    Best,
    David
    + 1  |  - 0

    Re: Mifare SDK Lite filterIntent

    17. July 2015 at 11:55
    Hi David,

    Thank you for replying to me.

    The Device is called a Prestigio, Model PAP5501.
    For the Log cat, I need to check for you.. Will post if I see any.
    Thank you
    Regards,
    Phil
    + 0  |  - 0

    Re: Mifare SDK Lite filterIntent

    21. July 2015 at 10:35
    Hi David,

    I tried a couple of times with various different code versions, and I added the following to my onNewIntent method before using the NXP library calls:

    Tag tagFromIntent = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
    Log.e(TAG,"TagFromIntent:"+ tagFromIntent.toString());
    String curTechlist[] = tagFromIntent.getTechList();
    boolean isClassicSupported=false;
    for(int i=0;i<curTechlist.length;i++){

    if(curTechlist.contains("Classic")){
    isClassicSupported=true;
    break;
    }
    }
    if(isClassicSupported) {
    classsic2 = MifareClassic.get(tagFromIntent);
    Log.e(TAG, Integer.toString(classsic2.getType()));
    int MFSize = classsic2.getSize();
    }
    else
    {
    Log.e(TAG,"NO Classic card //\n Classic card not supported by this device");

    }




    When I checked the Log Cat, I found the below issue: on the phone the get tech list returns not a Mifare device but the following:
    android.nfc.tech.NfcA

    07-21 10:29:19.333 9072-9072/com.nxp.sampleliblite E/NFC_TAG﹕ TagFromIntent:TAG: Tech [android.nfc.tech.NfcA ]
    07-21 10:29:43.667 9072-9072/com.nxp.sampleliblite E/NFC_TAG﹕ NO Classic card //
    Classic card not supported by this device
    + 0  |  - 0

    Re: Mifare SDK Lite filterIntent

    21. July 2015 at 10:36
    Any help on this?
    + 0  |  - 0

    Re: Mifare SDK Lite filterIntent

    21. July 2015 at 14:09
    Hey Phillip,

    I was trying to find out information on your NFC Controller used in your Device, but I could not find the info.
    The reason is, that non-NXP NFC controllers might not recognize Classic Card or have issues with detecting it.

    For example my Samsung Galaxy S4 cannot detect MF Classic Card, because I have a BROADCOM NFC Controller inside it,
    but the same card works perfeclty on my NEXUS 7 Tablet, because it has NXP NFC Controller in it.

    I would suggest first to determine if this is the possible issue, what you can do:

    - Figure out your NFC controller, which one it is
    - Try your App / Sample App on another Android Device that has NXP NFC Controller in it and see what happens if you tap the same card you use to it

    Then we will be able to narrow down reasons why is this happening. Because currently I see only these options:

    - You do not have a real MIFARE Classic card
    - You have a non-NXP NFC controller chip inside your Android Device
    - OR COULD be possible bug in your software (but this one I doubt since SDK is working for me, for example)

    Lets see what you find out.

    Best,
    David
    + 0  |  - 0

    Re: Mifare SDK Lite filterIntent

    23. July 2015 at 7:40
    Hey David,

    Thanks for replying again. you are correct.

    For point - I have tried connection to the Mifare cards using a C# app on my PC with a Omnikey 5321 PCSC readder, and it works, I can authenticate and read the card. So now, we know our card is legit Mifare 1k.

    For the Second point, I'm beginning to believe the phone's controller does not cater for Mifare Classic.. Hence it returns android.nfc.tech.NfcA as the only supported tech list on this specific card. So i tried connecting to the card using the NFCa tag methods which provides access to NFC-A (ISO 14443-3A) properties and I/O operations.

    The Connect call actually worked and I mannaged to get the Mifare Card Serial Number (UID) Ex: 9BF44F07 in this case i used the method mNfca.getTag().getId() which returned it.

    However if i attemt to do any furhter communication i get the following from log cat.

    07-23 07:38:51.374 25442-25453/com.philicoe.wavereader I/VISA_CARD﹕ nNFCa tag discovered
    07-23 07:38:51.394 25442-25453/com.philicoe.wavereader E/NFCa﹕ NFCa Connected
    07-23 07:38:51.394 25442-25453/com.philicoe.wavereader E/NFCa﹕ Connection bytes returned: 0400
    07-23 07:38:51.394 25442-25453/com.philicoe.wavereader E/NFCa﹕ Tag ID:9BF44F07
    07-23 07:38:51.394 25442-25453/com.philicoe.wavereader I/NFCa﹕ NFCa_APDU_TO_SEND_START:FF82200006089B07084FF4
    07-23 07:38:51.394 25442-25453/com.philicoe.wavereader I/NFCa﹕ Requesting NFCa APDU: FF82200006089B07084FF4
    07-23 07:38:51.394 25442-25453/com.philicoe.wavereader I/NFCa﹕ Calling NFCa tranceive: FF82200006089B07084FF4
    07-23 07:38:56.399 25442-25453/com.philicoe.wavereader E/NFCa﹕ Error communicating with NFCa card: android.nfc.TagLostException: Tag was lost.
    07-23 07:38:56.399 25442-25453/com.philicoe.wavereader I/NFCa﹕ NFCa_APDU_TO_SEND_START:FF860000050100006100F4
    07-23 07:38:56.399 25442-25453/com.philicoe.wavereader I/NFCa﹕ Requesting NFCa APDU: FF860000050100006100F4
    07-23 07:38:56.399 25442-25453/com.philicoe.wavereader I/NFCa﹕ Calling NFCa tranceive: FF860000050100006100F4
    07-23 07:39:01.409 25442-25453/com.philicoe.wavereader E/NFCa﹕ Error communicating with NFCa card: android.nfc.TagLostException: Tag was lost.
    07-23 07:39:01.409 25442-25453/com.philicoe.wavereader E/NFCa﹕ NFCa Send complete
    07-23 07:39:01.409 25442-25453/com.philicoe.wavereader E/VISA_CARD﹕ android.nfc.tech.NfcA


    Regards,



    + 0  |  - 0

    Re: Mifare SDK Lite filterIntent

    23. July 2015 at 9:34
    Hello Philip,

    Your scenario described above definetly implies that your Android Device has NFC Controller that is unable to detect Classic Card.
    Establishing connection with android native commands to the card does not mean that your phone now detects MF Classic.
    As you can see soon after sending some APDUs you are reciving exception "TagLost", this happens also on my Galaxy S4, which has Broadcom controller in it.

    I would really love to see, if you can manage to borromw from some a Nexus 7, or some other Android Device that has NXP NFC Controller.
    Just to really put a dot at the end of our statements - because we know are guessing that NFC Controller is the issue here.

    Best,
    David

    + 0  |  - 0
Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.