rename nfc_disconnect() function to nfc_close().
This commit is contained in:
parent
9d3ca39a44
commit
9eb37b3eee
35 changed files with 80 additions and 80 deletions
|
|
@ -301,7 +301,7 @@ error:
|
|||
}
|
||||
|
||||
void
|
||||
acr122_disconnect (nfc_device *pnd)
|
||||
acr122_close (nfc_device *pnd)
|
||||
{
|
||||
SCardDisconnect (DRIVER_DATA (pnd)->hCard, SCARD_LEAVE_CARD);
|
||||
acr122_free_scardcontext ();
|
||||
|
|
@ -467,7 +467,7 @@ const struct nfc_driver acr122_driver = {
|
|||
.name = ACR122_DRIVER_NAME,
|
||||
.probe = acr122_probe,
|
||||
.connect = acr122_connect,
|
||||
.disconnect = acr122_disconnect,
|
||||
.close = acr122_close,
|
||||
.strerror = pn53x_strerror,
|
||||
|
||||
.initiator_init = pn53x_initiator_init,
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ bool acr122_probe (nfc_connstring connstrings[], size_t connstrings_len, size
|
|||
nfc_device *acr122_connect (const nfc_connstring connstring);
|
||||
int acr122_send (nfc_device *pnd, const uint8_t *pbtData, const size_t szData, int timeout);
|
||||
int acr122_receive (nfc_device *pnd, uint8_t *pbtData, const size_t szData, int timeout);
|
||||
void acr122_disconnect (nfc_device *pnd);
|
||||
void acr122_close (nfc_device *pnd);
|
||||
|
||||
extern const struct nfc_driver acr122_driver;
|
||||
|
||||
|
|
|
|||
|
|
@ -270,7 +270,7 @@ arygon_connect (const nfc_connstring connstring)
|
|||
|
||||
// Check communication using "Reset TAMA" command
|
||||
if (arygon_reset_tama(pnd) < 0) {
|
||||
arygon_disconnect (pnd);
|
||||
arygon_close (pnd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -286,7 +286,7 @@ arygon_connect (const nfc_connstring connstring)
|
|||
}
|
||||
|
||||
void
|
||||
arygon_disconnect (nfc_device *pnd)
|
||||
arygon_close (nfc_device *pnd)
|
||||
{
|
||||
// Release UART port
|
||||
uart_close (DRIVER_DATA (pnd)->port);
|
||||
|
|
@ -561,7 +561,7 @@ const struct nfc_driver arygon_driver = {
|
|||
.name = ARYGON_DRIVER_NAME,
|
||||
.probe = arygon_probe,
|
||||
.connect = arygon_connect,
|
||||
.disconnect = arygon_disconnect,
|
||||
.close = arygon_close,
|
||||
.strerror = pn53x_strerror,
|
||||
|
||||
.initiator_init = pn53x_initiator_init,
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
bool arygon_probe (nfc_connstring connstrings[], size_t connstrings_len, size_t *pszDeviceFound);
|
||||
|
||||
nfc_device *arygon_connect (const nfc_connstring connstring);
|
||||
void arygon_disconnect (nfc_device *pnd);
|
||||
void arygon_close (nfc_device *pnd);
|
||||
|
||||
int arygon_tama_send (nfc_device *pnd, const uint8_t *pbtData, const size_t szData, int timeout);
|
||||
int arygon_tama_receive (nfc_device *pnd, uint8_t *pbtData, const size_t szDat, int timeouta);
|
||||
|
|
|
|||
|
|
@ -250,7 +250,7 @@ pn532_uart_connect (const nfc_connstring connstring)
|
|||
// Check communication using "Diagnose" command, with "Communication test" (0x00)
|
||||
if (pn53x_check_communication (pnd) < 0) {
|
||||
nfc_perror (pnd, "pn53x_check_communication");
|
||||
pn532_uart_disconnect (pnd);
|
||||
pn532_uart_close (pnd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -259,7 +259,7 @@ pn532_uart_connect (const nfc_connstring connstring)
|
|||
}
|
||||
|
||||
void
|
||||
pn532_uart_disconnect (nfc_device *pnd)
|
||||
pn532_uart_close (nfc_device *pnd)
|
||||
{
|
||||
// Release UART port
|
||||
uart_close (DRIVER_DATA(pnd)->port);
|
||||
|
|
@ -504,7 +504,7 @@ const struct nfc_driver pn532_uart_driver = {
|
|||
.name = PN532_UART_DRIVER_NAME,
|
||||
.probe = pn532_uart_probe,
|
||||
.connect = pn532_uart_connect,
|
||||
.disconnect = pn532_uart_disconnect,
|
||||
.close = pn532_uart_close,
|
||||
.strerror = pn53x_strerror,
|
||||
|
||||
.initiator_init = pn53x_initiator_init,
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
bool pn532_uart_probe (nfc_connstring connstrings[], size_t connstrings_len, size_t *pszDeviceFound);
|
||||
|
||||
nfc_device *pn532_uart_connect (const nfc_connstring connstring);
|
||||
void pn532_uart_disconnect (nfc_device *pnd);
|
||||
void pn532_uart_close (nfc_device *pnd);
|
||||
int pn532_uart_send (nfc_device *pnd, const uint8_t *pbtData, const size_t szData, int timeout);
|
||||
int pn532_uart_receive (nfc_device *pnd, uint8_t *pbtData, const size_t szData, int timeout);
|
||||
|
||||
|
|
|
|||
|
|
@ -479,7 +479,7 @@ error:
|
|||
}
|
||||
|
||||
void
|
||||
pn53x_usb_disconnect (nfc_device *pnd)
|
||||
pn53x_usb_close (nfc_device *pnd)
|
||||
{
|
||||
pn53x_usb_ack (pnd);
|
||||
|
||||
|
|
@ -794,7 +794,7 @@ const struct nfc_driver pn53x_usb_driver = {
|
|||
.name = PN53X_USB_DRIVER_NAME,
|
||||
.probe = pn53x_usb_probe,
|
||||
.connect = pn53x_usb_connect,
|
||||
.disconnect = pn53x_usb_disconnect,
|
||||
.close = pn53x_usb_close,
|
||||
.strerror = pn53x_strerror,
|
||||
|
||||
.initiator_init = pn53x_initiator_init,
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ bool pn53x_usb_probe (nfc_connstring connstrings[], size_t connstrings_len, s
|
|||
nfc_device *pn53x_usb_connect (const nfc_connstring connstring);
|
||||
int pn53x_usb_send (nfc_device *pnd, const uint8_t *pbtData, const size_t szData, int timeout);
|
||||
int pn53x_usb_receive (nfc_device *pnd, uint8_t *pbtData, const size_t szData, int timeout);
|
||||
void pn53x_usb_disconnect (nfc_device *pnd);
|
||||
void pn53x_usb_close (nfc_device *pnd);
|
||||
|
||||
extern const struct nfc_driver pn53x_usb_driver;
|
||||
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ struct nfc_driver {
|
|||
const char *name;
|
||||
bool (*probe)(nfc_connstring connstrings[], size_t connstrings_len, size_t * pszDeviceFound);
|
||||
struct nfc_device *(*connect) (const nfc_connstring connstring);
|
||||
void (*disconnect) (struct nfc_device *pnd);
|
||||
void (*close) (struct nfc_device *pnd);
|
||||
const char *(*strerror) (const struct nfc_device *pnd);
|
||||
|
||||
int (*initiator_init) (struct nfc_device *pnd);
|
||||
|
|
|
|||
|
|
@ -156,19 +156,19 @@ nfc_connect (const nfc_connstring connstring)
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief Disconnect from a NFC device
|
||||
* @brief Close from a NFC device
|
||||
* @param pnd \a nfc_device struct pointer that represent currently used device
|
||||
*
|
||||
* Initiator's selected tag is disconnected and the device, including allocated \a nfc_device struct, is released.
|
||||
* Initiator's selected tag is closed and the device, including allocated \a nfc_device struct, is released.
|
||||
*/
|
||||
void
|
||||
nfc_disconnect (nfc_device *pnd)
|
||||
nfc_close (nfc_device *pnd)
|
||||
{
|
||||
if (pnd) {
|
||||
// Go in idle mode
|
||||
nfc_idle (pnd);
|
||||
// Disconnect, clean up and release the device
|
||||
pnd->driver->disconnect (pnd);
|
||||
pnd->driver->close (pnd);
|
||||
|
||||
log_fini ();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue