How to configure libfreefare to work with NFC Cipurse?

33 Views Asked by At

How can i configure the libfreefare to work with Cipurse? I already configurated with standart ISO14443A but does not work.

FreefareTag *tags = NULL;
int tag_count = 0;

nfc_initiator_init(device);

// Drop the field for a while
nfc_device_set_property_bool(device, NP_ACTIVATE_FIELD, false);

// Configure the CRC and Parity settings
nfc_device_set_property_bool(device, NP_HANDLE_CRC, true);
nfc_device_set_property_bool(device, NP_HANDLE_PARITY, true);
nfc_device_set_property_bool(device, NP_FORCE_ISO14443_A, true);

// Enable field so more power-consuming cards can power themselves up
nfc_device_set_property_bool(device, NP_ACTIVATE_FIELD, true);

nfc_target candidates[MAX_CANDIDATES];
int candidates_count;
nfc_modulation modulation = {
    .nmt = NMT_ISO14443A, 
    .nbr = NBR_424
};

if ((candidates_count = nfc_initiator_list_passive_targets(device, modulation, candidates, MAX_CANDIDATES)) < 0) {
    std::cout << candidates_count << std::endl;
    //return NULL;
}

tags = (FreefareTag *)malloc((candidates_count + 1) * sizeof(FreefareTag));
if (!tags)
    return NULL;

for (int c = 0; c < candidates_count; c++) {
    FreefareTag t;
    if ((t = freefare_tag_new(device, candidates[c]))) {
        tags[tag_count++] = t;
    }
}

tags[tag_count] = NULL;
return tags;

I cannot find any code example for cipurse.

Any ideias? Best regards

0

There are 0 best solutions below