eapol/eapol_framework/eapol_symbian/am/common/symbian/eap_am_trace_symbian.cpp
branchRCL_3
changeset 46 c74b3d9f6b9e
parent 45 bad0cc58d154
--- a/eapol/eapol_framework/eapol_symbian/am/common/symbian/eap_am_trace_symbian.cpp	Tue Aug 31 15:16:37 2010 +0300
+++ b/eapol/eapol_framework/eapol_symbian/am/common/symbian/eap_am_trace_symbian.cpp	Wed Sep 01 12:23:57 2010 +0100
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2001-2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2001-2005 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of the License "Eclipse Public License v1.0"
@@ -11,30 +11,29 @@
 *
 * Contributors:
 *
-* Description:  Trace functions on Symbian.
+* Description:  EAP and WLAN authentication protocols.
 *
 */
 
 /*
-* %version: 16 %
+* %version: 7.1.3 %
 */
 
-#include "EapTraceSymbian.h"
-#include "eap_tools.h"
+#if defined(_DEBUG) || defined(DEBUG)
+
+#include "eap_am_trace_symbian.h"
 
-const TInt KMaxBufferSize = 512;
+const TInt KMaxBufferSize = 256;
 
-//-------------------------------------------------------------------------
-
-TUint8 octet_to_ascii(i32_t octet)
+u8_t octet_to_ascii(i32_t octet)
 {
 	if (0 <= octet && octet <= 9)
 	{
-		return static_cast<TUint8>('0' + octet);
+		return static_cast<u8_t>('0' + octet);
 	}
 	else if (10 <= octet && octet <= 16)
 	{
-		return static_cast<TUint8>('a' + (octet-10u));
+		return static_cast<u8_t>('a' + (octet-10u));
 	}
 	else
 	{
@@ -42,9 +41,7 @@
 	}
 }
 
-//-------------------------------------------------------------------------
-
-void formatted_print(const char * const format, ...)
+void formatted_print(eap_format_string format, ...)
 {
 	EAP_UNREFERENCED_PARAMETER(format);
 
@@ -79,7 +76,7 @@
 	TPtr8 m_trace_buf = trace_buf->Des();
 	TPtr16 m_trace_buf_16 = trace_buf_16->Des();
 
-	VA_LIST args = {0, };
+	VA_LIST args;
 	VA_START(args, format);
 	m_format_buf.Copy((const TUint8 *)format);
 	
@@ -114,7 +111,7 @@
 		#if defined(USE_EAP_HARDWARE_TRACE_RAW_PRINT)
 			RDebug::RawPrint(m_trace_buf_16);
 		#else
-			RDebug::Print(_L("%S"), &m_trace_buf_16);
+			formatted_print(_L("%S"), &m_trace_buf_16);
 		#endif //#if defined(USE_EAP_HARDWARE_TRACE_RAW_PRINT)
 	}
 
@@ -129,19 +126,18 @@
 
 }
 
-//-------------------------------------------------------------------------
 
-EXPORT_C void eap_trace_data_symbian(
-	const char * const prefix,
+void trace_data(
+	eap_const_string prefix,
 	const void * const p_data,
-	const TUint data_length)
+	const u32_t data_length)
 {
 
-	TUint8* m_tmp_buffer = NULL;	
-	TUint8* m_tmp_ascii_buffer = NULL;
+	u8_t* m_tmp_buffer = NULL;	
+	u8_t* m_tmp_ascii_buffer = NULL;
 		
-	m_tmp_buffer = new TUint8[KMaxBufferSize];	
-	m_tmp_ascii_buffer = new TUint8[KMaxBufferSize];
+	m_tmp_buffer = new u8_t[KMaxBufferSize];	
+	m_tmp_ascii_buffer = new u8_t[KMaxBufferSize];
 		
 	if( m_tmp_buffer == NULL || m_tmp_ascii_buffer == NULL)
 	{
@@ -154,16 +150,16 @@
 		return;
 	}
 
-	TUint8 *cursor = m_tmp_buffer;
-	TUint8 *cursor_ascii = m_tmp_ascii_buffer;
+	u8_t *cursor = m_tmp_buffer;
+	u8_t *cursor_ascii = m_tmp_ascii_buffer;
 	
-	const TUint8 *data = reinterpret_cast<const TUint8 *>(p_data);
-	TUint ind;
+	const u8_t *data = reinterpret_cast<const u8_t *>(p_data);
+	u32_t ind;
 	bool must_print = false;
-	TUint data_start = 0u;
+	u32_t data_start = 0u;
 
-	const TUint EAP_DATA_TRACE_BYTE_GROUP_SIZE = 1;
-	TUint byte_group_size = EAP_DATA_TRACE_BYTE_GROUP_SIZE;
+	const u32_t EAP_DATA_TRACE_BYTE_GROUP_SIZE = 1;
+	u32_t byte_group_size = EAP_DATA_TRACE_BYTE_GROUP_SIZE;
 
 #if !defined(USE_EAP_DEBUG_TRACE)
 	// This does not trace the pointer of the data.
@@ -250,24 +246,8 @@
 	
 	delete [] m_tmp_buffer;
 	delete [] m_tmp_ascii_buffer;
+}
 
-#if !defined(USE_EAP_DEBUG_TRACE)
-	// This does not trace the pointer of the data.
-	formatted_print(
-		"%s: data ends: %d (0x%x) bytes\n",
-		prefix,
-		data_length,
-		data_length);
-#else
-	formatted_print(
-		"%s: data ends 0x%08x: %d (0x%x) bytes\n",
-		prefix,
-		p_data,
-		data_length,
-		data_length);
 #endif
 
-}
-
-//-------------------------------------------------------------------------
 // End of file