diff options
author | Lassi Marttala <Lassi.LM.Marttala@partner.bmw.de> | 2012-09-26 09:35:52 +0200 |
---|---|---|
committer | Alexander Wenzel <Alexander.AW.Wenzel@bmw.de> | 2012-11-26 12:39:25 +0100 |
commit | 94c7cdfba0aab20254d37f765c7faea7f6c447f4 (patch) | |
tree | 48d8f080a0279997893cde1d94b85d014efaf485 /include | |
parent | 6e71f85408aea783cc21b98555da868d335e7c00 (diff) | |
download | DLT-daemon-94c7cdfba0aab20254d37f765c7faea7f6c447f4.tar.gz |
[GDLT-120]: Segmented Network Trace: Prepare for rewrite.
This is a combination of 2 commits. Original descriptions below.
[GDLT-120]: Remove dlt_queue. Only usage replace with POSIX queue.
[GDLT-120]: Improve documentation. Add a note about context having to be
pesistent thorough application lifetime.
[GDLT-120]: Add macro interface.
Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/dlt/dlt_user.h | 9 | ||||
-rw-r--r-- | include/dlt/dlt_user_macros.h | 28 |
2 files changed, 34 insertions, 3 deletions
diff --git a/include/dlt/dlt_user.h b/include/dlt/dlt_user.h index 60d163f..cfbd2d8 100644 --- a/include/dlt/dlt_user.h +++ b/include/dlt/dlt_user.h @@ -364,8 +364,8 @@ int dlt_user_log_write_raw(DltContextData *log,void *data,uint16_t length); int 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, truncated if necessary - * @param handle pointer to an object containing information about one special logging context + * Trace network message, truncated if necessary. + * @param handle pointer to an object containing information about logging context * @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) * @param header_len length of network message header * @param header pointer to network message header @@ -379,7 +379,9 @@ int dlt_user_trace_network_truncated(DltContext *handle, DltNetworkTraceType nw_ /** * Trace network message in segmented asynchronous mode. * The sending of the data is done in a separate thread. - * @param handle pointer to an object containing information about one special logging context + * Please note that handle must exist for the lifetime of the application, because + * data chunks are sent asynchronously in undetermined future time. + * @param handle pointer to an object containing information about logging context * @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) * @param header_len length of network message header * @param header pointer to network message header @@ -597,6 +599,7 @@ int dlt_log_uint(DltContext *handle,DltLogLevelType loglevel, unsigned int data) */ int dlt_log_raw(DltContext *handle,DltLogLevelType loglevel, void *data,uint16_t length); + /** * Forward a complete DLT message to the DLT daemon * @param msgdata Message data of DLT message diff --git a/include/dlt/dlt_user_macros.h b/include/dlt/dlt_user_macros.h index d3d6f42..20f605d 100644 --- a/include/dlt/dlt_user_macros.h +++ b/include/dlt/dlt_user_macros.h @@ -289,6 +289,34 @@ extern DltContext CONTEXT; }while(0) /** + * Trace network message, allow truncation + * @param CONTEXT object containing information about one special logging context + * @param TYPE type of network trace message + * @param HEADERLEN length of network message header + * @param HEADER pointer to network message header + * @param PAYLOADLEN length of network message payload + * @param PAYLOAD pointer to network message payload + */ +#define DLT_TRACE_NETWORK_TRUNCATED(CONTEXT,TYPE,HEADERLEN,HEADER,PAYLOADLEN,PAYLOAD) \ + do { \ + dlt_user_trace_network_truncated(&(CONTEXT),TYPE,HEADERLEN,HEADER,PAYLOADLEN,PAYLOAD, 1); \ + }while(0) + +/** + * Trace network message, segment large messages + * @param CONTEXT object containing information about one special logging context + * @param TYPE type of network trace message + * @param HEADERLEN length of network message header + * @param HEADER pointer to network message header + * @param PAYLOADLEN length of network message payload + * @param PAYLOAD pointer to network message payload + */ +#define DLT_TRACE_NETWORK_SEGMENTED(CONTEXT,TYPE,HEADERLEN,HEADER,PAYLOADLEN,PAYLOAD) \ + do { \ + dlt_user_trace_network_segmented(&(CONTEXT),TYPE,HEADERLEN,HEADER,PAYLOADLEN,PAYLOAD); \ + }while(0) + +/** * Send log message with string parameter. * @param CONTEXT object containing information about one special logging context * @param LOGLEVEL the log level of the log message |