From 971d799e39c54561e1fe607b15d0c497a6baa34e Mon Sep 17 00:00:00 2001 From: Romuald Conty Date: Wed, 20 Apr 2011 14:06:12 +0000 Subject: [PATCH] Arygon driver: append Arygon firmware version to device name. --- libnfc/drivers/arygon.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libnfc/drivers/arygon.c b/libnfc/drivers/arygon.c index 21aa41d..377e45d 100644 --- a/libnfc/drivers/arygon.c +++ b/libnfc/drivers/arygon.c @@ -184,6 +184,13 @@ arygon_connect (const nfc_device_desc_t * pndd) return NULL; } + char arygon_firmware_version[10]; + arygon_firmware (pnd, arygon_firmware_version); + char *pcName; + pcName = strdup (pnd->acName); + snprintf (pnd->acName, sizeof (pnd->acName), "%s %s", pcName, arygon_firmware_version); + free (pcName); + pn53x_init(pnd); return pnd; } @@ -234,6 +241,9 @@ arygon_tama_send (nfc_device_t * pnd, const byte_t * pbtData, const size_t szDat CHIP_DATA (pnd)->state = EXECUTE; } else if (0 == memcmp(arygon_error_unknown_mode, abtRxBuf, sizeof(abtRxBuf))) { ERR( "Bad frame format." ); + // We have already read 6 bytes and arygon_error_unknown_mode is 10 bytes long + // so we have to read 4 remaining bytes to be synchronized at the next receiving pass. + uart_receive (DRIVER_DATA (pnd)->port, abtRxBuf, 4, 0); return false; } else { return false;