diff options
author | Christian Muck <christian.muck@bmw.de> | 2011-09-05 15:02:58 +0200 |
---|---|---|
committer | Christian Muck <christian.muck@bmw.de> | 2011-09-05 15:02:58 +0200 |
commit | 6bbb4fc3ea0d1414659822200ad44686d5ec4e24 (patch) | |
tree | ed186088c3f7e2eef4bec828a0ce5a497e25ef7a | |
parent | 48928c656c68cc4a63e457c2511bbff457c87c36 (diff) | |
parent | d818704990324fbacd0c7cfb92ba1e7e73e59ab0 (diff) | |
download | DLT-daemon-6bbb4fc3ea0d1414659822200ad44686d5ec4e24.tar.gz |
Merge branch 'develop2'
-rwxr-xr-x | CMakeLists.txt | 24 | ||||
-rwxr-xr-x | LIMITATIONS | 11 | ||||
-rwxr-xr-x | README.txt | 4 | ||||
-rwxr-xr-x | ReleaseNotes.txt | 8 | ||||
-rwxr-xr-x | include/dlt/CMakeLists.txt | 2 | ||||
-rwxr-xr-x | include/dlt/dlt_common.h | 12 | ||||
-rwxr-xr-x | include/dlt/dlt_user.h | 10 | ||||
-rwxr-xr-x | include/dlt/dlt_user_macros.h | 97 | ||||
-rwxr-xr-x | include/dlt/dlt_version.h | 12 | ||||
-rwxr-xr-x | include/dlt/dlt_version.h.cmake | 12 | ||||
-rwxr-xr-x | src/daemon/dlt-daemon.c | 3 | ||||
-rwxr-xr-x | src/examples/dlt-example-user-func.c | 2 | ||||
-rwxr-xr-x | src/lib/CMakeLists.txt | 2 | ||||
-rwxr-xr-x | src/lib/dlt_user.c | 22 | ||||
-rwxr-xr-x | src/lib/dlt_user_cfg.h | 3 | ||||
-rwxr-xr-x | src/shared/dlt_common.c | 16 | ||||
-rwxr-xr-x | svnversion.h.cmake | 2 | ||||
-rwxr-xr-x | version.h | 7 | ||||
-rwxr-xr-x | version.h.cmake | 7 |
19 files changed, 153 insertions, 103 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ae1b99b..44e7447 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,33 +46,30 @@ PROJECT( automotive-dlt ) SET( ${PROJECT_NAME}_MAJOR_VERSION 2 )
SET( ${PROJECT_NAME}_MINOR_VERSION 2 )
SET( ${PROJECT_NAME}_PATCH_LEVEL 0 )
-set(GENIVI_PROJECT_VERSION ${${PROJECT_NAME}_MAJOR_VERSION}.${${PROJECT_NAME}_MINOR_VERSION}.${${PROJECT_NAME}_PATCH_LEVEL})
SET( ${PROJECT_NAME}_VERSION_STATE )
-SET( ${PROJECT_NAME}_REVISION 1666 )
+SET( GENIVI_PROJECT_VERSION ${${PROJECT_NAME}_MAJOR_VERSION}.${${PROJECT_NAME}_MINOR_VERSION}.${${PROJECT_NAME}_PATCH_LEVEL})
-# Write version information into include file
SET( PRINT_MAJOR_VERSION ${${PROJECT_NAME}_MAJOR_VERSION})
SET( PRINT_MINOR_VERSION ${${PROJECT_NAME}_MINOR_VERSION})
SET( PRINT_PATCH_LEVEL ${${PROJECT_NAME}_PATCH_LEVEL})
SET( PRINT_VERSION ${GENIVI_PROJECT_VERSION})
SET( PRINT_VERSION_STATE ${${PROJECT_NAME}_VERSION_STATE})
-SET( PRINT_VERSION_REVISION ${${PROJECT_NAME}_REVISION})
-# Print version information
-MESSAGE("VERSION ${PRINT_VERSION}")
-MESSAGE("VERSION_STATE ${PRINT_VERSION_STATE}")
-MESSAGE("REVISION ${PRINT_VERSION_REVISION}")
+IF(NOT DEFINED PRINT_REVISION)
+ execute_process(COMMAND git describe --tags WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ OUTPUT_VARIABLE PRINT_REVISION
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ENDIF(NOT DEFINED PRINT_REVISION)
##################### RPM CONFIG ########################
-
-SET( GENIVI_RPM_RELEASE "1${SVN_REVISION}")
+SET( GENIVI_RPM_RELEASE "1${IDLT_VERSION}")
SET( LICENSE "LGPL v2.1 with special exception" )
SET( SPEC_DIR "package")
#########################################################
SET(GENIVI_BUILDSYSTEM_AVAILABLE $ENV{GENIVI_BUILDSYSTEM})
IF(GENIVI_BUILDSYSTEM_AVAILABLE)
-INCLUDE($ENV{GENIVI_BUILDSYSTEM}/cmake_extensions/GeniviCMakeExtensions.cmake)
+ INCLUDE($ENV{GENIVI_BUILDSYSTEM}/cmake_extensions/GeniviCMakeExtensions.cmake)
ENDIF(GENIVI_BUILDSYSTEM_AVAILABLE)
@@ -173,8 +170,7 @@ CHECK_FUNCTION_EXISTS( strstr HAVE_FUNC_STRSTR) CHECK_FUNCTION_EXISTS( strtol HAVE_FUNC_STRTOL)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_SOURCE_DIR}/config.h @ONLY)
-CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/svnversion.h.cmake ${CMAKE_SOURCE_DIR}/svnversion.h @ONLY)
-CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/version.h.cmake ${CMAKE_SOURCE_DIR}/version.h @ONLY)
+CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/dlt/dlt_version.h.cmake ${CMAKE_SOURCE_DIR}/include/dlt/dlt_version.h @ONLY)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/doxygen.cfg.cmake ${CMAKE_SOURCE_DIR}/doxygen.cfg @ONLY)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/automotive-dlt.pc.cmake ${CMAKE_SOURCE_DIR}/automotive-dlt.pc @ONLY)
#CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/package/automotive-dlt.spec.cmake ${CMAKE_SOURCE_DIR}/package/automotive-dlt.spec ESCAPE_QUOTES)
@@ -184,6 +180,8 @@ OPTION(ENABLE_BUILD_DOC "Set to ON to build Documentation" OFF) MESSAGE( STATUS )
MESSAGE( STATUS "-------------------------------------------------------------------------------" )
+MESSAGE( STATUS "Build for Version ${PRINT_VERSION} build ${PRINT_REVISION}")
+MESSAGE( STATUS "VERSION_STATE ${PRINT_VERSION_STATE}")
MESSAGE( STATUS "BUILD_SHARED_LIBS = ${BUILD_SHARED_LIBS}" )
MESSAGE( STATUS "CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}" )
MESSAGE( STATUS "CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}" )
diff --git a/LIMITATIONS b/LIMITATIONS deleted file mode 100755 index 831374e..0000000 --- a/LIMITATIONS +++ /dev/null @@ -1,11 +0,0 @@ -KNOWN LIMITATIONS: -(26.07.2010) - -Client: -- Only one daemon connection is supported - -Daemon: -- Missing features, see TODO - -User: -- Only one application, but multiple contexts, are possible in each user application diff --git a/README.txt b/README.txt deleted file mode 100755 index f1e7ee9..0000000 --- a/README.txt +++ /dev/null @@ -1,4 +0,0 @@ -License -------- -See file: LICENSE.txt -The full LGPL license: LGPL.txt diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 7acb10c..beece75 100755 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -23,6 +23,14 @@ Alexander.AW.Wenzel@bmw.de Changes in this release
-----------------------
+2.3.0
+
+Improvements
+
+ * [GSW-62] DLT Library version check
+ * [GSW-28] Directory where persistent data is stored is not configurable
+ * [GSW-46] DLT client library sets a huge stack size for internal thread
+ * [GSW-59] Statically allocated large array
2.2.0:
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 diff --git a/src/daemon/dlt-daemon.c b/src/daemon/dlt-daemon.c index 2438368..4f30a86 100755 --- a/src/daemon/dlt-daemon.c +++ b/src/daemon/dlt-daemon.c @@ -98,9 +98,6 @@ #include <sys/time.h> #include <linux/stat.h> -#include "version.h" -#include "svnversion.h" - #include "dlt_types.h" #include "dlt-daemon.h" #include "dlt-daemon_cfg.h" diff --git a/src/examples/dlt-example-user-func.c b/src/examples/dlt-example-user-func.c index 2180a6b..8939f1b 100755 --- a/src/examples/dlt-example-user-func.c +++ b/src/examples/dlt-example-user-func.c @@ -217,7 +217,7 @@ int main(int argc, char* argv[]) } } - dlt_register_app("LOG","Test Application for Logging"); + dlt_register_app("LOG","Test Application for Logging", PACKAGE_MAJOR_VERSION,PACKAGE_MINOR_VERSION); dlt_register_context(&mycontext,"TEST","Test Context for Logging"); diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index 4b0f4f0..5fc0802 100755 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -45,7 +45,7 @@ ENDIF(GPROF_DLT_LIB) target_link_libraries(dlt rt ${CMAKE_THREAD_LIBS_INIT}) -set_target_properties(dlt PROPERTIES VERSION 2.2.0 SOVERSION 2) +set_target_properties(dlt PROPERTIES VERSION ${PRINT_VERSION} SOVERSION ${PRINT_MAJOR_VERSION}) install(TARGETS dlt LIBRARY DESTINATION lib diff --git a/src/lib/dlt_user.c b/src/lib/dlt_user.c index e1225bb..4493818 100755 --- a/src/lib/dlt_user.c +++ b/src/lib/dlt_user.c @@ -124,6 +124,24 @@ static int dlt_user_log_check_user_message(void); static void dlt_user_log_reattach_to_daemon(void); static int dlt_user_log_send_overflow(void); +int dlt_user_check_library_version(const char *user_major_version,const char *user_minor_version){ + + char str[200]; + char lib_major_version[DLT_USER_MAX_LIB_VERSION_LENGTH]; + char lib_minor_version[DLT_USER_MAX_LIB_VERSION_LENGTH]; + + dlt_get_major_version( lib_major_version); + dlt_get_minor_version( lib_minor_version); + + if( (strcmp(lib_major_version,user_major_version)!=0) || (strcmp(lib_minor_version,user_minor_version)!=0)) + { + sprintf(str,"DLT Library version check failed! Installed DLT library version is %s.%s - Application using DLT library version %s.%s\n",lib_major_version,lib_minor_version,user_major_version,user_minor_version); + dlt_log(LOG_WARNING, str); + return -1; + } + return 0; +} + int dlt_init(void) { char filename[DLT_USER_MAX_FILENAME_LENGTH]; @@ -372,7 +390,7 @@ int dlt_free(void) -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) { int ret; @@ -382,6 +400,8 @@ int dlt_register_app(const char *appid, const char * description) { return -1; } + + dlt_user_check_library_version(user_major_version, user_minor_version); } if ((appid==0) || (appid[0]=='\0')) diff --git a/src/lib/dlt_user_cfg.h b/src/lib/dlt_user_cfg.h index e6476f0..19228b4 100755 --- a/src/lib/dlt_user_cfg.h +++ b/src/lib/dlt_user_cfg.h @@ -104,6 +104,9 @@ /* Maximu length of a filename string */
#define DLT_USER_MAX_FILENAME_LENGTH 255
+/* Maximum length of a single version number */
+#define DLT_USER_MAX_LIB_VERSION_LENGTH 3
+
/* Length of buffer for constructing text output */
#define DLT_USER_TEXT_LENGTH 10024
diff --git a/src/shared/dlt_common.c b/src/shared/dlt_common.c index 22834dd..e5784c0 100755 --- a/src/shared/dlt_common.c +++ b/src/shared/dlt_common.c @@ -86,8 +86,7 @@ #include "dlt_common.h" #include "dlt_common_cfg.h" -#include "version.h" -#include "svnversion.h" +#include "dlt_version.h" #if defined (__WIN32__) || defined (_MSC_VER) #include <winsock2.h> /* for socket(), connect(), send(), and recv() */ @@ -3081,9 +3080,20 @@ speed_t dlt_convert_serial_speed(int baudrate) void dlt_get_version(char *buf) { sprintf(buf,"DLT Package Version: %s %s, Package Revision: %s, build on %s %s\n", - PACKAGE_VERSION, PACKAGE_VERSION_STATE, SVN_VERSION, __DATE__ , __TIME__ ); + PACKAGE_VERSION, PACKAGE_VERSION_STATE, PACKAGE_REVISION, __DATE__ , __TIME__ ); } +void dlt_get_major_version(char *buf) +{ + sprintf(buf,"%s",PACKAGE_MAJOR_VERSION); +} + +void dlt_get_minor_version(char *buf) +{ + sprintf(buf,"%s",PACKAGE_MINOR_VERSION); +} + + uint32_t dlt_uptime(void) { diff --git a/svnversion.h.cmake b/svnversion.h.cmake deleted file mode 100755 index d95074f..0000000 --- a/svnversion.h.cmake +++ /dev/null @@ -1,2 +0,0 @@ -/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ -#define SVN_VERSION "@PRINT_VERSION_REVISION@" diff --git a/version.h b/version.h deleted file mode 100755 index 776199f..0000000 --- a/version.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef __VERSION_H_ -#define __VERSION_H_ - -#define PACKAGE_VERSION_STATE "" -#define PACKAGE_VERSION "2.2.0" - -#endif diff --git a/version.h.cmake b/version.h.cmake deleted file mode 100755 index d4fea8a..0000000 --- a/version.h.cmake +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef __VERSION_H_ -#define __VERSION_H_ - -#define PACKAGE_VERSION_STATE "@PRINT_VERSION_STATE@" -#define PACKAGE_VERSION "@PRINT_VERSION@" - -#endif |