DLT_CSTRING implementation non verbose mode.
[profile/ivi/dlt-daemon.git] / src / lib / dlt_user.c
index 6c55a3b..2d04467 100644 (file)
@@ -405,6 +405,12 @@ 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;
+
+    /* With timestamp is enabled by default */
+    dlt_user.with_ecu_id= DLT_USER_WITH_ECU_ID;
+
     /* Local print is disabled by default */
     dlt_user.enable_local_print = 0;
 
@@ -1847,6 +1853,17 @@ int dlt_user_log_write_string(DltContextData *log, const char *text)
     return 0;
 }
 
+int dlt_user_log_write_constant_string(DltContextData *log, const char *text)
+{
+    /* Send parameter only in verbose mode */
+    if (dlt_user.verbose_mode)
+    {
+       return dlt_user_log_write_string(log,text);
+    }
+
+    return 0;
+}
+
 int dlt_user_log_write_utf8_string(DltContextData *log, const char *text)
 {
     uint16_t arg_size;
@@ -2742,6 +2759,38 @@ 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_with_ecu_id(int8_t with_ecu_id)
+{
+    if (dlt_user_initialised==0)
+    {
+        if (dlt_init()<0)
+        {
+            return -1;
+        }
+    }
+
+    /* Set with_timestamp */
+    dlt_user.with_ecu_id = with_ecu_id;
+
+    return 0;
+}
+
 int dlt_enable_local_print(void)
 {
     if (dlt_user_initialised==0)
@@ -2921,7 +2970,19 @@ 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_PROTOCOL_VERSION1 ;
+
+    /* send ecu id */
+    if(dlt_user.with_ecu_id)
+    {
+               msg.standardheader->htyp |= DLT_HTYP_WEID;
+    }
+
+    /* send timestamp */
+    if(dlt_user.with_timestamp)
+    {
+               msg.standardheader->htyp |= DLT_HTYP_WTMS;
+    }
 
     /* send session id */
     if(dlt_user.with_session_id)