From c021a50768e3c0a491e2314341ca6d0170bd2566 Mon Sep 17 00:00:00 2001 From: Romuald Conty Date: Tue, 17 Aug 2010 13:50:49 +0000 Subject: [PATCH] Oups, r534 was not a joke... just a mistake ;-) This commit fix my r534. --- libnfc/drivers/arygon.c | 6 +++--- libnfc/drivers/pn532_uart.c | 8 ++++---- libnfc/nfc.c | 3 ++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/libnfc/drivers/arygon.c b/libnfc/drivers/arygon.c index eeb1bf5..056bb04 100644 --- a/libnfc/drivers/arygon.c +++ b/libnfc/drivers/arygon.c @@ -109,11 +109,11 @@ arygon_list_devices(nfc_device_desc_t pnddDevices[], size_t szDevices, size_t *p *pszDeviceFound = 0; serial_port sp; - const char** pcPorts = UNIX_SERIAL_PORT_DEVS; + const char* pcPorts[] = DEFAULT_SERIAL_PORTS; const char* pcPort; int iDevice = 0; - while( pcPort = pcPorts[i++] ) { + while( pcPort = pcPorts[iDevice++] ) { sp = uart_open(pcPort); DBG("Trying to find ARYGON device on serial port: %s at %d bauds.", pcPort, SERIAL_DEFAULT_PORT_SPEED); @@ -124,7 +124,7 @@ arygon_list_devices(nfc_device_desc_t pnddDevices[], size_t szDevices, size_t *p uart_close(sp); // ARYGON reader is found - snprintf(pnddDevices[*pszDeviceFound].acDevice, DEVICE_NAME_LENGTH - 1, "%s (%s)", "ARYGON", acPort); + snprintf(pnddDevices[*pszDeviceFound].acDevice, DEVICE_NAME_LENGTH - 1, "%s (%s)", "ARYGON", pcPort); pnddDevices[*pszDeviceFound].acDevice[DEVICE_NAME_LENGTH - 1] = '\0'; pnddDevices[*pszDeviceFound].pcDriver = ARYGON_DRIVER_NAME; pnddDevices[*pszDeviceFound].pcPort = strdup(pcPort); diff --git a/libnfc/drivers/pn532_uart.c b/libnfc/drivers/pn532_uart.c index a0c3833..ba00791 100644 --- a/libnfc/drivers/pn532_uart.c +++ b/libnfc/drivers/pn532_uart.c @@ -83,11 +83,11 @@ pn532_uart_list_devices(nfc_device_desc_t pnddDevices[], size_t szDevices, size_ *pszDeviceFound = 0; serial_port sp; - const char** pcPorts = UNIX_SERIAL_PORT_DEVS; + const char* pcPorts[] = DEFAULT_SERIAL_PORTS; const char* pcPort; int iDevice = 0; - while( pcPort = pcPorts[i++] ) { + while( pcPort = pcPorts[iDevice++] ) { sp = uart_open(pcPort); DBG("Trying to find PN532 device on serial port: %s at %d bauds.", pcPort, SERIAL_DEFAULT_PORT_SPEED); @@ -113,8 +113,8 @@ pn532_uart_list_devices(nfc_device_desc_t pnddDevices[], size_t szDevices, size_ if((*pszDeviceFound) >= szDevices) break; } #ifdef DEBUG - if (sp == INVALID_SERIAL_PORT) DBG("Invalid serial port: %s",acPort); - if (sp == CLAIMED_SERIAL_PORT) DBG("Serial port already claimed: %s",acPort); + if (sp == INVALID_SERIAL_PORT) DBG("Invalid serial port: %s", pcPort); + if (sp == CLAIMED_SERIAL_PORT) DBG("Serial port already claimed: %s", pcPort); #endif /* DEBUG */ } #endif /* SERIAL_AUTOPROBE_ENABLED */ diff --git a/libnfc/nfc.c b/libnfc/nfc.c index e06f24c..e64df26 100644 --- a/libnfc/nfc.c +++ b/libnfc/nfc.c @@ -520,7 +520,8 @@ nfc_initiator_select_passive_target(const nfc_device_t* pnd, return true; } -bool nfc_initiator_list_passive_targets(nfc_device_t* pnd, const nfc_modulation_t nmInitModulation, nfc_target_info_t anti[], const size_t szTargets, size_t *pszTargetFound ) +bool +nfc_initiator_list_passive_targets(nfc_device_t* pnd, const nfc_modulation_t nmInitModulation, nfc_target_info_t anti[], const size_t szTargets, size_t *pszTargetFound) { nfc_target_info_t nti; size_t szTargetFound = 0;