From 87936e5249b2c22eefac0acfc21696e209ee6d35 Mon Sep 17 00:00:00 2001 From: Alexander Wenzel Date: Mon, 28 Jul 2014 13:33:23 +0200 Subject: New Callback function in DLT library, called when log level of context is changed Signed-off-by: Alexander Wenzel --- src/examples/dlt-example-user.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/examples') diff --git a/src/examples/dlt-example-user.c b/src/examples/dlt-example-user.c index 25d3110..a01ea44 100755 --- a/src/examples/dlt-example-user.c +++ b/src/examples/dlt-example-user.c @@ -74,6 +74,7 @@ #include "dlt_common.h" /* for dlt_get_version() */ int dlt_user_injection_callback(uint32_t service_id, void *data, uint32_t length); +void dlt_user_log_level_changed_callback(char context_id[DLT_ID_SIZE],uint8_t log_level,uint8_t trace_status); DLT_DECLARE_CONTEXT(mycontext); @@ -244,6 +245,7 @@ int main(int argc, char* argv[]) DLT_REGISTER_CONTEXT(mycontext,"TEST","Test Context for Logging"); DLT_REGISTER_INJECTION_CALLBACK(mycontext, 0x1000, dlt_user_injection_callback); + DLT_REGISTER_LOG_LEVEL_CHANGED_CALLBACK(mycontext, dlt_user_log_level_changed_callback); text = message; @@ -376,3 +378,13 @@ int dlt_user_injection_callback(uint32_t service_id, void *data, uint32_t length return 0; } +void dlt_user_log_level_changed_callback(char context_id[DLT_ID_SIZE],uint8_t log_level,uint8_t trace_status) +{ + char text[5]; + text[4]=0; + + memcpy(text,context_id,DLT_ID_SIZE); + + printf("Log level changed of context %s, LogLevel=%u, TraceState=%u \n",text,log_level,trace_status); +} + -- cgit v1.2.1