Remove extra whitespaces/tabs before EOL.

find . -name '*.[ch]' | xargs perl -pi -e 's/\t+$//; s/ +$//'

Thanks to Ludovic.
This commit is contained in:
Romuald Conty 2012-05-29 00:33:22 +00:00
parent 167238c60d
commit 26865bbc19
66 changed files with 483 additions and 483 deletions

View file

@ -1,13 +1,13 @@
/*-
* Public platform independent Near Field Communication (NFC) library
*
*
* Copyright (C) 2009, 2010, Roel Verdult, Romuald Conty
*
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for

View file

@ -1,15 +1,15 @@
/*-
* Public platform independent Near Field Communication (NFC) library
*
*
* Copyright (C) 2009, Roel Verdult, Romuald Conty
* Copyright (C) 2010, Roel Verdult, Romuald Conty
* Copyright (C) 2011, Romuald Conty, Romain Tartière
*
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for

View file

@ -1,15 +1,15 @@
/*-
* Public platform independent Near Field Communication (NFC) library
*
*
* Copyright (C) 2009, 2010, Roel Verdult, Romuald Conty
* Copyright (C) 2010, Roel Verdult, Romuald Conty
* Copyright (C) 2011, Romuald Conty, Romain Tartière
*
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
@ -138,7 +138,7 @@ void
uart_set_speed (serial_port sp, const uint32_t uiPortSpeed)
{
log_put (LOG_CATEGORY, NFC_PRIORITY_TRACE, "Serial port speed requested to be set to %d bauds.", uiPortSpeed);
// Portability note: on some systems, B9600 != 9600 so we have to do
// uint32_t <=> speed_t associations by hand.
speed_t stPortSpeed = B9600;
@ -352,13 +352,13 @@ uart_list_ports (void)
char **res2 = realloc (res, (szRes+1) * sizeof (char *));
if (!res2)
goto oom;
res = res2;
if (!(res[szRes-1] = malloc (6 + strlen (pdDirEnt->d_name))))
goto oom;
sprintf (res[szRes-1], "/dev/%s", pdDirEnt->d_name);
szRes++;
res[szRes-1] = NULL;
}

View file

@ -1,13 +1,13 @@
/*-
* Public platform independent Near Field Communication (NFC) library
*
*
* Copyright (C) 2009, 2010, Roel Verdult, Romuald Conty
*
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
@ -167,7 +167,7 @@ uart_receive (serial_port sp, uint8_t * pbtRx, const size_t szRx, void * abort_p
do {
log_put (LOG_CATEGORY, NFC_PRIORITY_TRACE, "ReadFile");
res = ReadFile (((struct serial_port_windows *) sp)->hPort, pbtRx + dwTotalBytesReceived,
dwBytesToGet,
dwBytesToGet,
&dwBytesReceived, NULL);
dwTotalBytesReceived += dwBytesReceived;
@ -179,7 +179,7 @@ uart_receive (serial_port sp, uint8_t * pbtRx, const size_t szRx, void * abort_p
} else if (dwBytesReceived == 0) {
return NFC_ETIMEOUT;
}
if (((DWORD)szRx) > dwTotalBytesReceived) {
dwBytesToGet -= dwBytesReceived;
}

View file

@ -1,13 +1,13 @@
/*-
* Public platform independent Near Field Communication (NFC) library
*
*
* Copyright (C) 2011, Romuald Conty, Romain Tartière
*
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
@ -74,21 +74,21 @@
#define TgGetTargetStatus 0x8A
/** @note PN53x's normal frame:
*
*
* .-- Start
* | .-- Packet length
* | | .-- Length checksum
* | | | .-- Direction (D4 Host to PN, D5 PN to Host)
* | | | | .-- Code
* | | | | | .-- Packet checksum
* | | | | | | .-- Postamble
* | | | | | | .-- Postamble
* V | | | | | |
* ----- V V V V V V
* 00 FF 02 FE D4 02 2A 00
*/
/** @note PN53x's extended frame:
*
*
* .-- Start
* | .-- Fixed to FF to enable extended frame
* | | .-- Packet length
@ -96,13 +96,13 @@
* | | | | .-- Direction (D4 Host to PN, D5 PN to Host)
* | | | | | .-- Code
* | | | | | | .-- Packet checksum
* | | | | | | | .-- Postamble
* | | | | | | | .-- Postamble
* V V V | | | | |
* ----- ----- ----- V V V V V
* 00 FF FF FF 00 02 FE D4 02 2A 00
*/
/**
/**
* Start bytes, packet length, length checksum, direction, packet checksum and postamble are overhead
*/
// The TFI is considered part of the overhead
@ -156,7 +156,7 @@ static const pn53x_command pn53x_commands[] = {
PNCMD( SAMConfiguration, PN531|PN532 ),
PNCMD( PowerDown, PN531|PN532 ),
PNCMD( AlparCommandForTDA, PN533|RCS360 ), // Has another usage on RC-S360...
// RF communication
PNCMD( RFConfiguration, PN531|PN532|PN533|RCS360 ),
PNCMD( RFRegulationTest, PN531|PN532|PN533 ),

View file

@ -1,15 +1,15 @@
/*-
* Public platform independent Near Field Communication (NFC) library
*
*
* Copyright (C) 2009, Roel Verdult, Romuald Conty
* Copyright (C) 2010, Roel Verdult, Romuald Conty, Romain Tartière
* Copyright (C) 2011, Romuald Conty, Romain Tartière
*
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
@ -80,11 +80,11 @@ pn53x_init(struct nfc_device *pnd)
nbSupportedModulation++;
CHIP_DATA(pnd)->supported_modulation_as_initiator[nbSupportedModulation] = NMT_FELICA;
nbSupportedModulation++;
}
}
if (pnd->btSupportByte & SUPPORT_ISO14443B) {
CHIP_DATA(pnd)->supported_modulation_as_initiator[nbSupportedModulation] = NMT_ISO14443B;
nbSupportedModulation++;
}
}
if(CHIP_DATA(pnd)->type != PN531) {
CHIP_DATA(pnd)->supported_modulation_as_initiator[nbSupportedModulation] = NMT_JEWEL;
nbSupportedModulation++;
@ -93,11 +93,11 @@ pn53x_init(struct nfc_device *pnd)
nbSupportedModulation++;
CHIP_DATA(pnd)->supported_modulation_as_initiator[nbSupportedModulation] = 0;
}
if (!CHIP_DATA(pnd)->supported_modulation_as_target) {
CHIP_DATA(pnd)->supported_modulation_as_target = (nfc_modulation_type*) pn53x_supported_modulation_as_target;
}
// CRC handling should be enabled by default as declared in nfc_device_new
// which is the case by default for pn53x, so nothing to do here
// Parity handling should be enabled by default as declared in nfc_device_new
@ -488,7 +488,7 @@ pn53x_decode_target_data (const uint8_t *pbtRawData, size_t szRawData, pn53x_typ
case NMT_ISO14443BI:
// Skip V & T Addresses
pbtRawData++;
if (*pbtRawData != 0x07) { // 0x07 = REPGEN
if (*pbtRawData != 0x07) { // 0x07 = REPGEN
return NFC_ECHIP;
}
pbtRawData++;
@ -757,7 +757,7 @@ pn53x_int_to_timeout (const int ms)
return res;
}
int
int
pn53x_set_property_int (struct nfc_device *pnd, const nfc_property property, const int value)
{
switch (property) {
@ -846,7 +846,7 @@ pn53x_set_property_bool (struct nfc_device *pnd, const nfc_property property, co
// TODO Made some research around this point:
// timings could be tweak better than this, and maybe we can tweak timings
// to "gain" a sort-of hardware polling (ie. like PN532 does)
if (pn53x_RFConfiguration__MaxRetries (pnd,
if (pn53x_RFConfiguration__MaxRetries (pnd,
(bEnable) ? 0xff : 0x00, // MxRtyATR, default: active = 0xff, passive = 0x02
(bEnable) ? 0xff : 0x01, // MxRtyPSL, default: 0x01
(bEnable) ? 0xff : 0x02 // MxRtyPassiveActivation, default: 0xff (0x00 leads to problems with PN531)
@ -984,7 +984,7 @@ pn53x_check_communication (struct nfc_device *pnd)
szRx = (size_t) res;
if ((sizeof(abtExpectedRx) == szRx) && (0 == memcmp (abtRx, abtExpectedRx, sizeof(abtExpectedRx))))
return NFC_SUCCESS;
return NFC_EIO;
}
@ -1051,7 +1051,7 @@ pn53x_initiator_select_passive_target_ext (struct nfc_device *pnd,
const uint8_t abtReqt[]= { 0x10 };
// Getting product code / fab code & store it in output buffer after the serial nr we'll obtain later
if ((res = pn53x_initiator_transceive_bytes (pnd, abtReqt, sizeof(abtReqt), abtTargetsData+2, sizeof(abtTargetsData)-2, timeout)) < 0) {
return res;
return res;
}
szTargetsData = (size_t)res;
}
@ -1123,7 +1123,7 @@ pn53x_initiator_poll_target (struct nfc_device *pnd,
nfc_target *pnt)
{
int res = 0;
if (CHIP_DATA(pnd)->type == PN532) {
size_t szTargetTypes = 0;
pn53x_target_type apttTargetTypes[32];
@ -1167,7 +1167,7 @@ pn53x_initiator_poll_target (struct nfc_device *pnd,
size_t szInitiatorData;
prepare_initiator_data (pnmModulations[n], &pbtInitiatorData, &szInitiatorData);
const int timeout_ms = uiPeriod * 150;
if ((res = pn53x_initiator_select_passive_target_ext (pnd, pnmModulations[n], pbtInitiatorData, szInitiatorData, pnt, timeout_ms)) < 0) {
if (pnd->last_error != NFC_ETIMEOUT) {
return pnd->last_error;
@ -1631,7 +1631,7 @@ pn53x_initiator_deselect_target (struct nfc_device *pnd)
return pn53x_InDeselect (pnd, 0); // 0 mean deselect all selected targets
}
int
int
pn53x_initiator_target_is_present (struct nfc_device *pnd, const nfc_target nt)
{
// TODO Check if nt is equal to current target
@ -1786,7 +1786,7 @@ pn53x_target_init (struct nfc_device *pnd, nfc_target *pnt, uint8_t *pbtRx, cons
// Set System Code
abtFeliCaParams[16] = 0x0f;
abtFeliCaParams[17] = 0xab;
pbtFeliCaParams = abtFeliCaParams;
break;
case NMT_ISO14443B:
@ -1884,7 +1884,7 @@ pn53x_target_receive_bits (struct nfc_device *pnd, uint8_t *pbtRx, const size_t
uint8_t abtRx[PN53x_EXTENDED_FRAME__DATA_MAX_LEN];
size_t szRx = sizeof (abtRx);
int res = 0;
// Try to gather a received frame from the reader
if ((res = pn53x_transceive (pnd, abtCmd, sizeof (abtCmd), abtRx, szRx, -1)) < 0)
return res;
@ -2048,7 +2048,7 @@ pn53x_target_send_bytes (struct nfc_device *pnd, const uint8_t *pbtTx, const siz
return pnd->last_error;
}
}
// NO BREAK
// NO BREAK
case NMT_JEWEL:
case NMT_ISO14443B:
case NMT_ISO14443BI:
@ -2064,7 +2064,7 @@ pn53x_target_send_bytes (struct nfc_device *pnd, const uint8_t *pbtTx, const siz
// Copy the data into the command frame
memcpy (abtCmd + 1, pbtTx, szTx);
// Try to send the bits to the reader
if ((res = pn53x_transceive (pnd, abtCmd, szTx + 1, NULL, 0, timeout)) < 0)
return res;
@ -2565,7 +2565,7 @@ pn53x_TgInitAsTarget (struct nfc_device *pnd, pn53x_target_mode ptm,
return res;
szRx = (size_t) res;
// Note: the first byte is skip:
// Note: the first byte is skip:
// its the "mode" byte which contains baudrate, DEP and Framing type (Mifare, active or FeliCa) datas.
if(pbtModeByte) {
*pbtModeByte = abtRx[0];
@ -2573,7 +2573,7 @@ pn53x_TgInitAsTarget (struct nfc_device *pnd, pn53x_target_mode ptm,
// Save the received byte count
szRx -= 1;
if ((szRx - 1) > szRxLen)
return NFC_EOVFLOW;
// Copy the received bytes
@ -2831,7 +2831,7 @@ pn53x_nm_to_ptt(const nfc_modulation nm)
return PTT_UNDEFINED;
}
int
int
pn53x_get_supported_modulation(nfc_device *pnd, const nfc_mode mode, const nfc_modulation_type * *const supported_mt)
{
switch (mode) {
@ -2841,7 +2841,7 @@ pn53x_get_supported_modulation(nfc_device *pnd, const nfc_mode mode, const nfc_m
case N_INITIATOR:
*supported_mt = CHIP_DATA(pnd)->supported_modulation_as_initiator;
break;
default:
default:
return NFC_EINVARG;
}
return NFC_SUCCESS;
@ -2849,12 +2849,12 @@ pn53x_get_supported_modulation(nfc_device *pnd, const nfc_mode mode, const nfc_m
int
pn53x_get_supported_baud_rate (nfc_device *pnd, const nfc_modulation_type nmt, const nfc_baud_rate * *const supported_br)
{
{
switch (nmt) {
case NMT_FELICA:
case NMT_FELICA:
*supported_br = (nfc_baud_rate*)pn53x_felica_supported_baud_rates;
break;
case NMT_ISO14443A:
case NMT_ISO14443A:
*supported_br = (nfc_baud_rate*)pn53x_iso14443a_supported_baud_rates;
break;
case NMT_ISO14443B:
@ -2872,7 +2872,7 @@ pn53x_get_supported_baud_rate (nfc_device *pnd, const nfc_modulation_type nmt, c
case NMT_JEWEL:
*supported_br = (nfc_baud_rate*)pn53x_jewel_supported_baud_rates;
break;
case NMT_DEP:
case NMT_DEP:
*supported_br = (nfc_baud_rate*)pn53x_dep_supported_baud_rates;
break;
default:
@ -2906,7 +2906,7 @@ pn53x_get_information_about (nfc_device *pnd, char *buf, size_t buflen)
if ((res = nfc_device_get_supported_modulation(pnd, N_INITIATOR, &nmt)) < 0) {
return res;
}
for (int i=0; nmt[i]; i++) {
if ((res = snprintf (buf, buflen, "%s%s (", (i==0)?"":", ", str_nfc_modulation_type (nmt[i]))) < 0) {
return NFC_ESOFT;
@ -2920,7 +2920,7 @@ pn53x_get_information_about (nfc_device *pnd, char *buf, size_t buflen)
if ((res = nfc_device_get_supported_baud_rate (pnd, nmt[i], &nbr)) < 0) {
return res;
}
for (int j=0; nbr[j]; j++) {
if ((res = snprintf (buf, buflen, "%s%s", (j==0)?"":", ", str_nfc_baud_rate (nbr[j]))) < 0) {
return NFC_ESOFT;
@ -2960,7 +2960,7 @@ pn53x_get_information_about (nfc_device *pnd, char *buf, size_t buflen)
if ((res = nfc_device_get_supported_modulation(pnd, N_TARGET, &nmt)) < 0) {
return res;
}
for (int i=0; nmt[i]; i++) {
if ((res = snprintf (buf, buflen, "%s%s (", (i==0)?"":", ", str_nfc_modulation_type (nmt[i]))) < 0) {
return NFC_ESOFT;
@ -2974,7 +2974,7 @@ pn53x_get_information_about (nfc_device *pnd, char *buf, size_t buflen)
if ((res = nfc_device_get_supported_baud_rate (pnd, nmt[i], &nbr)) < 0) {
return res;
}
for (int j=0; nbr[j]; j++) {
if ((res = snprintf (buf, buflen, "%s%s", (j==0)?"":", ", str_nfc_baud_rate (nbr[j]))) < 0) {
return NFC_ESOFT;
@ -3043,10 +3043,10 @@ pn53x_data_new (struct nfc_device *pnd, const struct pn53x_io *io)
// Set default communication timeout (52 ms)
CHIP_DATA (pnd)->timeout_communication = 52;
CHIP_DATA (pnd)->supported_modulation_as_initiator = NULL;
CHIP_DATA (pnd)->supported_modulation_as_target = NULL;
CHIP_DATA (pnd)->supported_modulation_as_target = NULL;
}
void

View file

@ -1,15 +1,15 @@
/*-
* Public platform independent Near Field Communication (NFC) library
*
*
* Copyright (C) 2009, Roel Verdult, Romuald Conty
* Copyright (C) 2010, Roel Verdult, Romuald Conty, Romain Tartière
* Copyright (C) 2011, Romuald Conty, Romain Tartière
*
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
@ -19,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
/**
/**
* @file pn53x.h
* @brief PN531, PN532 and PN533 common functions
*/
@ -189,8 +189,8 @@ struct pn53x_data {
int timeout_atr;
/** Communication timeout */
int timeout_communication;
/** Supported modulation type */
nfc_modulation_type *supported_modulation_as_initiator;
/** Supported modulation type */
nfc_modulation_type *supported_modulation_as_initiator;
nfc_modulation_type *supported_modulation_as_target;
};
@ -210,7 +210,7 @@ typedef enum {
/** JIS X 6319-4 (Sony Felica) http://en.wikipedia.org/wiki/FeliCa */
PM_FELICA_424 = 0x02,
/** ISO14443-B http://en.wikipedia.org/wiki/ISO/IEC_14443 (Not supported by PN531) */
PM_ISO14443B_106 = 0x03,
PM_ISO14443B_106 = 0x03,
/** Jewel Topaz (Innovision Research & Development) (Not supported by PN531) */
PM_JEWEL_106 = 0x04,
/** ISO14443-B http://en.wikipedia.org/wiki/ISO/IEC_14443 (Not supported by PN531 nor PN532) */
@ -322,7 +322,7 @@ int pn53x_initiator_poll_target (struct nfc_device *pnd,
nfc_target *pnt);
int pn53x_initiator_select_dep_target (struct nfc_device *pnd,
const nfc_dep_mode ndm, const nfc_baud_rate nbr,
const nfc_dep_info *pndiInitiator,
const nfc_dep_info *pndiInitiator,
nfc_target *pnt,
const int timeout);
int pn53x_initiator_transceive_bits (struct nfc_device *pnd, const uint8_t *pbtTx, const size_t szTxBits,

View file

@ -1,14 +1,14 @@
/*-
* Public platform independent Near Field Communication (NFC) library
*
*
* Copyright (C) 2009, Roel Verdult
* Copyright (C) 2011, Romuald Conty, Romain Tartière
*
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for

View file

@ -1,15 +1,15 @@
/*-
* Public platform independent Near Field Communication (NFC) library
*
*
* Copyright (C) 2009, Roel Verdult
* Copyright (C) 2011, Romain Tartiere, Romuald Conty
* Copyright (C) 2012, Romuald Conty
*
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
@ -282,7 +282,7 @@ acr122_pcsc_open (const nfc_connstring connstring)
pn53x_data_new (pnd, &acr122_pcsc_io);
SCARDCONTEXT *pscc;
log_put (LOG_CATEGORY, NFC_PRIORITY_TRACE, "Attempt to open %s", ndd.pcsc_device_name);
// Test if context succeeded
if (!(pscc = acr122_pcsc_get_scardcontext ()))

View file

@ -1,15 +1,15 @@
/**
* Public platform independent Near Field Communication (NFC) library
*
*
* Copyright (C) 2009, Roel Verdult
* Copyright (C) 2011, Romain Tartiere, Romuald Conty
* Copyright (C) 2012, Romuald Conty
*
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
@ -17,8 +17,8 @@
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*
*
*
* @file acr122_pcsc.h
* @brief Driver for ACR122 devices (behind PC/SC daemon)
*/

View file

@ -1,15 +1,15 @@
/*-
* Public platform independent Near Field Communication (NFC) library
*
*
* Copyright (C) 2009, Roel Verdult
* Copyright (C) 2010, Romain Tartière, Romuald Conty
* Copyright (C) 2011, Romain Tartière, Romuald Conty
*
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
@ -33,7 +33,7 @@
* Revision 1.1
* April 22rd, 2005
* http://www.usb.org/developers/devclass_docs/DWG_Smart-Card_CCID_Rev110.pdf
*
*
* ACR122U NFC Reader
* Application Programming Interface
* Revision 1.2
@ -684,7 +684,7 @@ acr122_usb_init (nfc_device *pnd)
/*
// See ACR122 manual: "Bi-Color LED and Buzzer Control" section
uint8_t acr122u_get_led_state_frame[] = {
uint8_t acr122u_get_led_state_frame[] = {
0x6b, // CCID
0x09, // lenght of frame
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // padding

View file

@ -1,14 +1,14 @@
/**
* Public platform independent Near Field Communication (NFC) library
*
*
* Copyright (C) 2009, Roel Verdult
* Copyright (C) 2011, Romain Tartière
*
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
@ -16,8 +16,8 @@
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*
*
*
* @file acr122_usb.h
* @brief Driver for ACR122 devices using direct USB connection (without PCSC)
*/

View file

@ -479,7 +479,7 @@ acr122s_probe(nfc_connstring connstrings[], size_t connstrings_len, size_t *pszD
return false;
#else /* SERIAL_AUTOPROBE_ENABLED */
*pszDeviceFound = 0;
serial_port sp;
char **acPorts = uart_list_ports ();
const char *acPort;
@ -488,7 +488,7 @@ acr122s_probe(nfc_connstring connstrings[], size_t connstrings_len, size_t *pszD
while ((acPort = acPorts[iDevice++])) {
sp = uart_open (acPort);
log_put (LOG_CATEGORY, NFC_PRIORITY_TRACE, "Trying to find ACR122S device on serial port: %s at %d bauds.", acPort, ACR122S_DEFAULT_SPEED);
if ((sp != INVALID_SERIAL_PORT) && (sp != CLAIMED_SERIAL_PORT)) {
// We need to flush input to be sure first reply does not comes from older byte transceive
uart_flush_input (sp);
@ -512,7 +512,7 @@ acr122s_probe(nfc_connstring connstrings[], size_t connstrings_len, size_t *pszD
pn53x_data_new(pnd, &acr122s_io);
CHIP_DATA(pnd)->type = PN532;
CHIP_DATA(pnd)->power_mode = NORMAL;
char version[32];
int ret = acr122s_get_firmware_version(pnd, version, sizeof(version));
if (ret == 0 && strncmp("ACR122S", version, 7) != 0) {
@ -525,11 +525,11 @@ acr122s_probe(nfc_connstring connstrings[], size_t connstrings_len, size_t *pszD
if (ret != 0)
continue;
// ACR122S reader is found
memcpy (connstrings[*pszDeviceFound], connstring, sizeof(nfc_connstring));
(*pszDeviceFound)++;
// Test if we reach the maximum "wanted" devices
if (*pszDeviceFound >= connstrings_len)
break;
@ -551,7 +551,7 @@ acr122s_open(const nfc_connstring connstring)
nfc_device *pnd;
struct acr122s_descriptor ndd;
int connstring_decode_level = acr122s_connstring_decode (connstring, &ndd);
if (connstring_decode_level < 2) {
return NULL;
}

View file

@ -1,15 +1,15 @@
/*-
* Public platform independent Near Field Communication (NFC) library
*
*
* Copyright (C) 2009, Roel Verdult
* Copyright (C) 2010, Romuald Conty
* Copyright (C) 2011, Romain Tartière, Romuald Conty
*
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
@ -22,7 +22,7 @@
/**
* @file arygon.c
* @brief ARYGON readers driver
*
*
* This driver can handle ARYGON readers that use UART as bus.
* UART connection can be direct (host<->arygon_uc) or could be provided by internal USB to serial interface (e.g. host<->ftdi_chip<->arygon_uc)
*/
@ -50,11 +50,11 @@
#include "uart.h"
/** @def DEV_ARYGON_PROTOCOL_ARYGON_ASCII
* @brief High level language in ASCII format. (Common µC commands and Mifare® commands)
* @brief High level language in ASCII format. (Common µC commands and Mifare® commands)
*/
#define DEV_ARYGON_PROTOCOL_ARYGON_ASCII '0'
/** @def DEV_ARYGON_MODE_HL_ASCII
* @brief High level language in Binary format With AddressingByte for party line. (Common µC commands and Mifare® commands)
* @brief High level language in Binary format With AddressingByte for party line. (Common µC commands and Mifare® commands)
*/
#define DEV_ARYGON_PROTOCOL_ARYGON_BINARY_WAB '1'
/** @def DEV_ARYGON_PROTOCOL_TAMA
@ -541,7 +541,7 @@ arygon_reset_tama (nfc_device *pnd)
return NFC_SUCCESS;
}
static int
static int
arygon_abort_command (nfc_device *pnd)
{
if (pnd) {

View file

@ -1,15 +1,15 @@
/**
* Public platform independent Near Field Communication (NFC) library
*
*
* Copyright (C) 2009, Roel Verdult
* Copyright (C) 2010, Romuald Conty
* Copyright (C) 2011, Romuald Conty, Romain Tartière
*
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
@ -17,8 +17,8 @@
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*
*
*
* @file arygon.h
* @brief Driver for PN53x-equipped ARYGON device connected using UART
*/

View file

@ -1,14 +1,14 @@
/*-
* Public platform independent Near Field Communication (NFC) library
*
*
* Copyright (C) 2010, Roel Verdult, Romuald Conty
* Copyright (C) 2011, Romuald Conty, Romain Tartière
*
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
@ -61,7 +61,7 @@ struct pn532_uart_data {
volatile bool abort_flag;
#endif
};
#define DRIVER_DATA(pnd) ((struct pn532_uart_data*)(pnd->driver_data))
bool

View file

@ -1,14 +1,14 @@
/**
* Public platform independent Near Field Communication (NFC) library
*
*
* Copyright (C) 2010, Roel Verdult, Romuald Conty
* Copyright (C) 2011, Romuald Conty, Romain Tartière
*
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
@ -16,8 +16,8 @@
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*
*
*
* @file pn532_uart.h
* @brief Driver for PN532 connected in UART (HSU)
*/

View file

@ -1,15 +1,15 @@
/*-
* Public platform independent Near Field Communication (NFC) library
*
*
* Copyright (C) 2009, Roel Verdult
* Copyright (C) 2010, Romain Tartière, Romuald Conty
* Copyright (C) 2011, Romain Tartière, Romuald Conty
*
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
@ -686,19 +686,19 @@ pn53x_usb_init (nfc_device *pnd)
/*
On ASK LoGO hardware:
LEDs port bits definition:
LEDs port bits definition:
* LED 1: bit 2 (P32)
* LED 2: bit 1 (P31)
* LED 3: bit 0 or 3 (depending of hardware revision) (P30 or P33)
* LED 4: bit 5 (P35)
Notes:
* Set logical 0 to switch LED on; logical 1 to switch LED off.
Notes:
* Set logical 0 to switch LED on; logical 1 to switch LED off.
* Bit 4 should be maintained at 1 to keep RF field on.
Progressive field activation:
The ASK LoGO hardware can progressively power-up the antenna.
To use this feature we have to switch on the field by switching on
the field on PN533 (RFConfiguration) then set P34 to '1', and cut-off the
the field on PN533 (RFConfiguration) then set P34 to '1', and cut-off the
field by switching off the field on PN533 then set P34 to '0'.
*/

View file

@ -1,14 +1,14 @@
/**
* Public platform independent Near Field Communication (NFC) library
*
*
* Copyright (C) 2009, Roel Verdult
* Copyright (C) 2011, Romain Tartière
*
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
@ -16,8 +16,8 @@
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*
*
*
* @file pn53x_usb.h
* @brief Drive for PN53x USB devices
*/

View file

@ -1,13 +1,13 @@
/*-
* Public platform independent Near Field Communication (NFC) library
*
*
* Copyright (C) 2009, Roel Verdult
*
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
@ -95,28 +95,28 @@ iso14443a_locate_historical_bytes (uint8_t *pbtAts, size_t szAts, size_t *pszTk)
* @brief Add cascade tags (0x88) in UID
* @see ISO/IEC 14443-3 (6.4.4 UID contents and cascade levels)
*/
void
void
iso14443_cascade_uid (const uint8_t abtUID[], const size_t szUID, uint8_t *pbtCascadedUID, size_t *pszCascadedUID)
{
switch (szUID) {
case 7:
pbtCascadedUID[0] = 0x88;
memcpy (pbtCascadedUID + 1, abtUID, 7);
*pszCascadedUID = 8;
break;
case 10:
pbtCascadedUID[0] = 0x88;
memcpy (pbtCascadedUID + 1, abtUID, 3);
pbtCascadedUID[4] = 0x88;
memcpy (pbtCascadedUID + 5, abtUID + 3, 7);
*pszCascadedUID = 12;
break;
case 4:
default:
memcpy (pbtCascadedUID, abtUID, szUID);
*pszCascadedUID = szUID;
break;
}
switch (szUID) {
case 7:
pbtCascadedUID[0] = 0x88;
memcpy (pbtCascadedUID + 1, abtUID, 7);
*pszCascadedUID = 8;
break;
case 10:
pbtCascadedUID[0] = 0x88;
memcpy (pbtCascadedUID + 1, abtUID, 3);
pbtCascadedUID[4] = 0x88;
memcpy (pbtCascadedUID + 5, abtUID + 3, 7);
*pszCascadedUID = 12;
break;
case 4:
default:
memcpy (pbtCascadedUID, abtUID, szUID);
*pszCascadedUID = szUID;
break;
}
}

View file

@ -1,13 +1,13 @@
/*-
* Public platform independent Near Field Communication (NFC) library
*
*
* Copyright (C) 2011, Romuald Conty, Romain Tartière
*
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for

View file

@ -41,8 +41,8 @@
__attribute__((format(printf, 3, 4)))
# endif
;
#define NFC_PRIORITY_FATAL "fatal"
#define NFC_PRIORITY_ALERT "alert"
#define NFC_PRIORITY_CRIT "critical"
@ -59,7 +59,7 @@
#define log_msg(category, priority, message) do {} while (0)
#define log_set_appender(category, appender) do {} while (0)
#define log_put(category, priority, format, ...) do {} while (0)
#define NFC_PRIORITY_FATAL 8
#define NFC_PRIORITY_ALERT 7
#define NFC_PRIORITY_CRIT 6

View file

@ -1,13 +1,13 @@
/*-
* Public platform independent Near Field Communication (NFC) library
*
*
* Copyright (C) 2009, Roel Verdult
*
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for

View file

@ -1,13 +1,13 @@
/**
* Public platform independent Near Field Communication (NFC) library
*
*
* Copyright (C) 2009, Roel Verdult
*
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
@ -15,8 +15,8 @@
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*
*
*
* @file mirror-subr.h
* @brief Mirror bytes
*/

View file

@ -1,13 +1,13 @@
/*-
* Public platform independent Near Field Communication (NFC) library
*
*
* Copyright (C) 2011, Romain Tartière, Romuald Conty
*
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for

View file

@ -1,13 +1,13 @@
/*-
* Public platform independent Near Field Communication (NFC) library
*
*
* Copyright (C) 2011, Romuald Conty, Romain Tartière
*
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for

View file

@ -1,13 +1,13 @@
/*-
* Public platform independent Near Field Communication (NFC) library
*
*
* Copyright (C) 2011, Romuald Conty
*
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
@ -25,7 +25,7 @@
#include <nfc/nfc.h>
#include "nfc-internal.h"
void
void
prepare_initiator_data (const nfc_modulation nm, uint8_t **ppbtInitiatorData, size_t * pszInitiatorData)
{
switch (nm.nmt) {

View file

@ -1,13 +1,13 @@
/*-
* Public platform independent Near Field Communication (NFC) library
*
*
* Copyright (C) 2011, Romain Tartière, Romuald Conty
*
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
@ -54,7 +54,7 @@
/*
* Buffer management macros.
*
*
* The following macros ease setting-up and using buffers:
* BUFFER_INIT (data, 5); // data -> [ xx, xx, xx, xx, xx ]
* BUFFER_SIZE (data); // size -> 0

View file

@ -1,15 +1,15 @@
/*-
* Public platform independent Near Field Communication (NFC) library
*
*
* Copyright (C) 2009, Roel Verdult, Romuald Conty
* Copyright (C) 2010, Roel Verdult, Romuald Conty, Romain Tartière
* Copyright (C) 2011, Romuald Conty, Romain Tartière
*
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
@ -19,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
/**
/**
* @file nfc.c
* @brief NFC library implementation
*/
@ -30,36 +30,36 @@
* must not call any libnfc functions after deinitialization.
*/
/**
* @defgroup dev NFC Device/Hardware manipulation
* @defgroup dev NFC Device/Hardware manipulation
* The functionality documented below is designed to help with the following
* operations:
* - Enumerating the NFC devices currently attached to the system
* - Opening and closing the chosen device
*/
*/
/**
* @defgroup initiator NFC initiator
* This page details how to act as "reader".
*/
*/
/**
* @defgroup target NFC target
* This page details how to act as tag (i.e. MIFARE Classic) or NFC target device.
*/
*/
/**
* @defgroup error Error reporting
* Most libnfc functions return 0 on success or one of error codes defined on failure.
*/
*/
/**
* @defgroup data Special data accessors
* The functionnality documented below allow to access to special data as device name or device connstring.
*/
*/
/**
* @defgroup properties Properties accessors
* The functionnality documented below allow to configure parameters and registers.
*/
*/
/**
* @defgroup misc Miscellaneous
*
*/
*
*/
/* vim:set ts=2 sw=2 et: */
@ -128,7 +128,7 @@ nfc_exit(nfc_context *context)
/** @ingroup dev
* @brief Get the defaut NFC device
* @param connstring \a nfc_connstring pointer where the default connection string will be stored
* @param connstring \a nfc_connstring pointer where the default connection string will be stored
* @return \e true on success
*
* This function fill \e connstring with the LIBNFC_DEFAULT_DEVICE environment variable content
@ -136,11 +136,11 @@ nfc_exit(nfc_context *context)
* \e connstring with the corresponding \a nfc_connstring value.
*
* This function returns true when LIBNFC_DEFAULT_DEVICE is set or an available device is found.
*
*
* @note The \e connstring content can be invalid if LIBNFC_DEFAULT_DEVICE is
* set with incorrect value.
*/
bool
bool
nfc_get_default_device (nfc_connstring *connstring)
{
char *env_default_connstring = getenv ("LIBNFC_DEFAULT_DEVICE");
@ -166,14 +166,14 @@ nfc_get_default_device (nfc_connstring *connstring)
* @return Returns pointer to a \a nfc_device struct if successfull; otherwise returns \c NULL value.
*
* If \e connstring is \c NULL, the \a nfc_get_default_device() function is used.
*
*
* If \e connstring is set, this function will try to claim the right device using information provided by \e connstring.
*
* When it has successfully claimed a NFC device, memory is allocated to save the device information.
* It will return a pointer to a \a nfc_device struct.
* This pointer should be supplied by every next functions of libnfc that should perform an action with this device.
*
* @note Depending on the desired operation mode, the device needs to be configured by using nfc_initiator_init() or nfc_target_init(),
* @note Depending on the desired operation mode, the device needs to be configured by using nfc_initiator_init() or nfc_target_init(),
* optionally followed by manual tuning of the parameters if the default parameters are not suiting your goals.
*/
nfc_device *
@ -191,12 +191,12 @@ nfc_open (nfc_context *context, const nfc_connstring connstring)
} else {
strncpy (ncs, connstring, sizeof (nfc_connstring));
}
// Search through the device list for an available device
const struct nfc_driver *ndr;
const struct nfc_driver **pndr = nfc_drivers;
while ((ndr = *pndr)) {
// Specific device is requested: using device description
// Specific device is requested: using device description
if (0 != strncmp (ndr->name, ncs, strlen(ndr->name))) {
pndr++;
continue;
@ -209,7 +209,7 @@ nfc_open (nfc_context *context, const nfc_connstring connstring)
log_fini ();
return pnd;
}
log_put (LOG_CATEGORY, NFC_PRIORITY_TRACE, "\"%s\" (%s) has been claimed.", pnd->name, pnd->connstring);
log_fini ();
return pnd;
@ -233,7 +233,7 @@ nfc_close (nfc_device *pnd)
if (pnd) {
// Go in idle mode
nfc_idle (pnd);
// Close, clean up and release the device
// Close, clean up and release the device
pnd->driver->close (pnd);
}
@ -245,7 +245,7 @@ nfc_close (nfc_device *pnd)
* @param context The context to operate on, or NULL for the default context.
* @param connstrings array of \a nfc_connstring.
* @param szDevices size of the \a connstrings array.
*
*
*/
size_t
nfc_list_devices (nfc_context *context, nfc_connstring connstrings[] , size_t szDevices)
@ -282,7 +282,7 @@ nfc_list_devices (nfc_context *context, nfc_connstring connstrings[] , size_t sz
*
* @see nfc_property enum values
*/
int
int
nfc_device_set_property_int (nfc_device *pnd, const nfc_property property, const int value)
{
HAL (device_set_property_int, pnd, property, value);
@ -385,7 +385,7 @@ nfc_initiator_init (nfc_device *pnd)
*
* @param[out] pnt \a nfc_target struct pointer which will filled if available
*
* The NFC device will try to find one available passive tag or emulated tag.
* The NFC device will try to find one available passive tag or emulated tag.
*
* The chip needs to know with what kind of tag it is dealing with, therefore
* the initial modulation and speed (106, 212 or 424 kbps) should be supplied.
@ -519,11 +519,11 @@ nfc_initiator_poll_target (nfc_device *pnd,
* The NFC device will try to find an available D.E.P. target. The standards
* (ISO18092 and ECMA-340) describe the modulation that can be used for reader
* to passive communications.
*
*
* @note \a nfc_dep_info will be returned when the target was acquired successfully.
*/
int
nfc_initiator_select_dep_target (nfc_device *pnd,
nfc_initiator_select_dep_target (nfc_device *pnd,
const nfc_dep_mode ndm, const nfc_baud_rate nbr,
const nfc_dep_info *pndiInitiator, nfc_target *pnt, const int timeout)
{
@ -544,7 +544,7 @@ nfc_initiator_select_dep_target (nfc_device *pnd,
* The NFC device will try to find an available D.E.P. target. The standards
* (ISO18092 and ECMA-340) describe the modulation that can be used for reader
* to passive communications.
*
*
* @note \a nfc_dep_info will be returned when the target was acquired successfully.
*/
int
@ -599,7 +599,7 @@ nfc_initiator_deselect_target (nfc_device *pnd)
* @param[out] pbtRx response from the tags
* @param szRx size of \a pbtRx (Will return NFC_EOVFLOW if RX exceeds this size)
* @param timeout in milliseconds
*
*
* The NFC device (configured as initiator) will transmit the supplied bytes (\a pbtTx) to the target.
* It waits for the response and stores the received bytes in the \a pbtRx byte array.
*
@ -646,7 +646,7 @@ nfc_initiator_transceive_bytes (nfc_device *pnd, const uint8_t *pbtTx, const siz
* explain how it works, if you just are sending two bytes with ISO14443-A
* compliant parity bits you better can use the
* nfc_initiator_transceive_bytes() function.
*
*
* @param[out] pbtRx response from the tag
* @param[out] pbtRxPar parameter contains a byte array of the corresponding parity bits
*
@ -850,7 +850,7 @@ nfc_target_send_bytes (nfc_device *pnd, const uint8_t *pbtTx, const size_t szTx,
/** @ingroup target
* @brief Receive bytes and APDU frames
* @return Returns received bytes count on success, otherwise returns libnfc's error code
*
*
* @param pnd \a nfc_device struct pointer that represent currently used device
* @param pbtRx pointer to Rx buffer
* @param szRx size of Rx buffer
@ -928,12 +928,12 @@ static struct sErrorMessage {
/** @ingroup error
* @brief Return the last error string
* @return Returns a string
*
*
* @param pnd \a nfc_device struct pointer that represent currently used device
*/
const char *
nfc_strerror (const nfc_device *pnd)
{
{
const char *pcRes = "Unknown error";
size_t i;
for (i = 0; i < (sizeof (sErrorMessages) / sizeof (struct sErrorMessage)); i++) {
@ -949,7 +949,7 @@ nfc_strerror (const nfc_device *pnd)
/** @ingroup error
* @brief Renders the last error in pcStrErrBuf for a maximum size of szBufLen chars
* @return Returns 0 upon success
*
*
* @param pnd \a nfc_device struct pointer that represent currently used device
* @param pcStrErrBuf a string that contains the last error.
* @param szBufLen size of buffer
@ -962,9 +962,9 @@ nfc_strerror_r (const nfc_device *pnd, char *pcStrErrBuf, size_t szBufLen)
/** @ingroup error
* @brief Display the last error occured on a nfc_device
*
*
* @param pnd \a nfc_device struct pointer that represent currently used device
* @param pcString a string
* @param pcString a string
*/
void
nfc_perror (const nfc_device *pnd, const char *pcString)
@ -975,7 +975,7 @@ nfc_perror (const nfc_device *pnd, const char *pcString)
/** @ingroup error
* @brief Returns last error occured on a nfc_device
* @return Returns an integer that represents to libnfc's error code.
*
*
* @param pnd \a nfc_device struct pointer that represent currently used device
*/
int
@ -989,7 +989,7 @@ nfc_device_get_last_error (const nfc_device *pnd)
/** @ingroup data
* @brief Returns the device name
* @return Returns a string with the device name
*
*
* @param pnd \a nfc_device struct pointer that represent currently used device
*/
const char *
@ -1001,7 +1001,7 @@ nfc_device_get_name (nfc_device *pnd)
/** @ingroup data
* @brief Returns the device connection string
* @return Returns a string with the device connstring
*
*
* @param pnd \a nfc_device struct pointer that represent currently used device
*/
const char *
@ -1016,9 +1016,9 @@ nfc_device_get_connstring (nfc_device *pnd)
* @param pnd \a nfc_device struct pointer that represent currently used device
* @param mode \a nfc_mode.
* @param supported_mt pointer of \a nfc_modulation_type array.
*
*
*/
int
int
nfc_device_get_supported_modulation (nfc_device *pnd, const nfc_mode mode, const nfc_modulation_type **const supported_mt)
{
HAL (get_supported_modulation, pnd, mode, supported_mt);
@ -1030,9 +1030,9 @@ nfc_device_get_supported_modulation (nfc_device *pnd, const nfc_mode mode, const
* @param pnd \a nfc_device struct pointer that represent currently used device
* @param nmt \a nfc_modulation_type.
* @param supported_br pointer of \a nfc_baud_rate array.
*
*
*/
int
int
nfc_device_get_supported_baud_rate (nfc_device *pnd, const nfc_modulation_type nmt, const nfc_baud_rate **const supported_br)
{
HAL (get_supported_baud_rate, pnd, nmt, supported_br);
@ -1043,7 +1043,7 @@ nfc_device_get_supported_baud_rate (nfc_device *pnd, const nfc_modulation_type n
/** @ingroup misc
* @brief Returns the library version
* @return Returns a string with the library version
*
*
* @param pnd \a nfc_device struct pointer that represent currently used device
*/
const char *
@ -1063,7 +1063,7 @@ nfc_version (void)
* @param buf string to print information
* @param buflen buf length
*/
int
int
nfc_device_get_information_about (nfc_device *pnd, char *buf, size_t buflen)
{
HAL (device_get_information_about, pnd, buf, buflen);