nfc-tools / libnfc

Platform independent Near Field Communication (NFC) library
http://nfc-tools.org
GNU Lesser General Public License v3.0
1.72k stars 442 forks source link

Read/Write ISO14443B-2 ST SRx card #494

Open kevXZY opened 6 years ago

kevXZY commented 6 years ago

Hello

I'm able to detect the card. I can read the UID but noting else.

Any ideas ?

Thank you

lodi-g commented 6 years ago

See #436

You must first init an B tag, and then you can use sub-b types like B2SR for SRx.

doudz commented 4 years ago

@lodi-g Could you explain what you mean ?

You must first init an B tag, and then you can use sub-b types like B2SR for SRx.

lodi-g commented 4 years ago

@lodi-g Could you explain what you mean ?

You must first init an B tag, and then you can use sub-b types like B2SR for SRx.

It's been a while, but here's a sample that was working for a B2SR tag.

static bool is_tag_present(void) {
    nfc_target ant[1];
    nfc_modulation nm = {.nmt = NMT_ISO14443B, .nbr = NBR_106};
    nfc_initiator_list_passive_targets(pnd, nm, ant, 1);

    nfc_target ant2[1];
    nfc_modulation nm2 = {.nmt = NMT_ISO14443B2SR, .nbr = NBR_106};
    int res = nfc_initiator_list_passive_targets(pnd, nm2, ant2, 1);

    return res == 1;
}

You can read more in issue #439