1 //******************************************************************
3 // Copyright 2017 Samsung Mobile Communications GmbH All Rights Reserved.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://www.apache.org/licenses/LICENSE-2.0
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
26 #elif defined(__TIZEN__)
27 #ifdef OIC_SUPPORT_TIZEN_TRACE
30 #elif defined(ARDUINO)
40 void oic_trace_begin(const char *name, ...);
42 void oic_trace_buffer(const char *name, const uint8_t * buffer, size_t bufferSize);
44 #define OIC_TRACE_BEGIN(MSG, ...)
45 #define OIC_TRACE_END()
46 #define OIC_TRACE_MARK(MSG, ...)
47 #define OIC_TRACE_BUFFER(MSG, BUF, SIZ)
49 #elif defined(__TIZEN__)
50 /* trace macro for Tizen. this will call ttrace api internally*/
51 #ifdef OIC_SUPPORT_TIZEN_TRACE
55 void oic_trace_buffer(const char *name, const uint8_t * buffer, size_t bufferSize);
57 /* ttrace api is available on tizen2.4 (or above) only */
58 #define OIC_TRACE_BEGIN(MSG, ...) \
59 traceBegin(TTRACE_TAG_APP, "OIC:"#MSG, ##__VA_ARGS__)
60 #define OIC_TRACE_END() \
61 traceEnd(TTRACE_TAG_APP)
62 #define OIC_TRACE_MARK(MSG, ...) \
63 traceBegin(TTRACE_TAG_APP, "OIC:"#MSG, ##__VA_ARGS__), \
64 traceEnd(TTRACE_TAG_APP)
65 #define OIC_TRACE_BUFFER(MSG, BUF, SIZ) \
66 oic_trace_buffer(MSG, BUF, SIZ)
68 #define OIC_TRACE_BEGIN(MSG, ...)
69 #define OIC_TRACE_END()
70 #define OIC_TRACE_MARK(MSG, ...)
71 #define OIC_TRACE_BUFFER(MSG, BUF, SIZ)
74 #elif defined(ARDUINO)
75 /* trace macro for Arduino. currently this will call nothing*/
76 #define OIC_TRACE_BEGIN(MSG, ...)
77 #define OIC_TRACE_END()
78 #define OIC_TRACE_MARK(MSG, ...)
79 #define OIC_TRACE_BUFFER(MSG, BUF, SIZ)
82 #define OIC_TRACE_BEGIN(MSG, ...)
83 #define OIC_TRACE_END()
84 #define OIC_TRACE_MARK(MSG, ...)
85 #define OIC_TRACE_BUFFER(MSG, BUF, SIZ)