More attempt to support Sony S360 reader

Initialisation of RC-S360 in mode 0
Better generic nfc-list, does not rely only on DeSelect to avoid duplicates
Restore SetParameters for RC-S360
Handle Diagnose communication test properly

Tested:
    - nfc-list          => ok except for B' & 3B
    - nfc-anticol       => fails to send raw frames before select
    - nfc-mfultralight  => ok
    - nfc-mfclassic     => ok
    - pn53x-tamashell   => ok
    - pn53x-diagnose    => ok
    - nfc-dep-initiator => ok
    - nfc-dep-target    => fails in InitAsTarget
    - nfc-emulate-*     => fails in InitAsTarget

Commands momentarily disabled for RC-S330:
    - InDeselect
    - InRelease
    - select_passive_target for B'& 3B
This commit is contained in:
Philippe Teuwen
2011-06-07 20:36:20 +00:00
parent cbbda20018
commit 80a5ad1fd6
5 changed files with 38 additions and 21 deletions

View File

@@ -406,11 +406,21 @@ nfc_initiator_list_passive_targets (nfc_device_t * pnd,
while (nfc_initiator_select_passive_target (pnd, nm, pbtInitData, szInitDataLen, &nt)) {
nfc_initiator_deselect_target (pnd);
if (szTargets > szTargetFound) {
memcpy (&(ant[szTargetFound]), &nt, sizeof (nfc_target_t));
} else {
if (szTargets == szTargetFound) {
break;
}
int i;
bool seen = false;
// Check if we've already seen this tag
for (i = 0; i < szTargetFound; i++) {
if (memcmp(&(ant[i]), &nt, sizeof (nfc_target_t)) == 0) {
seen = true;
}
}
if (seen) {
break;
}
memcpy (&(ant[szTargetFound]), &nt, sizeof (nfc_target_t));
szTargetFound++;
// deselect has no effect on FeliCa and Jewel cards so we'll stop after one...
// ISO/IEC 14443 B' cards are polled at 100% probability so it's not possible to detect correctly two cards at the same time