From c1f33130d9d2100e6232f8f3c782949c75205be6 Mon Sep 17 00:00:00 2001 From: Daniel Tomas Date: Thu, 21 Apr 2011 14:11:28 -0700 Subject: Patch to enable low level traces. This patch permit to display the NFC frames exchanged through the I2C line. To enable that, you just need to enable LOW_LEVEL_TRACES macro. Change-Id: Ica2ff2e6d111b76c056161ec557346f23d21ada0 --- Linux_x86/phOsalNfc.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'Linux_x86/phOsalNfc.c') diff --git a/Linux_x86/phOsalNfc.c b/Linux_x86/phOsalNfc.c index 6149fc3..9765e2c 100644 --- a/Linux_x86/phOsalNfc.c +++ b/Linux_x86/phOsalNfc.c @@ -150,3 +150,26 @@ void phOsalNfc_RaiseException(phOsalNfc_ExceptionType_t eExceptionType, uint16_t } } +/*! + * \brief display data bytes. + * This function displays data bytes for debug purpose + * \param[in] pString pointer to string to be displayed. + * \param[in] length number of bytes to be displayed. + * \param[in] pBuffer pointer to data bytes to be displayed. + * + */ +void phOsalNfc_PrintData(const char *pString, uint32_t length, uint8_t *pBuffer) +{ + char print_buffer[512]; // Max length 512 for the download mode + int i; + + if(NULL!=pString && length > 1 && length < 34) + { + print_buffer[0] = '\0'; + for (i = 0; i < length; i++) { + snprintf(&print_buffer[i*5], 6, " 0x%02X", pBuffer[i]); + } + LOGD("> NFC I2C %s: %s", pString,print_buffer); + } +} + -- cgit v1.1