Added new examples which can be manually build against DLt library.
authorAlexander Wenzel <Alexander.AW.Wenzel@bmw.de>
Thu, 15 May 2014 08:47:05 +0000 (10:47 +0200)
committerAlexander Wenzel <Alexander.AW.Wenzel@bmw.de>
Fri, 16 May 2014 06:37:42 +0000 (08:37 +0200)
Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
examples/README.txt [new file with mode: 0644]
examples/example1/CMakeLists.txt [new file with mode: 0755]
examples/example1/example1.c [new file with mode: 0644]
examples/example2/CMakeLists.txt [new file with mode: 0755]
examples/example2/dlt_id.h [new file with mode: 0644]
examples/example2/example2.c [new file with mode: 0644]
examples/example2/example2.xml [new file with mode: 0644]
examples/example3/CMakeLists.txt [new file with mode: 0755]
examples/example3/dlt_id.h [new file with mode: 0644]
examples/example3/example3.c [new file with mode: 0644]
examples/example3/example3.xml [new file with mode: 0644]

diff --git a/examples/README.txt b/examples/README.txt
new file mode 100644 (file)
index 0000000..728e5c2
--- /dev/null
@@ -0,0 +1,4 @@
+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
diff --git a/examples/example1/CMakeLists.txt b/examples/example1/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..363a567
--- /dev/null
@@ -0,0 +1,56 @@
+#######
+# Dlt - Diagnostic Log and Trace
+# @licence make begin@
+#
+# Copyright (C) 2011-2014, BMW AG - Alexander Wenzel <alexander.aw.wenzel@bmw.de>
+# 
+# Contributions are licensed to the GENIVI Alliance under one or more
+# Contribution License Agreements.
+# 
+# This Source Code Form is subject to the terms of the
+# Mozilla Public License, v. 2.0. If a  copy of the MPL was not distributed with
+# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# @licence end@
+########
+
+#
+# DLT example implementation
+#
+
+cmake_minimum_required( VERSION 2.6 )
+project( automotive-dlt-example1 )
+
+#
+# set prefix
+#
+
+set( CMAKE_INSTALL_PREFIX "/usr" )
+
+#
+# find dependency packages
+#
+
+find_package(PkgConfig)
+pkg_check_modules(DLT REQUIRED automotive-dlt)
+
+#
+# include directories
+#
+
+include_directories(
+    ${DLT_INCLUDE_DIRS}
+)
+
+#
+# build project
+#
+
+set(dlt_example1_SRCS example1.c)
+add_executable(dlt-example1 ${dlt_example1_SRCS})
+target_link_libraries(dlt-example1 ${DLT_LIBRARIES})
+set_target_properties(dlt-example1 PROPERTIES LINKER_LANGUAGE C)
+
+install(TARGETS dlt-example1
+       RUNTIME DESTINATION bin
+       COMPONENT base)
diff --git a/examples/example1/example1.c b/examples/example1/example1.c
new file mode 100644 (file)
index 0000000..4c812dd
--- /dev/null
@@ -0,0 +1,64 @@
+/**
+ * @licence app begin@
+ * Copyright (C) 2014  BMW AG
+ *
+ * This file is part of GENIVI Project Dlt - Diagnostic Log and Trace console apps.
+ *
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
+ *
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a  copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ *
+ * \author Alexander Wenzel <alexander.aw.wenzel@bmw.de> BMW 2011-2012
+ *
+ * \file dlt-example-user.c
+ * For further information see http://www.genivi.org/.
+ * @licence end@
+ */
+
+
+/*******************************************************************************
+**                                                                            **
+**  SRC-MODULE: example1.c                                                    **
+**                                                                            **
+**  TARGET    : linux                                                         **
+**                                                                            **
+**  PROJECT   : DLT                                                           **
+**                                                                            **
+**  AUTHOR    : Alexander Wenzel Alexander.AW.Wenzel@bmw.de                   **
+**                                                                            **
+**  PURPOSE   :                                                               **
+**                                                                            **
+**  REMARKS   :                                                               **
+**                                                                            **
+**  PLATFORM DEPENDANT [yes/no]: yes                                          **
+**                                                                            **
+**  TO BE CHANGED BY USER [yes/no]: no                                        **
+**                                                                            **
+*******************************************************************************/
+
+#include <stdio.h>      /* for printf() and fprintf() */
+#include <stdlib.h>     /* for atoi() and exit() */
+
+#include <dlt.h>
+
+DLT_DECLARE_CONTEXT(con_exa1);
+
+int main()
+{
+       DLT_REGISTER_APP("EXA1","First Example");
+
+       DLT_REGISTER_CONTEXT(con_exa1,"CON","First context");
+
+       DLT_LOG(con_exa1,DLT_LOG_INFO,DLT_STRING("Hello world!"));
+
+    usleep(1000);
+
+       DLT_UNREGISTER_CONTEXT(con_exa1);
+
+       DLT_UNREGISTER_APP();
+}
diff --git a/examples/example2/CMakeLists.txt b/examples/example2/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..65efbce
--- /dev/null
@@ -0,0 +1,56 @@
+#######
+# Dlt - Diagnostic Log and Trace
+# @licence make begin@
+#
+# Copyright (C) 2011-2014, BMW AG - Alexander Wenzel <alexander.aw.wenzel@bmw.de>
+# 
+# Contributions are licensed to the GENIVI Alliance under one or more
+# Contribution License Agreements.
+# 
+# This Source Code Form is subject to the terms of the
+# Mozilla Public License, v. 2.0. If a  copy of the MPL was not distributed with
+# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# @licence end@
+########
+
+#
+# DLT example implementation
+#
+
+cmake_minimum_required( VERSION 2.6 )
+project( automotive-dlt-example2 )
+
+#
+# set prefix
+#
+
+set( CMAKE_INSTALL_PREFIX "/usr" )
+
+#
+# find dependency packages
+#
+
+find_package(PkgConfig)
+pkg_check_modules(DLT REQUIRED automotive-dlt)
+
+#
+# include directories
+#
+
+include_directories(
+    ${DLT_INCLUDE_DIRS}
+)
+
+#
+# build project
+#
+
+set(dlt_example2_SRCS example2.c)
+add_executable(dlt-example2 ${dlt_example2_SRCS})
+target_link_libraries(dlt-example2 ${DLT_LIBRARIES})
+set_target_properties(dlt-example2 PROPERTIES LINKER_LANGUAGE C)
+
+install(TARGETS dlt-example2
+       RUNTIME DESTINATION bin
+       COMPONENT base)
diff --git a/examples/example2/dlt_id.h b/examples/example2/dlt_id.h
new file mode 100644 (file)
index 0000000..e5d1dbc
--- /dev/null
@@ -0,0 +1,10 @@
+// generated file, do not edit
+
+#ifndef DLT_ID_H
+#define DLT_ID_H
+
+#define DLT_EXA2_CON_EXA2_ID1 1000
+#define DLT_EXA2_CON_EXA2_ID2 1001
+#define DLT_EXA2_CON_EXA2_ID3 1002
+
+#endif /* DLT_ID_H */
diff --git a/examples/example2/example2.c b/examples/example2/example2.c
new file mode 100644 (file)
index 0000000..7daa9a9
--- /dev/null
@@ -0,0 +1,73 @@
+/**
+ * @licence app begin@
+ * Copyright (C) 2014  BMW AG
+ *
+ * This file is part of GENIVI Project Dlt - Diagnostic Log and Trace console apps.
+ *
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
+ *
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a  copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ *
+ * \author Alexander Wenzel <alexander.aw.wenzel@bmw.de> BMW 2011-2012
+ *
+ * \file dlt-example-user.c
+ * For further information see http://www.genivi.org/.
+ * @licence end@
+ */
+
+
+/*******************************************************************************
+**                                                                            **
+**  SRC-MODULE: example2.c                                                    **
+**                                                                            **
+**  TARGET    : linux                                                         **
+**                                                                            **
+**  PROJECT   : DLT                                                           **
+**                                                                            **
+**  AUTHOR    : Alexander Wenzel Alexander.AW.Wenzel@bmw.de                   **
+**                                                                            **
+**  PURPOSE   :                                                               **
+**                                                                            **
+**  REMARKS   :                                                               **
+**                                                                            **
+**  PLATFORM DEPENDANT [yes/no]: yes                                          **
+**                                                                            **
+**  TO BE CHANGED BY USER [yes/no]: no                                        **
+**                                                                            **
+*******************************************************************************/
+
+#include <stdio.h>      /* for printf() and fprintf() */
+#include <stdlib.h>     /* for atoi() and exit() */
+
+#include <dlt.h>
+
+#include "dlt_id.h"
+
+DLT_DECLARE_CONTEXT(con_exa2);
+
+int main()
+{
+       int num;
+
+       DLT_REGISTER_APP("EXA2","Third Example");
+       DLT_REGISTER_CONTEXT(con_exa2,"CON","First context");
+
+       DLT_NONVERBOSE_MODE();
+
+       for(num=0;num<10;num++)
+       {
+               DLT_LOG_ID(con_exa2,DLT_LOG_INFO,DLT_EXA2_CON_EXA2_ID1,DLT_INT32(12345678),DLT_STRING("Hello world 1!"));
+               DLT_LOG_ID(con_exa2,DLT_LOG_ERROR,DLT_EXA2_CON_EXA2_ID2,DLT_INT32(87654321),DLT_STRING("Hello world 2!"));
+               DLT_LOG_ID(con_exa2,DLT_LOG_WARN,DLT_EXA2_CON_EXA2_ID3,DLT_INT32(11223344),DLT_STRING("Hello world 3!"));
+       usleep(1000);
+       }
+
+       DLT_UNREGISTER_CONTEXT(con_exa2);
+
+       DLT_UNREGISTER_APP();
+}
diff --git a/examples/example2/example2.xml b/examples/example2/example2.xml
new file mode 100644 (file)
index 0000000..4a6b15c
--- /dev/null
@@ -0,0 +1,167 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<fx:FIBEX xmlns:ho="http://www.asam.net/xml" xmlns:fx="http://www.asam.net/xml/fbx">
+    <fx:PROJECT ID="projectEntry">
+        <ho:SHORT-NAME>projectEntry</ho:SHORT-NAME>
+    </fx:PROJECT>
+    <fx:ELEMENTS>
+        <fx:ECUS>
+            <fx:ECU ID="Entry">
+                <ho:SHORT-NAME>Entry</ho:SHORT-NAME>
+                <fx:MANUFACTURER-EXTENSION>
+                    <SW_VERSION>unknown</SW_VERSION>
+                    <APPLICATIONS>
+                        <APPLICATION>
+                            <APPLICATION_ID>EXA2</APPLICATION_ID>
+                            <APPLICATION_DESCRIPTION>Third Example</APPLICATION_DESCRIPTION>
+                            <CONTEXTS>
+                                <CONTEXT>
+                                    <CONTEXT_ID>CON</CONTEXT_ID>
+                                    <CONTEXT_DESCRIPTION>First context</CONTEXT_DESCRIPTION>
+                                </CONTEXT>
+                            </CONTEXTS>
+                        </APPLICATION>
+                    </APPLICATIONS>
+                </fx:MANUFACTURER-EXTENSION>
+            </fx:ECU>
+        </fx:ECUS>
+        <fx:PDUS>
+            <fx:PDU ID="PDU_1000_0">
+                <ho:SHORT-NAME>PDU_1000_0</ho:SHORT-NAME>
+                <fx:BYTE-LENGTH>4</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_SINT32"/>
+                    </fx:SIGNAL-INSTANCE>
+                </fx:SIGNAL-INSTANCES>
+            </fx:PDU>
+            <fx:PDU ID="PDU_1000_1">
+                <ho:SHORT-NAME>PDU_1000_1</ho:SHORT-NAME>
+                <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:BYTE-LENGTH>4</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_SINT32"/>
+                    </fx:SIGNAL-INSTANCE>
+                </fx:SIGNAL-INSTANCES>
+            </fx:PDU>
+            <fx:PDU ID="PDU_1001_1">
+                <ho:SHORT-NAME>PDU_1001_1</ho:SHORT-NAME>
+                <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:BYTE-LENGTH>4</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_SINT32"/>
+                    </fx:SIGNAL-INSTANCE>
+                </fx:SIGNAL-INSTANCES>
+            </fx:PDU>
+            <fx:PDU ID="PDU_1002_1">
+                <ho:SHORT-NAME>PDU_1002_1</ho:SHORT-NAME>
+                <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:FRAME ID="ID_1000">
+                <ho:SHORT-NAME>ID_1000</ho:SHORT-NAME>
+                <fx:BYTE-LENGTH>4</fx:BYTE-LENGTH>
+                <fx:FRAME-TYPE>OTHER</fx:FRAME-TYPE>
+                <fx:PDU-INSTANCES>
+                    <fx:PDU-INSTANCE ID="P_1000_0">
+                        <fx:PDU-REF ID-REF="PDU_1000_0"/>
+                        <fx:SEQUENCE-NUMBER>0</fx:SEQUENCE-NUMBER>
+                    </fx:PDU-INSTANCE>
+                    <fx:PDU-INSTANCE ID="P_1000_1">
+                        <fx:PDU-REF ID-REF="PDU_1000_1"/>
+                        <fx:SEQUENCE-NUMBER>1</fx:SEQUENCE-NUMBER>
+                    </fx:PDU-INSTANCE>
+                </fx:PDU-INSTANCES>
+                <fx:MANUFACTURER-EXTENSION>
+                    <MESSAGE_TYPE>DLT_TYPE_LOG</MESSAGE_TYPE>
+                    <MESSAGE_INFO>DLT_LOG_INFO</MESSAGE_INFO>
+                    <APPLICATION_ID>EXA2</APPLICATION_ID>
+                    <CONTEXT_ID>CON</CONTEXT_ID>
+                    <MESSAGE_SOURCE_FILE>/home/alex/workspace/ascgit/dlt-daemon/examples/example2/example2.c</MESSAGE_SOURCE_FILE>
+                    <MESSAGE_LINE_NUMBER>64</MESSAGE_LINE_NUMBER>
+                </fx:MANUFACTURER-EXTENSION>
+            </fx:FRAME>
+            <fx:FRAME ID="ID_1001">
+                <ho:SHORT-NAME>ID_1001</ho:SHORT-NAME>
+                <fx:BYTE-LENGTH>4</fx:BYTE-LENGTH>
+                <fx:FRAME-TYPE>OTHER</fx:FRAME-TYPE>
+                <fx:PDU-INSTANCES>
+                    <fx:PDU-INSTANCE ID="P_1001_0">
+                        <fx:PDU-REF ID-REF="PDU_1001_0"/>
+                        <fx:SEQUENCE-NUMBER>0</fx:SEQUENCE-NUMBER>
+                    </fx:PDU-INSTANCE>
+                    <fx:PDU-INSTANCE ID="P_1001_1">
+                        <fx:PDU-REF ID-REF="PDU_1001_1"/>
+                        <fx:SEQUENCE-NUMBER>1</fx:SEQUENCE-NUMBER>
+                    </fx:PDU-INSTANCE>
+                </fx:PDU-INSTANCES>
+                <fx:MANUFACTURER-EXTENSION>
+                    <MESSAGE_TYPE>DLT_TYPE_LOG</MESSAGE_TYPE>
+                    <MESSAGE_INFO>DLT_LOG_ERROR</MESSAGE_INFO>
+                    <APPLICATION_ID>EXA2</APPLICATION_ID>
+                    <CONTEXT_ID>CON</CONTEXT_ID>
+                    <MESSAGE_SOURCE_FILE>/home/alex/workspace/ascgit/dlt-daemon/examples/example2/example2.c</MESSAGE_SOURCE_FILE>
+                    <MESSAGE_LINE_NUMBER>65</MESSAGE_LINE_NUMBER>
+                </fx:MANUFACTURER-EXTENSION>
+            </fx:FRAME>
+            <fx:FRAME ID="ID_1002">
+                <ho:SHORT-NAME>ID_1002</ho:SHORT-NAME>
+                <fx:BYTE-LENGTH>4</fx:BYTE-LENGTH>
+                <fx:FRAME-TYPE>OTHER</fx:FRAME-TYPE>
+                <fx:PDU-INSTANCES>
+                    <fx:PDU-INSTANCE ID="P_1002_0">
+                        <fx:PDU-REF ID-REF="PDU_1002_0"/>
+                        <fx:SEQUENCE-NUMBER>0</fx:SEQUENCE-NUMBER>
+                    </fx:PDU-INSTANCE>
+                    <fx:PDU-INSTANCE ID="P_1002_1">
+                        <fx:PDU-REF ID-REF="PDU_1002_1"/>
+                        <fx:SEQUENCE-NUMBER>1</fx:SEQUENCE-NUMBER>
+                    </fx:PDU-INSTANCE>
+                </fx:PDU-INSTANCES>
+                <fx:MANUFACTURER-EXTENSION>
+                    <MESSAGE_TYPE>DLT_TYPE_LOG</MESSAGE_TYPE>
+                    <MESSAGE_INFO>DLT_LOG_WARN</MESSAGE_INFO>
+                    <APPLICATION_ID>EXA2</APPLICATION_ID>
+                    <CONTEXT_ID>CON</CONTEXT_ID>
+                    <MESSAGE_SOURCE_FILE>/home/alex/workspace/ascgit/dlt-daemon/examples/example2/example2.c</MESSAGE_SOURCE_FILE>
+                    <MESSAGE_LINE_NUMBER>66</MESSAGE_LINE_NUMBER>
+                </fx:MANUFACTURER-EXTENSION>
+            </fx:FRAME>
+        </fx:FRAMES>
+    </fx:ELEMENTS>
+</fx:FIBEX>
diff --git a/examples/example3/CMakeLists.txt b/examples/example3/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..52c4f8a
--- /dev/null
@@ -0,0 +1,56 @@
+#######
+# Dlt - Diagnostic Log and Trace
+# @licence make begin@
+#
+# Copyright (C) 2011-2014, BMW AG - Alexander Wenzel <alexander.aw.wenzel@bmw.de>
+# 
+# Contributions are licensed to the GENIVI Alliance under one or more
+# Contribution License Agreements.
+# 
+# This Source Code Form is subject to the terms of the
+# Mozilla Public License, v. 2.0. If a  copy of the MPL was not distributed with
+# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# @licence end@
+########
+
+#
+# DLT example implementation
+#
+
+cmake_minimum_required( VERSION 2.6 )
+project( automotive-dlt-example3 )
+
+#
+# set prefix
+#
+
+set( CMAKE_INSTALL_PREFIX "/usr" )
+
+#
+# find dependency packages
+#
+
+find_package(PkgConfig)
+pkg_check_modules(DLT REQUIRED automotive-dlt)
+
+#
+# include directories
+#
+
+include_directories(
+    ${DLT_INCLUDE_DIRS}
+)
+
+#
+# build project
+#
+
+set(dlt_example3_SRCS example3.c)
+add_executable(dlt-example3 ${dlt_example3_SRCS})
+target_link_libraries(dlt-example3 ${DLT_LIBRARIES})
+set_target_properties(dlt-example3 PROPERTIES LINKER_LANGUAGE C)
+
+install(TARGETS dlt-example3
+       RUNTIME DESTINATION bin
+       COMPONENT base)
diff --git a/examples/example3/dlt_id.h b/examples/example3/dlt_id.h
new file mode 100644 (file)
index 0000000..844de3c
--- /dev/null
@@ -0,0 +1,10 @@
+// generated file, do not edit
+
+#ifndef DLT_ID_H
+#define DLT_ID_H
+
+#define DLT_EXA3_CON_EXA3_ID1 1000
+#define DLT_EXA3_CON_EXA3_ID2 1001
+#define DLT_EXA3_CON_EXA3_ID3 1002
+
+#endif /* DLT_ID_H */
diff --git a/examples/example3/example3.c b/examples/example3/example3.c
new file mode 100644 (file)
index 0000000..bd72671
--- /dev/null
@@ -0,0 +1,73 @@
+/**
+ * @licence app begin@
+ * Copyright (C) 2014  BMW AG
+ *
+ * This file is part of GENIVI Project Dlt - Diagnostic Log and Trace console apps.
+ *
+ * Contributions are licensed to the GENIVI Alliance under one or more
+ * Contribution License Agreements.
+ *
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a  copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ *
+ * \author Alexander Wenzel <alexander.aw.wenzel@bmw.de> BMW 2011-2012
+ *
+ * \file dlt-example-user.c
+ * For further information see http://www.genivi.org/.
+ * @licence end@
+ */
+
+
+/*******************************************************************************
+**                                                                            **
+**  SRC-MODULE: example3.c                                                    **
+**                                                                            **
+**  TARGET    : linux                                                         **
+**                                                                            **
+**  PROJECT   : DLT                                                           **
+**                                                                            **
+**  AUTHOR    : Alexander Wenzel Alexander.AW.Wenzel@bmw.de                   **
+**                                                                            **
+**  PURPOSE   :                                                               **
+**                                                                            **
+**  REMARKS   :                                                               **
+**                                                                            **
+**  PLATFORM DEPENDANT [yes/no]: yes                                          **
+**                                                                            **
+**  TO BE CHANGED BY USER [yes/no]: no                                        **
+**                                                                            **
+*******************************************************************************/
+
+#include <stdio.h>      /* for printf() and fprintf() */
+#include <stdlib.h>     /* for atoi() and exit() */
+
+#include <dlt.h>
+
+#include "dlt_id.h"
+
+DLT_DECLARE_CONTEXT(con_exa3);
+
+int main()
+{
+       int num;
+
+       DLT_REGISTER_APP("EXA3","Third Example");
+       DLT_REGISTER_CONTEXT(con_exa3,"CON","First context");
+
+       DLT_NONVERBOSE_MODE();
+
+       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!"));
+       usleep(1000);
+       }
+
+       DLT_UNREGISTER_CONTEXT(con_exa3);
+
+       DLT_UNREGISTER_APP();
+}
diff --git a/examples/example3/example3.xml b/examples/example3/example3.xml
new file mode 100644 (file)
index 0000000..706c0b5
--- /dev/null
@@ -0,0 +1,167 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<fx:FIBEX xmlns:ho="http://www.asam.net/xml" xmlns:fx="http://www.asam.net/xml/fbx">
+    <fx:PROJECT ID="projectEntry">
+        <ho:SHORT-NAME>projectEntry</ho:SHORT-NAME>
+    </fx:PROJECT>
+    <fx:ELEMENTS>
+        <fx:ECUS>
+            <fx:ECU ID="Entry">
+                <ho:SHORT-NAME>Entry</ho:SHORT-NAME>
+                <fx:MANUFACTURER-EXTENSION>
+                    <SW_VERSION>unknown</SW_VERSION>
+                    <APPLICATIONS>
+                        <APPLICATION>
+                            <APPLICATION_ID>EXA3</APPLICATION_ID>
+                            <APPLICATION_DESCRIPTION>Third Example</APPLICATION_DESCRIPTION>
+                            <CONTEXTS>
+                                <CONTEXT>
+                                    <CONTEXT_ID>CON</CONTEXT_ID>
+                                    <CONTEXT_DESCRIPTION>First context</CONTEXT_DESCRIPTION>
+                                </CONTEXT>
+                            </CONTEXTS>
+                        </APPLICATION>
+                    </APPLICATIONS>
+                </fx:MANUFACTURER-EXTENSION>
+            </fx:ECU>
+        </fx:ECUS>
+        <fx:PDUS>
+            <fx:PDU ID="PDU_1000_0">
+                <ho:SHORT-NAME>PDU_1000_0</ho:SHORT-NAME>
+                <fx:BYTE-LENGTH>4</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_SINT32"/>
+                    </fx:SIGNAL-INSTANCE>
+                </fx:SIGNAL-INSTANCES>
+            </fx:PDU>
+            <fx:PDU ID="PDU_1000_1">
+                <ho:SHORT-NAME>PDU_1000_1</ho:SHORT-NAME>
+                <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:BYTE-LENGTH>4</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_SINT32"/>
+                    </fx:SIGNAL-INSTANCE>
+                </fx:SIGNAL-INSTANCES>
+            </fx:PDU>
+            <fx:PDU ID="PDU_1001_1">
+                <ho:SHORT-NAME>PDU_1001_1</ho:SHORT-NAME>
+                <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:BYTE-LENGTH>4</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_SINT32"/>
+                    </fx:SIGNAL-INSTANCE>
+                </fx:SIGNAL-INSTANCES>
+            </fx:PDU>
+            <fx:PDU ID="PDU_1002_1">
+                <ho:SHORT-NAME>PDU_1002_1</ho:SHORT-NAME>
+                <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:FRAME ID="ID_1000">
+                <ho:SHORT-NAME>ID_1000</ho:SHORT-NAME>
+                <fx:BYTE-LENGTH>4</fx:BYTE-LENGTH>
+                <fx:FRAME-TYPE>OTHER</fx:FRAME-TYPE>
+                <fx:PDU-INSTANCES>
+                    <fx:PDU-INSTANCE ID="P_1000_0">
+                        <fx:PDU-REF ID-REF="PDU_1000_0"/>
+                        <fx:SEQUENCE-NUMBER>0</fx:SEQUENCE-NUMBER>
+                    </fx:PDU-INSTANCE>
+                    <fx:PDU-INSTANCE ID="P_1000_1">
+                        <fx:PDU-REF ID-REF="PDU_1000_1"/>
+                        <fx:SEQUENCE-NUMBER>1</fx:SEQUENCE-NUMBER>
+                    </fx:PDU-INSTANCE>
+                </fx:PDU-INSTANCES>
+                <fx:MANUFACTURER-EXTENSION>
+                    <MESSAGE_TYPE>DLT_TYPE_LOG</MESSAGE_TYPE>
+                    <MESSAGE_INFO>DLT_LOG_INFO</MESSAGE_INFO>
+                    <APPLICATION_ID>EXA3</APPLICATION_ID>
+                    <CONTEXT_ID>CON</CONTEXT_ID>
+                    <MESSAGE_SOURCE_FILE>/home/alex/workspace/ascgit/dlt-daemon/examples/example3/example3.c</MESSAGE_SOURCE_FILE>
+                    <MESSAGE_LINE_NUMBER>64</MESSAGE_LINE_NUMBER>
+                </fx:MANUFACTURER-EXTENSION>
+            </fx:FRAME>
+            <fx:FRAME ID="ID_1001">
+                <ho:SHORT-NAME>ID_1001</ho:SHORT-NAME>
+                <fx:BYTE-LENGTH>4</fx:BYTE-LENGTH>
+                <fx:FRAME-TYPE>OTHER</fx:FRAME-TYPE>
+                <fx:PDU-INSTANCES>
+                    <fx:PDU-INSTANCE ID="P_1001_0">
+                        <fx:PDU-REF ID-REF="PDU_1001_0"/>
+                        <fx:SEQUENCE-NUMBER>0</fx:SEQUENCE-NUMBER>
+                    </fx:PDU-INSTANCE>
+                    <fx:PDU-INSTANCE ID="P_1001_1">
+                        <fx:PDU-REF ID-REF="PDU_1001_1"/>
+                        <fx:SEQUENCE-NUMBER>1</fx:SEQUENCE-NUMBER>
+                    </fx:PDU-INSTANCE>
+                </fx:PDU-INSTANCES>
+                <fx:MANUFACTURER-EXTENSION>
+                    <MESSAGE_TYPE>DLT_TYPE_LOG</MESSAGE_TYPE>
+                    <MESSAGE_INFO>DLT_LOG_ERROR</MESSAGE_INFO>
+                    <APPLICATION_ID>EXA3</APPLICATION_ID>
+                    <CONTEXT_ID>CON</CONTEXT_ID>
+                    <MESSAGE_SOURCE_FILE>/home/alex/workspace/ascgit/dlt-daemon/examples/example3/example3.c</MESSAGE_SOURCE_FILE>
+                    <MESSAGE_LINE_NUMBER>65</MESSAGE_LINE_NUMBER>
+                </fx:MANUFACTURER-EXTENSION>
+            </fx:FRAME>
+            <fx:FRAME ID="ID_1002">
+                <ho:SHORT-NAME>ID_1002</ho:SHORT-NAME>
+                <fx:BYTE-LENGTH>4</fx:BYTE-LENGTH>
+                <fx:FRAME-TYPE>OTHER</fx:FRAME-TYPE>
+                <fx:PDU-INSTANCES>
+                    <fx:PDU-INSTANCE ID="P_1002_0">
+                        <fx:PDU-REF ID-REF="PDU_1002_0"/>
+                        <fx:SEQUENCE-NUMBER>0</fx:SEQUENCE-NUMBER>
+                    </fx:PDU-INSTANCE>
+                    <fx:PDU-INSTANCE ID="P_1002_1">
+                        <fx:PDU-REF ID-REF="PDU_1002_1"/>
+                        <fx:SEQUENCE-NUMBER>1</fx:SEQUENCE-NUMBER>
+                    </fx:PDU-INSTANCE>
+                </fx:PDU-INSTANCES>
+                <fx:MANUFACTURER-EXTENSION>
+                    <MESSAGE_TYPE>DLT_TYPE_LOG</MESSAGE_TYPE>
+                    <MESSAGE_INFO>DLT_LOG_WARN</MESSAGE_INFO>
+                    <APPLICATION_ID>EXA3</APPLICATION_ID>
+                    <CONTEXT_ID>CON</CONTEXT_ID>
+                    <MESSAGE_SOURCE_FILE>/home/alex/workspace/ascgit/dlt-daemon/examples/example3/example3.c</MESSAGE_SOURCE_FILE>
+                    <MESSAGE_LINE_NUMBER>66</MESSAGE_LINE_NUMBER>
+                </fx:MANUFACTURER-EXTENSION>
+            </fx:FRAME>
+        </fx:FRAMES>
+    </fx:ELEMENTS>
+</fx:FIBEX>