summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChristian Muck <christian.muck@bmw.de>2011-09-05 15:02:23 +0200
committerChristian Muck <christian.muck@bmw.de>2011-09-05 15:02:23 +0200
commitd818704990324fbacd0c7cfb92ba1e7e73e59ab0 (patch)
treeed186088c3f7e2eef4bec828a0ce5a497e25ef7a /include
parent48928c656c68cc4a63e457c2511bbff457c87c36 (diff)
downloadDLT-daemon-d818704990324fbacd0c7cfb92ba1e7e73e59ab0.tar.gz
[GSW-62] DLT Library version check
Diffstat (limited to 'include')
-rwxr-xr-xinclude/dlt/CMakeLists.txt2
-rwxr-xr-xinclude/dlt/dlt_common.h12
-rwxr-xr-xinclude/dlt/dlt_user.h10
-rwxr-xr-xinclude/dlt/dlt_user_macros.h97
-rwxr-xr-xinclude/dlt/dlt_version.h12
-rwxr-xr-xinclude/dlt/dlt_version.h.cmake12
6 files changed, 95 insertions, 50 deletions
diff --git a/include/dlt/CMakeLists.txt b/include/dlt/CMakeLists.txt
index fcdbaea..6ddcfad 100755
--- a/include/dlt/CMakeLists.txt
+++ b/include/dlt/CMakeLists.txt
@@ -35,6 +35,6 @@
# @licence end@
########
-install(FILES dlt.h dlt_user.h dlt_user_macros.h dlt_client.h dlt_protocol.h dlt_common.h dlt_types.h
+install(FILES dlt.h dlt_user.h dlt_user_macros.h dlt_client.h dlt_protocol.h dlt_common.h dlt_types.h dlt_version.h
DESTINATION include/dlt
COMPONENT devel)
diff --git a/include/dlt/dlt_common.h b/include/dlt/dlt_common.h
index 44c1f33..c745afc 100755
--- a/include/dlt/dlt_common.h
+++ b/include/dlt/dlt_common.h
@@ -1044,6 +1044,18 @@ extern "C"
*/
void dlt_get_version(char *buf);
+ /**
+ * Print dlt major version to buffer
+ * @param buf Pointer to buffer
+ */
+ void dlt_get_major_version(char *buf);
+
+ /**
+ * Print dlt minor version to buffer
+ * @param buf Pointer to buffer
+ */
+ void dlt_get_minor_version(char *buf);
+
#endif
/* Function prototypes which should be used only internally */
diff --git a/include/dlt/dlt_user.h b/include/dlt/dlt_user.h
index a1b6229..263a5f2 100755
--- a/include/dlt/dlt_user.h
+++ b/include/dlt/dlt_user.h
@@ -382,7 +382,7 @@ int dlt_free();
* @param description long name of the application
* @return negative value if there was an error
*/
-int dlt_register_app(const char *appid, const char * description);
+int dlt_register_app(const char *appid, const char * description, const char * user_major_version, const char * user_minor_version);
/**
* Unregister an application in the daemon.
@@ -440,6 +440,14 @@ int dlt_register_injection_callback(DltContext *handle, uint32_t service_id,
int dlt_verbose_mode(void);
/**
+ * Check the version of dlt library with library version used of the application.
+ * @param Major version number of application - see dlt_version.h
+ * @param Minor version number of application - see dlt_version.h
+ * @return negative value if there is a mismatch
+ */
+int dlt_user_check_library_version(const char *user_major_version,const char *user_minor_version);
+
+/**
* Switch to non-verbose mode
*
*/
diff --git a/include/dlt/dlt_user_macros.h b/include/dlt/dlt_user_macros.h
index 78ef66d..979026a 100755
--- a/include/dlt/dlt_user_macros.h
+++ b/include/dlt/dlt_user_macros.h
@@ -35,41 +35,40 @@
* @licence end@
*/
-
/*******************************************************************************
-** **
-** SRC-MODULE: dlt_user_macros.h **
-** **
-** TARGET : linux **
-** **
-** PROJECT : DLT **
-** **
-** AUTHOR : Alexander Wenzel Alexander.AW.Wenzel@bmw.de **
-** Markus Klein **
-** **
-** PURPOSE : **
-** **
-** REMARKS : **
-** **
-** PLATFORM DEPENDANT [yes/no]: yes **
-** **
-** TO BE CHANGED BY USER [yes/no]: no **
-** **
-*******************************************************************************/
+ ** **
+ ** SRC-MODULE: dlt_user_macros.h **
+ ** **
+ ** TARGET : linux **
+ ** **
+ ** PROJECT : DLT **
+ ** **
+ ** AUTHOR : Alexander Wenzel Alexander.AW.Wenzel@bmw.de **
+ ** Markus Klein **
+ ** **
+ ** PURPOSE : **
+ ** **
+ ** REMARKS : **
+ ** **
+ ** PLATFORM DEPENDANT [yes/no]: yes **
+ ** **
+ ** TO BE CHANGED BY USER [yes/no]: no **
+ ** **
+ *******************************************************************************/
/*******************************************************************************
-** Author Identity **
-********************************************************************************
-** **
-** Initials Name Company **
-** -------- ------------------------- ---------------------------------- **
-** aw Alexander Wenzel BMW **
-** mk Markus Klein Fraunhofer ESK **
-*******************************************************************************/
+ ** Author Identity **
+ ********************************************************************************
+ ** **
+ ** Initials Name Company **
+ ** -------- ------------------------- ---------------------------------- **
+ ** aw Alexander Wenzel BMW **
+ ** mk Markus Klein Fraunhofer ESK **
+ *******************************************************************************/
/*******************************************************************************
-** Revision Control History **
-*******************************************************************************/
+ ** Revision Control History **
+ *******************************************************************************/
/*
* $LastChangedRevision: 1515 $
@@ -82,15 +81,17 @@
#ifndef DLT_USER_MACROS_H
#define DLT_USER_MACORS_H
+#include "dlt_version.h"
+
/**
- \defgroup userapi DLT User API
- \addtogroup userapi
- \{
-*/
+ \defgroup userapi DLT User API
+ \addtogroup userapi
+ \{
+ */
/**************************************************************************************************
-* The folowing macros define a macro interface for DLT
-**************************************************************************************************/
+ * The folowing macros define a macro interface for DLT
+ **************************************************************************************************/
/**
* Create an object for a new context.
@@ -114,7 +115,8 @@ extern DltContext CONTEXT;
* @param DESCRIPTION ASCII string containing description
*/
#define DLT_REGISTER_APP(APPID,DESCRIPTION) \
- dlt_register_app( APPID, DESCRIPTION);
+ dlt_register_app( APPID, DESCRIPTION, PACKAGE_MAJOR_VERSION, PACKAGE_MINOR_VERSION );
+
/**
* Unregister application.
@@ -137,9 +139,9 @@ extern DltContext CONTEXT;
* @param CONTEXTID context id with maximal four characters
* @param DESCRIPTION ASCII string containing description
* @param LOGLEVEL log level to be pre-set for this context
- (DLT_LOG_DEFAULT is not allowed here)
+ (DLT_LOG_DEFAULT is not allowed here)
* @param TRACESTATUS trace status to be pre-set for this context
- (DLT_TRACE_STATUS_DEFAULT is not allowed here)
+ (DLT_TRACE_STATUS_DEFAULT is not allowed here)
*/
#define DLT_REGISTER_CONTEXT_LL_TS(CONTEXT,CONTEXTID,DESCRIPTION,LOGLEVEL,TRACESTATUS) \
dlt_register_context_ll_ts(&(CONTEXT), CONTEXTID, DESCRIPTION, LOGLEVEL, TRACESTATUS);
@@ -167,8 +169,8 @@ extern DltContext CONTEXT;
* @param ARGS variable list of arguments
*/
#ifdef _MSC_VER
- /* DLT_LOG is not supported by MS Visual C++ */
- /* use function interface instead */
+/* DLT_LOG is not supported by MS Visual C++ */
+/* use function interface instead */
#else
#define DLT_LOG(CONTEXT,LOGLEVEL,ARGS...) \
{ \
@@ -187,12 +189,12 @@ extern DltContext CONTEXT;
* @param LOGLEVEL the log level of the log message
* @param MSGID the message id of log message
* @param ARGS variable list of arguments:
- calls to DLT_STRING(), DLT_BOOL(), DLT_FLOAT32(), DLT_FLOAT64(),
- DLT_INT(), DLT_UINT(), DLT_RAW()
+ calls to DLT_STRING(), DLT_BOOL(), DLT_FLOAT32(), DLT_FLOAT64(),
+ DLT_INT(), DLT_UINT(), DLT_RAW()
*/
#ifdef _MSC_VER
- /* DLT_LOG_ID is not supported by MS Visual C++ */
- /* use function interface instead */
+/* DLT_LOG_ID is not supported by MS Visual C++ */
+/* use function interface instead */
#else
#define DLT_LOG_ID(CONTEXT,LOGLEVEL,MSGID,ARGS...) \
{ \
@@ -311,7 +313,6 @@ extern DltContext CONTEXT;
dlt_log_string(&(CONTEXT), LOGLEVEL, TEXT); \
}
-
/**
* Send log message with string parameter and integer parameter.
* @param CONTEXT object containing information about one special logging context
@@ -408,7 +409,7 @@ extern DltContext CONTEXT;
dlt_disable_local_print();
/**
- \}
-*/
+ \}
+ */
#endif /* DLT_USER_MACROS_H */
diff --git a/include/dlt/dlt_version.h b/include/dlt/dlt_version.h
new file mode 100755
index 0000000..48d37a2
--- /dev/null
+++ b/include/dlt/dlt_version.h
@@ -0,0 +1,12 @@
+/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
+#ifndef __VERSION_H_
+#define __VERSION_H_
+
+#define PACKAGE_VERSION_STATE ""
+#define PACKAGE_VERSION "2.2.0"
+#define PACKAGE_MAJOR_VERSION "2"
+#define PACKAGE_MINOR_VERSION "2"
+#define PACKAGE_PATCH_LEVEL "0"
+#define PACKAGE_REVISION "v2.2.0-9-g48928c6"
+
+#endif
diff --git a/include/dlt/dlt_version.h.cmake b/include/dlt/dlt_version.h.cmake
new file mode 100755
index 0000000..f217db3
--- /dev/null
+++ b/include/dlt/dlt_version.h.cmake
@@ -0,0 +1,12 @@
+/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
+#ifndef __VERSION_H_
+#define __VERSION_H_
+
+#define PACKAGE_VERSION_STATE "@PRINT_VERSION_STATE@"
+#define PACKAGE_VERSION "@PRINT_VERSION@"
+#define PACKAGE_MAJOR_VERSION "@PRINT_MAJOR_VERSION@"
+#define PACKAGE_MINOR_VERSION "@PRINT_MINOR_VERSION@"
+#define PACKAGE_PATCH_LEVEL "@PRINT_PATCH_LEVEL@"
+#define PACKAGE_REVISION "@PRINT_REVISION@"
+
+#endif