diff options
Diffstat (limited to 'src/lib/dlt_user.c')
-rw-r--r-- | src/lib/dlt_user.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/lib/dlt_user.c b/src/lib/dlt_user.c index 6c55a3b..b7ab992 100644 --- a/src/lib/dlt_user.c +++ b/src/lib/dlt_user.c @@ -405,6 +405,9 @@ int dlt_init_common(void) /* WIth session id is enabled by default */ dlt_user.with_session_id = DLT_USER_WITH_SESSION_ID; + /* With timestamp is enabled by default */ + dlt_user.with_timestamp= DLT_USER_WITH_TIMESTAMP; + /* Local print is disabled by default */ dlt_user.enable_local_print = 0; @@ -2742,6 +2745,22 @@ int dlt_with_session_id(int8_t with_session_id) return 0; } +int dlt_with_timestamp(int8_t with_timestamp) +{ + if (dlt_user_initialised==0) + { + if (dlt_init()<0) + { + return -1; + } + } + + /* Set with_timestamp */ + dlt_user.with_timestamp = with_timestamp; + + return 0; +} + int dlt_enable_local_print(void) { if (dlt_user_initialised==0) @@ -2921,7 +2940,13 @@ DltReturnValue dlt_user_log_send_log(DltContextData *log, int mtype) } msg.standardheader = (DltStandardHeader*)(msg.headerbuffer + sizeof(DltStorageHeader)); - msg.standardheader->htyp = DLT_HTYP_WEID | DLT_HTYP_WTMS | DLT_HTYP_PROTOCOL_VERSION1 ; + msg.standardheader->htyp = DLT_HTYP_WEID | DLT_HTYP_PROTOCOL_VERSION1 ; + + /* send timestamp */ + if(dlt_user.with_timestamp) + { + msg.standardheader->htyp |= DLT_HTYP_WTMS; + } /* send session id */ if(dlt_user.with_session_id) |