Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
This folder contains several examples of applications using the DLT library. These examples will be extended in the future to show different Use Cases.
Example1: Minimal DLT Example
This folder contains several examples of applications using the DLT library. These examples will be extended in the future to show different Use Cases.
Example1: Minimal DLT Example
-Example2-3: Non Verbose Mode Examples with different AppIdds
+Example2: Non Verbose Mode Examples with different AppIdds and normal Strings
+Example3: Non Verbose Mode Examples with different AppIdds and constant strings
for(num=0;num<10;num++)
{
for(num=0;num<10;num++)
{
- DLT_LOG_ID(con_exa3,DLT_LOG_INFO,DLT_EXA3_CON_EXA3_ID1,DLT_INT32(12345678),DLT_STRING("Hello world 1!"));
- DLT_LOG_ID(con_exa3,DLT_LOG_ERROR,DLT_EXA3_CON_EXA3_ID2,DLT_INT32(87654321),DLT_STRING("Hello world 2!"));
- DLT_LOG_ID(con_exa3,DLT_LOG_WARN,DLT_EXA3_CON_EXA3_ID3,DLT_INT32(11223344),DLT_STRING("Hello world 3!"));
+ DLT_LOG_ID(con_exa3,DLT_LOG_INFO,DLT_EXA3_CON_EXA3_ID1,DLT_INT32(12345678),DLT_CSTRING("Hello world 1!"));
+ DLT_LOG_ID(con_exa3,DLT_LOG_ERROR,DLT_EXA3_CON_EXA3_ID2,DLT_INT32(87654321),DLT_CSTRING("Hello world 2!"));
+ DLT_LOG_ID(con_exa3,DLT_LOG_WARN,DLT_EXA3_CON_EXA3_ID3,DLT_INT32(11223344),DLT_CSTRING("Hello world 3!"));
</fx:PDU>
<fx:PDU ID="PDU_1000_1">
<ho:SHORT-NAME>PDU_1000_1</ho:SHORT-NAME>
</fx:PDU>
<fx:PDU ID="PDU_1000_1">
<ho:SHORT-NAME>PDU_1000_1</ho:SHORT-NAME>
+ <ho:DESC>Hello world 1!</ho:DESC>
<fx:BYTE-LENGTH>0</fx:BYTE-LENGTH>
<fx:PDU-TYPE>OTHER</fx:PDU-TYPE>
<fx:BYTE-LENGTH>0</fx:BYTE-LENGTH>
<fx:PDU-TYPE>OTHER</fx:PDU-TYPE>
- <fx:SIGNAL-INSTANCES>
- <fx:SIGNAL-INSTANCE ID="S_1000_0">
- <fx:SEQUENCE-NUMBER>0</fx:SEQUENCE-NUMBER>
- <fx:SIGNAL-REF ID-REF="S_STRG_ASCII"/>
- </fx:SIGNAL-INSTANCE>
- </fx:SIGNAL-INSTANCES>
</fx:PDU>
<fx:PDU ID="PDU_1001_0">
<ho:SHORT-NAME>PDU_1001_0</ho:SHORT-NAME>
</fx:PDU>
<fx:PDU ID="PDU_1001_0">
<ho:SHORT-NAME>PDU_1001_0</ho:SHORT-NAME>
</fx:PDU>
<fx:PDU ID="PDU_1001_1">
<ho:SHORT-NAME>PDU_1001_1</ho:SHORT-NAME>
</fx:PDU>
<fx:PDU ID="PDU_1001_1">
<ho:SHORT-NAME>PDU_1001_1</ho:SHORT-NAME>
+ <ho:DESC>Hello world 2!</ho:DESC>
<fx:BYTE-LENGTH>0</fx:BYTE-LENGTH>
<fx:PDU-TYPE>OTHER</fx:PDU-TYPE>
<fx:BYTE-LENGTH>0</fx:BYTE-LENGTH>
<fx:PDU-TYPE>OTHER</fx:PDU-TYPE>
- <fx:SIGNAL-INSTANCES>
- <fx:SIGNAL-INSTANCE ID="S_1001_0">
- <fx:SEQUENCE-NUMBER>0</fx:SEQUENCE-NUMBER>
- <fx:SIGNAL-REF ID-REF="S_STRG_ASCII"/>
- </fx:SIGNAL-INSTANCE>
- </fx:SIGNAL-INSTANCES>
</fx:PDU>
<fx:PDU ID="PDU_1002_0">
<ho:SHORT-NAME>PDU_1002_0</ho:SHORT-NAME>
</fx:PDU>
<fx:PDU ID="PDU_1002_0">
<ho:SHORT-NAME>PDU_1002_0</ho:SHORT-NAME>
</fx:PDU>
<fx:PDU ID="PDU_1002_1">
<ho:SHORT-NAME>PDU_1002_1</ho:SHORT-NAME>
</fx:PDU>
<fx:PDU ID="PDU_1002_1">
<ho:SHORT-NAME>PDU_1002_1</ho:SHORT-NAME>
+ <ho:DESC>Hello world 3!</ho:DESC>
<fx:BYTE-LENGTH>0</fx:BYTE-LENGTH>
<fx:PDU-TYPE>OTHER</fx:PDU-TYPE>
<fx:BYTE-LENGTH>0</fx:BYTE-LENGTH>
<fx:PDU-TYPE>OTHER</fx:PDU-TYPE>
- <fx:SIGNAL-INSTANCES>
- <fx:SIGNAL-INSTANCE ID="S_1002_0">
- <fx:SEQUENCE-NUMBER>0</fx:SEQUENCE-NUMBER>
- <fx:SIGNAL-REF ID-REF="S_STRG_ASCII"/>
- </fx:SIGNAL-INSTANCE>
- </fx:SIGNAL-INSTANCES>
</fx:PDU>
</fx:PDUS>
<fx:FRAMES>
</fx:PDU>
</fx:PDUS>
<fx:FRAMES>
* In the future in none verbose mode the string will not be sent via DLT message.\r
* @param TEXT ASCII string\r
*/\r
* In the future in none verbose mode the string will not be sent via DLT message.\r
* @param TEXT ASCII string\r
*/\r
-#define DLT_CSTRING(TEXT) \\r
- DLT_STRING(TEXT)\r
+/* #define DLT_CSTRING(TEXT) */\r
+/* UNCHANGED */\r
\r
#endif /* DLT_COMMON_API_H */\r
\r
\r
#endif /* DLT_COMMON_API_H */\r
\r
*/
int dlt_user_log_write_string( DltContextData *log, const char *text);
*/
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.
* 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.
dlt_user_log_write_string(&log,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
*/
* Add utf8-encoded string parameter to the log messsage.
* @param TEXT UTF8-encoded string
*/
+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;
int dlt_user_log_write_utf8_string(DltContextData *log, const char *text)
{
uint16_t arg_size;