summaryrefslogtreecommitdiff
path: root/AudioManagerUtilities
diff options
context:
space:
mode:
authorJens Lorenz <jlorenz@de.adit-jv.com>2016-12-08 11:05:49 +0100
committerJens Lorenz <jlorenz@de.adit-jv.com>2016-12-08 11:05:49 +0100
commit3cec2f355765ec225ef5f8c228f7d00720582e52 (patch)
treefc69eb263c565a8eec891350766d579965a5baf8 /AudioManagerUtilities
parent30754a4100cf18b6d0b689bafbb23583d165f81b (diff)
downloadaudiomanager-3cec2f355765ec225ef5f8c228f7d00720582e52.tar.gz
AMUtil: Check log level support of DLT added.
Signed-off-by: Jens Lorenz <jlorenz@de.adit-jv.com>
Diffstat (limited to 'AudioManagerUtilities')
-rw-r--r--AudioManagerUtilities/CMakeLists.txt10
-rw-r--r--AudioManagerUtilities/include/CAmDltWrapper.h12
2 files changed, 22 insertions, 0 deletions
diff --git a/AudioManagerUtilities/CMakeLists.txt b/AudioManagerUtilities/CMakeLists.txt
index 6e9a06f..5933e4b 100644
--- a/AudioManagerUtilities/CMakeLists.txt
+++ b/AudioManagerUtilities/CMakeLists.txt
@@ -109,6 +109,16 @@ IF (WITH_DLT)
add_definitions(${DLT_CFLAGS_OTHER})
+ set (DLT_VERSIONING ${DLT_VERSION})
+ string (REPLACE "." ";" DLT_VERSIONING ${DLT_VERSIONING})
+ list (LENGTH DLT_VERSIONING size)
+
+ if (size GREATER "1")
+ list (GET DLT_VERSIONING 0 DLT_MAJOR_VERSION)
+ list (GET DLT_VERSIONING 1 DLT_MINOR_VERSION)
+ add_definitions (-DDLT_MAJOR_VERSION=${DLT_MAJOR_VERSION} -DDLT_MINOR_VERSION=${DLT_MINOR_VERSION})
+ endif (size GREATER "1")
+
set(AUDIO_MANAGER_UTILITIES_LIBS
${AUDIO_MANAGER_UTILITIES_LIBS}
${DLT_LIBRARIES}
diff --git a/AudioManagerUtilities/include/CAmDltWrapper.h b/AudioManagerUtilities/include/CAmDltWrapper.h
index 8c2b514..a37ec77 100644
--- a/AudioManagerUtilities/include/CAmDltWrapper.h
+++ b/AudioManagerUtilities/include/CAmDltWrapper.h
@@ -158,6 +158,18 @@ public:
bool init(DltLogLevelType loglevel, DltContext* context = NULL);
+ bool checkLogLevel(DltLogLevelType logLevel)
+ {
+#ifdef WITH_DLT
+ #if (DLT_MAJOR_VERSION >= 2 && DLT_MINOR_VERSION >= 16)
+ return (1 == dlt_user_is_logLevel_enabled(&mDltContext,logLevel)? true: false);
+ #else
+ return false;
+ #endif
+#else
+ return (logLevel <= mDltContext.log_level_user);
+#endif
+ }
void deinit();
void send();
void append(const int8_t value);