mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-05-26 15:16:15 +00:00
driver Arygon: don't try to send commands if reset failed
This commit is contained in:
@@ -206,10 +206,8 @@ struct arygon_descriptor {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
arygon_close(nfc_device *pnd)
|
arygon_close_step2(nfc_device *pnd)
|
||||||
{
|
{
|
||||||
pn53x_idle(pnd);
|
|
||||||
|
|
||||||
// Release UART port
|
// Release UART port
|
||||||
uart_close(DRIVER_DATA(pnd)->port);
|
uart_close(DRIVER_DATA(pnd)->port);
|
||||||
|
|
||||||
@@ -223,6 +221,13 @@ arygon_close(nfc_device *pnd)
|
|||||||
nfc_device_free(pnd);
|
nfc_device_free(pnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
arygon_close(nfc_device *pnd)
|
||||||
|
{
|
||||||
|
pn53x_idle(pnd);
|
||||||
|
arygon_close_step2(pnd);
|
||||||
|
}
|
||||||
|
|
||||||
static nfc_device *
|
static nfc_device *
|
||||||
arygon_open(const nfc_context *context, const nfc_connstring connstring)
|
arygon_open(const nfc_context *context, const nfc_connstring connstring)
|
||||||
{
|
{
|
||||||
@@ -313,7 +318,7 @@ arygon_open(const nfc_context *context, const nfc_connstring connstring)
|
|||||||
|
|
||||||
// Check communication using "Reset TAMA" command
|
// Check communication using "Reset TAMA" command
|
||||||
if (arygon_reset_tama(pnd) < 0) {
|
if (arygon_reset_tama(pnd) < 0) {
|
||||||
arygon_close(pnd);
|
arygon_close_step2(pnd);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user