genivi-diagnostic-log-and-trace@lists.genivi.org

Diagnostic Log and Trace (DLT) Discussion List

View all threads

Regarding DLT Message construction using DltMessage Structure

SK
Satish Kumar
Mon, Jun 22, 2020 12:47 PM

Hi,
I  am working around the DLT  component.  As  part of the requirement, I  will have  to construct a DLT message manually  with the help  of  the below structures
*** The structure of the DLT file storage header. This header is used before each stored DLT message./typedef struct{char pattern[DLT_ID_SIZE]; /< This pattern should be DLT0x01 */uint32_t seconds; /< seconds since 1.1.1970 /int32_t microseconds; /< Microseconds */char ecu[DLT_ID_SIZE]; /< The ECU id is added, if it is not already in the DLT message itself /} PACKED DltStorageHeader;
/
The structure of the DLT standard header. This header is used in each DLT message./typedef struct{uint8_t htyp; /< This parameter contains several informations, see definitions below */uint8_t mcnt; /< The message counter is increased with each sent DLT message /uint16_t len; /< Length of the complete message, without storage header /} PACKED DltStandardHeader;
/
The structure of the DLT extra header parameters. Each parameter is sent only if enabled in htyp.
/typedef struct{char ecu[DLT_ID_SIZE]; /< ECU id */uint32_t seid; /< Session number /uint32_t tmsp; /< Timestamp since system start in 0.1 milliseconds /} PACKED DltStandardHeaderExtra;
/
The structure of the DLT extended header. This header is only sent if enabled in htyp parameter.
/typedef struct{uint8_t msin; /< messsage info */uint8_t noar; /< number of arguments /char apid[DLT_ID_SIZE]; /< application id */char ctid[DLT_ID_SIZE]; /< context id /} PACKED DltExtendedHeader;/
The structure to organize the DLT messages.* This structure is used by the corresponding functions.*/typedef struct sDltMessage{/ flags /int8_t found_serialheader;
/ offsets /int32_t resync_offset;
/ size parameters /int32_t headersize; /< size of complete header including storage header */int32_t datasize; /< size of complete payload */
/ buffer for current loaded message /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 /DltStandardHeader standardheader; /< pointer to standard header of current loaded header /DltStandardHeaderExtra headerextra; /< extra parameters of current loaded header */DltExtendedHeader extendedheader; /< pointer to extended of current loaded header /} DltMessage;

  1. Could anyone of you provide the sample and proper values of DLT-Message field values?  Any help/suggestions would be appreciated     DltMessage msg = {input1,input2,input3......inputn }// sample values of dlt-message structure      I tired myself  but somehow I feel I need some  clarity on proper values of DltMessage structure members 2. How data size is different from the data buffer size?
    Thanks,Satish
Hi, I  am working around the DLT  component.  As  part of the requirement, I  will have  to construct a DLT message manually  with the help  of  the below structures *** The structure of the DLT file storage header. This header is used before each stored DLT message.*/typedef struct{char pattern[DLT_ID_SIZE]; /**< This pattern should be DLT0x01 */uint32_t seconds; /**< seconds since 1.1.1970 */int32_t microseconds; /**< Microseconds */char ecu[DLT_ID_SIZE]; /**< The ECU id is added, if it is not already in the DLT message itself */} PACKED DltStorageHeader; /*** The structure of the DLT standard header. This header is used in each DLT message.*/typedef struct{uint8_t htyp; /**< This parameter contains several informations, see definitions below */uint8_t mcnt; /**< The message counter is increased with each sent DLT message */uint16_t len; /**< Length of the complete message, without storage header */} PACKED DltStandardHeader; /*** The structure of the DLT extra header parameters. Each parameter is sent only if enabled in htyp.*/typedef struct{char ecu[DLT_ID_SIZE]; /**< ECU id */uint32_t seid; /**< Session number */uint32_t tmsp; /**< Timestamp since system start in 0.1 milliseconds */} PACKED DltStandardHeaderExtra; /*** The structure of the DLT extended header. This header is only sent if enabled in htyp parameter.*/typedef struct{uint8_t msin; /**< messsage info */uint8_t noar; /**< number of arguments */char apid[DLT_ID_SIZE]; /**< application id */char ctid[DLT_ID_SIZE]; /**< context id */} PACKED DltExtendedHeader;/*** The structure to organize the DLT messages.* This structure is used by the corresponding functions.*/typedef struct sDltMessage{/ flags /int8_t found_serialheader; / offsets /int32_t resync_offset; / size parameters /int32_t headersize; /**< size of complete header including storage header */int32_t datasize; /**< size of complete payload */ / buffer for current loaded message /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 /DltStandardHeader standardheader; /**< pointer to standard header of current loaded header /DltStandardHeaderExtra headerextra; /**< extra parameters of current loaded header */DltExtendedHeader extendedheader; /**< pointer to extended of current loaded header /} DltMessage; 1. Could anyone of you provide the sample and proper values of DLT-Message field values?  Any help/suggestions would be appreciated     DltMessage msg = {input1,input2,input3......inputn }// sample values of dlt-message structure      I tired myself  but somehow I feel I need some  clarity on proper values of DltMessage structure members 2. How data size is different from the data buffer size? Thanks,Satish