* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
- * \author Alexander Wenzel <alexander.wenzel@bmw.de> BMW 2011-2012
+ * \author Alexander Wenzel <alexander.aw.wenzel@bmw.de> BMW 2011-2012
*
* \file dlt_common.h
* For further information see http://www.genivi.org/.
#define DLT_SWAP_32(value) ((((value) >> 24)&0xff) | (((value) << 8)&0xff0000) | (((value) >> 8)&0xff00) | (((value) << 24)&0xff000000))
/* Set Big Endian and Little Endian to a initial value, if not defined */
+#if !defined __USE_BSD
#ifndef LITTLE_ENDIAN
#define LITTLE_ENDIAN 1234
#endif
#ifndef BIG_ENDIAN
#define BIG_ENDIAN 4321
#endif
+#endif /* __USE_BSD */
/* If byte order is not defined, default to little endian */
+#if !defined __USE_BSD
#ifndef BYTE_ORDER
#define BYTE_ORDER LITTLE_ENDIAN
#endif
+#endif /* __USE_BSD */
/* Check for byte-order */
#if (BYTE_ORDER==BIG_ENDIAN)
#define LOG_DAEMON (3<<3)
#endif
+enum {
+ DLT_LOG_TO_CONSOLE=0,
+ DLT_LOG_TO_SYSLOG=1,
+ DLT_LOG_TO_FILE=2,
+ DLT_LOG_DROPPED=3
+};
+
/**
* The standard TCP Port used for DLT daemon
*/
#define DLT_DAEMON_TCP_PORT 3490
+
+/* Initi value for file descritpor */
+#define DLT_FD_INIT -1
+
+/* Minimum value for a file descriptor except the POSIX Standards: stdin=0, stdout=1, stderr=2 */
+#define DLT_FD_MINIMUM 3
+
/**
* The size of a DLT ID
*/
\
if(_verbose) \
{ \
- sprintf(_strbuf, "%s()\n",__func__); \
+ snprintf(_strbuf, 255, "%s()\n",__func__); \
dlt_log(LOG_INFO, _strbuf); \
} \
}
uint8_t headerbuffer[sizeof(DltStorageHeader)+
sizeof(DltStandardHeader)+sizeof(DltStandardHeaderExtra)+sizeof(DltExtendedHeader)]; /**< buffer for loading complete header */
uint8_t *databuffer; /**< buffer for loading payload */
+ int32_t databuffersize;
/* header values of current loaded message */
DltStorageHeader *storageheader; /**< pointer to storage header of current loaded header */
uint32_t service_id; /**< service ID */
uint8_t status; /**< reponse status */
uint8_t overflow; /**< overflow status */
+ uint32_t overflow_counter; /**< overflow counter */
} PACKED DltServiceMessageBufferOverflowResponse;
typedef struct
uint32_t service_id; /**< service ID */
uint8_t status; /**< reponse status */
uint32_t length; /**< length of following payload */
- /* char [] payload */
+ /*char [] payload;*/
} PACKED DltServiceGetSoftwareVersionResponse;
/**
+ * The structure of the DLT Service Unregister Context.
+ */
+typedef struct
+{
+ uint32_t service_id; /**< service ID */
+ uint8_t status; /**< reponse status */
+ char apid[DLT_ID_SIZE]; /**< application id */
+ char ctid[DLT_ID_SIZE]; /**< context id */
+ char comid[DLT_ID_SIZE]; /**< communication interface */
+} PACKED DltServiceUnregisterContext;
+
+/**
+ * The structure of the DLT Service Connection Info
+ */
+typedef struct
+{
+ uint32_t service_id; /**< service ID */
+ uint8_t status; /**< reponse status */
+ uint8_t state; /**< new state */
+ char comid[DLT_ID_SIZE]; /**< communication interface */
+} PACKED DltServiceConnectionInfo;
+
+/**
+ * The structure of the DLT Service Timezone
+ */
+typedef struct
+{
+ uint32_t service_id; /**< service ID */
+ uint8_t status; /**< reponse status */
+ int32_t timezone; /**< Timezone in seconds */
+ uint8_t isdst; /**< Is daylight saving time */
+} PACKED DltServiceTimezone;
+
+/**
* Structure to store filter parameters.
* ID are maximal four characters. Unused values are filled with zeros.
* If every value as filter is valid, the id should be empty by having only zero values.
int size;
} DltBufferBlockHead;
+#define DLT_MESSAGE_ERROR_OK 0
+#define DLT_MESSAGE_ERROR_UNKNOWN -1
+#define DLT_MESSAGE_ERROR_SIZE -2
+#define DLT_MESSAGE_ERROR_CONTENT -3
+
#ifdef __cplusplus
extern "C"
{
*/
int dlt_message_argument_print(DltMessage *msg,uint32_t type_info,uint8_t **ptr,int32_t *datalength,char *text,int textlength,int byteLength,int verbose);
+ /**
+ * Check environment variables.
+ */
+ void dlt_check_envvar();
+
#ifdef __cplusplus
}
#endif