From 9a91fe28c05c54f7428325b0290a29c28966ae56 Mon Sep 17 00:00:00 2001 From: Alexander Wenzel Date: Mon, 19 May 2014 14:23:55 +0200 Subject: DLT_CSTRING implementation non verbose mode. Signed-off-by: Alexander Wenzel --- include/dlt/dlt_common_api.h | 4 ++-- include/dlt/dlt_user.h | 13 ++++++++++++- include/dlt/dlt_user_macros.h | 7 +++++++ 3 files changed, 21 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/dlt/dlt_common_api.h b/include/dlt/dlt_common_api.h index 83acac5..f849567 100644 --- a/include/dlt/dlt_common_api.h +++ b/include/dlt/dlt_common_api.h @@ -234,8 +234,8 @@ * In the future in none verbose mode the string will not be sent via DLT message. * @param TEXT ASCII string */ -#define DLT_CSTRING(TEXT) \ - DLT_STRING(TEXT) +/* #define DLT_CSTRING(TEXT) */ +/* UNCHANGED */ #endif /* DLT_COMMON_API_H */ diff --git a/include/dlt/dlt_user.h b/include/dlt/dlt_user.h index 93ac0a0..7d41896 100644 --- a/include/dlt/dlt_user.h +++ b/include/dlt/dlt_user.h @@ -354,7 +354,18 @@ int dlt_user_log_write_int64(DltContextData *log, int64_t data); */ int dlt_user_log_write_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. + * @param log pointer to an object containing information about logging context data + * @param text pointer to the parameter written into log message containing null termination. + * @return negative value if there was an error + */ +int dlt_user_log_write_constant_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. diff --git a/include/dlt/dlt_user_macros.h b/include/dlt/dlt_user_macros.h index 3b6bb06..37a8ccf 100644 --- a/include/dlt/dlt_user_macros.h +++ b/include/dlt/dlt_user_macros.h @@ -206,6 +206,13 @@ extern DltContext CONTEXT; #define DLT_STRING(TEXT) \ dlt_user_log_write_string(&log,TEXT) +/** + * Add constant string parameter to the log messsage. + * @param TEXT Constant ASCII string + */ +#define DLT_CSTRING(TEXT) \ + dlt_user_log_write_constant_string(&log,TEXT) + /** * Add utf8-encoded string parameter to the log messsage. * @param TEXT UTF8-encoded string -- cgit v1.2.1