3 * Copyright (C) 2012 BMW AG
5 * This file is part of GENIVI Project Dlt - Diagnostic Log and Trace console apps.
7 * Contributions are licensed to the GENIVI Alliance under one or more
8 * Contribution License Agreements.
11 * This Source Code Form is subject to the terms of the
12 * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
13 * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
16 * \author Alexander Wenzel <alexander.aw.wenzel@bmw.de> BMW 2011-2012
19 * For further information see http://www.genivi.org/.
24 /*******************************************************************************
26 ** SRC-MODULE: dlt_user.h **
32 ** AUTHOR : Alexander Wenzel Alexander.AW.Wenzel@bmw.de **
39 ** PLATFORM DEPENDANT [yes/no]: yes **
41 ** TO BE CHANGED BY USER [yes/no]: no **
43 *******************************************************************************/
45 /*******************************************************************************
47 ********************************************************************************
49 ** Initials Name Company **
50 ** -------- ------------------------- ---------------------------------- **
51 ** aw Alexander Wenzel BMW **
52 ** mk Markus Klein Fraunhofer ESK **
53 *******************************************************************************/
55 /*******************************************************************************
56 ** Revision Control History **
57 *******************************************************************************/
60 * $LastChangedRevision: 1670 $
61 * $LastChangedDate: 2011-04-08 15:12:06 +0200 (Fr, 08. Apr 2011) $
71 \defgroup userapi DLT User API
75 #include "dlt_types.h"
76 #include "dlt_common.h"
77 #include "dlt_user_macros.h"
81 #if !defined (__WIN32__)
82 #include <semaphore.h>
90 * Definitions of DLT log level
94 DLT_LOG_DEFAULT = -1, /**< Default log level */
95 DLT_LOG_OFF = 0x00, /**< Log level off */
96 DLT_LOG_FATAL = 0x01, /**< fatal system error */
97 DLT_LOG_ERROR = 0x02, /**< error with impact to correct functionality */
98 DLT_LOG_WARN = 0x03, /**< warning, correct behaviour could not be ensured */
99 DLT_LOG_INFO = 0x04, /**< informational */
100 DLT_LOG_DEBUG = 0x05, /**< debug */
101 DLT_LOG_VERBOSE = 0x06 /**< highest grade of information */
105 * Definitions of DLT trace status
109 DLT_TRACE_STATUS_DEFAULT = -1, /**< Default trace status */
110 DLT_TRACE_STATUS_OFF = 0x00, /**< Trace status: Off */
111 DLT_TRACE_STATUS_ON = 0x01 /**< Trace status: On */
112 } DltTraceStatusType;
115 * Definitions for dlt_user_trace_network/DLT_TRACE_NETWORK()
116 * as defined in the DLT protocol
120 DLT_NW_TRACE_IPC = 0x01, /**< Interprocess communication */
121 DLT_NW_TRACE_CAN = 0x02, /**< Controller Area Network Bus */
122 DLT_NW_TRACE_FLEXRAY = 0x03, /**< Flexray Bus */
123 DLT_NW_TRACE_MOST = 0x04, /**< Media Oriented System Transport Bus */
124 DLT_NW_TRACE_RESERVED0 = 0x05,
125 DLT_NW_TRACE_RESERVED1 = 0x06,
126 DLT_NW_TRACE_RESERVED2 = 0x07,
127 DLT_NW_TRACE_USER_DEFINED0 = 0x08,
128 DLT_NW_TRACE_USER_DEFINED1 = 0x09,
129 DLT_NW_TRACE_USER_DEFINED2 = 0x0A,
130 DLT_NW_TRACE_USER_DEFINED3 = 0x0B,
131 DLT_NW_TRACE_USER_DEFINED4 = 0x0C,
132 DLT_NW_TRACE_USER_DEFINED5 = 0x0D,
133 DLT_NW_TRACE_USER_DEFINED6 = 0x0E,
134 DLT_NW_TRACE_USER_DEFINED7 = 0x0F
135 } DltNetworkTraceType;
138 * This are the log modes.
142 DLT_USER_MODE_UNDEFINED = -1,
143 DLT_USER_MODE_OFF = 0,
144 DLT_USER_MODE_EXTERNAL ,
145 DLT_USER_MODE_INTERNAL ,
149 #define DLT_USER_BUF_MAX_SIZE 2048 /**< maximum size of each user buffer, also used for injection buffer */
151 #define DLT_USER_RESENDBUF_MAX_SIZE (DLT_USER_BUF_MAX_SIZE + 100) /**< Size of resend buffer; Max DLT message size is 2K plus some extra header space */
153 /* Use a semaphore or mutex from your OS to prevent concurrent access to the DLT buffer. */
154 #define DLT_SEM_LOCK() { sem_wait(&dlt_mutex); }
155 #define DLT_SEM_FREE() { sem_post(&dlt_mutex); }
158 * This structure is used for every context used in an application.
162 char contextID[4]; /**< context id */
163 int32_t log_level_pos; /**< offset in user-application context field */
164 int8_t *log_level_ptr; /**< pointer to the log level */
165 int8_t *trace_status_ptr; /**< pointer to the trace status */
166 uint8_t mcnt; /**< message counter */
170 * This structure is used for context data used in an application.
174 DltContext *handle; /**< pointer to DltContext */
175 unsigned char buffer[DLT_USER_BUF_MAX_SIZE]; /**< buffer for building log message*/
176 int32_t size; /**< payload size */
177 int32_t log_level; /**< log level */
178 int32_t trace_status; /**< trace status */
179 int32_t args_num; /**< number of arguments for extended header*/
180 char* context_description; /**< description of context */
186 int (*injection_callback)(uint32_t service_id, void *data, uint32_t length);
187 } DltUserInjectionCallback;
190 * This structure is used in a table managing all contexts and the corresponding log levels in an application.
194 char contextID[DLT_ID_SIZE]; /**< Context ID */
195 int8_t log_level; /**< Log level */
196 int8_t *log_level_ptr; /**< Ptr to the log level */
197 int8_t trace_status; /**< Trace status */
198 int8_t *trace_status_ptr; /**< Ptr to the trace status */
199 char *context_description; /**< description of context */
200 DltUserInjectionCallback *injection_table; /**< Table with pointer to injection functions and service ids */
201 uint32_t nrcallbacks;
205 * This structure is used once for one application.
209 char ecuID[DLT_ID_SIZE]; /**< ECU ID */
210 char appID[DLT_ID_SIZE]; /**< Application ID */
211 int dlt_log_handle; /**< Handle to fifo of dlt daemon */
212 int dlt_user_handle; /**< Handle to own fifo */
213 mqd_t dlt_segmented_queue_read_handle; /**< Handle message queue */
214 mqd_t dlt_segmented_queue_write_handle; /**< Handle message queue */
215 pthread_t dlt_segmented_nwt_handle; /**< thread handle of segmented sending */
217 int8_t dlt_is_file; /**< Target of logging: 1 to file, 0 to daemon */
219 dlt_ll_ts_type *dlt_ll_ts; //[MAX_DLT_LL_TS_ENTRIES]; /**< Internal management struct for all contexts */
220 uint32_t dlt_ll_ts_max_num_entries; /**< Maximum number of contexts */
222 uint32_t dlt_ll_ts_num_entries; /**< Number of used contexts */
224 int8_t overflow; /**< Overflow marker, set to 1 on overflow, 0 otherwise */
225 uint32_t overflow_counter; /**< Counts the number of lost messages */
227 char *application_description; /**< description of application */
229 DltReceiver receiver; /**< Receiver for internal user-defined messages from daemon */
231 int8_t verbose_mode; /**< Verbose mode enabled: 1 enabled, 0 disabled */
232 int8_t use_extende_header_for_non_verbose; /**< Use extended header for non verbose: 1 enabled, 0 disabled */
233 int8_t with_session_id; /**< Send always session id: 1 enabled, 0 disabled */
234 int8_t with_timestamp; /**< Send always timestamp: 1 enabled, 0 disabled */
235 int8_t with_ecu_id; /**< Send always ecu id: 1 enabled, 0 disabled */
237 int8_t enable_local_print; /**< Local printing of log messages: 1 enabled, 0 disabled */
238 int8_t local_print_mode; /**< Local print mode, controlled by environment variable */
240 int8_t log_state; /**< Log state of external connection: 1 client connected, 0 not connected, -1 unknown */
242 //DltRingBuffer rbuf;
243 DltBuffer startup_buffer; /**< Ring-buffer for buffering messages during startup and missing connection */
245 // Buffer used for resending, locked by DLT semaphore
246 uint8_t resend_buffer[DLT_USER_RESENDBUF_MAX_SIZE];
248 #ifdef DLT_SHM_ENABLE
251 #ifdef DLT_TEST_ENABLE
252 int corrupt_user_header;
253 int corrupt_message_size;
254 int16_t corrupt_message_size_size;
258 /**************************************************************************************************
259 * The folowing API functions define a low level function interface for DLT
260 **************************************************************************************************/
263 * Initialise the generation of a DLT log message (intended for usage in non-verbose mode)
264 * This function has to be called first, when an application wants to send a new log messages.
265 * @param handle pointer to an object containing information about one special logging context
266 * @param log pointer to an object containing information about logging context data
267 * @param loglevel this is the current log level of the log message to be sent
268 * @return negative value if there was an error
270 int dlt_user_log_write_start(DltContext *handle, DltContextData *log, DltLogLevelType loglevel);
273 * Initialise the generation of a DLT log message (intended for usage in verbose mode)
274 * This function has to be called first, when an application wants to send a new log messages.
275 * @param handle pointer to an object containing information about one special logging context
276 * @param log pointer to an object containing information about logging context data
277 * @param loglevel this is the current log level of the log message to be sent
278 * @param messageid message id of message
279 * @return negative value if there was an error
281 int dlt_user_log_write_start_id(DltContext *handle, DltContextData *log, DltLogLevelType loglevel, uint32_t messageid);
284 * Finishing the generation of a DLT log message and sending it to the DLT daemon.
285 * This function has to be called after writing all the log attributes of a log message.
286 * @param log pointer to an object containing information about logging context data
287 * @return negative value if there was an error
289 int dlt_user_log_write_finish(DltContextData *log);
292 * Write a boolean parameter into a DLT log message.
293 * dlt_user_log_write_start has to be called before adding any attributes to the log message.
294 * Finish sending log message by calling dlt_user_log_write_finish.
295 * @param log pointer to an object containing information about logging context data
296 * @param data boolean parameter written into log message (mapped to uint8)
297 * @return negative value if there was an error
299 int dlt_user_log_write_bool(DltContextData *log, uint8_t data);
302 * Write a float parameter into a DLT log message.
303 * dlt_user_log_write_start has to be called before adding any attributes to the log message.
304 * Finish sending log message by calling dlt_user_log_write_finish.
305 * @param log pointer to an object containing information about logging context data
306 * @param data float32_t parameter written into log message.
307 * @return negative value if there was an error
309 int dlt_user_log_write_float32(DltContextData *log, float32_t data);
312 * Write a double parameter into a DLT log message.
313 * dlt_user_log_write_start has to be called before adding any attributes to the log message.
314 * Finish sending log message by calling dlt_user_log_write_finish.
315 * @param log pointer to an object containing information about logging context data
316 * @param data float64_t parameter written into log message.
317 * @return negative value if there was an error
319 int dlt_user_log_write_float64(DltContextData *log, double data);
322 * Write a uint parameter into a DLT log message.
323 * dlt_user_log_write_start has to be called before adding any attributes to the log message.
324 * Finish sending log message by calling dlt_user_log_write_finish.
325 * @param log pointer to an object containing information about logging context data
326 * @param data unsigned int parameter written into log message.
327 * @return negative value if there was an error
329 int dlt_user_log_write_uint(DltContextData *log, unsigned int data);
330 int dlt_user_log_write_uint8(DltContextData *log, uint8_t data);
331 int dlt_user_log_write_uint16(DltContextData *log, uint16_t data);
332 int dlt_user_log_write_uint32(DltContextData *log, uint32_t data);
333 int dlt_user_log_write_uint64(DltContextData *log, uint64_t data);
335 * Write a int parameter into a DLT log message.
336 * dlt_user_log_write_start has to be called before adding any attributes to the log message.
337 * Finish sending log message by calling dlt_user_log_write_finish.
338 * @param log pointer to an object containing information about logging context data
339 * @param data int parameter written into log message.
340 * @return negative value if there was an error
342 int dlt_user_log_write_int(DltContextData *log, int data);
343 int dlt_user_log_write_int8(DltContextData *log, int8_t data);
344 int dlt_user_log_write_int16(DltContextData *log, int16_t data);
345 int dlt_user_log_write_int32(DltContextData *log, int32_t data);
346 int dlt_user_log_write_int64(DltContextData *log, int64_t data);
348 * Write a null terminated ASCII string into a DLT log message.
349 * dlt_user_log_write_start has to be called before adding any attributes to the log message.
350 * Finish sending log message by calling dlt_user_log_write_finish.
351 * @param log pointer to an object containing information about logging context data
352 * @param text pointer to the parameter written into log message containing null termination.
353 * @return negative value if there was an error
355 int dlt_user_log_write_string( DltContextData *log, const char *text);
358 * Write a constant null terminated ASCII string into a DLT log message.
359 * In non verbose mode DLT parameter will not be send at all.
360 * dlt_user_log_write_start has to be called before adding any attributes to the log message.
361 * Finish sending log message by calling dlt_user_log_write_finish.
362 * @param log pointer to an object containing information about logging context data
363 * @param text pointer to the parameter written into log message containing null termination.
364 * @return negative value if there was an error
366 int dlt_user_log_write_constant_string( DltContextData *log, const char *text);
369 * Write a null terminated UTF8 string into a DLT log message.
370 * dlt_user_log_write_start has to be called before adding any attributes to the log message.
371 * Finish sending log message by calling dlt_user_log_write_finish.
372 * @param log pointer to an object containing information about logging context data
373 * @param text pointer to the parameter written into log message containing null termination.
374 * @return negative value if there was an error
376 int dlt_user_log_write_utf8_string(DltContextData *log, const char *text);
379 * Write a binary memory block into a DLT log message.
380 * dlt_user_log_write_start has to be called before adding any attributes to the log message.
381 * Finish sending log message by calling dlt_user_log_write_finish.
382 * @param log pointer to an object containing information about logging context data
383 * @param data pointer to the parameter written into log message.
384 * @param length length in bytes of the parameter written into log message.
385 * @return negative value if there was an error
387 int dlt_user_log_write_raw(DltContextData *log,void *data,uint16_t length);
390 * Trace network message
391 * @param handle pointer to an object containing information about one special logging context
392 * @param nw_trace_type type of network trace (DLT_NW_TRACE_IPC, DLT_NW_TRACE_CAN, DLT_NW_TRACE_FLEXRAY, or DLT_NW_TRACE_MOST)
393 * @param header_len length of network message header
394 * @param header pointer to network message header
395 * @param payload_len length of network message payload
396 * @param payload pointer to network message payload
397 * @return negative value if there was an error
399 int dlt_user_trace_network(DltContext *handle, DltNetworkTraceType nw_trace_type, uint16_t header_len, void *header, uint16_t payload_len, void *payload);
402 * Trace network message, truncated if necessary.
403 * @param handle pointer to an object containing information about logging context
404 * @param nw_trace_type type of network trace (DLT_NW_TRACE_IPC, DLT_NW_TRACE_CAN, DLT_NW_TRACE_FLEXRAY, or DLT_NW_TRACE_MOST)
405 * @param header_len length of network message header
406 * @param header pointer to network message header
407 * @param payload_len length of network message payload
408 * @param payload pointer to network message payload
409 * @param allow_truncate Set to > 0 to allow truncating of the message if it is too large.
410 * @return negative value if there was an error
412 int 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);
415 * Trace network message in segmented asynchronous mode.
416 * The sending of the data is done in a separate thread.
417 * Please note that handle must exist for the lifetime of the application, because
418 * data chunks are sent asynchronously in undetermined future time.
419 * @param handle pointer to an object containing information about logging context
420 * @param nw_trace_type type of network trace (DLT_NW_TRACE_IPC, DLT_NW_TRACE_CAN, DLT_NW_TRACE_FLEXRAY, or DLT_NW_TRACE_MOST)
421 * @param header_len length of network message header
422 * @param header pointer to network message header
423 * @param payload_len length of network message payload
424 * @param payload pointer to network message payload
425 * @return 0 on success, -1 on failure
427 int dlt_user_trace_network_segmented(DltContext *handle, DltNetworkTraceType nw_trace_type, uint16_t header_len, void *header, uint16_t payload_len, void *payload);
429 /**************************************************************************************************
430 * The folowing API functions define a high level function interface for DLT
431 **************************************************************************************************/
434 * Initialise the user lib communication with daemon.
435 * This function has to be called first, before using any DLT user lib functions.
436 * @return negative value if there was an error
441 * Initialise the user lib writing only to file.
442 * This function has to be called first, before using any DLT user lib functions.
443 * @param name name of an optional log file
444 * @return negative value if there was an error
446 int dlt_init_file(const char *name);
449 * Terminate the user lib.
450 * This function has to be called when finishing using the DLT user lib.
451 * @return negative value if there was an error
456 * Check the library version of DLT library.
457 * @param user_major_version the major version to be compared
458 * @param user_minor_version the minor version to be compared
459 * @return negative value if there was an error
461 int dlt_check_library_version(const char * user_major_version, const char * user_minor_version);
464 * Register an application in the daemon.
465 * @param appid four byte long character array with the application id
466 * @param description long name of the application
467 * @return negative value if there was an error
469 int dlt_register_app(const char *appid, const char * description);
472 * Unregister an application in the daemon.
473 * This function has to be called when finishing using an application.
474 * @return negative value if there was an error
476 int dlt_unregister_app(void);
479 * Register a context in the daemon.
480 * This function has to be called before first usage of the context.
481 * @param handle pointer to an object containing information about one special logging context
482 * @param contextid four byte long character array with the context id
483 * @param description long name of the context
484 * @return negative value if there was an error
486 int dlt_register_context(DltContext *handle, const char *contextid, const char * description);
489 * Register a context in the daemon with pre-defined log level and pre-defined trace status.
490 * This function has to be called before first usage of the context.
491 * @param handle pointer to an object containing information about one special logging context
492 * @param contextid four byte long character array with the context id
493 * @param description long name of the context
494 * @param loglevel This is the log level to be pre-set for this context
495 (DLT_LOG_DEFAULT is not allowed here)
496 * @param tracestatus This is the trace status to be pre-set for this context
497 (DLT_TRACE_STATUS_DEFAULT is not allowed here)
498 * @return negative value if there was an error
500 int dlt_register_context_ll_ts(DltContext *handle, const char *contextid, const char * description, int loglevel, int tracestatus);
503 * Unregister a context in the DLT daemon.
504 * This function has to be called when finishing using a context.
505 * @param handle pointer to an object containing information about one special logging context
506 * @return negative value if there was an error
508 int dlt_unregister_context(DltContext *handle);
511 * Set the logging mode used by the daemon.
512 * The logging mode is stored persistantly by the daemon.
513 * @see DltUserLogMode
514 * @param mode the new logging mode used by the daemon: off, extern, internal, both.
515 * @return negative value if there was an error
517 int dlt_set_log_mode(DltUserLogMode mode);
520 * Get the state of the connected client to the daemon.
521 * The user application gets a message, when client is connected or disconnected.
522 * This value contains the last state.
523 * It needs some time until the application gets state from the daemon.
524 * Until then the state is "unknown state".
525 * @return -1 = unknown state, 0 = client not connected, 1 = client connected
527 int dlt_get_log_state();
530 * Register callback function called when injection message was received
531 * @param handle pointer to an object containing information about one special logging context
532 * @param service_id the service id to be waited for
533 * @param (*dlt_injection_callback) function pointer to callback function
534 * @return negative value if there was an error
536 int dlt_register_injection_callback(DltContext *handle, uint32_t service_id,
537 int (*dlt_injection_callback)(uint32_t service_id, void *data, uint32_t length));
540 * Switch to verbose mode
543 int dlt_verbose_mode(void);
546 * Check the version of dlt library with library version used of the application.
547 * @param Major version number of application - see dlt_version.h
548 * @param Minor version number of application - see dlt_version.h
549 * @return negative value if there is a mismatch
551 int dlt_user_check_library_version(const char *user_major_version,const char *user_minor_version);
554 * Switch to non-verbose mode
557 int dlt_nonverbose_mode(void);
560 * Use extended header in non verbose mode.
561 * Enabled by default.
562 * @param use_extende_header_for_non_verbose Use extended header for non verbose mode if true
563 * @return negative value if no success
565 int dlt_use_extended_header_for_non_verbose(int8_t use_extende_header_for_non_verbose);
568 * Send session id configuration.
569 * Enabled by default.
570 * @param with_session_id Send session id in each message if enabled
571 * @return negative value if no success
573 int dlt_with_session_id(int8_t with_session_id);
576 * Send timestamp configuration.
577 * Enabled by default.
578 * @param with_timestamp Send timestamp id in each message if enabled
579 * @return negative value if no success
581 int dlt_with_timestamp(int8_t with_timestamp);
584 * Send ecu id configuration.
585 * Enabled by default.
586 * @param with_ecu_id Send ecu id in each message if enabled
587 * @return negative value if no success
589 int dlt_with_ecu_id(int8_t with_ecu_id);
592 * Set maximum logged log level and trace status of application
594 * @param loglevel This is the log level to be set for the whole application
595 * @param tracestatus This is the trace status to be set for the whole application
596 * @return negative value if there was an error
598 int dlt_set_application_ll_ts_limit(DltLogLevelType loglevel, DltTraceStatusType tracestatus);
601 * Enable local printing of messages
604 int dlt_enable_local_print(void);
607 * Disable local printing of messages
610 int dlt_disable_local_print(void);
613 * Write a null terminated ASCII string into a DLT log message.
614 * @param handle pointer to an object containing information about one special logging context
615 * @param loglevel this is the current log level of the log message to be sent
616 * @param text pointer to the ASCII string written into log message containing null termination.
617 * @return negative value if there was an error
619 int dlt_log_string(DltContext *handle,DltLogLevelType loglevel, const char *text);
622 * Write a null terminated ASCII string and an integer value into a DLT log message.
623 * @param handle pointer to an object containing information about one special logging context
624 * @param loglevel this is the current log level of the log message to be sent
625 * @param text pointer to the ASCII string written into log message containing null termination.
626 * @param data integer value written into the log message
627 * @return negative value if there was an error
629 int dlt_log_string_int(DltContext *handle,DltLogLevelType loglevel, const char *text, int data);
632 * Write a null terminated ASCII string and an unsigned integer value into a DLT log message.
633 * @param handle pointer to an object containing information about one special logging context
634 * @param loglevel this is the current log level of the log message to be sent
635 * @param text pointer to the ASCII string written into log message containing null termination.
636 * @param data unsigned integer value written into the log message
637 * @return negative value if there was an error
639 int dlt_log_string_uint(DltContext *handle,DltLogLevelType loglevel, const char *text, unsigned int data);
642 * Write an integer value into a DLT log message.
643 * @param handle pointer to an object containing information about one special logging context
644 * @param loglevel this is the current log level of the log message to be sent
645 * @param data integer value written into the log message
646 * @return negative value if there was an error
648 int dlt_log_int(DltContext *handle,DltLogLevelType loglevel, int data);
651 * Write an unsigned integer value into a DLT log message.
652 * @param handle pointer to an object containing information about one special logging context
653 * @param loglevel this is the current log level of the log message to be sent
654 * @param data unsigned integer value written into the log message
655 * @return negative value if there was an error
657 int dlt_log_uint(DltContext *handle,DltLogLevelType loglevel, unsigned int data);
660 * Write an unsigned integer value into a DLT log message.
661 * @param handle pointer to an object containing information about one special logging context
662 * @param loglevel this is the current log level of the log message to be sent
663 * @param data pointer to the parameter written into log message.
664 * @param length length in bytes of the parameter written into log message.
665 * @return negative value if there was an error
667 int dlt_log_raw(DltContext *handle,DltLogLevelType loglevel, void *data,uint16_t length);
671 * Forward a complete DLT message to the DLT daemon
672 * @param msgdata Message data of DLT message
673 * @param size Size of DLT message
674 * @return negative value if there was an error
676 int dlt_forward_msg(void *msgdata,size_t size);
679 * Get the total size and available size of the shared memory buffer between daemon and applications.
680 * This information is useful to control the flow control between applications and daemon.
681 * For example only 50% of the buffer should be used for file transfer.
682 * @param total_size total size of buffer in bytes
683 * @param used_size used size of buffer in bytes
684 * @return negative value if there was an error
686 int dlt_user_check_buffer(int *total_size, int *used_size);
689 * Try to resend log message in the user buffer. Stops if the dlt_uptime is bigger than
690 * dlt_uptime() + DLT_USER_ATEXIT_RESEND_BUFFER_EXIT_TIMEOUT. A pause between the resending
691 * attempts can be defined with DLT_USER_ATEXIT_RESEND_BUFFER_SLEEP
692 * @return number of messages in the user buffer
694 int dlt_user_atexit_blow_out_user_buffer(void);
697 * Try to resend log message in the user buffer.
698 * @return 0 on success, negative on failure.
700 int dlt_user_log_resend_buffer(void);
702 #ifdef DLT_TEST_ENABLE
703 void dlt_user_test_corrupt_user_header(int enable);
704 void dlt_user_test_corrupt_message_size(int enable,int16_t size);
705 #endif /* DLT_TEST_ENABLE */
715 #endif /* DLT_USER_H */