From 199ff0e7f736d848a7e01a12f04ddb21ecf36d74 Mon Sep 17 00:00:00 2001 From: Lutz Helwing Date: Mon, 13 Jul 2015 16:06:09 +0200 Subject: Replaced all tabs with spaces in all files in include folder Signed-off-by: Alexander Wenzel --- include/dlt/CMakeLists.txt | 2 +- include/dlt/dlt_common.h | 206 +++++++++++++++++------------------ include/dlt/dlt_common_api.h | 70 ++++++------ include/dlt/dlt_filetransfer.h | 58 +++++----- include/dlt/dlt_offline_trace.h | 6 +- include/dlt/dlt_protocol.h | 46 ++++---- include/dlt/dlt_shm.h | 20 ++-- include/dlt/dlt_types.h | 26 ++--- include/dlt/dlt_user.h | 180 +++++++++++++++--------------- include/dlt/dlt_user_macros.h | 236 ++++++++++++++++++++-------------------- 10 files changed, 427 insertions(+), 423 deletions(-) (limited to 'include') diff --git a/include/dlt/CMakeLists.txt b/include/dlt/CMakeLists.txt index 841edbb..a137206 100644 --- a/include/dlt/CMakeLists.txt +++ b/include/dlt/CMakeLists.txt @@ -17,4 +17,4 @@ 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 dlt_shm.h dlt_offline_trace.h dlt_filetransfer.h dlt_common_api.h DESTINATION include/dlt - COMPONENT devel) + COMPONENT devel) diff --git a/include/dlt/dlt_common.h b/include/dlt/dlt_common.h index 2288f69..467fa6e 100755 --- a/include/dlt/dlt_common.h +++ b/include/dlt/dlt_common.h @@ -165,17 +165,17 @@ #define DLT_ENDIAN_GET_64(htyp,x) ((((htyp) & DLT_HTYP_MSBF)>0)?DLT_BETOH_64(x):DLT_LETOH_64(x)) #if defined (__WIN32__) || defined (_MSC_VER) -#define LOG_EMERG 0 -#define LOG_ALERT 1 -#define LOG_CRIT 2 -#define LOG_ERR 3 -#define LOG_WARNING 4 -#define LOG_NOTICE 5 -#define LOG_INFO 6 -#define LOG_DEBUG 7 - -#define LOG_PID 0x01 -#define LOG_DAEMON (3<<3) +#define LOG_EMERG 0 +#define LOG_ALERT 1 +#define LOG_CRIT 2 +#define LOG_ERR 3 +#define LOG_WARNING 4 +#define LOG_NOTICE 5 +#define LOG_INFO 6 +#define LOG_DEBUG 7 + +#define LOG_PID 0x01 +#define LOG_DAEMON (3<<3) #endif enum { @@ -218,12 +218,12 @@ enum { #define PRINT_FUNCTION_VERBOSE(_verbose) \ { \ - static char _strbuf[255]; \ + static char _strbuf[255]; \ \ if(_verbose) \ { \ - snprintf(_strbuf, 255, "%s()\n",__func__); \ - dlt_log(LOG_INFO, _strbuf); \ + snprintf(_strbuf, 255, "%s()\n",__func__); \ + dlt_log(LOG_INFO, _strbuf); \ } \ } @@ -232,29 +232,29 @@ enum { #endif #define DLT_MSG_IS_CONTROL(MSG) ((DLT_IS_HTYP_UEH((MSG)->standardheader->htyp)) && \ - (DLT_GET_MSIN_MSTP((MSG)->extendedheader->msin)==DLT_TYPE_CONTROL)) + (DLT_GET_MSIN_MSTP((MSG)->extendedheader->msin)==DLT_TYPE_CONTROL)) #define DLT_MSG_IS_CONTROL_REQUEST(MSG) ((DLT_IS_HTYP_UEH((MSG)->standardheader->htyp)) && \ - (DLT_GET_MSIN_MSTP((MSG)->extendedheader->msin)==DLT_TYPE_CONTROL) && \ - (DLT_GET_MSIN_MTIN((MSG)->extendedheader->msin)==DLT_CONTROL_REQUEST)) + (DLT_GET_MSIN_MSTP((MSG)->extendedheader->msin)==DLT_TYPE_CONTROL) && \ + (DLT_GET_MSIN_MTIN((MSG)->extendedheader->msin)==DLT_CONTROL_REQUEST)) #define DLT_MSG_IS_CONTROL_RESPONSE(MSG) ((DLT_IS_HTYP_UEH((MSG)->standardheader->htyp)) && \ - (DLT_GET_MSIN_MSTP((MSG)->extendedheader->msin)==DLT_TYPE_CONTROL) && \ - (DLT_GET_MSIN_MTIN((MSG)->extendedheader->msin)==DLT_CONTROL_RESPONSE)) + (DLT_GET_MSIN_MSTP((MSG)->extendedheader->msin)==DLT_TYPE_CONTROL) && \ + (DLT_GET_MSIN_MTIN((MSG)->extendedheader->msin)==DLT_CONTROL_RESPONSE)) #define DLT_MSG_IS_CONTROL_TIME(MSG) ((DLT_IS_HTYP_UEH((MSG)->standardheader->htyp)) && \ - (DLT_GET_MSIN_MSTP((MSG)->extendedheader->msin)==DLT_TYPE_CONTROL) && \ - (DLT_GET_MSIN_MTIN((MSG)->extendedheader->msin)==DLT_CONTROL_TIME)) + (DLT_GET_MSIN_MSTP((MSG)->extendedheader->msin)==DLT_TYPE_CONTROL) && \ + (DLT_GET_MSIN_MTIN((MSG)->extendedheader->msin)==DLT_CONTROL_TIME)) #define DLT_MSG_IS_NW_TRACE(MSG) ((DLT_IS_HTYP_UEH((MSG)->standardheader->htyp)) && \ - (DLT_GET_MSIN_MSTP((MSG)->extendedheader->msin)==DLT_TYPE_NW_TRACE)) + (DLT_GET_MSIN_MSTP((MSG)->extendedheader->msin)==DLT_TYPE_NW_TRACE)) #define DLT_MSG_IS_TRACE_MOST(MSG) ((DLT_IS_HTYP_UEH((MSG)->standardheader->htyp)) && \ - (DLT_GET_MSIN_MSTP((MSG)->extendedheader->msin)==DLT_TYPE_NW_TRACE) && \ - (DLT_GET_MSIN_MTIN((MSG)->extendedheader->msin)==DLT_NW_TRACE_MOST)) + (DLT_GET_MSIN_MSTP((MSG)->extendedheader->msin)==DLT_TYPE_NW_TRACE) && \ + (DLT_GET_MSIN_MTIN((MSG)->extendedheader->msin)==DLT_NW_TRACE_MOST)) #define DLT_MSG_IS_NONVERBOSE(MSG) (!(DLT_IS_HTYP_UEH((MSG)->standardheader->htyp)) || \ - ((DLT_IS_HTYP_UEH((MSG)->standardheader->htyp)) && (!(DLT_IS_MSIN_VERB((MSG)->extendedheader->msin))))) + ((DLT_IS_HTYP_UEH((MSG)->standardheader->htyp)) && (!(DLT_IS_MSIN_VERB((MSG)->extendedheader->msin))))) /* @@ -275,39 +275,39 @@ enum { #define DLT_FILTER_MAX 30 /**< Maximum number of filters */ #define DLT_MSG_READ_VALUE(dst,src,length,type) \ - { \ +{ \ if((length<0) || ((length)<((int32_t)sizeof(type)))) \ - { length = -1; } \ + { length = -1; } \ else \ - { dst = *((type*)src);src+=sizeof(type);length-=sizeof(type); } \ - } + { dst = *((type*)src);src+=sizeof(type);length-=sizeof(type); } \ +} #define DLT_MSG_READ_ID(dst,src,length) \ - { \ +{ \ if((length<0) || ((length) /* Needed for LONG_MAX */ -#include /* Needed for struct stat st*/ -#include "dlt.h" /* Needed for DLT Logs */ -#include /* Signal handling */ +#include /* Needed for LONG_MAX */ +#include /* Needed for struct stat st*/ +#include "dlt.h" /* Needed for DLT Logs */ +#include /* Signal handling */ #include "errno.h" @@ -86,31 +86,31 @@ extern int dlt_user_log_file_packagesCount(DltContext *fileContext, const char * * @param filename Absolute file path * @return Returns 0 if everything was okey.If there was a failure value < 0 will be returned. */ - extern int dlt_user_log_file_infoAbout(DltContext *fileContext, const char *filename); - - - //!Transfer the head of the file as a dlt logs. - /**The head of the file must be logged to dlt because the head contains inforamtion about the file serial number, - * the file name, the file size, package number the file have and the buffer size. - * All these informations are needed from the plugin of the dlt viewer. - * See the Mainpages.c for more informations. - * @param fileContext Specific context to log the file to dlt - * @param filename Absolute file path - * @param alias Alias for the file. An alternative name to show in the receiving end - * @return Returns 0 if everything was okey. If there was a failure value < 0 will be returned. - */ - extern int dlt_user_log_file_header_alias(DltContext *fileContext, const char *filename, const char *alias); - - //!Transfer the head of the file as a dlt logs. - /**The head of the file must be logged to dlt because the head contains inforamtion about the file serial number, - * the file name, the file size, package number the file have and the buffer size. - * All these informations are needed from the plugin of the dlt viewer. - * See the Mainpages.c for more informations. - * @param fileContext Specific context to log the file to dlt - * @param filename Absolute file path - * @return Returns 0 if everything was okey. If there was a failure value < 0 will be returned. - */ - extern int dlt_user_log_file_header(DltContext *fileContext, const char *filename); +extern int dlt_user_log_file_infoAbout(DltContext *fileContext, const char *filename); + + +//!Transfer the head of the file as a dlt logs. +/**The head of the file must be logged to dlt because the head contains inforamtion about the file serial number, + * the file name, the file size, package number the file have and the buffer size. + * All these informations are needed from the plugin of the dlt viewer. + * See the Mainpages.c for more informations. + * @param fileContext Specific context to log the file to dlt + * @param filename Absolute file path + * @param alias Alias for the file. An alternative name to show in the receiving end + * @return Returns 0 if everything was okey. If there was a failure value < 0 will be returned. + */ +extern int dlt_user_log_file_header_alias(DltContext *fileContext, const char *filename, const char *alias); + +//!Transfer the head of the file as a dlt logs. +/**The head of the file must be logged to dlt because the head contains inforamtion about the file serial number, + * the file name, the file size, package number the file have and the buffer size. + * All these informations are needed from the plugin of the dlt viewer. + * See the Mainpages.c for more informations. + * @param fileContext Specific context to log the file to dlt + * @param filename Absolute file path + * @return Returns 0 if everything was okey. If there was a failure value < 0 will be returned. + */ +extern int dlt_user_log_file_header(DltContext *fileContext, const char *filename); //!Transfer the content data of a file. diff --git a/include/dlt/dlt_offline_trace.h b/include/dlt/dlt_offline_trace.h index 84cb416..64a0958 100644 --- a/include/dlt/dlt_offline_trace.h +++ b/include/dlt/dlt_offline_trace.h @@ -61,10 +61,10 @@ typedef struct { - char directory[NAME_MAX + 1]; /**< (String) Store DLT messages to local directory */ + char directory[NAME_MAX + 1];/**< (String) Store DLT messages to local directory */ char filename[NAME_MAX + 1]; /**< (String) Filename of currently used log file */ - int fileSize; /**< (int) Maximum size in bytes of one trace file (Default: 1000000) */ - int maxSize; /**< (int) Maximum size of all trace files (Default: 4000000) */ + int fileSize; /**< (int) Maximum size in bytes of one trace file (Default: 1000000) */ + int maxSize; /**< (int) Maximum size of all trace files (Default: 4000000) */ int ohandle; } DltOfflineTrace; diff --git a/include/dlt/dlt_protocol.h b/include/dlt/dlt_protocol.h index 71dfa76..d734084 100755 --- a/include/dlt/dlt_protocol.h +++ b/include/dlt/dlt_protocol.h @@ -145,25 +145,25 @@ /* * Definitions of types of arguments in payload. */ -#define DLT_TYPE_INFO_TYLE 0x0000000f /**< Length of standard data: 1 = 8bit, 2 = 16bit, 3 = 32 bit, 4 = 64 bit, 5 = 128 bit */ -#define DLT_TYPE_INFO_BOOL 0x00000010 /**< Boolean data */ -#define DLT_TYPE_INFO_SINT 0x00000020 /**< Signed integer data */ -#define DLT_TYPE_INFO_UINT 0x00000040 /**< Unsigned integer data */ -#define DLT_TYPE_INFO_FLOA 0x00000080 /**< Float data */ -#define DLT_TYPE_INFO_ARAY 0x00000100 /**< Array of standard types */ -#define DLT_TYPE_INFO_STRG 0x00000200 /**< String */ -#define DLT_TYPE_INFO_RAWD 0x00000400 /**< Raw data */ -#define DLT_TYPE_INFO_VARI 0x00000800 /**< Set, if additional information to a variable is available */ -#define DLT_TYPE_INFO_FIXP 0x00001000 /**< Set, if quantization and offset are added */ -#define DLT_TYPE_INFO_TRAI 0x00002000 /**< Set, if additional trace information is added */ -#define DLT_TYPE_INFO_STRU 0x00004000 /**< Struct */ -#define DLT_TYPE_INFO_SCOD 0x00038000 /**< coding of the type string: 0 = ASCII, 1 = UTF-8 */ - -#define DLT_TYLE_8BIT 0x00000001 -#define DLT_TYLE_16BIT 0x00000002 -#define DLT_TYLE_32BIT 0x00000003 -#define DLT_TYLE_64BIT 0x00000004 -#define DLT_TYLE_128BIT 0x00000005 +#define DLT_TYPE_INFO_TYLE 0x0000000f /**< Length of standard data: 1 = 8bit, 2 = 16bit, 3 = 32 bit, 4 = 64 bit, 5 = 128 bit */ +#define DLT_TYPE_INFO_BOOL 0x00000010 /**< Boolean data */ +#define DLT_TYPE_INFO_SINT 0x00000020 /**< Signed integer data */ +#define DLT_TYPE_INFO_UINT 0x00000040 /**< Unsigned integer data */ +#define DLT_TYPE_INFO_FLOA 0x00000080 /**< Float data */ +#define DLT_TYPE_INFO_ARAY 0x00000100 /**< Array of standard types */ +#define DLT_TYPE_INFO_STRG 0x00000200 /**< String */ +#define DLT_TYPE_INFO_RAWD 0x00000400 /**< Raw data */ +#define DLT_TYPE_INFO_VARI 0x00000800 /**< Set, if additional information to a variable is available */ +#define DLT_TYPE_INFO_FIXP 0x00001000 /**< Set, if quantization and offset are added */ +#define DLT_TYPE_INFO_TRAI 0x00002000 /**< Set, if additional trace information is added */ +#define DLT_TYPE_INFO_STRU 0x00004000 /**< Struct */ +#define DLT_TYPE_INFO_SCOD 0x00038000 /**< coding of the type string: 0 = ASCII, 1 = UTF-8 */ + +#define DLT_TYLE_8BIT 0x00000001 +#define DLT_TYLE_16BIT 0x00000002 +#define DLT_TYLE_32BIT 0x00000003 +#define DLT_TYLE_64BIT 0x00000004 +#define DLT_TYLE_128BIT 0x00000005 #define DLT_SCOD_ASCII 0x00000000 #define DLT_SCOD_UTF8 0x00008000 @@ -196,8 +196,8 @@ #define DLT_SERVICE_ID_LAST_ENTRY 0x15 /**< Service ID: Last entry to avoid any further modifications in dependent code */ #define DLT_SERVICE_ID_UNREGISTER_CONTEXT 0xf01 /**< Service ID: Message unregister context */ #define DLT_SERVICE_ID_CONNECTION_INFO 0xf02 /**< Service ID: Message connection info */ -#define DLT_SERVICE_ID_TIMEZONE 0xf03 /**< Service ID: Timezone */ -#define DLT_SERVICE_ID_MARKER 0xf04 /**< Service ID: Marker */ +#define DLT_SERVICE_ID_TIMEZONE 0xf03 /**< Service ID: Timezone */ +#define DLT_SERVICE_ID_MARKER 0xf04 /**< Service ID: Marker */ #define DLT_SERVICE_ID_CALLSW_CINJECTION 0xFFF /**< Service ID: Message Injection (minimal ID) */ /* @@ -210,8 +210,8 @@ /* * Definitions of DLT service connection state */ -#define DLT_CONNECTION_STATUS_DISCONNECTED 0x01 /**< Client is disconnected */ -#define DLT_CONNECTION_STATUS_CONNECTED 0x02 /**< Client is connected */ +#define DLT_CONNECTION_STATUS_DISCONNECTED 0x01 /**< Client is disconnected */ +#define DLT_CONNECTION_STATUS_CONNECTED 0x02 /**< Client is connected */ /** \} diff --git a/include/dlt/dlt_shm.h b/include/dlt/dlt_shm.h index 5c9df51..52e8e1a 100644 --- a/include/dlt/dlt_shm.h +++ b/include/dlt/dlt_shm.h @@ -61,32 +61,32 @@ /* shared memory key */ /* must be the same for server and cleint */ -#define DLT_SHM_KEY 11771 +#define DLT_SHM_KEY 11771 /* default size of shared memory */ /* size is extended during creation to fit segment size */ /* client retreives real size from shm buffer */ -#define DLT_SHM_SIZE 100000 +#define DLT_SHM_SIZE 100000 /* Id of the used semaphore */ /* used for synchronisation of write and read access of multiple clients and server */ /* must be the same for server and client */ -#define DLT_SHM_SEM 22771 +#define DLT_SHM_SEM 22771 -#define DLT_SHM_HEAD "SHM" +#define DLT_SHM_HEAD "SHM" typedef struct { - int shmid; /* Id of shared memory */ - int semid; /* Id of semaphore */ - DltBuffer buffer; + int shmid; /* Id of shared memory */ + int semid; /* Id of semaphore */ + DltBuffer buffer; } DltShm; typedef struct { - char head[4]; - unsigned char status; - int size; + char head[4]; + unsigned char status; + int size; } DltShmBlockHead; #define DLT_SHM_SEM_GET(id) dlt_shm_pv(id,-1) diff --git a/include/dlt/dlt_types.h b/include/dlt/dlt_types.h index f10963a..1e7c8e6 100755 --- a/include/dlt/dlt_types.h +++ b/include/dlt/dlt_types.h @@ -27,7 +27,7 @@ /******************************************************************************* ** ** -** SRC-MODULE: dlt_types.h ** +** SRC-MODULE: dlt_types.h ** ** ** ** TARGET : linux ** ** ** @@ -60,22 +60,22 @@ #define DLT_TYPES_H #ifdef _MSC_VER - typedef __int64 int64_t; - typedef __int32 int32_t; - typedef __int16 int16_t; - typedef __int8 int8_t; +typedef __int64 int64_t; +typedef __int32 int32_t; +typedef __int16 int16_t; +typedef __int8 int8_t; - typedef unsigned __int64 uint64_t; - typedef unsigned __int32 uint32_t; - typedef unsigned __int16 uint16_t; - typedef unsigned __int8 uint8_t; +typedef unsigned __int64 uint64_t; +typedef unsigned __int32 uint32_t; +typedef unsigned __int16 uint16_t; +typedef unsigned __int8 uint8_t; - typedef int pid_t; - typedef unsigned int speed_t; +typedef int pid_t; +typedef unsigned int speed_t; - #define UINT16_MAX 0xFFFF +#define UINT16_MAX 0xFFFF - #include +#include #else #include #endif diff --git a/include/dlt/dlt_user.h b/include/dlt/dlt_user.h index 1c84c46..b6181bf 100644 --- a/include/dlt/dlt_user.h +++ b/include/dlt/dlt_user.h @@ -94,14 +94,14 @@ extern "C" { */ typedef enum { - DLT_LOG_DEFAULT = -1, /**< Default log level */ - DLT_LOG_OFF = 0x00, /**< Log level off */ - DLT_LOG_FATAL = 0x01, /**< fatal system error */ - DLT_LOG_ERROR = 0x02, /**< error with impact to correct functionality */ - DLT_LOG_WARN = 0x03, /**< warning, correct behaviour could not be ensured */ - DLT_LOG_INFO = 0x04, /**< informational */ - DLT_LOG_DEBUG = 0x05, /**< debug */ - DLT_LOG_VERBOSE = 0x06 /**< highest grade of information */ + DLT_LOG_DEFAULT = -1, /**< Default log level */ + DLT_LOG_OFF = 0x00, /**< Log level off */ + DLT_LOG_FATAL = 0x01, /**< fatal system error */ + DLT_LOG_ERROR = 0x02, /**< error with impact to correct functionality */ + DLT_LOG_WARN = 0x03, /**< warning, correct behaviour could not be ensured */ + DLT_LOG_INFO = 0x04, /**< informational */ + DLT_LOG_DEBUG = 0x05, /**< debug */ + DLT_LOG_VERBOSE = 0x06 /**< highest grade of information */ } DltLogLevelType; /** @@ -109,13 +109,13 @@ typedef enum */ typedef enum { - DLT_FORMAT_DEFAULT = 0x00, /**< no sepecial format */ - DLT_FORMAT_HEX8 = 0x01, /**< Hex 8 */ - DLT_FORMAT_HEX16 = 0x02, /**< Hex 16 */ - DLT_FORMAT_HEX32 = 0x03, /**< Hex 32 */ - DLT_FORMAT_HEX64 = 0x04, /**< Hex 64 */ - DLT_FORMAT_BIN8 = 0x05, /**< Binary 8 */ - DLT_FORMAT_BIN16 = 0x06 /**< Binary 16 */ + DLT_FORMAT_DEFAULT = 0x00, /**< no sepecial format */ + DLT_FORMAT_HEX8 = 0x01, /**< Hex 8 */ + DLT_FORMAT_HEX16 = 0x02, /**< Hex 16 */ + DLT_FORMAT_HEX32 = 0x03, /**< Hex 32 */ + DLT_FORMAT_HEX64 = 0x04, /**< Hex 64 */ + DLT_FORMAT_BIN8 = 0x05, /**< Binary 8 */ + DLT_FORMAT_BIN16 = 0x06 /**< Binary 16 */ } DltFormatType; /** @@ -123,9 +123,9 @@ typedef enum */ typedef enum { - DLT_TRACE_STATUS_DEFAULT = -1, /**< Default trace status */ - DLT_TRACE_STATUS_OFF = 0x00, /**< Trace status: Off */ - DLT_TRACE_STATUS_ON = 0x01 /**< Trace status: On */ + DLT_TRACE_STATUS_DEFAULT = -1, /**< Default trace status */ + DLT_TRACE_STATUS_OFF = 0x00, /**< Trace status: Off */ + DLT_TRACE_STATUS_ON = 0x01 /**< Trace status: On */ } DltTraceStatusType; /** @@ -134,21 +134,21 @@ typedef enum */ typedef enum { - DLT_NW_TRACE_IPC = 0x01, /**< Interprocess communication */ - DLT_NW_TRACE_CAN = 0x02, /**< Controller Area Network Bus */ - DLT_NW_TRACE_FLEXRAY = 0x03, /**< Flexray Bus */ - DLT_NW_TRACE_MOST = 0x04, /**< Media Oriented System Transport Bus */ - DLT_NW_TRACE_RESERVED0 = 0x05, - DLT_NW_TRACE_RESERVED1 = 0x06, - DLT_NW_TRACE_RESERVED2 = 0x07, - DLT_NW_TRACE_USER_DEFINED0 = 0x08, - DLT_NW_TRACE_USER_DEFINED1 = 0x09, - DLT_NW_TRACE_USER_DEFINED2 = 0x0A, - DLT_NW_TRACE_USER_DEFINED3 = 0x0B, - DLT_NW_TRACE_USER_DEFINED4 = 0x0C, - DLT_NW_TRACE_USER_DEFINED5 = 0x0D, - DLT_NW_TRACE_USER_DEFINED6 = 0x0E, - DLT_NW_TRACE_USER_DEFINED7 = 0x0F + DLT_NW_TRACE_IPC = 0x01, /**< Interprocess communication */ + DLT_NW_TRACE_CAN = 0x02, /**< Controller Area Network Bus */ + DLT_NW_TRACE_FLEXRAY = 0x03, /**< Flexray Bus */ + DLT_NW_TRACE_MOST = 0x04, /**< Media Oriented System Transport Bus */ + DLT_NW_TRACE_RESERVED0 = 0x05, + DLT_NW_TRACE_RESERVED1 = 0x06, + DLT_NW_TRACE_RESERVED2 = 0x07, + DLT_NW_TRACE_USER_DEFINED0 = 0x08, + DLT_NW_TRACE_USER_DEFINED1 = 0x09, + DLT_NW_TRACE_USER_DEFINED2 = 0x0A, + DLT_NW_TRACE_USER_DEFINED3 = 0x0B, + DLT_NW_TRACE_USER_DEFINED4 = 0x0C, + DLT_NW_TRACE_USER_DEFINED5 = 0x0D, + DLT_NW_TRACE_USER_DEFINED6 = 0x0E, + DLT_NW_TRACE_USER_DEFINED7 = 0x0F } DltNetworkTraceType; /** @@ -156,16 +156,16 @@ typedef enum */ typedef enum { - DLT_USER_MODE_UNDEFINED = -1, - DLT_USER_MODE_OFF = 0, - DLT_USER_MODE_EXTERNAL , - DLT_USER_MODE_INTERNAL , - DLT_USER_MODE_BOTH + DLT_USER_MODE_UNDEFINED = -1, + DLT_USER_MODE_OFF = 0, + DLT_USER_MODE_EXTERNAL , + DLT_USER_MODE_INTERNAL , + DLT_USER_MODE_BOTH } DltUserLogMode; #define DLT_USER_BUF_MAX_SIZE 2048 /**< maximum size of each user buffer, also used for injection buffer */ -#define DLT_USER_RESENDBUF_MAX_SIZE (DLT_USER_BUF_MAX_SIZE + 100) /**< Size of resend buffer; Max DLT message size is 2K plus some extra header space */ +#define DLT_USER_RESENDBUF_MAX_SIZE (DLT_USER_BUF_MAX_SIZE + 100) /**< Size of resend buffer; Max DLT message size is 2K plus some extra header space */ /* Use a semaphore or mutex from your OS to prevent concurrent access to the DLT buffer. */ #define DLT_SEM_LOCK() { sem_wait(&dlt_mutex); } @@ -176,11 +176,11 @@ typedef enum */ typedef struct { - char contextID[4]; /**< context id */ - int32_t log_level_pos; /**< offset in user-application context field */ - int8_t *log_level_ptr; /**< pointer to the log level */ - int8_t *trace_status_ptr; /**< pointer to the trace status */ - uint8_t mcnt; /**< message counter */ + char contextID[4]; /**< context id */ + int32_t log_level_pos; /**< offset in user-application context field */ + int8_t *log_level_ptr; /**< pointer to the log level */ + int8_t *trace_status_ptr; /**< pointer to the trace status */ + uint8_t mcnt; /**< message counter */ } DltContext; /** @@ -189,26 +189,26 @@ typedef struct typedef struct { DltContext *handle; /**< pointer to DltContext */ - unsigned char buffer[DLT_USER_BUF_MAX_SIZE]; /**< buffer for building log message*/ - int32_t size; /**< payload size */ - int32_t log_level; /**< log level */ - int32_t trace_status; /**< trace status */ - int32_t args_num; /**< number of arguments for extended header*/ - char* context_description; /**< description of context */ + unsigned char buffer[DLT_USER_BUF_MAX_SIZE]; /**< buffer for building log message*/ + int32_t size; /**< payload size */ + int32_t log_level; /**< log level */ + int32_t trace_status; /**< trace status */ + int32_t args_num; /**< number of arguments for extended header*/ + char* context_description; /**< description of context */ } DltContextData; typedef struct { - uint32_t service_id; - int (*injection_callback)(uint32_t service_id, void *data, uint32_t length); + uint32_t service_id; + int (*injection_callback)(uint32_t service_id, void *data, uint32_t length); } DltUserInjectionCallback; typedef struct { - char contextID[DLT_ID_SIZE]; /**< Context ID */ + char contextID[DLT_ID_SIZE]; /**< Context ID */ int8_t log_level; /**< Log level */ int8_t trace_status; /**< Trace status */ - void (*log_level_changed_callback) (char context_id[DLT_ID_SIZE],uint8_t log_level,uint8_t trace_status); + void (*log_level_changed_callback) (char context_id[DLT_ID_SIZE],uint8_t log_level,uint8_t trace_status); } DltUserLogLevelChangedCallback; /** @@ -226,7 +226,7 @@ typedef struct uint32_t nrcallbacks; // Log Level changed callback - void (*log_level_changed_callback) (char context_id[DLT_ID_SIZE],uint8_t log_level,uint8_t trace_status); + void (*log_level_changed_callback) (char context_id[DLT_ID_SIZE],uint8_t log_level,uint8_t trace_status); } dlt_ll_ts_type; @@ -235,44 +235,48 @@ typedef struct */ typedef struct { - char ecuID[DLT_ID_SIZE]; /**< ECU ID */ - char appID[DLT_ID_SIZE]; /**< Application ID */ - int dlt_log_handle; /**< Handle to fifo of dlt daemon */ - int dlt_user_handle; /**< Handle to own fifo */ - mqd_t dlt_segmented_queue_read_handle; /**< Handle message queue */ + char ecuID[DLT_ID_SIZE]; /**< ECU ID */ + char appID[DLT_ID_SIZE]; /**< Application ID */ + int dlt_log_handle; /**< Handle to fifo of dlt daemon */ + int dlt_user_handle; /**< Handle to own fifo */ + mqd_t dlt_segmented_queue_read_handle; /**< Handle message queue */ mqd_t dlt_segmented_queue_write_handle; /**< Handle message queue */ - pthread_t dlt_segmented_nwt_handle; /**< thread handle of segmented sending */ + pthread_t dlt_segmented_nwt_handle; /**< thread handle of segmented sending */ - int8_t dlt_is_file; /**< Target of logging: 1 to file, 0 to daemon */ + int8_t dlt_is_file; /**< Target of logging: 1 to file, 0 to daemon */ - dlt_ll_ts_type *dlt_ll_ts; //[MAX_DLT_LL_TS_ENTRIES]; /**< Internal management struct for all contexts */ - uint32_t dlt_ll_ts_max_num_entries; /**< Maximum number of contexts */ + dlt_ll_ts_type *dlt_ll_ts; /** [MAX_DLT_LL_TS_ENTRIES]; < Internal management struct for all + contexts */ + uint32_t dlt_ll_ts_max_num_entries; /**< Maximum number of contexts */ - uint32_t dlt_ll_ts_num_entries; /**< Number of used contexts */ + uint32_t dlt_ll_ts_num_entries; /**< Number of used contexts */ - int8_t overflow; /**< Overflow marker, set to 1 on overflow, 0 otherwise */ - uint32_t overflow_counter; /**< Counts the number of lost messages */ + int8_t overflow; /**< Overflow marker, set to 1 on overflow, 0 otherwise */ + uint32_t overflow_counter; /**< Counts the number of lost messages */ - char *application_description; /**< description of application */ + char *application_description; /**< description of application */ - DltReceiver receiver; /**< Receiver for internal user-defined messages from daemon */ + DltReceiver receiver; /**< Receiver for internal user-defined messages from daemon */ - int8_t verbose_mode; /**< Verbose mode enabled: 1 enabled, 0 disabled */ - int8_t use_extende_header_for_non_verbose; /**< Use extended header for non verbose: 1 enabled, 0 disabled */ - int8_t with_session_id; /**< Send always session id: 1 enabled, 0 disabled */ - int8_t with_timestamp; /**< Send always timestamp: 1 enabled, 0 disabled */ - int8_t with_ecu_id; /**< Send always ecu id: 1 enabled, 0 disabled */ + int8_t verbose_mode; /**< Verbose mode enabled: 1 enabled, 0 disabled */ + int8_t use_extende_header_for_non_verbose; /**< Use extended header for non verbose: 1 enabled, 0 disabled */ + int8_t with_session_id; /**< Send always session id: 1 enabled, 0 disabled */ + int8_t with_timestamp; /**< Send always timestamp: 1 enabled, 0 disabled */ + int8_t with_ecu_id; /**< Send always ecu id: 1 enabled, 0 disabled */ - int8_t enable_local_print; /**< Local printing of log messages: 1 enabled, 0 disabled */ - int8_t local_print_mode; /**< Local print mode, controlled by environment variable */ + int8_t enable_local_print; /**< Local printing of log messages: 1 enabled, 0 disabled */ + int8_t local_print_mode; /**< Local print mode, controlled by environment variable */ - int8_t log_state; /**< Log state of external connection: 1 client connected, 0 not connected, -1 unknown */ + int8_t log_state; /**< Log state of external connection: + 1 client connected, + 0 not connected, + -1 unknown */ //DltRingBuffer rbuf; - DltBuffer startup_buffer; /**< Ring-buffer for buffering messages during startup and missing connection */ + DltBuffer startup_buffer; /**< Ring-buffer for buffering messages during startup and missing connection */ - // Buffer used for resending, locked by DLT semaphore - uint8_t resend_buffer[DLT_USER_RESENDBUF_MAX_SIZE]; + // Buffer used for resending, locked by DLT semaphore + uint8_t resend_buffer[DLT_USER_RESENDBUF_MAX_SIZE]; #ifdef DLT_SHM_ENABLE DltShm dlt_shm; @@ -487,8 +491,8 @@ int dlt_user_trace_network_truncated(DltContext *handle, DltNetworkTraceType nw_ int dlt_user_trace_network_segmented(DltContext *handle, DltNetworkTraceType nw_trace_type, uint16_t header_len, void *header, uint16_t payload_len, void *payload); /************************************************************************************************** -* The folowing API functions define a high level function interface for DLT -**************************************************************************************************/ + * The folowing API functions define a high level function interface for DLT + **************************************************************************************************/ /** * Initialise the user lib communication with daemon. @@ -552,9 +556,9 @@ int dlt_register_context(DltContext *handle, const char *contextid, const char * * @param contextid four byte long character array with the context id * @param description long name of the context * @param loglevel This is the 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 This is the 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) * @return negative value if there was an error */ int dlt_register_context_ll_ts(DltContext *handle, const char *contextid, const char * description, int loglevel, int tracestatus); @@ -594,7 +598,7 @@ int dlt_get_log_state(); * @return negative value if there was an error */ int dlt_register_injection_callback(DltContext *handle, uint32_t service_id, - int (*dlt_injection_callback)(uint32_t service_id, void *data, uint32_t length)); + int (*dlt_injection_callback)(uint32_t service_id, void *data, uint32_t length)); /** * Register callback function called when log level of context was changed @@ -603,7 +607,7 @@ int dlt_register_injection_callback(DltContext *handle, uint32_t service_id, * @return negative value if there was an error */ int dlt_register_log_level_changed_callback(DltContext *handle, - void (*dlt_log_level_changed_callback)(char context_id[DLT_ID_SIZE],uint8_t log_level, uint8_t trace_status)); + void (*dlt_log_level_changed_callback)(char context_id[DLT_ID_SIZE],uint8_t log_level, uint8_t trace_status)); /** * Switch to verbose mode @@ -774,8 +778,8 @@ int dlt_user_atexit_blow_out_user_buffer(void); int dlt_user_log_resend_buffer(void); #ifdef DLT_TEST_ENABLE -void dlt_user_test_corrupt_user_header(int enable); -void dlt_user_test_corrupt_message_size(int enable,int16_t size); + void dlt_user_test_corrupt_user_header(int enable); + void dlt_user_test_corrupt_message_size(int enable,int16_t size); #endif /* DLT_TEST_ENABLE */ #ifdef __cplusplus diff --git a/include/dlt/dlt_user_macros.h b/include/dlt/dlt_user_macros.h index 7f55ad3..2e2528c 100644 --- a/include/dlt/dlt_user_macros.h +++ b/include/dlt/dlt_user_macros.h @@ -73,10 +73,10 @@ #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 @@ -91,7 +91,7 @@ * Example: DLT_DECLARE_CONTEXT(hContext) */ #define DLT_DECLARE_CONTEXT(CONTEXT) \ -DltContext CONTEXT; + DltContext CONTEXT; /** * Use an object of a new context created in another module. @@ -102,7 +102,7 @@ DltContext CONTEXT; * Example: DLT_IMPORT_CONTEXT(hContext) */ #define DLT_IMPORT_CONTEXT(CONTEXT) \ -extern DltContext CONTEXT; + extern DltContext CONTEXT; /** * Register application. @@ -110,15 +110,15 @@ extern DltContext CONTEXT; * @param DESCRIPTION ASCII string containing description */ #define DLT_REGISTER_APP(APPID,DESCRIPTION) do {\ - (void)dlt_check_library_version(_DLT_PACKAGE_MAJOR_VERSION, _DLT_PACKAGE_MINOR_VERSION ); \ - (void)dlt_register_app( APPID, DESCRIPTION);} while(0) + (void)dlt_check_library_version(_DLT_PACKAGE_MAJOR_VERSION, _DLT_PACKAGE_MINOR_VERSION ); \ + (void)dlt_register_app( APPID, DESCRIPTION);} while(0) /** * Unregister application. */ #define DLT_UNREGISTER_APP() do{\ - (void)dlt_unregister_app();} while(0) + (void)dlt_unregister_app();} while(0) /** * Register context (with default log level and default trace status) @@ -127,7 +127,7 @@ extern DltContext CONTEXT; * @param DESCRIPTION ASCII string containing description */ #define DLT_REGISTER_CONTEXT(CONTEXT,CONTEXTID,DESCRIPTION) do{\ - (void)dlt_register_context(&(CONTEXT), CONTEXTID, DESCRIPTION);} while(0) + (void)dlt_register_context(&(CONTEXT), CONTEXTID, DESCRIPTION);} while(0) /** * Register context with pre-defined log level and pre-defined trace status. @@ -140,14 +140,14 @@ extern DltContext CONTEXT; (DLT_TRACE_STATUS_DEFAULT is not allowed here) */ #define DLT_REGISTER_CONTEXT_LL_TS(CONTEXT,CONTEXTID,DESCRIPTION,LOGLEVEL,TRACESTATUS) do{\ - (void)dlt_register_context_ll_ts(&(CONTEXT), CONTEXTID, DESCRIPTION, LOGLEVEL, TRACESTATUS);} while(0) + (void)dlt_register_context_ll_ts(&(CONTEXT), CONTEXTID, DESCRIPTION, LOGLEVEL, TRACESTATUS);} while(0) /** * Unregister context. * @param CONTEXT object containing information about one special logging context */ #define DLT_UNREGISTER_CONTEXT(CONTEXT) do{\ - (void)dlt_unregister_context(&(CONTEXT));} while(0) + (void)dlt_unregister_context(&(CONTEXT));} while(0) /** * Register callback function called when injection message was received @@ -156,7 +156,7 @@ extern DltContext CONTEXT; * @param CALLBACK function pointer to callback function */ #define DLT_REGISTER_INJECTION_CALLBACK(CONTEXT, SERVICEID, CALLBACK) do{\ - (void)dlt_register_injection_callback(&(CONTEXT),SERVICEID, CALLBACK);} while(0) + (void)dlt_register_injection_callback(&(CONTEXT),SERVICEID, CALLBACK);} while(0) /** * Register callback function called when log level of context was changed @@ -164,7 +164,7 @@ extern DltContext CONTEXT; * @param CALLBACK function pointer to callback function */ #define DLT_REGISTER_LOG_LEVEL_CHANGED_CALLBACK(CONTEXT, CALLBACK) do{\ - (void)dlt_register_log_level_changed_callback(&(CONTEXT),CALLBACK);} while(0) + (void)dlt_register_log_level_changed_callback(&(CONTEXT),CALLBACK);} while(0) /** * Send log message with variable list of messages (intended for verbose mode) @@ -180,19 +180,19 @@ extern DltContext CONTEXT; /* use function interface instead */ #else #define DLT_LOG(CONTEXT,LOGLEVEL,ARGS...) \ - do { \ - if((CONTEXT).log_level_ptr && ((LOGLEVEL)<=(int)*((CONTEXT).log_level_ptr) ) && ((LOGLEVEL)!=0)) \ - { \ - DltContextData log_local; \ - int dlt_local; \ - dlt_local = dlt_user_log_write_start(&CONTEXT,&log_local,LOGLEVEL); \ - if (dlt_local > 0) \ - { \ - ARGS; \ - (void)dlt_user_log_write_finish(&log_local); \ - } \ - } \ - } while(0) + do { \ + if((CONTEXT).log_level_ptr && ((LOGLEVEL)<=(int)*((CONTEXT).log_level_ptr) ) && ((LOGLEVEL)!=0)) \ + { \ + DltContextData log_local; \ + int dlt_local; \ + dlt_local = dlt_user_log_write_start(&CONTEXT,&log_local,LOGLEVEL); \ + if (dlt_local > 0) \ + { \ + ARGS; \ + (void)dlt_user_log_write_finish(&log_local); \ + } \ + } \ + } while(0) #endif /** @@ -212,19 +212,19 @@ extern DltContext CONTEXT; /* use function interface instead */ #else #define DLT_LOG_ID(CONTEXT,LOGLEVEL,MSGID,ARGS...) \ - do { \ - if((CONTEXT).log_level_ptr && ((LOGLEVEL)<=(int)*((CONTEXT).log_level_ptr) ) && ((LOGLEVEL)!=0)) \ - { \ - DltContextData log_local; \ - int dlt_local; \ - dlt_local = dlt_user_log_write_start_id(&CONTEXT,&log_local,LOGLEVEL,MSGID); \ - if (dlt_local > 0) \ - { \ - ARGS; \ - (void)dlt_user_log_write_finish(&log_local); \ - } \ - } \ - } while(0) + do { \ + if((CONTEXT).log_level_ptr && ((LOGLEVEL)<=(int)*((CONTEXT).log_level_ptr) ) && ((LOGLEVEL)!=0)) \ + { \ + DltContextData log_local; \ + int dlt_local; \ + dlt_local = dlt_user_log_write_start_id(&CONTEXT,&log_local,LOGLEVEL,MSGID); \ + if (dlt_local > 0) \ + { \ + ARGS; \ + (void)dlt_user_log_write_finish(&log_local); \ + } \ + } \ + } while(0) #endif /** @@ -232,80 +232,80 @@ extern DltContext CONTEXT; * @param TEXT ASCII string */ #define DLT_STRING(TEXT) \ - (void)dlt_user_log_write_string(&log_local,TEXT) + (void)dlt_user_log_write_string(&log_local,TEXT) /** * Add constant string parameter to the log messsage. * @param TEXT Constant ASCII string */ #define DLT_CSTRING(TEXT) \ - (void)dlt_user_log_write_constant_string(&log_local,TEXT) + (void)dlt_user_log_write_constant_string(&log_local,TEXT) /** * Add utf8-encoded string parameter to the log messsage. * @param TEXT UTF8-encoded string */ #define DLT_UTF8(TEXT) \ - (void)dlt_user_log_write_utf8_string(&log_local,TEXT) + (void)dlt_user_log_write_utf8_string(&log_local,TEXT) /** * Add boolean parameter to the log messsage. * @param BOOL_VAR Boolean value (mapped to uint8) */ #define DLT_BOOL(BOOL_VAR) \ - (void)dlt_user_log_write_bool(&log_local,BOOL_VAR) + (void)dlt_user_log_write_bool(&log_local,BOOL_VAR) /** * Add float32 parameter to the log messsage. * @param FLOAT32_VAR Float32 value (mapped to float) */ #define DLT_FLOAT32(FLOAT32_VAR) \ - (void)dlt_user_log_write_float32(&log_local,FLOAT32_VAR) + (void)dlt_user_log_write_float32(&log_local,FLOAT32_VAR) /** * Add float64 parameter to the log messsage. * @param FLOAT64_VAR Float64 value (mapped to double) */ #define DLT_FLOAT64(FLOAT64_VAR) \ - (void)dlt_user_log_write_float64(&log_local,FLOAT64_VAR) + (void)dlt_user_log_write_float64(&log_local,FLOAT64_VAR) /** * Add integer parameter to the log messsage. * @param INT_VAR integer value */ #define DLT_INT(INT_VAR) \ - (void)dlt_user_log_write_int(&log_local,INT_VAR) + (void)dlt_user_log_write_int(&log_local,INT_VAR) #define DLT_INT8(INT_VAR) \ - (void)dlt_user_log_write_int8(&log_local,INT_VAR) + (void)dlt_user_log_write_int8(&log_local,INT_VAR) #define DLT_INT16(INT_VAR) \ - (void)dlt_user_log_write_int16(&log_local,INT_VAR) + (void)dlt_user_log_write_int16(&log_local,INT_VAR) #define DLT_INT32(INT_VAR) \ - (void)dlt_user_log_write_int32(&log_local,INT_VAR) + (void)dlt_user_log_write_int32(&log_local,INT_VAR) #define DLT_INT64(INT_VAR) \ - (void)dlt_user_log_write_int64(&log_local,INT_VAR) + (void)dlt_user_log_write_int64(&log_local,INT_VAR) /** * Add unsigned integer parameter to the log messsage. * @param UINT_VAR unsigned integer value */ #define DLT_UINT(UINT_VAR) \ - (void)dlt_user_log_write_uint(&log_local,UINT_VAR) + (void)dlt_user_log_write_uint(&log_local,UINT_VAR) #define DLT_UINT8(UINT_VAR) \ - (void)dlt_user_log_write_uint8(&log_local,UINT_VAR) + (void)dlt_user_log_write_uint8(&log_local,UINT_VAR) #define DLT_UINT16(UINT_VAR) \ - (void)dlt_user_log_write_uint16(&log_local,UINT_VAR) + (void)dlt_user_log_write_uint16(&log_local,UINT_VAR) #define DLT_UINT32(UINT_VAR) \ - (void)dlt_user_log_write_uint32(&log_local,UINT_VAR) + (void)dlt_user_log_write_uint32(&log_local,UINT_VAR) #define DLT_UINT64(UINT_VAR) \ - (void)dlt_user_log_write_uint64(&log_local,UINT_VAR) + (void)dlt_user_log_write_uint64(&log_local,UINT_VAR) /** * Add binary memory block to the log messages. @@ -313,19 +313,19 @@ extern DltContext CONTEXT; * @param LEN length of memory block */ #define DLT_RAW(BUF,LEN) \ - (void)dlt_user_log_write_raw(&log_local,BUF,LEN) + (void)dlt_user_log_write_raw(&log_local,BUF,LEN) #define DLT_HEX8(UINT_VAR) \ - (void)dlt_user_log_write_uint8_formatted(&log_local,UINT_VAR,DLT_FORMAT_HEX8) + (void)dlt_user_log_write_uint8_formatted(&log_local,UINT_VAR,DLT_FORMAT_HEX8) #define DLT_HEX16(UINT_VAR) \ - (void)dlt_user_log_write_uint16_formatted(&log_local,UINT_VAR,DLT_FORMAT_HEX16) + (void)dlt_user_log_write_uint16_formatted(&log_local,UINT_VAR,DLT_FORMAT_HEX16) #define DLT_HEX32(UINT_VAR) \ - (void)dlt_user_log_write_uint32_formatted(&log_local,UINT_VAR,DLT_FORMAT_HEX32) + (void)dlt_user_log_write_uint32_formatted(&log_local,UINT_VAR,DLT_FORMAT_HEX32) #define DLT_HEX64(UINT_VAR) \ - (void)dlt_user_log_write_uint64_formatted(&log_local,UINT_VAR,DLT_FORMAT_HEX64) + (void)dlt_user_log_write_uint64_formatted(&log_local,UINT_VAR,DLT_FORMAT_HEX64) #define DLT_BIN8(UINT_VAR) \ - (void)dlt_user_log_write_uint8_formatted(&log_local,UINT_VAR,DLT_FORMAT_BIN8) + (void)dlt_user_log_write_uint8_formatted(&log_local,UINT_VAR,DLT_FORMAT_BIN8) #define DLT_BIN16(UINT_VAR) \ - (void)dlt_user_log_write_uint16_formatted(&log_local,UINT_VAR,DLT_FORMAT_BIN16) + (void)dlt_user_log_write_uint16_formatted(&log_local,UINT_VAR,DLT_FORMAT_BIN16) /** * Trace network message @@ -338,10 +338,10 @@ extern DltContext CONTEXT; */ #define DLT_TRACE_NETWORK(CONTEXT,TYPE,HEADERLEN,HEADER,PAYLOADLEN,PAYLOAD) \ do { \ - if ((CONTEXT).trace_status_ptr && *((CONTEXT).trace_status_ptr)==DLT_TRACE_STATUS_ON) \ - { \ - (void)dlt_user_trace_network(&(CONTEXT),TYPE,HEADERLEN,HEADER,PAYLOADLEN,PAYLOAD); \ - } \ + if ((CONTEXT).trace_status_ptr && *((CONTEXT).trace_status_ptr)==DLT_TRACE_STATUS_ON) \ + { \ + (void)dlt_user_trace_network(&(CONTEXT),TYPE,HEADERLEN,HEADER,PAYLOADLEN,PAYLOAD); \ + } \ }while(0) /** @@ -355,10 +355,10 @@ extern DltContext CONTEXT; */ #define DLT_TRACE_NETWORK_TRUNCATED(CONTEXT,TYPE,HEADERLEN,HEADER,PAYLOADLEN,PAYLOAD) \ do { \ - if ((CONTEXT).trace_status_ptr && *((CONTEXT).trace_status_ptr)==DLT_TRACE_STATUS_ON) \ - { \ - (void)dlt_user_trace_network_truncated(&(CONTEXT),TYPE,HEADERLEN,HEADER,PAYLOADLEN,PAYLOAD, 1); \ - } \ + if ((CONTEXT).trace_status_ptr && *((CONTEXT).trace_status_ptr)==DLT_TRACE_STATUS_ON) \ + { \ + (void)dlt_user_trace_network_truncated(&(CONTEXT),TYPE,HEADERLEN,HEADER,PAYLOADLEN,PAYLOAD, 1); \ + } \ }while(0) /** @@ -372,10 +372,10 @@ extern DltContext CONTEXT; */ #define DLT_TRACE_NETWORK_SEGMENTED(CONTEXT,TYPE,HEADERLEN,HEADER,PAYLOADLEN,PAYLOAD) \ do { \ - if ((CONTEXT).trace_status_ptr && *((CONTEXT).trace_status_ptr)==DLT_TRACE_STATUS_ON) \ - { \ - (void)dlt_user_trace_network_segmented(&(CONTEXT),TYPE,HEADERLEN,HEADER,PAYLOADLEN,PAYLOAD); \ - } \ + if ((CONTEXT).trace_status_ptr && *((CONTEXT).trace_status_ptr)==DLT_TRACE_STATUS_ON) \ + { \ + (void)dlt_user_trace_network_segmented(&(CONTEXT),TYPE,HEADERLEN,HEADER,PAYLOADLEN,PAYLOAD); \ + } \ }while(0) /** @@ -386,10 +386,10 @@ extern DltContext CONTEXT; */ #define DLT_LOG_STRING(CONTEXT,LOGLEVEL,TEXT) \ do { \ - if((CONTEXT).log_level_ptr && ((LOGLEVEL)<=(int)*((CONTEXT).log_level_ptr) ) && ((LOGLEVEL)!=0)) \ - { \ - (void)dlt_log_string(&(CONTEXT), LOGLEVEL, TEXT); \ - } \ + if((CONTEXT).log_level_ptr && ((LOGLEVEL)<=(int)*((CONTEXT).log_level_ptr) ) && ((LOGLEVEL)!=0)) \ + { \ + (void)dlt_log_string(&(CONTEXT), LOGLEVEL, TEXT); \ + } \ } while(0) /** @@ -400,12 +400,12 @@ extern DltContext CONTEXT; * @param INT_VAR integer value */ #define DLT_LOG_STRING_INT(CONTEXT,LOGLEVEL,TEXT,INT_VAR) \ - do { \ - if((CONTEXT).log_level_ptr && ((LOGLEVEL)<=(int)*((CONTEXT).log_level_ptr) ) && ((LOGLEVEL)!=0)) \ - { \ - (void)dlt_log_string_int(&(CONTEXT), LOGLEVEL, TEXT, INT_VAR); \ - } \ - } while(0) + do { \ + if((CONTEXT).log_level_ptr && ((LOGLEVEL)<=(int)*((CONTEXT).log_level_ptr) ) && ((LOGLEVEL)!=0)) \ + { \ + (void)dlt_log_string_int(&(CONTEXT), LOGLEVEL, TEXT, INT_VAR); \ + } \ + } while(0) /** * Send log message with string parameter and unsigned integer parameter. @@ -415,12 +415,12 @@ extern DltContext CONTEXT; * @param UINT_VAR unsigned integer value */ #define DLT_LOG_STRING_UINT(CONTEXT,LOGLEVEL,TEXT,UINT_VAR) \ - do { \ - if((CONTEXT).log_level_ptr && ((LOGLEVEL)<=(int)*((CONTEXT).log_level_ptr) ) && ((LOGLEVEL)!=0)) \ - { \ - (void)dlt_log_string_uint(&(CONTEXT),LOGLEVEL,TEXT,UINT_VAR); \ - } \ - } while(0) + do { \ + if((CONTEXT).log_level_ptr && ((LOGLEVEL)<=(int)*((CONTEXT).log_level_ptr) ) && ((LOGLEVEL)!=0)) \ + { \ + (void)dlt_log_string_uint(&(CONTEXT),LOGLEVEL,TEXT,UINT_VAR); \ + } \ + } while(0) /** * Send log message with unsigned integer parameter. @@ -429,12 +429,12 @@ extern DltContext CONTEXT; * @param UINT_VAR unsigned integer value */ #define DLT_LOG_UINT(CONTEXT,LOGLEVEL,UINT_VAR) \ - do { \ - if((CONTEXT).log_level_ptr && ((LOGLEVEL)<=(int)*((CONTEXT).log_level_ptr) ) && ((LOGLEVEL)!=0)) \ - { \ - (void)dlt_log_uint(&(CONTEXT),LOGLEVEL,UINT_VAR); \ - } \ - } while(0) + do { \ + if((CONTEXT).log_level_ptr && ((LOGLEVEL)<=(int)*((CONTEXT).log_level_ptr) ) && ((LOGLEVEL)!=0)) \ + { \ + (void)dlt_log_uint(&(CONTEXT),LOGLEVEL,UINT_VAR); \ + } \ + } while(0) /** * Send log message with integer parameter. @@ -443,12 +443,12 @@ extern DltContext CONTEXT; * @param INT_VAR integer value */ #define DLT_LOG_INT(CONTEXT,LOGLEVEL,INT_VAR) \ - do { \ - if((CONTEXT).log_level_ptr && ((LOGLEVEL)<=(int)*((CONTEXT).log_level_ptr) ) && ((LOGLEVEL)!=0)) \ - { \ - (void)dlt_log_int(&(CONTEXT),LOGLEVEL,INT_VAR); \ - } \ - } while(0) + do { \ + if((CONTEXT).log_level_ptr && ((LOGLEVEL)<=(int)*((CONTEXT).log_level_ptr) ) && ((LOGLEVEL)!=0)) \ + { \ + (void)dlt_log_int(&(CONTEXT),LOGLEVEL,INT_VAR); \ + } \ + } while(0) /** * Send log message with binary memory block. @@ -458,34 +458,34 @@ extern DltContext CONTEXT; * @param LEN length of memory block */ #define DLT_LOG_RAW(CONTEXT,LOGLEVEL,BUF,LEN) \ - do { \ - if((CONTEXT).log_level_ptr && ((LOGLEVEL)<=(int)*((CONTEXT).log_level_ptr) ) && ((LOGLEVEL)!=0)) \ - { \ - (void)dlt_log_raw(&(CONTEXT),LOGLEVEL,BUF,LEN); \ - } \ - } while(0) + do { \ + if((CONTEXT).log_level_ptr && ((LOGLEVEL)<=(int)*((CONTEXT).log_level_ptr) ) && ((LOGLEVEL)!=0)) \ + { \ + (void)dlt_log_raw(&(CONTEXT),LOGLEVEL,BUF,LEN); \ + } \ + } while(0) /** * Send log message with marker. */ #define DLT_LOG_MARKER() \ - do { \ - (void)dlt_log_marker(); \ - } while(0) + do { \ + (void)dlt_log_marker(); \ + } while(0) /** * Switch to verbose mode * */ #define DLT_VERBOSE_MODE() do { \ - (void)dlt_verbose_mode();} while(0) + (void)dlt_verbose_mode();} while(0) /** * Switch to non-verbose mode * */ #define DLT_NONVERBOSE_MODE() do {\ - (void)dlt_nonverbose_mode();} while(0) + (void)dlt_nonverbose_mode();} while(0) /** * Set maximum logged log level and trace status of application @@ -501,17 +501,17 @@ extern DltContext CONTEXT; * */ #define DLT_ENABLE_LOCAL_PRINT() do {\ - (void)dlt_enable_local_print();} while(0) + (void)dlt_enable_local_print();} while(0) /** * Disable local printing of messages * */ #define DLT_DISABLE_LOCAL_PRINT() do {\ - (void)dlt_disable_local_print();} while(0) + (void)dlt_disable_local_print();} while(0) /** - \} - */ + \} +*/ #endif /* DLT_USER_MACROS_H */ -- cgit v1.2.1