automotive-dlt
DLT User API

Data Structures

struct  DltContext
 
struct  DltContextData
 
struct  DltUserInjectionCallback
 
struct  DltUserLogLevelChangedCallback
 
struct  dlt_ll_ts_type
 
struct  dlt_env_ll_item
 holds initial log-level for given appId:ctxId pair More...
 
struct  dlt_env_ll_set
 holds all initial log-levels given via environment variable DLT_INITIAL_LOG_LEVEL More...
 
struct  DltUser
 

Macros

#define DLT_USER_BUF_MAX_SIZE   1390
 
#define DLT_USER_RESENDBUF_MAX_SIZE   (DLT_USER_BUF_MAX_SIZE + 100)
 
#define DLT_SEM_LOCK()   { sem_wait(&dlt_mutex); }
 
#define DLT_SEM_FREE()   { sem_post(&dlt_mutex); }
 
#define DLT_DECLARE_CONTEXT(CONTEXT)   DltContext CONTEXT;
 
#define DLT_IMPORT_CONTEXT(CONTEXT)   extern DltContext CONTEXT;
 
#define DLT_REGISTER_APP(APPID, DESCRIPTION)
 
#define DLT_UNREGISTER_APP()
 
#define DLT_REGISTER_CONTEXT(CONTEXT, CONTEXTID, DESCRIPTION)
 
#define DLT_REGISTER_CONTEXT_LL_TS(CONTEXT, CONTEXTID, DESCRIPTION, LOGLEVEL, TRACESTATUS)
 
#define DLT_UNREGISTER_CONTEXT(CONTEXT)
 
#define DLT_REGISTER_INJECTION_CALLBACK(CONTEXT, SERVICEID, CALLBACK)
 
#define DLT_REGISTER_LOG_LEVEL_CHANGED_CALLBACK(CONTEXT, CALLBACK)
 
#define DLT_LOG(CONTEXT, LOGLEVEL, ARGS...)
 
#define DLT_LOG_ID(CONTEXT, LOGLEVEL, MSGID, ARGS...)
 
#define DLT_STRING(TEXT)   (void)dlt_user_log_write_string(&log_local,TEXT)
 
#define DLT_CSTRING(TEXT)   (void)dlt_user_log_write_constant_string(&log_local,TEXT)
 
#define DLT_UTF8(TEXT)   (void)dlt_user_log_write_utf8_string(&log_local,TEXT)
 
#define DLT_BOOL(BOOL_VAR)   (void)dlt_user_log_write_bool(&log_local,BOOL_VAR)
 
#define DLT_FLOAT32(FLOAT32_VAR)   (void)dlt_user_log_write_float32(&log_local,FLOAT32_VAR)
 
#define DLT_FLOAT64(FLOAT64_VAR)   (void)dlt_user_log_write_float64(&log_local,FLOAT64_VAR)
 
#define DLT_INT(INT_VAR)   (void)dlt_user_log_write_int(&log_local,INT_VAR)
 
#define DLT_INT8(INT_VAR)   (void)dlt_user_log_write_int8(&log_local,INT_VAR)
 
#define DLT_INT16(INT_VAR)   (void)dlt_user_log_write_int16(&log_local,INT_VAR)
 
#define DLT_INT32(INT_VAR)   (void)dlt_user_log_write_int32(&log_local,INT_VAR)
 
#define DLT_INT64(INT_VAR)   (void)dlt_user_log_write_int64(&log_local,INT_VAR)
 
#define DLT_UINT(UINT_VAR)   (void)dlt_user_log_write_uint(&log_local,UINT_VAR)
 
#define DLT_UINT8(UINT_VAR)   (void)dlt_user_log_write_uint8(&log_local,UINT_VAR)
 
#define DLT_UINT16(UINT_VAR)   (void)dlt_user_log_write_uint16(&log_local,UINT_VAR)
 
#define DLT_UINT32(UINT_VAR)   (void)dlt_user_log_write_uint32(&log_local,UINT_VAR)
 
#define DLT_UINT64(UINT_VAR)   (void)dlt_user_log_write_uint64(&log_local,UINT_VAR)
 
#define DLT_RAW(BUF, LEN)   (void)dlt_user_log_write_raw(&log_local,BUF,LEN)
 
#define DLT_HEX8(UINT_VAR)   (void)dlt_user_log_write_uint8_formatted(&log_local,UINT_VAR,DLT_FORMAT_HEX8)
 
#define DLT_HEX16(UINT_VAR)   (void)dlt_user_log_write_uint16_formatted(&log_local,UINT_VAR,DLT_FORMAT_HEX16)
 
#define DLT_HEX32(UINT_VAR)   (void)dlt_user_log_write_uint32_formatted(&log_local,UINT_VAR,DLT_FORMAT_HEX32)
 
#define DLT_HEX64(UINT_VAR)   (void)dlt_user_log_write_uint64_formatted(&log_local,UINT_VAR,DLT_FORMAT_HEX64)
 
#define DLT_BIN8(UINT_VAR)   (void)dlt_user_log_write_uint8_formatted(&log_local,UINT_VAR,DLT_FORMAT_BIN8)
 
#define DLT_BIN16(UINT_VAR)   (void)dlt_user_log_write_uint16_formatted(&log_local,UINT_VAR,DLT_FORMAT_BIN16)
 
#define DLT_PTR(PTR_VAR)   (void)dlt_user_log_write_ptr(&log_local, PTR_VAR)
 
#define DLT_TRACE_NETWORK(CONTEXT, TYPE, HEADERLEN, HEADER, PAYLOADLEN, PAYLOAD)
 
#define DLT_TRACE_NETWORK_TRUNCATED(CONTEXT, TYPE, HEADERLEN, HEADER, PAYLOADLEN, PAYLOAD)
 
#define DLT_TRACE_NETWORK_SEGMENTED(CONTEXT, TYPE, HEADERLEN, HEADER, PAYLOADLEN, PAYLOAD)
 
#define DLT_LOG_STRING(CONTEXT, LOGLEVEL, TEXT)
 
#define DLT_LOG_STRING_INT(CONTEXT, LOGLEVEL, TEXT, INT_VAR)
 
#define DLT_LOG_STRING_UINT(CONTEXT, LOGLEVEL, TEXT, UINT_VAR)
 
#define DLT_LOG_UINT(CONTEXT, LOGLEVEL, UINT_VAR)
 
#define DLT_LOG_INT(CONTEXT, LOGLEVEL, INT_VAR)
 
#define DLT_LOG_RAW(CONTEXT, LOGLEVEL, BUF, LEN)
 
#define DLT_LOG_MARKER()
 
#define DLT_VERBOSE_MODE()
 
#define DLT_NONVERBOSE_MODE()
 
#define DLT_SET_APPLICATION_LL_TS_LIMIT(LOGLEVEL, TRACESTATUS)
 
#define DLT_ENABLE_LOCAL_PRINT()
 
#define DLT_DISABLE_LOCAL_PRINT()
 
#define DLT_IS_LOG_LEVEL_ENABLED(CONTEXT, LOGLEVEL)   (dlt_user_is_logLevel_enabled(&CONTEXT,LOGLEVEL) == DLT_RETURN_TRUE)
 

Functions

DltReturnValue dlt_user_log_write_start (DltContext *handle, DltContextData *log, DltLogLevelType loglevel)
 
DltReturnValue dlt_user_log_write_start_id (DltContext *handle, DltContextData *log, DltLogLevelType loglevel, uint32_t messageid)
 
DltReturnValue dlt_user_log_write_finish (DltContextData *log)
 
DltReturnValue dlt_user_log_write_bool (DltContextData *log, uint8_t data)
 
DltReturnValue dlt_user_log_write_float32 (DltContextData *log, float32_t data)
 
DltReturnValue dlt_user_log_write_float64 (DltContextData *log, double data)
 
DltReturnValue dlt_user_log_write_uint (DltContextData *log, unsigned int data)
 
DltReturnValue dlt_user_log_write_uint8 (DltContextData *log, uint8_t data)
 
DltReturnValue dlt_user_log_write_uint16 (DltContextData *log, uint16_t data)
 
DltReturnValue dlt_user_log_write_uint32 (DltContextData *log, uint32_t data)
 
DltReturnValue dlt_user_log_write_uint64 (DltContextData *log, uint64_t data)
 
DltReturnValue dlt_user_log_write_uint8_formatted (DltContextData *log, uint8_t data, DltFormatType type)
 
DltReturnValue dlt_user_log_write_uint16_formatted (DltContextData *log, uint16_t data, DltFormatType type)
 
DltReturnValue dlt_user_log_write_uint32_formatted (DltContextData *log, uint32_t data, DltFormatType type)
 
DltReturnValue dlt_user_log_write_uint64_formatted (DltContextData *log, uint64_t data, DltFormatType type)
 
DltReturnValue dlt_user_log_write_ptr (DltContextData *log, void *data)
 
DltReturnValue dlt_user_log_write_int (DltContextData *log, int data)
 
DltReturnValue dlt_user_log_write_int8 (DltContextData *log, int8_t data)
 
DltReturnValue dlt_user_log_write_int16 (DltContextData *log, int16_t data)
 
DltReturnValue dlt_user_log_write_int32 (DltContextData *log, int32_t data)
 
DltReturnValue dlt_user_log_write_int64 (DltContextData *log, int64_t data)
 
DltReturnValue dlt_user_log_write_string (DltContextData *log, const char *text)
 
DltReturnValue dlt_user_log_write_constant_string (DltContextData *log, const char *text)
 
DltReturnValue dlt_user_log_write_utf8_string (DltContextData *log, const char *text)
 
DltReturnValue dlt_user_log_write_raw (DltContextData *log, void *data, uint16_t length)
 
DltReturnValue dlt_user_log_write_raw_formatted (DltContextData *log, void *data, uint16_t length, DltFormatType type)
 
DltReturnValue dlt_user_trace_network (DltContext *handle, DltNetworkTraceType nw_trace_type, uint16_t header_len, void *header, uint16_t payload_len, void *payload)
 
DltReturnValue dlt_user_trace_network_truncated (DltContext *handle, DltNetworkTraceType nw_trace_type, uint16_t header_len, void *header, uint16_t payload_len, void *payload, int allow_truncate)
 
DltReturnValue dlt_user_trace_network_segmented (DltContext *handle, DltNetworkTraceType nw_trace_type, uint16_t header_len, void *header, uint16_t payload_len, void *payload)
 
DltReturnValue dlt_init ()
 
DltReturnValue dlt_init_file (const char *name)
 
DltReturnValue dlt_free ()
 
DltReturnValue dlt_check_library_version (const char *user_major_version, const char *user_minor_version)
 
DltReturnValue dlt_register_app (const char *appid, const char *description)
 
DltReturnValue dlt_unregister_app (void)
 
DltReturnValue dlt_register_context (DltContext *handle, const char *contextid, const char *description)
 
DltReturnValue dlt_register_context_ll_ts (DltContext *handle, const char *contextid, const char *description, int loglevel, int tracestatus)
 
DltReturnValue dlt_unregister_context (DltContext *handle)
 
int dlt_set_resend_timeout_atexit (uint32_t timeout_in_milliseconds)
 
DltReturnValue dlt_set_log_mode (DltUserLogMode mode)
 
int dlt_get_log_state ()
 
DltReturnValue dlt_register_injection_callback (DltContext *handle, uint32_t service_id, int(*dlt_injection_callback)(uint32_t service_id, void *data, uint32_t length))
 
DltReturnValue dlt_register_log_level_changed_callback (DltContext *handle, void(*dlt_log_level_changed_callback)(char context_id[DLT_ID_SIZE], uint8_t log_level, uint8_t trace_status))
 
DltReturnValue dlt_verbose_mode (void)
 
DltReturnValue dlt_user_check_library_version (const char *user_major_version, const char *user_minor_version)
 
DltReturnValue dlt_nonverbose_mode (void)
 
DltReturnValue dlt_use_extended_header_for_non_verbose (int8_t use_extende_header_for_non_verbose)
 
DltReturnValue dlt_with_session_id (int8_t with_session_id)
 
DltReturnValue dlt_with_timestamp (int8_t with_timestamp)
 
DltReturnValue dlt_with_ecu_id (int8_t with_ecu_id)
 
DltReturnValue dlt_set_application_ll_ts_limit (DltLogLevelType loglevel, DltTraceStatusType tracestatus)
 
int dlt_env_adjust_ll_from_env (dlt_env_ll_set const *const ll_set, char const *const apid, char const *const ctid, int const ll)
 adjust log-level based on values given through environment More...
 
int dlt_env_extract_ll_set (char **const env, dlt_env_ll_set *const ll_set)
 extract log-level settings from given string More...
 
void dlt_env_free_ll_set (dlt_env_ll_set *const ll_set)
 release ll_set More...
 
DltReturnValue dlt_enable_local_print (void)
 
DltReturnValue dlt_disable_local_print (void)
 
DltReturnValue dlt_log_string (DltContext *handle, DltLogLevelType loglevel, const char *text)
 
DltReturnValue dlt_log_string_int (DltContext *handle, DltLogLevelType loglevel, const char *text, int data)
 
DltReturnValue dlt_log_string_uint (DltContext *handle, DltLogLevelType loglevel, const char *text, unsigned int data)
 
DltReturnValue dlt_log_int (DltContext *handle, DltLogLevelType loglevel, int data)
 
DltReturnValue dlt_log_uint (DltContext *handle, DltLogLevelType loglevel, unsigned int data)
 
DltReturnValue dlt_log_raw (DltContext *handle, DltLogLevelType loglevel, void *data, uint16_t length)
 
DltReturnValue dlt_log_marker ()
 
DltReturnValue dlt_forward_msg (void *msgdata, size_t size)
 
DltReturnValue dlt_user_check_buffer (int *total_size, int *used_size)
 
int dlt_user_atexit_blow_out_user_buffer (void)
 
DltReturnValue dlt_user_log_resend_buffer (void)
 
static DltReturnValue dlt_user_is_logLevel_enabled (DltContext *handle, DltLogLevelType loglevel)
 

Detailed Description

Macro Definition Documentation

#define DLT_BIN16 (   UINT_VAR)    (void)dlt_user_log_write_uint16_formatted(&log_local,UINT_VAR,DLT_FORMAT_BIN16)

Definition at line 327 of file dlt_user_macros.h.

#define DLT_BIN8 (   UINT_VAR)    (void)dlt_user_log_write_uint8_formatted(&log_local,UINT_VAR,DLT_FORMAT_BIN8)

Definition at line 325 of file dlt_user_macros.h.

#define DLT_BOOL (   BOOL_VAR)    (void)dlt_user_log_write_bool(&log_local,BOOL_VAR)

Add boolean parameter to the log messsage.

Parameters
BOOL_VARBoolean value (mapped to uint8)

Definition at line 255 of file dlt_user_macros.h.

Referenced by test2m(), and test3m().

#define DLT_CSTRING (   TEXT)    (void)dlt_user_log_write_constant_string(&log_local,TEXT)

Add constant string parameter to the log messsage.

Parameters
TEXTConstant ASCII string

Definition at line 241 of file dlt_user_macros.h.

#define DLT_DECLARE_CONTEXT (   CONTEXT)    DltContext CONTEXT;

Create an object for a new context. This macro has to be called first for every.

Parameters
CONTEXTobject containing information about one special logging context
Note
To avoid the MISRA warning "Null statement is located close to other code or comments" remove the semicolon when using the macro. Example: DLT_DECLARE_CONTEXT(hContext)

Definition at line 93 of file dlt_user_macros.h.

Referenced by stress3(), and thread_function().

#define DLT_DISABLE_LOCAL_PRINT ( )
Value:
do {\
(void)dlt_disable_local_print();} while(0)
DltReturnValue dlt_disable_local_print(void)
Definition: dlt_user.c:3296

Disable local printing of messages

Definition at line 516 of file dlt_user_macros.h.

Referenced by test6m().

#define DLT_ENABLE_LOCAL_PRINT ( )
Value:
do {\
(void)dlt_enable_local_print();} while(0)
DltReturnValue dlt_enable_local_print(void)
Definition: dlt_user.c:3280

Enable local printing of messages

Definition at line 509 of file dlt_user_macros.h.

Referenced by main(), and test6m().

#define DLT_FLOAT32 (   FLOAT32_VAR)    (void)dlt_user_log_write_float32(&log_local,FLOAT32_VAR)

Add float32 parameter to the log messsage.

Parameters
FLOAT32_VARFloat32 value (mapped to float)

Definition at line 262 of file dlt_user_macros.h.

Referenced by main(), test2m(), and test3m().

#define DLT_FLOAT64 (   FLOAT64_VAR)    (void)dlt_user_log_write_float64(&log_local,FLOAT64_VAR)

Add float64 parameter to the log messsage.

Parameters
FLOAT64_VARFloat64 value (mapped to double)

Definition at line 269 of file dlt_user_macros.h.

Referenced by test2m(), and test3m().

#define DLT_HEX16 (   UINT_VAR)    (void)dlt_user_log_write_uint16_formatted(&log_local,UINT_VAR,DLT_FORMAT_HEX16)

Definition at line 319 of file dlt_user_macros.h.

#define DLT_HEX32 (   UINT_VAR)    (void)dlt_user_log_write_uint32_formatted(&log_local,UINT_VAR,DLT_FORMAT_HEX32)

Definition at line 321 of file dlt_user_macros.h.

#define DLT_HEX64 (   UINT_VAR)    (void)dlt_user_log_write_uint64_formatted(&log_local,UINT_VAR,DLT_FORMAT_HEX64)

Definition at line 323 of file dlt_user_macros.h.

#define DLT_HEX8 (   UINT_VAR)    (void)dlt_user_log_write_uint8_formatted(&log_local,UINT_VAR,DLT_FORMAT_HEX8)

Definition at line 317 of file dlt_user_macros.h.

#define DLT_IMPORT_CONTEXT (   CONTEXT)    extern DltContext CONTEXT;

Use an object of a new context created in another module. This macro has to be called first for every.

Parameters
CONTEXTobject containing information about one special logging context
Note
To avoid the MISRA warning "Null statement is located close to other code or comments" remove the semicolon when using the macro. Example: DLT_IMPORT_CONTEXT(hContext)

Definition at line 104 of file dlt_user_macros.h.

#define DLT_INT (   INT_VAR)    (void)dlt_user_log_write_int(&log_local,INT_VAR)
#define DLT_INT16 (   INT_VAR)    (void)dlt_user_log_write_int16(&log_local,INT_VAR)

Definition at line 282 of file dlt_user_macros.h.

Referenced by test2m(), and test3m().

#define DLT_INT32 (   INT_VAR)    (void)dlt_user_log_write_int32(&log_local,INT_VAR)

Definition at line 285 of file dlt_user_macros.h.

Referenced by main(), test2m(), and test3m().

#define DLT_INT64 (   INT_VAR)    (void)dlt_user_log_write_int64(&log_local,INT_VAR)

Definition at line 288 of file dlt_user_macros.h.

Referenced by test2m(), and test3m().

#define DLT_INT8 (   INT_VAR)    (void)dlt_user_log_write_int8(&log_local,INT_VAR)

Definition at line 279 of file dlt_user_macros.h.

Referenced by test2m(), and test3m().

#define DLT_IS_LOG_LEVEL_ENABLED (   CONTEXT,
  LOGLEVEL 
)    (dlt_user_is_logLevel_enabled(&CONTEXT,LOGLEVEL) == DLT_RETURN_TRUE)

Check if log level is enabled

Parameters
CONTEXTobject containing information about one special logging context
LOGLEVELthe log level of the log message

Definition at line 525 of file dlt_user_macros.h.

Referenced by test5m().

#define DLT_LOG (   CONTEXT,
  LOGLEVEL,
  ARGS... 
)
Value:
do { \
{ \
DltContextData log_local; \
int dlt_local; \
dlt_local = dlt_user_log_write_start(&CONTEXT,&log_local,LOGLEVEL); \
if (dlt_local > 0) \
{ \
ARGS; \
(void)dlt_user_log_write_finish(&log_local); \
} \
} \
} while(0)
static DltReturnValue dlt_user_is_logLevel_enabled(DltContext *handle, DltLogLevelType loglevel)
Definition: dlt_user.h:788
DltReturnValue dlt_user_log_write_finish(DltContextData *log)
Definition: dlt_user.c:1482
DltReturnValue dlt_user_log_write_start(DltContext *handle, DltContextData *log, DltLogLevelType loglevel)
Definition: dlt_user.c:1428

Send log message with variable list of messages (intended for verbose mode)

Parameters
CONTEXTobject containing information about one special logging context
LOGLEVELthe log level of the log message
ARGSvariable list of arguments
Note
To avoid the MISRA warning "The comma operator has been used outside a for statement" use a semicolon instead of a comma to separate the ARGS. Example: DLT_LOG(hContext, DLT_LOG_INFO, DLT_STRING("Hello world"); DLT_INT(123));

Definition at line 182 of file dlt_user_macros.h.

Referenced by compress_file_to(), DLT_DECLARE_CONTEXT(), DLT_IMPORT_CONTEXT(), dlt_kpi_log_interrupts(), dlt_kpi_log_list(), dlt_system_signal_handler(), dlt_user_injection_callback(), dlt_user_log_file_data(), dlt_user_log_file_end(), dlt_user_log_file_errorMessage(), dlt_user_log_file_header(), dlt_user_log_file_header_alias(), dlt_user_log_file_infoAbout(), dlt_user_log_file_packagesCount(), do_logging(), filetransfer_thread(), flush_dir(), flush_dir_compress(), flush_dir_original(), flush_dir_send(), init_filetransfer_dirs(), init_shell(), join_threads(), logfile_thread(), logprocess_thread(), main(), read_socket(), register_contexts(), send_dumped_file(), send_one(), start_filetransfer(), start_logfile(), start_logprocess(), start_syslog(), start_threads(), stress3(), syslog_thread(), test1m(), test2m(), test3m(), test4m(), test5m(), test6m(), test7m(), test8m(), test9m(), test_injection_function_callback(), test_injection_macro_callback(), testall(), testFile1Run1(), testFile1Run2(), testFile2Run1(), testFile2Run2(), testFile3Run1(), testFile3Run2(), testFile3Run3(), thread_function(), unique_name(), and wait_for_files().

#define DLT_LOG_ID (   CONTEXT,
  LOGLEVEL,
  MSGID,
  ARGS... 
)
Value:
do { \
{ \
DltContextData log_local; \
int dlt_local; \
dlt_local = dlt_user_log_write_start_id(&CONTEXT,&log_local,LOGLEVEL,MSGID); \
if (dlt_local > 0) \
{ \
ARGS; \
(void)dlt_user_log_write_finish(&log_local); \
} \
} \
} while(0)
DltReturnValue dlt_user_log_write_start_id(DltContext *handle, DltContextData *log, DltLogLevelType loglevel, uint32_t messageid)
Definition: dlt_user.c:1433
static DltReturnValue dlt_user_is_logLevel_enabled(DltContext *handle, DltLogLevelType loglevel)
Definition: dlt_user.h:788
DltReturnValue dlt_user_log_write_finish(DltContextData *log)
Definition: dlt_user.c:1482

Send log message with variable list of messages (intended for non-verbose mode)

Parameters
CONTEXTobject containing information about one special logging context
LOGLEVELthe log level of the log message
MSGIDthe message id of log message
ARGSvariable list of arguments: calls to DLT_STRING(), DLT_BOOL(), DLT_FLOAT32(), DLT_FLOAT64(), DLT_INT(), DLT_UINT(), DLT_RAW()
Note
To avoid the MISRA warning "The comma operator has been used outside a for statement" use a semicolon instead of a comma to separate the ARGS. Example: DLT_LOG_ID(hContext, DLT_LOG_INFO, 0x1234, DLT_STRING("Hello world"); DLT_INT(123));

Definition at line 214 of file dlt_user_macros.h.

Referenced by main(), and test3m().

#define DLT_LOG_INT (   CONTEXT,
  LOGLEVEL,
  INT_VAR 
)
Value:
do { \
{ \
(void)dlt_log_int(&(CONTEXT),LOGLEVEL,INT_VAR); \
} \
} while(0)
DltReturnValue dlt_log_int(DltContext *handle, DltLogLevelType loglevel, int data)
Definition: dlt_user.c:3056
static DltReturnValue dlt_user_is_logLevel_enabled(DltContext *handle, DltLogLevelType loglevel)
Definition: dlt_user.h:788

Send log message with integer parameter.

Parameters
CONTEXTobject containing information about one special logging context
LOGLEVELthe log level of the log message
INT_VARinteger value

Definition at line 451 of file dlt_user_macros.h.

Referenced by test5m().

#define DLT_LOG_MARKER ( )
Value:
do { \
(void)dlt_log_marker(); \
} while(0)
DltReturnValue dlt_log_marker()
Definition: dlt_user.c:3164

Send log message with marker.

Definition at line 477 of file dlt_user_macros.h.

Referenced by main().

#define DLT_LOG_RAW (   CONTEXT,
  LOGLEVEL,
  BUF,
  LEN 
)
Value:
do { \
{ \
(void)dlt_log_raw(&(CONTEXT),LOGLEVEL,BUF,LEN); \
} \
} while(0)
static DltReturnValue dlt_user_is_logLevel_enabled(DltContext *handle, DltLogLevelType loglevel)
Definition: dlt_user.h:788
DltReturnValue dlt_log_raw(DltContext *handle, DltLogLevelType loglevel, void *data, uint16_t length)
Definition: dlt_user.c:3128

Send log message with binary memory block.

Parameters
CONTEXTobject containing information about one special logging context
LOGLEVELthe log level of the log message
BUFpointer to memory block
LENlength of memory block

Definition at line 466 of file dlt_user_macros.h.

Referenced by test5m().

#define DLT_LOG_STRING (   CONTEXT,
  LOGLEVEL,
  TEXT 
)
Value:
do { \
{ \
(void)dlt_log_string(&(CONTEXT), LOGLEVEL, TEXT); \
} \
} while(0)
DltReturnValue dlt_log_string(DltContext *handle, DltLogLevelType loglevel, const char *text)
Definition: dlt_user.c:2940
static DltReturnValue dlt_user_is_logLevel_enabled(DltContext *handle, DltLogLevelType loglevel)
Definition: dlt_user.h:788

Send log message with string parameter.

Parameters
CONTEXTobject containing information about one special logging context
LOGLEVELthe log level of the log message
TEXTASCII string

Definition at line 393 of file dlt_user_macros.h.

Referenced by test5m(), test6m(), test7m(), test8m(), and test9m().

#define DLT_LOG_STRING_INT (   CONTEXT,
  LOGLEVEL,
  TEXT,
  INT_VAR 
)
Value:
do { \
{ \
(void)dlt_log_string_int(&(CONTEXT), LOGLEVEL, TEXT, INT_VAR); \
} \
} while(0)
DltReturnValue dlt_log_string_int(DltContext *handle, DltLogLevelType loglevel, const char *text, int data)
Definition: dlt_user.c:2976
static DltReturnValue dlt_user_is_logLevel_enabled(DltContext *handle, DltLogLevelType loglevel)
Definition: dlt_user.h:788

Send log message with string parameter and integer parameter.

Parameters
CONTEXTobject containing information about one special logging context
LOGLEVELthe log level of the log messages
TEXTASCII string
INT_VARinteger value

Definition at line 408 of file dlt_user_macros.h.

Referenced by test5m().

#define DLT_LOG_STRING_UINT (   CONTEXT,
  LOGLEVEL,
  TEXT,
  UINT_VAR 
)
Value:
do { \
{ \
(void)dlt_log_string_uint(&(CONTEXT),LOGLEVEL,TEXT,UINT_VAR); \
} \
} while(0)
static DltReturnValue dlt_user_is_logLevel_enabled(DltContext *handle, DltLogLevelType loglevel)
Definition: dlt_user.h:788
DltReturnValue dlt_log_string_uint(DltContext *handle, DltLogLevelType loglevel, const char *text, unsigned int data)
Definition: dlt_user.c:3016

Send log message with string parameter and unsigned integer parameter.

Parameters
CONTEXTobject containing information about one special logging context
LOGLEVELthe log level of the log message
TEXTASCII string
UINT_VARunsigned integer value

Definition at line 423 of file dlt_user_macros.h.

Referenced by test5m().

#define DLT_LOG_UINT (   CONTEXT,
  LOGLEVEL,
  UINT_VAR 
)
Value:
do { \
{ \
(void)dlt_log_uint(&(CONTEXT),LOGLEVEL,UINT_VAR); \
} \
} while(0)
DltReturnValue dlt_log_uint(DltContext *handle, DltLogLevelType loglevel, unsigned int data)
Definition: dlt_user.c:3092
static DltReturnValue dlt_user_is_logLevel_enabled(DltContext *handle, DltLogLevelType loglevel)
Definition: dlt_user.h:788

Send log message with unsigned integer parameter.

Parameters
CONTEXTobject containing information about one special logging context
LOGLEVELthe log level of the log message
UINT_VARunsigned integer value

Definition at line 437 of file dlt_user_macros.h.

Referenced by test5m().

#define DLT_NONVERBOSE_MODE ( )
Value:
do {\
(void)dlt_nonverbose_mode();} while(0)
DltReturnValue dlt_nonverbose_mode(void)
Definition: dlt_user.c:3195

Switch to non-verbose mode

Definition at line 493 of file dlt_user_macros.h.

Referenced by main(), and test3m().

#define DLT_PTR (   PTR_VAR)    (void)dlt_user_log_write_ptr(&log_local, PTR_VAR)

Architecture independent macro to print pointers

Definition at line 333 of file dlt_user_macros.h.

Referenced by test5m().

#define DLT_RAW (   BUF,
  LEN 
)    (void)dlt_user_log_write_raw(&log_local,BUF,LEN)

Add binary memory block to the log messages.

Parameters
BUFpointer to memory block
LENlength of memory block

Definition at line 315 of file dlt_user_macros.h.

Referenced by dlt_user_log_file_data(), main(), stress3(), test2m(), test3m(), test4m(), and testall().

#define DLT_REGISTER_APP (   APPID,
  DESCRIPTION 
)
Value:
do {\
(void)dlt_register_app( APPID, DESCRIPTION);} while(0)
DltReturnValue dlt_register_app(const char *appid, const char *description)
Definition: dlt_user.c:800
#define _DLT_PACKAGE_MAJOR_VERSION
Definition: dlt_version.h:24
DltReturnValue dlt_check_library_version(const char *user_major_version, const char *user_minor_version)
Definition: dlt_user.c:795
#define _DLT_PACKAGE_MINOR_VERSION
Definition: dlt_version.h:25

Register application.

Parameters
APPIDapplication id with maximal four characters
DESCRIPTIONASCII string containing description

Definition at line 112 of file dlt_user_macros.h.

Referenced by DLT_DECLARE_CONTEXT(), main(), and run_threads().

#define DLT_REGISTER_CONTEXT (   CONTEXT,
  CONTEXTID,
  DESCRIPTION 
)
Value:
do{\
(void)dlt_register_context(&(CONTEXT), CONTEXTID, DESCRIPTION);} while(0)
DltReturnValue dlt_register_context(DltContext *handle, const char *contextid, const char *description)
Definition: dlt_user.c:883

Register context (with default log level and default trace status)

Parameters
CONTEXTobject containing information about one special logging context
CONTEXTIDcontext id with maximal four characters
DESCRIPTIONASCII string containing description

Definition at line 129 of file dlt_user_macros.h.

Referenced by DLT_DECLARE_CONTEXT(), do_logging(), filetransfer_thread(), init_shell(), logprocess_thread(), main(), register_contexts(), stress3(), syslog_thread(), and thread_function().

#define DLT_REGISTER_CONTEXT_LL_TS (   CONTEXT,
  CONTEXTID,
  DESCRIPTION,
  LOGLEVEL,
  TRACESTATUS 
)
Value:
do{\
(void)dlt_register_context_ll_ts(&(CONTEXT), CONTEXTID, DESCRIPTION, LOGLEVEL, TRACESTATUS);} while(0)
DltReturnValue dlt_register_context_ll_ts(DltContext *handle, const char *contextid, const char *description, int loglevel, int tracestatus)
Definition: dlt_user.c:911

Register context with pre-defined log level and pre-defined trace status.

Parameters
CONTEXTobject containing information about one special logging context
CONTEXTIDcontext id with maximal four characters
DESCRIPTIONASCII string containing description
LOGLEVELlog level to be pre-set for this context (DLT_LOG_DEFAULT is not allowed here)
TRACESTATUStrace status to be pre-set for this context (DLT_TRACE_STATUS_DEFAULT is not allowed here)

Definition at line 142 of file dlt_user_macros.h.

Referenced by main().

#define DLT_REGISTER_INJECTION_CALLBACK (   CONTEXT,
  SERVICEID,
  CALLBACK 
)
Value:
do{\
(void)dlt_register_injection_callback(&(CONTEXT),SERVICEID, CALLBACK);} while(0)
DltReturnValue dlt_register_injection_callback(DltContext *handle, uint32_t service_id, int(*dlt_injection_callback)(uint32_t service_id, void *data, uint32_t length))
Definition: dlt_user.c:2377

Register callback function called when injection message was received

Parameters
CONTEXTobject containing information about one special logging context
SERVICEIDservice id of the injection message
CALLBACKfunction pointer to callback function

Definition at line 158 of file dlt_user_macros.h.

Referenced by init_shell(), and main().

#define DLT_REGISTER_LOG_LEVEL_CHANGED_CALLBACK (   CONTEXT,
  CALLBACK 
)
Value:
do{\
(void)dlt_register_log_level_changed_callback(&(CONTEXT),CALLBACK);} while(0)
DltReturnValue dlt_register_log_level_changed_callback(DltContext *handle, void(*dlt_log_level_changed_callback)(char context_id[DLT_ID_SIZE], uint8_t log_level, uint8_t trace_status))
Definition: dlt_user.c:2463

Register callback function called when log level of context was changed

Parameters
CONTEXTobject containing information about one special logging context
CALLBACKfunction pointer to callback function

Definition at line 166 of file dlt_user_macros.h.

Referenced by main().

#define DLT_SET_APPLICATION_LL_TS_LIMIT (   LOGLEVEL,
  TRACESTATUS 
)
Value:
do {\
(void)dlt_set_application_ll_ts_limit(LOGLEVEL, TRACESTATUS);} while(0)
DltReturnValue dlt_set_application_ll_ts_limit(DltLogLevelType loglevel, DltTraceStatusType tracestatus)
Definition: dlt_user.c:1208

Set maximum logged log level and trace status of application

Parameters
LOGLEVELThis is the log level to be set for the whole application
TRACESTATUSThis is the trace status to be set for the whole application

Definition at line 502 of file dlt_user_macros.h.

Referenced by test7m(), test8m(), and test9m().

#define DLT_TRACE_NETWORK (   CONTEXT,
  TYPE,
  HEADERLEN,
  HEADER,
  PAYLOADLEN,
  PAYLOAD 
)
Value:
do { \
if ((CONTEXT).trace_status_ptr && *((CONTEXT).trace_status_ptr)==DLT_TRACE_STATUS_ON) \
{ \
(void)dlt_user_trace_network(&(CONTEXT),TYPE,HEADERLEN,HEADER,PAYLOADLEN,PAYLOAD); \
} \
}while(0)
DltReturnValue dlt_user_trace_network(DltContext *handle, DltNetworkTraceType nw_trace_type, uint16_t header_len, void *header, uint16_t payload_len, void *payload)
Definition: dlt_user.c:2850

Trace network message

Parameters
CONTEXTobject containing information about one special logging context
TYPEtype of network trace message
HEADERLENlength of network message header
HEADERpointer to network message header
PAYLOADLENlength of network message payload
PAYLOADpointer to network message payload

Definition at line 345 of file dlt_user_macros.h.

Referenced by test7m().

#define DLT_TRACE_NETWORK_SEGMENTED (   CONTEXT,
  TYPE,
  HEADERLEN,
  HEADER,
  PAYLOADLEN,
  PAYLOAD 
)
Value:
do { \
if ((CONTEXT).trace_status_ptr && *((CONTEXT).trace_status_ptr)==DLT_TRACE_STATUS_ON) \
{ \
(void)dlt_user_trace_network_segmented(&(CONTEXT),TYPE,HEADERLEN,HEADER,PAYLOADLEN,PAYLOAD); \
} \
}while(0)
DltReturnValue dlt_user_trace_network_segmented(DltContext *handle, DltNetworkTraceType nw_trace_type, uint16_t header_len, void *header, uint16_t payload_len, void *payload)
Definition: dlt_user.c:2770

Trace network message, segment large messages

Parameters
CONTEXTobject containing information about one special logging context
TYPEtype of network trace message
HEADERLENlength of network message header
HEADERpointer to network message header
PAYLOADLENlength of network message payload
PAYLOADpointer to network message payload

Definition at line 379 of file dlt_user_macros.h.

Referenced by DLT_DECLARE_CONTEXT(), and test9m().

#define DLT_TRACE_NETWORK_TRUNCATED (   CONTEXT,
  TYPE,
  HEADERLEN,
  HEADER,
  PAYLOADLEN,
  PAYLOAD 
)
Value:
do { \
if ((CONTEXT).trace_status_ptr && *((CONTEXT).trace_status_ptr)==DLT_TRACE_STATUS_ON) \
{ \
(void)dlt_user_trace_network_truncated(&(CONTEXT),TYPE,HEADERLEN,HEADER,PAYLOADLEN,PAYLOAD, 1); \
} \
}while(0)
DltReturnValue dlt_user_trace_network_truncated(DltContext *handle, DltNetworkTraceType nw_trace_type, uint16_t header_len, void *header, uint16_t payload_len, void *payload, int allow_truncate)
Definition: dlt_user.c:2855

Trace network message, allow truncation

Parameters
CONTEXTobject containing information about one special logging context
TYPEtype of network trace message
HEADERLENlength of network message header
HEADERpointer to network message header
PAYLOADLENlength of network message payload
PAYLOADpointer to network message payload

Definition at line 362 of file dlt_user_macros.h.

Referenced by test8m().

#define DLT_UINT (   UINT_VAR)    (void)dlt_user_log_write_uint(&log_local,UINT_VAR)

Add unsigned integer parameter to the log messsage.

Parameters
UINT_VARunsigned integer value

Definition at line 295 of file dlt_user_macros.h.

Referenced by dlt_user_log_file_data(), dlt_user_log_file_end(), dlt_user_log_file_errorMessage(), dlt_user_log_file_header(), dlt_user_log_file_header_alias(), dlt_user_log_file_infoAbout(), main(), test2m(), and test3m().

#define DLT_UINT16 (   UINT_VAR)    (void)dlt_user_log_write_uint16(&log_local,UINT_VAR)

Definition at line 301 of file dlt_user_macros.h.

Referenced by main(), test2m(), and test3m().

#define DLT_UINT32 (   UINT_VAR)    (void)dlt_user_log_write_uint32(&log_local,UINT_VAR)
#define DLT_UINT64 (   UINT_VAR)    (void)dlt_user_log_write_uint64(&log_local,UINT_VAR)

Definition at line 307 of file dlt_user_macros.h.

Referenced by test2m(), and test3m().

#define DLT_UINT8 (   UINT_VAR)    (void)dlt_user_log_write_uint8(&log_local,UINT_VAR)

Definition at line 298 of file dlt_user_macros.h.

Referenced by main(), test2m(), and test3m().

#define DLT_UNREGISTER_APP ( )
Value:
do{\
(void)dlt_unregister_app();} while(0)
DltReturnValue dlt_unregister_app(void)
Definition: dlt_user.c:1118

Unregister application.

Definition at line 120 of file dlt_user_macros.h.

Referenced by DLT_DECLARE_CONTEXT(), main(), and run_threads().

#define DLT_UNREGISTER_CONTEXT (   CONTEXT)
Value:
do{\
(void)dlt_unregister_context(&(CONTEXT));} while(0)
DltReturnValue dlt_unregister_context(DltContext *handle)
Definition: dlt_user.c:1148

Unregister context.

Parameters
CONTEXTobject containing information about one special logging context

Definition at line 149 of file dlt_user_macros.h.

Referenced by DLT_DECLARE_CONTEXT(), do_logging(), main(), stress1(), and thread_function().

#define DLT_USER_RESENDBUF_MAX_SIZE   (DLT_USER_BUF_MAX_SIZE + 100)

Size of resend buffer; Max DLT message size is 1390 bytes plus some extra header space

Definition at line 94 of file dlt_user.h.

#define DLT_UTF8 (   TEXT)    (void)dlt_user_log_write_utf8_string(&log_local,TEXT)

Add utf8-encoded string parameter to the log messsage.

Parameters
TEXTUTF8-encoded string

Definition at line 248 of file dlt_user_macros.h.

Referenced by test2m(), and test3m().

#define DLT_VERBOSE_MODE ( )
Value:
do { \
(void)dlt_verbose_mode();} while(0)
DltReturnValue dlt_verbose_mode(void)
Definition: dlt_user.c:3178

Switch to verbose mode

Definition at line 486 of file dlt_user_macros.h.

Referenced by test3m().

Function Documentation

DltReturnValue dlt_check_library_version ( const char *  user_major_version,
const char *  user_minor_version 
)

Check the library version of DLT library.

Parameters
user_major_versionthe major version to be compared
user_minor_versionthe minor version to be compared
Returns
Value from DltReturnValue enum, DLT_RETURN_ERROR if there is a mismatch

Definition at line 795 of file dlt_user.c.

References dlt_user_check_library_version().

DltReturnValue dlt_disable_local_print ( void  )

Disable local printing of messages

Returns
Value from DltReturnValue enum

Definition at line 3296 of file dlt_user.c.

References dlt_init(), DLT_RETURN_ERROR, DLT_RETURN_OK, dlt_user_initialised, dlt_vlog(), and DltUser::enable_local_print.

Referenced by test6f().

DltReturnValue dlt_enable_local_print ( void  )

Enable local printing of messages

Returns
Value from DltReturnValue enum

Definition at line 3280 of file dlt_user.c.

References dlt_init(), DLT_RETURN_ERROR, DLT_RETURN_OK, dlt_user_initialised, dlt_vlog(), and DltUser::enable_local_print.

Referenced by main(), and test6f().

int dlt_env_adjust_ll_from_env ( dlt_env_ll_set const *const  ll_set,
char const *const  apid,
char const *const  ctid,
int const  ll 
)

adjust log-level based on values given through environment

Iterate over the set of items, and find the best match. For any item that matches, the one with the highest priority is selected and that log-level is returned.

Priorities are determined as follows:

  • no apid, no ctid only ll given in item: use ll with prio 1
  • no apid, ctid matches: use ll with prio 2
  • no ctid, apid matches: use ll with prio 3
  • apid, ctid matches: use ll with prio 4

If no item matches or in case of error, the original log-level (

Parameters
ll)is returned

Iterate over the set of items, and find the best match (

See also
ll_item_get_matching_prio) For any item that matches, the one with the highest priority is selected and that log-level is returned.

If no item matches or in case of error, the original log-level (

Parameters
ll)is returned

Definition at line 537 of file dlt_env_ll.c.

References dlt_env_ll_item_get_matching_prio(), dlt_env_ll_set::item, dlt_env_ll_item::ll, and dlt_env_ll_set::num_elem.

Referenced by dlt_register_context_ll_ts().

int dlt_env_extract_ll_set ( char **const  env,
dlt_env_ll_set *const  ll_set 
)

extract log-level settings from given string

Scan

Parameters
envfor setttings like apid:ctid:log-level and store them in given
ll_set
envreference to a string to be parsed, after parsing env will point after the last parse character
ll_setset of log-level extracted from given string
Returns
0 on success
-1 on failure

extract log-level settings from given string

The given set is initialized within this function (memory is allocated). Make sure, that the caller frees this memory when it is no longer needed!

Returns
0 if successful, -1 else

Definition at line 408 of file dlt_env_ll.c.

References dlt_env_ll_set::array_size, dlt_env_extract_ll_item(), dlt_env_increase_ll_set(), dlt_env_init_ll_set(), dlt_env_ll_set::item, and dlt_env_ll_set::num_elem.

Referenced by dlt_init_common().

void dlt_env_free_ll_set ( dlt_env_ll_set *const  ll_set)

release ll_set

Definition at line 350 of file dlt_env_ll.c.

References dlt_env_ll_set::array_size, dlt_env_ll_set::item, NULL, and dlt_env_ll_set::num_elem.

Referenced by dlt_free().

int dlt_get_log_state ( )

Get the state of the connected client to the daemon. The user application gets a message, when client is connected or disconnected. This value contains the last state. It needs some time until the application gets state from the daemon. Until then the state is "unknown state".

Returns
-1 = unknown state, 0 = client not connected, 1 = client connected

Definition at line 1276 of file dlt_user.c.

References DltUser::log_state.

Referenced by main(), and send_dumped_file().

DltReturnValue dlt_init_file ( const char *  name)

Initialize the user lib writing only to file. This function has to be called first, before using any DLT user lib functions.

Parameters
namename of an optional log file
Returns
Value from DltReturnValue enum

Definition at line 350 of file dlt_user.c.

References dlt_init_common(), DltUser::dlt_is_file, DltUser::dlt_log_handle, DLT_RETURN_ERROR, DLT_RETURN_OK, DLT_RETURN_WRONG_PARAMETER, DLT_USER_BUFFER_LENGTH, dlt_user_initialised, and dlt_vnlog().

Referenced by main().

DltReturnValue dlt_log_int ( DltContext handle,
DltLogLevelType  loglevel,
int  data 
)

Write an integer value into a DLT log message.

Parameters
handlepointer to an object containing information about one special logging context
loglevelthis is the current log level of the log message to be sent
datainteger value written into the log message
Returns
Value from DltReturnValue enum

Definition at line 3056 of file dlt_user.c.

References DLT_LOG_MAX, DLT_RETURN_ERROR, DLT_RETURN_OK, DLT_RETURN_WRONG_PARAMETER, dlt_user_log_write_finish(), dlt_user_log_write_int(), dlt_user_log_write_start(), dlt_vlog(), NULL, and DltUser::verbose_mode.

Referenced by test5f().

DltReturnValue dlt_log_marker ( )

Write marker message to DLT.

Returns
Value from DltReturnValue enum

Definition at line 3164 of file dlt_user.c.

References dlt_init(), DLT_RETURN_ERROR, DLT_RETURN_OK, dlt_user_initialised, dlt_user_log_send_marker(), and dlt_vlog().

DltReturnValue dlt_log_raw ( DltContext handle,
DltLogLevelType  loglevel,
void *  data,
uint16_t  length 
)

Write an unsigned integer value into a DLT log message.

Parameters
handlepointer to an object containing information about one special logging context
loglevelthis is the current log level of the log message to be sent
datapointer to the parameter written into log message.
lengthlength in bytes of the parameter written into log message.
Returns
Value from DltReturnValue enum

Definition at line 3128 of file dlt_user.c.

References DLT_LOG_MAX, DLT_RETURN_ERROR, DLT_RETURN_OK, DLT_RETURN_WRONG_PARAMETER, dlt_user_log_write_finish(), dlt_user_log_write_raw(), dlt_user_log_write_start(), dlt_vlog(), NULL, and DltUser::verbose_mode.

Referenced by test5f().

DltReturnValue dlt_log_string ( DltContext handle,
DltLogLevelType  loglevel,
const char *  text 
)

Write a null terminated ASCII string into a DLT log message.

Parameters
handlepointer to an object containing information about one special logging context
loglevelthis is the current log level of the log message to be sent
textpointer to the ASCII string written into log message containing null termination.
Returns
Value from DltReturnValue enum

Definition at line 2940 of file dlt_user.c.

References DLT_LOG_MAX, DLT_RETURN_ERROR, DLT_RETURN_OK, DLT_RETURN_WRONG_PARAMETER, dlt_user_log_write_finish(), dlt_user_log_write_start(), dlt_user_log_write_string(), dlt_vlog(), NULL, and DltUser::verbose_mode.

Referenced by test5f().

DltReturnValue dlt_log_string_int ( DltContext handle,
DltLogLevelType  loglevel,
const char *  text,
int  data 
)

Write a null terminated ASCII string and an integer value into a DLT log message.

Parameters
handlepointer to an object containing information about one special logging context
loglevelthis is the current log level of the log message to be sent
textpointer to the ASCII string written into log message containing null termination.
datainteger value written into the log message
Returns
Value from DltReturnValue enum

Definition at line 2976 of file dlt_user.c.

References DLT_LOG_MAX, DLT_RETURN_ERROR, DLT_RETURN_OK, DLT_RETURN_WRONG_PARAMETER, dlt_user_log_write_finish(), dlt_user_log_write_int(), dlt_user_log_write_start(), dlt_user_log_write_string(), dlt_vlog(), NULL, and DltUser::verbose_mode.

Referenced by test5f().

DltReturnValue dlt_log_string_uint ( DltContext handle,
DltLogLevelType  loglevel,
const char *  text,
unsigned int  data 
)

Write a null terminated ASCII string and an unsigned integer value into a DLT log message.

Parameters
handlepointer to an object containing information about one special logging context
loglevelthis is the current log level of the log message to be sent
textpointer to the ASCII string written into log message containing null termination.
dataunsigned integer value written into the log message
Returns
Value from DltReturnValue enum

Definition at line 3016 of file dlt_user.c.

References DLT_LOG_MAX, DLT_RETURN_ERROR, DLT_RETURN_OK, DLT_RETURN_WRONG_PARAMETER, dlt_user_log_write_finish(), dlt_user_log_write_start(), dlt_user_log_write_string(), dlt_user_log_write_uint(), dlt_vlog(), NULL, and DltUser::verbose_mode.

Referenced by test5f().

DltReturnValue dlt_log_uint ( DltContext handle,
DltLogLevelType  loglevel,
unsigned int  data 
)

Write an unsigned integer value into a DLT log message.

Parameters
handlepointer to an object containing information about one special logging context
loglevelthis is the current log level of the log message to be sent
dataunsigned integer value written into the log message
Returns
Value from DltReturnValue enum

Definition at line 3092 of file dlt_user.c.

References DLT_LOG_MAX, DLT_RETURN_ERROR, DLT_RETURN_OK, DLT_RETURN_WRONG_PARAMETER, dlt_user_log_write_finish(), dlt_user_log_write_start(), dlt_user_log_write_uint(), dlt_vlog(), NULL, and DltUser::verbose_mode.

Referenced by test5f().

DltReturnValue dlt_nonverbose_mode ( void  )

Switch to non-verbose mode

Definition at line 3195 of file dlt_user.c.

References dlt_init(), DLT_RETURN_ERROR, DLT_RETURN_OK, dlt_user_initialised, dlt_vlog(), and DltUser::verbose_mode.

Referenced by main(), and test3f().

DltReturnValue dlt_register_app ( const char *  appid,
const char *  description 
)

Register an application in the daemon.

Parameters
appidfour byte long character array with the application id
descriptionlong name of the application
Returns
Value from DltReturnValue enum

Definition at line 800 of file dlt_user.c.

References DltUser::appID, DltUser::application_description, dlt_init(), DltUser::dlt_log_handle, DLT_RETURN_ERROR, DLT_RETURN_OK, DLT_RETURN_WRONG_PARAMETER, DLT_SEM_FREE, DLT_SEM_LOCK, dlt_set_id(), dlt_user_initialised, dlt_user_log_resend_buffer(), dlt_user_log_send_register_application(), dlt_vlog(), and NULL.

Referenced by main().

DltReturnValue dlt_register_context ( DltContext handle,
const char *  contextid,
const char *  description 
)

Register a context in the daemon. This function has to be called before first usage of the context.

Parameters
handlepointer to an object containing information about one special logging context
contextidfour byte long character array with the context id
descriptionlong name of the context
Returns
Value from DltReturnValue enum

Definition at line 883 of file dlt_user.c.

References dlt_init(), dlt_register_context_ll_ts(), DLT_RETURN_ERROR, DLT_RETURN_WRONG_PARAMETER, DLT_SEM_FREE, DLT_SEM_LOCK, dlt_user_initialised, DLT_USER_LOG_LEVEL_NOT_SET, DLT_USER_TRACE_STATUS_NOT_SET, dlt_vlog(), and NULL.

Referenced by main(), and stress1().

DltReturnValue dlt_register_context_ll_ts ( DltContext handle,
const char *  contextid,
const char *  description,
int  loglevel,
int  tracestatus 
)

Register a context in the daemon with pre-defined log level and pre-defined trace status. This function has to be called before first usage of the context.

Parameters
handlepointer to an object containing information about one special logging context
contextidfour byte long character array with the context id
descriptionlong name of the context
loglevelThis is the log level to be pre-set for this context (DLT_LOG_DEFAULT is not allowed here)
tracestatusThis is the trace status to be pre-set for this context (DLT_TRACE_STATUS_DEFAULT is not allowed here)
Returns
Value from DltReturnValue enum

Definition at line 911 of file dlt_user.c.

References DltUser::appID, DltContextData::context_description, dlt_ll_ts_type::context_description, DltContext::contextID, dlt_ll_ts_type::contextID, dlt_env_adjust_ll_from_env(), DltUser::dlt_ll_ts, DltUser::dlt_ll_ts_max_num_entries, DltUser::dlt_ll_ts_num_entries, DLT_LOG_MAX, DLT_RETURN_ERROR, DLT_RETURN_WRONG_PARAMETER, DLT_SEM_FREE, DLT_SEM_LOCK, dlt_set_id(), DLT_TRACE_STATUS_MAX, DLT_USER_CONTEXT_ALLOC_SIZE, DLT_USER_INITIAL_LOG_LEVEL, DLT_USER_INITIAL_TRACE_STATUS, dlt_user_log_init(), DLT_USER_LOG_LEVEL_NOT_SET, dlt_user_log_send_register_context(), DLT_USER_TRACE_STATUS_NOT_SET, dlt_vlog(), DltUser::initial_ll_set, dlt_ll_ts_type::injection_table, DltContextData::log_level, dlt_ll_ts_type::log_level, dlt_ll_ts_type::log_level_changed_callback, DltContext::log_level_pos, DltContext::log_level_ptr, dlt_ll_ts_type::log_level_ptr, DltContext::mcnt, dlt_ll_ts_type::nrcallbacks, NULL, DltContextData::trace_status, dlt_ll_ts_type::trace_status, DltContext::trace_status_ptr, and dlt_ll_ts_type::trace_status_ptr.

Referenced by dlt_register_context().

DltReturnValue dlt_register_injection_callback ( DltContext handle,
uint32_t  service_id,
int(*)(uint32_t service_id, void *data, uint32_t length)  dlt_injection_callback 
)

Register callback function called when injection message was received

Parameters
handlepointer to an object containing information about one special logging context
service_idthe service id to be waited for
(*dlt_injection_callback)function pointer to callback function
Returns
Value from DltReturnValue enum

Definition at line 2377 of file dlt_user.c.

References DltUser::dlt_is_file, DltUser::dlt_ll_ts, DLT_RETURN_ERROR, DLT_RETURN_OK, DLT_RETURN_WRONG_PARAMETER, DLT_SEM_FREE, DLT_SEM_LOCK, DLT_USER_INJECTION_MIN, dlt_user_log_init(), DltUserInjectionCallback::injection_callback, dlt_ll_ts_type::injection_table, DltContext::log_level_pos, dlt_ll_ts_type::nrcallbacks, NULL, service_id, and DltUserInjectionCallback::service_id.

Referenced by main().

DltReturnValue dlt_register_log_level_changed_callback ( DltContext handle,
void(*)(char context_id[DLT_ID_SIZE], uint8_t log_level, uint8_t trace_status)  dlt_log_level_changed_callback 
)

Register callback function called when log level of context was changed

Parameters
handlepointer to an object containing information about one special logging context
(*dlt_log_level_changed_callback)function pointer to callback function
Returns
Value from DltReturnValue enum

Definition at line 2463 of file dlt_user.c.

References DltUser::dlt_is_file, DltUser::dlt_ll_ts, DLT_RETURN_ERROR, DLT_RETURN_OK, DLT_SEM_FREE, DLT_SEM_LOCK, dlt_user_log_init(), dlt_ll_ts_type::log_level_changed_callback, DltContext::log_level_pos, and NULL.

DltReturnValue dlt_set_application_ll_ts_limit ( DltLogLevelType  loglevel,
DltTraceStatusType  tracestatus 
)

Set maximum logged log level and trace status of application

Parameters
loglevelThis is the log level to be set for the whole application
tracestatusThis is the trace status to be set for the whole application
Returns
Value from DltReturnValue enum

Definition at line 1208 of file dlt_user.c.

References DltUser::appID, dlt_init(), DltUser::dlt_ll_ts, DltUser::dlt_ll_ts_num_entries, DLT_LOG_MAX, DLT_RETURN_ERROR, DLT_RETURN_WRONG_PARAMETER, DLT_SEM_FREE, DLT_SEM_LOCK, dlt_send_app_ll_ts_limit(), DLT_TRACE_STATUS_MAX, dlt_user_initialised, dlt_vlog(), dlt_ll_ts_type::log_level, dlt_ll_ts_type::log_level_ptr, NULL, dlt_ll_ts_type::trace_status, and dlt_ll_ts_type::trace_status_ptr.

Referenced by test7f(), test8f(), and test9f().

DltReturnValue dlt_set_log_mode ( DltUserLogMode  mode)

Set the logging mode used by the daemon. The logging mode is stored persistantly by the daemon.

See also
DltUserLogMode
Parameters
modethe new logging mode used by the daemon: off, extern, internal, both.
Returns
Value from DltReturnValue enum

Definition at line 1281 of file dlt_user.c.

References dlt_init(), DLT_RETURN_ERROR, DLT_RETURN_WRONG_PARAMETER, dlt_user_initialised, dlt_user_log_send_log_mode(), DLT_USER_MODE_MAX, and dlt_vlog().

Referenced by main().

int dlt_set_resend_timeout_atexit ( uint32_t  timeout_in_milliseconds)

Set maximum timeout for re-sending at exit

Parameters
timeout_in_millisecondsmaximum time to wait until giving up re-sending, default 10000 (equals to 10 seconds)

Definition at line 1301 of file dlt_user.c.

References dlt_init(), dlt_user_initialised, and DltUser::timeout_at_exit_handler.

Referenced by DLT_DECLARE_CONTEXT(), and main().

DltReturnValue dlt_unregister_app ( void  )

Unregister an application in the daemon. This function has to be called when finishing using an application.

Returns
Value from DltReturnValue enum

Definition at line 1118 of file dlt_user.c.

References DltUser::appID, DltUser::application_description, DLT_RETURN_ERROR, DLT_RETURN_OK, DLT_SEM_FREE, DLT_SEM_LOCK, dlt_set_id(), dlt_user_initialised, dlt_user_log_send_unregister_application(), dlt_vlog(), and NULL.

Referenced by dlt_user_atexit_handler(), and main().

DltReturnValue dlt_use_extended_header_for_non_verbose ( int8_t  use_extende_header_for_non_verbose)

Use extended header in non verbose mode. Enabled by default.

Parameters
use_extende_header_for_non_verboseUse extended header for non verbose mode if true
Returns
Value from DltReturnValue enum

Definition at line 3212 of file dlt_user.c.

References dlt_init(), DLT_RETURN_ERROR, DLT_RETURN_OK, dlt_user_initialised, dlt_vlog(), and DltUser::use_extende_header_for_non_verbose.

int dlt_user_atexit_blow_out_user_buffer ( void  )

Try to resend log message in the user buffer. Stops if the dlt_uptime is bigger than dlt_uptime() + DLT_USER_ATEXIT_RESEND_BUFFER_EXIT_TIMEOUT. A pause between the resending attempts can be defined with DLT_USER_ATEXIT_RESEND_BUFFER_SLEEP

Returns
number of messages in the user buffer

Definition at line 621 of file dlt_user.c.

References dlt_buffer_get_message_count(), DltUser::dlt_log_handle, DLT_SEM_FREE, DLT_SEM_LOCK, dlt_uptime(), DLT_USER_ATEXIT_RESEND_BUFFER_SLEEP, DLT_USER_BUFFER_LENGTH, dlt_user_log_reattach_to_daemon(), dlt_user_log_resend_buffer(), dlt_user_log_send_overflow(), dlt_vnlog(), DltUser::overflow_counter, DltUser::startup_buffer, and DltUser::timeout_at_exit_handler.

Referenced by dlt_user_atexit_handler().

DltReturnValue dlt_user_check_buffer ( int *  total_size,
int *  used_size 
)

Get the total size and available size of the shared memory buffer between daemon and applications. This information is useful to control the flow control between applications and daemon. For example only 50% of the buffer should be used for file transfer.

Parameters
total_sizetotal size of buffer in bytes
used_sizeused size of buffer in bytes
Returns
Value from DltReturnValue enum

Definition at line 4512 of file dlt_user.c.

References dlt_buffer_get_total_size(), dlt_buffer_get_used_size(), DLT_RETURN_OK, DLT_RETURN_WRONG_PARAMETER, DLT_SEM_FREE, DLT_SEM_LOCK, dlt_shm_get_total_size(), dlt_shm_get_used_size(), NULL, and DltUser::startup_buffer.

Referenced by check_buffer(), checkUserBufferForFreeSpace(), send_dumped_file(), testFile1Run2(), and testFile2Run2().

DltReturnValue dlt_user_check_library_version ( const char *  user_major_version,
const char *  user_minor_version 
)

Check the version of dlt library with library version used of the application.

Parameters
Majorversion number of application - see dlt_version.h
Minorversion number of application - see dlt_version.h
Returns
Value from DltReturnValue enum, DLT_RETURN_ERROR if there is a mismatch

Definition at line 165 of file dlt_user.c.

References dlt_get_major_version(), dlt_get_minor_version(), DLT_RETURN_ERROR, DLT_RETURN_OK, DLT_USER_BUFFER_LENGTH, DLT_USER_MAX_LIB_VERSION_LENGTH, and dlt_vnlog().

Referenced by dlt_check_library_version().

static DltReturnValue dlt_user_is_logLevel_enabled ( DltContext handle,
DltLogLevelType  loglevel 
)
inlinestatic

Checks the log level passed by the log function if enabled for that context or not. This function can be called by applications before generating their logs. Also called before writing new log messages.

Parameters
handlepointer to an object containing information about one special logging context
loglevelthis is the current log level of the log message to be sent
Returns
Value from DltReturnValue enum, DLT_RETURN_TRUE if log level is enabled

Definition at line 788 of file dlt_user.h.

References DLT_LOG_OFF, DLT_RETURN_LOGGING_DISABLED, DLT_RETURN_TRUE, DLT_RETURN_WRONG_PARAMETER, DltContext::log_level_ptr, and NULL.

Referenced by dlt_user_log_write_start_id(), and test5f().

DltReturnValue dlt_user_log_write_bool ( DltContextData log,
uint8_t  data 
)

Write a boolean parameter into a DLT log message. dlt_user_log_write_start has to be called before adding any attributes to the log message. Finish sending log message by calling dlt_user_log_write_finish.

Parameters
logpointer to an object containing information about logging context data
databoolean parameter written into log message (mapped to uint8)
Returns
Value from DltReturnValue enum

Definition at line 2245 of file dlt_user.c.

References DltContextData::args_num, DltContextData::buffer, DLT_RETURN_ERROR, DLT_RETURN_OK, DLT_RETURN_USER_BUFFER_FULL, DLT_RETURN_WRONG_PARAMETER, DLT_TYPE_INFO_BOOL, DLT_USER_BUF_MAX_SIZE, dlt_user_initialised, dlt_vlog(), NULL, DltContextData::size, and DltUser::verbose_mode.

Referenced by logToDlt(), test2f(), and test3f().

DltReturnValue dlt_user_log_write_constant_string ( DltContextData log,
const char *  text 
)

Write a constant null terminated ASCII string into a DLT log message. In non verbose mode DLT parameter will not be send at all. dlt_user_log_write_start has to be called before adding any attributes to the log message. Finish sending log message by calling dlt_user_log_write_finish.

Parameters
logpointer to an object containing information about logging context data
textpointer to the parameter written into log message containing null termination.
Returns
Value from DltReturnValue enum

Definition at line 2326 of file dlt_user.c.

References DLT_RETURN_OK, dlt_user_log_write_string(), and DltUser::verbose_mode.

DltReturnValue dlt_user_log_write_finish ( DltContextData log)

Finishing the generation of a DLT log message and sending it to the DLT daemon. This function has to be called after writing all the log attributes of a log message.

Parameters
logpointer to an object containing information about logging context data
Returns
Value from DltReturnValue enum

Definition at line 1482 of file dlt_user.c.

References DLT_RETURN_WRONG_PARAMETER, DLT_TYPE_LOG, dlt_user_log_send_log(), and NULL.

Referenced by dlt_kpi_log_interrupts(), dlt_kpi_log_list(), dlt_log_int(), dlt_log_raw(), dlt_log_string(), dlt_log_string_int(), dlt_log_string_uint(), dlt_log_uint(), main(), test1f(), test2f(), test3f(), test4f(), test6f(), test7f(), test8f(), and test9f().

DltReturnValue dlt_user_log_write_float32 ( DltContextData log,
float32_t  data 
)

Write a float parameter into a DLT log message. dlt_user_log_write_start has to be called before adding any attributes to the log message. Finish sending log message by calling dlt_user_log_write_finish.

Parameters
logpointer to an object containing information about logging context data
datafloat32_t parameter written into log message.
Returns
Value from DltReturnValue enum

Definition at line 1559 of file dlt_user.c.

References DltContextData::args_num, DltContextData::buffer, DLT_RETURN_ERROR, DLT_RETURN_OK, DLT_RETURN_USER_BUFFER_FULL, DLT_RETURN_WRONG_PARAMETER, DLT_TYLE_32BIT, DLT_TYPE_INFO_FLOA, DLT_USER_BUF_MAX_SIZE, dlt_user_initialised, dlt_vlog(), NULL, DltContextData::size, and DltUser::verbose_mode.

Referenced by logToDlt(), main(), test2f(), and test3f().

DltReturnValue dlt_user_log_write_float64 ( DltContextData log,
double  data 
)

Write a double parameter into a DLT log message. dlt_user_log_write_start has to be called before adding any attributes to the log message. Finish sending log message by calling dlt_user_log_write_finish.

Parameters
logpointer to an object containing information about logging context data
datafloat64_t parameter written into log message.
Returns
Value from DltReturnValue enum

Definition at line 1599 of file dlt_user.c.

References DltContextData::args_num, DltContextData::buffer, DLT_RETURN_ERROR, DLT_RETURN_OK, DLT_RETURN_USER_BUFFER_FULL, DLT_RETURN_WRONG_PARAMETER, DLT_TYLE_64BIT, DLT_TYPE_INFO_FLOA, DLT_USER_BUF_MAX_SIZE, dlt_user_initialised, dlt_vlog(), NULL, DltContextData::size, and DltUser::verbose_mode.

Referenced by logToDlt(), test2f(), and test3f().

DltReturnValue dlt_user_log_write_int ( DltContextData log,
int  data 
)

Write a int parameter into a DLT log message. dlt_user_log_write_start has to be called before adding any attributes to the log message. Finish sending log message by calling dlt_user_log_write_finish.

Parameters
logpointer to an object containing information about logging context data
dataint parameter written into log message.
Returns
Value from DltReturnValue enum

Definition at line 2062 of file dlt_user.c.

References DLT_RETURN_ERROR, DLT_RETURN_OK, DLT_RETURN_WRONG_PARAMETER, dlt_user_initialised, dlt_user_log_write_int16(), dlt_user_log_write_int32(), dlt_user_log_write_int64(), dlt_user_log_write_int8(), dlt_vlog(), and NULL.

Referenced by dlt_log_int(), dlt_log_string_int(), main(), test2f(), and test3f().

DltReturnValue dlt_user_log_write_ptr ( DltContextData log,
void *  data 
)

Write a pointer value architecture independent. dlt_user_log_write_start has to be called before adding any attributes to the log message. Finish sending log message by calling dlt_user_log_write_finish.

Parameters
logpointer to an object containing information about logging context data
datavoid* parameter written into log message.
Returns
Value from DltReturnValue enum

Definition at line 2030 of file dlt_user.c.

References DLT_FORMAT_HEX32, DLT_FORMAT_HEX64, DLT_RETURN_ERROR, DLT_RETURN_OK, DLT_RETURN_WRONG_PARAMETER, dlt_user_initialised, dlt_user_log_write_uint32_formatted(), dlt_user_log_write_uint64_formatted(), dlt_vlog(), and NULL.

DltReturnValue dlt_user_log_write_raw ( DltContextData log,
void *  data,
uint16_t  length 
)

Write a binary memory block into a DLT log message. dlt_user_log_write_start has to be called before adding any attributes to the log message. Finish sending log message by calling dlt_user_log_write_finish.

Parameters
logpointer to an object containing information about logging context data
datapointer to the parameter written into log message.
lengthlength in bytes of the parameter written into log message.
Returns
Value from DltReturnValue enum

Definition at line 1490 of file dlt_user.c.

References DLT_FORMAT_DEFAULT, and dlt_user_log_write_raw_formatted().

Referenced by dlt_log_raw(), dlt_user_trace_network_segmented_segment(), dlt_user_trace_network_segmented_start(), dlt_user_trace_network_truncated(), test2f(), test3f(), and test4f().

DltReturnValue dlt_user_log_write_raw_formatted ( DltContextData log,
void *  data,
uint16_t  length,
DltFormatType  type 
)

Write a binary memory block into a DLT log message. dlt_user_log_write_start has to be called before adding any attributes to the log message. Finish sending log message by calling dlt_user_log_write_finish.

Parameters
logpointer to an object containing information about logging context data
datapointer to the parameter written into log message.
lengthlength in bytes of the parameter written into log message.
typethe format information.
Returns
Value from DltReturnValue enum

Definition at line 1495 of file dlt_user.c.

References DltContextData::args_num, DltContextData::buffer, DLT_FORMAT_BIN16, DLT_FORMAT_BIN8, DLT_FORMAT_HEX64, DLT_FORMAT_HEX8, DLT_FORMAT_MAX, DLT_RETURN_ERROR, DLT_RETURN_OK, DLT_RETURN_USER_BUFFER_FULL, DLT_RETURN_WRONG_PARAMETER, DLT_SCOD_BIN, DLT_SCOD_HEX, DLT_TYPE_INFO_RAWD, DLT_USER_BUF_MAX_SIZE, dlt_user_initialised, dlt_vlog(), NULL, DltContextData::size, and DltUser::verbose_mode.

Referenced by dlt_user_log_write_raw().

DltReturnValue dlt_user_log_write_start ( DltContext handle,
DltContextData log,
DltLogLevelType  loglevel 
)
inline

Initialize the generation of a DLT log message (intended for usage in verbose mode) This function has to be called first, when an application wants to send a new log messages. Following functions like dlt_user_log_write_string and dlt_user_log_write_finish must only be called, when return value is bigger than zero.

Parameters
handlepointer to an object containing information about one special logging context
logpointer to an object containing information about logging context data
loglevelthis is the current log level of the log message to be sent
Returns
Value from DltReturnValue enum, DLT_RETURN_TRUE if log level is matching

Definition at line 1428 of file dlt_user.c.

References DLT_USER_DEFAULT_MSGID, and dlt_user_log_write_start_id().

Referenced by dlt_kpi_log_interrupts(), dlt_kpi_log_list(), dlt_log_int(), dlt_log_raw(), dlt_log_string(), dlt_log_string_int(), dlt_log_string_uint(), dlt_log_uint(), main(), test1f(), test2f(), test3f(), test4f(), test6f(), test7f(), test8f(), and test9f().

DltReturnValue dlt_user_log_write_start_id ( DltContext handle,
DltContextData log,
DltLogLevelType  loglevel,
uint32_t  messageid 
)

Initialize the generation of a DLT log message (intended for usage in non-verbose mode) This function has to be called first, when an application wants to send a new log messages. Following functions like dlt_user_log_write_string and dlt_user_log_write_finish must only be called, when return value is bigger than zero.

Parameters
handlepointer to an object containing information about one special logging context
logpointer to an object containing information about logging context data
loglevelthis is the current log level of the log message to be sent
messageidmessage id of message
Returns
Value from DltReturnValue enum, DLT_RETURN_TRUE if log level is matching

Definition at line 1433 of file dlt_user.c.

References DltContextData::args_num, DltContextData::buffer, DltUser::dlt_ll_ts, DLT_LOG_FATAL_RESET_TRAP, DLT_LOG_MAX, DLT_RETURN_ERROR, DLT_RETURN_OK, DLT_RETURN_TRUE, DLT_RETURN_USER_BUFFER_FULL, DLT_RETURN_WRONG_PARAMETER, DLT_USER_BUF_MAX_SIZE, dlt_user_is_logLevel_enabled(), dlt_user_log_init(), dlt_vlog(), DltContextData::log_level, NULL, DltContextData::size, and DltUser::verbose_mode.

Referenced by dlt_user_log_write_start(), main(), and test3f().

DltReturnValue dlt_user_log_write_string ( DltContextData log,
const char *  text 
)

Write a null terminated ASCII string into a DLT log message. dlt_user_log_write_start has to be called before adding any attributes to the log message. Finish sending log message by calling dlt_user_log_write_finish.

Parameters
logpointer to an object containing information about logging context data
textpointer to the parameter written into log message containing null termination.
Returns
Value from DltReturnValue enum

Definition at line 2280 of file dlt_user.c.

References DltContextData::args_num, DltContextData::buffer, DLT_RETURN_ERROR, DLT_RETURN_OK, DLT_RETURN_USER_BUFFER_FULL, DLT_RETURN_WRONG_PARAMETER, DLT_SCOD_ASCII, DLT_TYPE_INFO_STRG, DLT_USER_BUF_MAX_SIZE, dlt_user_initialised, dlt_vlog(), NULL, DltContextData::size, and DltUser::verbose_mode.

Referenced by dlt_kpi_log_interrupts(), dlt_kpi_log_list(), dlt_log_string(), dlt_log_string_int(), dlt_log_string_uint(), dlt_user_log_write_constant_string(), dlt_user_trace_network_segmented_end(), dlt_user_trace_network_segmented_segment(), dlt_user_trace_network_segmented_start(), dlt_user_trace_network_truncated(), main(), test1f(), test2f(), test3f(), test4f(), test6f(), test7f(), test8f(), and test9f().

DltReturnValue dlt_user_log_write_uint ( DltContextData log,
unsigned int  data 
)

Write a uint parameter into a DLT log message. dlt_user_log_write_start has to be called before adding any attributes to the log message. Finish sending log message by calling dlt_user_log_write_finish.

Parameters
logpointer to an object containing information about logging context data
dataunsigned int parameter written into log message.
Returns
Value from DltReturnValue enum

Definition at line 1639 of file dlt_user.c.

References DLT_RETURN_ERROR, DLT_RETURN_OK, DLT_RETURN_WRONG_PARAMETER, dlt_user_initialised, dlt_user_log_write_uint16(), dlt_user_log_write_uint32(), dlt_user_log_write_uint64(), dlt_user_log_write_uint8(), dlt_vlog(), and NULL.

Referenced by dlt_log_string_uint(), dlt_log_uint(), test2f(), and test3f().

DltReturnValue dlt_user_log_write_uint8_formatted ( DltContextData log,
uint8_t  data,
DltFormatType  type 
)

Write a uint parameter into a DLT log message. The output will be formatted as given by the parameter type. dlt_user_log_write_start has to be called before adding any attributes to the log message. Finish sending log message by calling dlt_user_log_write_finish.

Parameters
logpointer to an object containing information about logging context data
dataunsigned int parameter written into log message.
typeThe formatting type of the string output.
Returns
Value from DltReturnValue enum

Definition at line 1822 of file dlt_user.c.

References DltContextData::args_num, DltContextData::buffer, DLT_FORMAT_BIN16, DLT_FORMAT_BIN8, DLT_FORMAT_HEX64, DLT_FORMAT_HEX8, DLT_FORMAT_MAX, DLT_RETURN_ERROR, DLT_RETURN_OK, DLT_RETURN_USER_BUFFER_FULL, DLT_RETURN_WRONG_PARAMETER, DLT_SCOD_BIN, DLT_SCOD_HEX, DLT_TYLE_8BIT, DLT_TYPE_INFO_UINT, DLT_USER_BUF_MAX_SIZE, dlt_user_initialised, dlt_vlog(), NULL, DltContextData::size, and DltUser::verbose_mode.

DltReturnValue dlt_user_log_write_utf8_string ( DltContextData log,
const char *  text 
)

Write a null terminated UTF8 string into a DLT log message. dlt_user_log_write_start has to be called before adding any attributes to the log message. Finish sending log message by calling dlt_user_log_write_finish.

Parameters
logpointer to an object containing information about logging context data
textpointer to the parameter written into log message containing null termination.
Returns
Value from DltReturnValue enum

Definition at line 2332 of file dlt_user.c.

References DltContextData::args_num, DltContextData::buffer, DLT_RETURN_ERROR, DLT_RETURN_OK, DLT_RETURN_USER_BUFFER_FULL, DLT_RETURN_WRONG_PARAMETER, DLT_SCOD_UTF8, DLT_TYPE_INFO_STRG, DLT_USER_BUF_MAX_SIZE, dlt_user_initialised, dlt_vlog(), NULL, DltContextData::size, and DltUser::verbose_mode.

Referenced by logToDlt().

DltReturnValue dlt_user_trace_network ( DltContext handle,
DltNetworkTraceType  nw_trace_type,
uint16_t  header_len,
void *  header,
uint16_t  payload_len,
void *  payload 
)

Trace network message

Parameters
handlepointer to an object containing information about one special logging context
nw_trace_typetype of network trace (DLT_NW_TRACE_IPC, DLT_NW_TRACE_CAN, DLT_NW_TRACE_FLEXRAY, or DLT_NW_TRACE_MOST)
header_lenlength of network message header
headerpointer to network message header
payload_lenlength of network message payload
payloadpointer to network message payload
Returns
Value from DltReturnValue enum

Definition at line 2850 of file dlt_user.c.

References dlt_user_trace_network_truncated().

Referenced by dlt_user_trace_network_segmented(), and test7f().

DltReturnValue dlt_user_trace_network_segmented ( DltContext handle,
DltNetworkTraceType  nw_trace_type,
uint16_t  header_len,
void *  header,
uint16_t  payload_len,
void *  payload 
)

Trace network message in segmented asynchronous mode. The sending of the data is done in a separate thread. Please note that handle must exist for the lifetime of the application, because data chunks are sent asynchronously in undetermined future time.

Parameters
handlepointer to an object containing information about logging context
nw_trace_typetype of network trace (DLT_NW_TRACE_IPC, DLT_NW_TRACE_CAN, DLT_NW_TRACE_FLEXRAY, or DLT_NW_TRACE_MOST)
header_lenlength of network message header
headerpointer to network message header
payload_lenlength of network message payload
payloadpointer to network message payload
Returns
Value from DltReturnValue enum

Definition at line 2770 of file dlt_user.c.

References dlt_init_message_queue(), dlt_log(), DLT_RETURN_BUFFER_FULL, DLT_RETURN_ERROR, DLT_RETURN_OK, DltUser::dlt_segmented_queue_write_handle, DLT_USER_BUF_MAX_SIZE, dlt_user_trace_network(), dlt_user_trace_network_segmented_start(), dlt_vnlog(), s_segmented_data::handle, s_segmented_data::header, s_segmented_data::header_len, s_segmented_data::id, NULL, nw_trace_type, s_segmented_data::nw_trace_type, s_segmented_data::payload, and s_segmented_data::payload_len.

Referenced by test9f().

DltReturnValue dlt_user_trace_network_truncated ( DltContext handle,
DltNetworkTraceType  nw_trace_type,
uint16_t  header_len,
void *  header,
uint16_t  payload_len,
void *  payload,
int  allow_truncate 
)

Trace network message, truncated if necessary.

Parameters
handlepointer to an object containing information about logging context
nw_trace_typetype of network trace (DLT_NW_TRACE_IPC, DLT_NW_TRACE_CAN, DLT_NW_TRACE_FLEXRAY, or DLT_NW_TRACE_MOST)
header_lenlength of network message header
headerpointer to network message header
payload_lenlength of network message payload
payloadpointer to network message payload
allow_truncateSet to > 0 to allow truncating of the message if it is too large.
Returns
Value from DltReturnValue enum

Calculate maximum available space in sending buffer after headers.

Definition at line 2855 of file dlt_user.c.

References DltContextData::args_num, DltUser::dlt_ll_ts, DLT_NW_TRACE_MAX, DLT_RETURN_ERROR, DLT_RETURN_OK, DLT_RETURN_WRONG_PARAMETER, DLT_TRACE_STATUS_ON, DLT_TYPE_NW_TRACE, DLT_USER_BUF_MAX_SIZE, dlt_user_log_init(), dlt_user_log_send_log(), dlt_user_log_write_raw(), dlt_user_log_write_string(), dlt_user_log_write_uint32(), dlt_vlog(), NULL, nw_trace_type, DltContextData::size, DltContextData::trace_status, and DltContext::trace_status_ptr.

Referenced by dlt_user_trace_network(), and test8f().

DltReturnValue dlt_verbose_mode ( void  )

Switch to verbose mode

Returns
Value from DltReturnValue enum

Definition at line 3178 of file dlt_user.c.

References dlt_init(), DLT_RETURN_ERROR, DLT_RETURN_OK, dlt_user_initialised, dlt_vlog(), and DltUser::verbose_mode.

Referenced by main(), and test3f().

DltReturnValue dlt_with_ecu_id ( int8_t  with_ecu_id)

Send ecu id configuration. Enabled by default.

Parameters
with_ecu_idSend ecu id in each message if enabled
Returns
Value from DltReturnValue enum

Definition at line 3263 of file dlt_user.c.

References dlt_init(), DLT_RETURN_ERROR, DLT_RETURN_OK, dlt_user_initialised, dlt_vlog(), and DltUser::with_ecu_id.

Referenced by main().

DltReturnValue dlt_with_session_id ( int8_t  with_session_id)

Send session id configuration. Enabled by default.

Parameters
with_session_idSend session id in each message if enabled
Returns
Value from DltReturnValue enum

Definition at line 3229 of file dlt_user.c.

References dlt_init(), DLT_RETURN_ERROR, DLT_RETURN_OK, dlt_user_initialised, dlt_vlog(), and DltUser::with_session_id.

Referenced by main().

DltReturnValue dlt_with_timestamp ( int8_t  with_timestamp)

Send timestamp configuration. Enabled by default.

Parameters
with_timestampSend timestamp id in each message if enabled
Returns
Value from DltReturnValue enum

Definition at line 3246 of file dlt_user.c.

References dlt_init(), DLT_RETURN_ERROR, DLT_RETURN_OK, dlt_user_initialised, dlt_vlog(), and DltUser::with_timestamp.

Referenced by main().