0
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef _USBPNTRACE_H_
|
|
20 |
#define _USBPNTRACE_H_
|
|
21 |
|
|
22 |
#define ASSERT_RESET ASSERT_RESET_ALWAYS
|
|
23 |
|
|
24 |
|
|
25 |
// INCLUDES
|
|
26 |
// CONSTANTS
|
|
27 |
|
|
28 |
// MACROS
|
|
29 |
// INCLUDES
|
|
30 |
#include <e32svr.h> // RDebug
|
|
31 |
|
|
32 |
#define _T(a) _L(a)
|
|
33 |
|
|
34 |
// Trace asserts are made both in UDEB and UREL.
|
|
35 |
#define __TRACE_PRINTF(a) RDebug::Print a
|
|
36 |
|
|
37 |
#ifdef _DEBUG
|
|
38 |
|
|
39 |
_LIT(KUsbPnLinkName, "USB Phonet Link");
|
|
40 |
|
|
41 |
void BuildTraceFunc( const TDesC* aPrefix );
|
|
42 |
void DataDumpTraceFunc( const TDesC& aPrefix, const TDesC8& aData );
|
|
43 |
|
|
44 |
#define BUILD_TRACE( a ) BuildTraceFunc( a )
|
|
45 |
#define DATA_DUMP_TRACE( a, b ) DataDumpTraceFunc( a, b )
|
|
46 |
|
|
47 |
// define assertions
|
|
48 |
#ifdef __WINS__
|
|
49 |
#define TRACE_ASSERT(a) if (!(a)) __TRACE_PRINTF((_L("Assertion failed: file= __FILE__ , line=%d, compiled=__DATE__ __TIME__ "),__LINE__))
|
|
50 |
#define TRACE_ASSERT_RETURN(a) __TRACE_PRINTF((_L("Assertion failed: file= __FILE__ , line=%d, compiled=__DATE__ __TIME__ "),__LINE__))
|
|
51 |
#else
|
|
52 |
#define TRACE_ASSERT(a) if (!(a)) __TRACE_PRINTF((_L("Assertion failed: file=" __FILE__ ", line=%d, compiled="__DATE__ __TIME__""),__LINE__ ))
|
|
53 |
#define TRACE_ASSERT_RETURN(a) __TRACE_PRINTF((_L("Assertion failed: file=" __FILE__ ", line=%d, compiled="__DATE__ __TIME__""),__LINE__ ))
|
|
54 |
#endif //__WINS__
|
|
55 |
|
|
56 |
#if defined COMPONENT_TRACE_FLAG
|
|
57 |
#define C_TRACE(a) __TRACE_PRINTF(a)
|
|
58 |
#else
|
|
59 |
#define C_TRACE(a)
|
|
60 |
#endif // COMPONENT_TRACE_FLAG
|
|
61 |
|
|
62 |
#if defined API_TRACE_FLAG
|
|
63 |
#define A_TRACE(a) __TRACE_PRINTF(a)
|
|
64 |
#else
|
|
65 |
#define A_TRACE(a)
|
|
66 |
#endif // API_TRACE_FLAG
|
|
67 |
|
|
68 |
#if defined EXTENDED_TRACE_FLAG
|
|
69 |
#define E_TRACE(a) __TRACE_PRINTF(a)
|
|
70 |
#else
|
|
71 |
#define E_TRACE(a)
|
|
72 |
#endif // EXTENDED_TRACE_FLAG
|
|
73 |
|
|
74 |
#else
|
|
75 |
#define TRACE_ASSERT(a)
|
|
76 |
#define TRACE_ASSERT_RETURN(a) a
|
|
77 |
#define C_TRACE(a)
|
|
78 |
#define A_TRACE(a)
|
|
79 |
#define E_TRACE(a)
|
|
80 |
#define BUILD_TRACE(a)
|
|
81 |
#define DATA_DUMP_TRACE(a, b)
|
|
82 |
#endif // _DEBUG
|
|
83 |
|
|
84 |
// Resets and trace asserts are made both in UDEB and UREL (traces only in udeb)
|
|
85 |
#ifdef __WINS__
|
|
86 |
#define ASSERT_RESET_ALWAYS(a,b,c) error // ASSERT_RESET_ALWAYS for (!TRACE_MODE_KERNEL_&& __WINS__) not implemented
|
|
87 |
#define TRACE_ASSERT_ALWAYS __TRACE_PRINTF( (_L("Assertion failed: file= __FILE__ , line=%d, compiled=__DATE__ __TIME__ "),__LINE__) )
|
|
88 |
#else
|
|
89 |
#define ASSERT_RESET_ALWAYS(a,b,c) if(!(a)) { __TRACE_PRINTF( (_L("Assertion failed: file= __FILE__ , line=%d, compiled=__DATE__ __TIME__ "),__LINE__) ); User::Panic(b,c); }
|
|
90 |
#define TRACE_ASSERT_ALWAYS __TRACE_PRINTF( (_L("Assertion failed: file=%s, line=%d, compiled=%s %s "),__FILE__, __LINE__, __DATE__, __TIME__) )
|
|
91 |
#endif
|
|
92 |
|
|
93 |
// DATA TYPES
|
|
94 |
|
|
95 |
// FUNCTION PROTOTYPES
|
|
96 |
|
|
97 |
// FORWARD DECLARATIONS
|
|
98 |
|
|
99 |
#endif //#ifndef _USBPNTRACE_H_
|
|
100 |
// End of File
|