Timeout is now integer.

This commit is contained in:
Audrey Diacre 2011-11-25 11:37:30 +00:00
parent dad3603936
commit 5c7454a2f7
29 changed files with 133 additions and 145 deletions

View file

@ -105,7 +105,7 @@ transmit_bytes (const uint8_t * pbtTx, const size_t szTx)
print_hex (pbtTx, szTx);
}
// Transmit the command bytes
if (!nfc_initiator_transceive_bytes (pnd, pbtTx, szTx, abtRx, &szRx, NULL))
if (!nfc_initiator_transceive_bytes (pnd, pbtTx, szTx, abtRx, &szRx, 0))
return false;
// Show received answer

View file

@ -93,7 +93,7 @@ main (int argc, const char *argv[])
print_nfc_target (nt, false);
printf ("Sending: %s\n", abtTx);
if (!nfc_initiator_transceive_bytes (pnd, abtTx, sizeof(abtTx), abtRx, &szRx, NULL)) {
if (!nfc_initiator_transceive_bytes (pnd, abtTx, sizeof(abtTx), abtRx, &szRx, 0)) {
nfc_perror(pnd, "nfc_initiator_transceive_bytes");
goto error;
}

View file

@ -125,7 +125,7 @@ main (int argc, const char *argv[])
}
printf("Initiator request received. Waiting for data...\n");
if (!nfc_target_receive_bytes (pnd, abtRx, &szRx, NULL)) {
if (!nfc_target_receive_bytes (pnd, abtRx, &szRx, 0)) {
nfc_perror(pnd, "nfc_target_receive_bytes");
goto error;
}
@ -133,7 +133,7 @@ main (int argc, const char *argv[])
printf ("Received: %s\n", abtRx);
printf ("Sending: %s\n", abtTx);
if (!nfc_target_send_bytes (pnd, abtTx, sizeof(abtTx), NULL)) {
if (!nfc_target_send_bytes (pnd, abtTx, sizeof(abtTx), 0)) {
nfc_perror(pnd, "nfc_target_send_bytes");
goto error;
}

View file

@ -148,7 +148,7 @@ nfc_target_emulate_tag(nfc_device* pnd, nfc_target * pnt)
while ( loop ) {
loop = target_io( pnt, abtRx, szRx, abtTx, &szTx );
if (szTx) {
if (!nfc_target_send_bytes(pnd, abtTx, szTx, NULL)) {
if (!nfc_target_send_bytes(pnd, abtTx, szTx, 0)) {
nfc_perror (pnd, "nfc_target_send_bytes");
return false;
}
@ -158,7 +158,7 @@ nfc_target_emulate_tag(nfc_device* pnd, nfc_target * pnt)
nfc_configure (pnd, NDO_HANDLE_CRC, false);
init_mfc_auth = false;
}
if (!nfc_target_receive_bytes(pnd, abtRx, &szRx, NULL)) {
if (!nfc_target_receive_bytes(pnd, abtRx, &szRx, 0)) {
nfc_perror (pnd, "nfc_target_receive_bytes");
return false;
}

View file

@ -88,7 +88,7 @@ main (int argc, const char *argv[])
printf ("NFC device [%s] connected.\n", pnd->acName);
result = pn53x_transceive (pnd, pncmd_diagnose_communication_line_test, sizeof (pncmd_diagnose_communication_line_test), abtRx, &szRx, NULL);
result = pn53x_transceive (pnd, pncmd_diagnose_communication_line_test, sizeof (pncmd_diagnose_communication_line_test), abtRx, &szRx, 0);
if (result) {
// Result of Diagnose ping for RC-S360 doesn't contain status byte so we've to handle both cases
result = (memcmp (pncmd_diagnose_communication_line_test + 1, abtRx, sizeof (pncmd_diagnose_communication_line_test) - 1) == 0) ||
@ -98,7 +98,7 @@ main (int argc, const char *argv[])
}
printf (" Communication line test: %s\n", result ? "OK" : "Failed");
result = pn53x_transceive (pnd, pncmd_diagnose_rom_test, sizeof (pncmd_diagnose_rom_test), abtRx, &szRx, NULL);
result = pn53x_transceive (pnd, pncmd_diagnose_rom_test, sizeof (pncmd_diagnose_rom_test), abtRx, &szRx, 0);
if (result) {
result = ((szRx == 1) && (abtRx[0] == 0x00));
} else {
@ -106,7 +106,7 @@ main (int argc, const char *argv[])
}
printf (" ROM test: %s\n", result ? "OK" : "Failed");
result = pn53x_transceive (pnd, pncmd_diagnose_ram_test, sizeof (pncmd_diagnose_ram_test), abtRx, &szRx, NULL);
result = pn53x_transceive (pnd, pncmd_diagnose_ram_test, sizeof (pncmd_diagnose_ram_test), abtRx, &szRx, 0);
if (result) {
result = ((szRx == 1) && (abtRx[0] == 0x00));
} else {

View file

@ -110,7 +110,7 @@ main (int argc, const char *argv[])
// Connect with the SAM
// FIXME: Its a private pn53x function
if (!pn53x_SAMConfiguration (pnd, mode, NULL)) {
if (!pn53x_SAMConfiguration (pnd, mode, 0)) {
nfc_perror (pnd, "pn53x_SAMConfiguration");
exit (EXIT_FAILURE);
}
@ -185,7 +185,7 @@ main (int argc, const char *argv[])
}
// Disconnect from the SAM
pn53x_SAMConfiguration (pnd, PSM_NORMAL, NULL);
pn53x_SAMConfiguration (pnd, PSM_NORMAL, 0);
// Disconnect from NFC device
nfc_disconnect (pnd);

View file

@ -178,7 +178,7 @@ int main(int argc, const char* argv[])
print_hex((uint8_t*)abtTx,szTx);
szRx = sizeof(abtRx);
if (!pn53x_transceive (pnd, abtTx, szTx, abtRx, &szRx, NULL)) {
if (!pn53x_transceive (pnd, abtTx, szTx, abtRx, &szRx, 0)) {
free(cmd);
nfc_perror (pnd, "Rx");
continue;