Timeout is now integer.
This commit is contained in:
parent
dad3603936
commit
5c7454a2f7
29 changed files with 133 additions and 145 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue