automotive-dlt
dlt_protocol.h
Go to the documentation of this file.
1 /*
2  * @licence app begin@
3  * SPDX license identifier: MPL-2.0
4  *
5  * Copyright (C) 2011-2015, BMW AG
6  *
7  * This file is part of GENIVI Project DLT - Diagnostic Log and Trace.
8  *
9  * This Source Code Form is subject to the terms of the
10  * Mozilla Public License (MPL), v. 2.0.
11  * If a copy of the MPL was not distributed with this file,
12  * You can obtain one at http://mozilla.org/MPL/2.0/.
13  *
14  * For further information see http://www.genivi.org/.
15  * @licence end@
16  */
17 
28 /*******************************************************************************
29 ** **
30 ** SRC-MODULE: dlt_protocol.h **
31 ** **
32 ** TARGET : linux **
33 ** **
34 ** PROJECT : DLT **
35 ** **
36 ** AUTHOR : Alexander Wenzel Alexander.AW.Wenzel@bmw.de **
37 ** Markus Klein **
38 ** **
39 ** PURPOSE : **
40 ** **
41 ** REMARKS : **
42 ** **
43 ** PLATFORM DEPENDANT [yes/no]: yes **
44 ** **
45 ** TO BE CHANGED BY USER [yes/no]: no **
46 ** **
47 *******************************************************************************/
48 
49 /*******************************************************************************
50 ** Author Identity **
51 ********************************************************************************
52 ** **
53 ** Initials Name Company **
54 ** -------- ------------------------- ---------------------------------- **
55 ** aw Alexander Wenzel BMW **
56 ** mk Markus Klein Fraunhofer ESK **
57 *******************************************************************************/
58 
59 /*******************************************************************************
60 ** Revision Control History **
61 *******************************************************************************/
62 
63 /*
64  * $LastChangedRevision$
65  * $LastChangedDate$
66  * $LastChangedBy$
67  Initials Date Comment
68  aw 13.01.2010 initial
69  */
70 #ifndef DLT_PROTOCOL_H
71 #define DLT_PROTOCOL_H
72 
79 /*
80  * Definitions of the htyp parameter in standard header.
81  */
82 #define DLT_HTYP_UEH 0x01
83 #define DLT_HTYP_MSBF 0x02
84 #define DLT_HTYP_WEID 0x04
85 #define DLT_HTYP_WSID 0x08
86 #define DLT_HTYP_WTMS 0x10
87 #define DLT_HTYP_VERS 0xe0
89 #define DLT_IS_HTYP_UEH(htyp) ((htyp) & DLT_HTYP_UEH)
90 #define DLT_IS_HTYP_MSBF(htyp) ((htyp) & DLT_HTYP_MSBF)
91 #define DLT_IS_HTYP_WEID(htyp) ((htyp) & DLT_HTYP_WEID)
92 #define DLT_IS_HTYP_WSID(htyp) ((htyp) & DLT_HTYP_WSID)
93 #define DLT_IS_HTYP_WTMS(htyp) ((htyp) & DLT_HTYP_WTMS)
94 
95 #define DLT_HTYP_PROTOCOL_VERSION1 (1<<5)
96 
97 /*
98  * Definitions of msin parameter in extended header.
99  */
100 #define DLT_MSIN_VERB 0x01
101 #define DLT_MSIN_MSTP 0x0e
102 #define DLT_MSIN_MTIN 0xf0
104 #define DLT_MSIN_MSTP_SHIFT 1
105 #define DLT_MSIN_MTIN_SHIFT 4
107 #define DLT_IS_MSIN_VERB(msin) ((msin) & DLT_MSIN_VERB)
108 #define DLT_GET_MSIN_MSTP(msin) (((msin) & DLT_MSIN_MSTP) >> DLT_MSIN_MSTP_SHIFT)
109 #define DLT_GET_MSIN_MTIN(msin) (((msin) & DLT_MSIN_MTIN) >> DLT_MSIN_MTIN_SHIFT)
110 
111 /*
112  * Definitions of mstp parameter in extended header.
113  */
114 #define DLT_TYPE_LOG 0x00
115 #define DLT_TYPE_APP_TRACE 0x01
116 #define DLT_TYPE_NW_TRACE 0x02
117 #define DLT_TYPE_CONTROL 0x03
119 /*
120  * Definitions of msti parameter in extended header.
121  */
122 #define DLT_TRACE_VARIABLE 0x01
123 #define DLT_TRACE_FUNCTION_IN 0x02
124 #define DLT_TRACE_FUNCTION_OUT 0x03
125 #define DLT_TRACE_STATE 0x04
126 #define DLT_TRACE_VFB 0x05
128 /*
129  * Definitions of msbi parameter in extended header.
130  */
131 
132 /* see file dlt_user.h */
133 
134 /*
135  * Definitions of msci parameter in extended header.
136  */
137 #define DLT_CONTROL_REQUEST 0x01
138 #define DLT_CONTROL_RESPONSE 0x02
139 #define DLT_CONTROL_TIME 0x03
141 #define DLT_MSIN_CONTROL_REQUEST ((DLT_TYPE_CONTROL << DLT_MSIN_MSTP_SHIFT) | (DLT_CONTROL_REQUEST << DLT_MSIN_MTIN_SHIFT))
142 #define DLT_MSIN_CONTROL_RESPONSE ((DLT_TYPE_CONTROL << DLT_MSIN_MSTP_SHIFT) | (DLT_CONTROL_RESPONSE << DLT_MSIN_MTIN_SHIFT))
143 #define DLT_MSIN_CONTROL_TIME ((DLT_TYPE_CONTROL << DLT_MSIN_MSTP_SHIFT) | (DLT_CONTROL_TIME << DLT_MSIN_MTIN_SHIFT))
144 
145 /*
146  * Definitions of types of arguments in payload.
147  */
148 #define DLT_TYPE_INFO_TYLE 0x0000000f
149 #define DLT_TYPE_INFO_BOOL 0x00000010
150 #define DLT_TYPE_INFO_SINT 0x00000020
151 #define DLT_TYPE_INFO_UINT 0x00000040
152 #define DLT_TYPE_INFO_FLOA 0x00000080
153 #define DLT_TYPE_INFO_ARAY 0x00000100
154 #define DLT_TYPE_INFO_STRG 0x00000200
155 #define DLT_TYPE_INFO_RAWD 0x00000400
156 #define DLT_TYPE_INFO_VARI 0x00000800
157 #define DLT_TYPE_INFO_FIXP 0x00001000
158 #define DLT_TYPE_INFO_TRAI 0x00002000
159 #define DLT_TYPE_INFO_STRU 0x00004000
160 #define DLT_TYPE_INFO_SCOD 0x00038000
162 #define DLT_TYLE_8BIT 0x00000001
163 #define DLT_TYLE_16BIT 0x00000002
164 #define DLT_TYLE_32BIT 0x00000003
165 #define DLT_TYLE_64BIT 0x00000004
166 #define DLT_TYLE_128BIT 0x00000005
167 
168 #define DLT_SCOD_ASCII 0x00000000
169 #define DLT_SCOD_UTF8 0x00008000
170 #define DLT_SCOD_HEX 0x00010000
171 #define DLT_SCOD_BIN 0x00018000
172 
173 /*
174  * Definitions of DLT services.
175  */
176 #define DLT_SERVICE_ID_SET_LOG_LEVEL 0x01
177 #define DLT_SERVICE_ID_SET_TRACE_STATUS 0x02
178 #define DLT_SERVICE_ID_GET_LOG_INFO 0x03
179 #define DLT_SERVICE_ID_GET_DEFAULT_LOG_LEVEL 0x04
180 #define DLT_SERVICE_ID_STORE_CONFIG 0x05
181 #define DLT_SERVICE_ID_RESET_TO_FACTORY_DEFAULT 0x06
182 #define DLT_SERVICE_ID_SET_COM_INTERFACE_STATUS 0x07
183 #define DLT_SERVICE_ID_SET_COM_INTERFACE_MAX_BANDWIDTH 0x08
184 #define DLT_SERVICE_ID_SET_VERBOSE_MODE 0x09
185 #define DLT_SERVICE_ID_SET_MESSAGE_FILTERING 0x0A
186 #define DLT_SERVICE_ID_SET_TIMING_PACKETS 0x0B
187 #define DLT_SERVICE_ID_GET_LOCAL_TIME 0x0C
188 #define DLT_SERVICE_ID_USE_ECU_ID 0x0D
189 #define DLT_SERVICE_ID_USE_SESSION_ID 0x0E
190 #define DLT_SERVICE_ID_USE_TIMESTAMP 0x0F
191 #define DLT_SERVICE_ID_USE_EXTENDED_HEADER 0x10
192 #define DLT_SERVICE_ID_SET_DEFAULT_LOG_LEVEL 0x11
193 #define DLT_SERVICE_ID_SET_DEFAULT_TRACE_STATUS 0x12
194 #define DLT_SERVICE_ID_GET_SOFTWARE_VERSION 0x13
195 #define DLT_SERVICE_ID_MESSAGE_BUFFER_OVERFLOW 0x14
196 #define DLT_SERVICE_ID_LAST_ENTRY 0x15
197 #define DLT_SERVICE_ID_UNREGISTER_CONTEXT 0xf01
198 #define DLT_SERVICE_ID_CONNECTION_INFO 0xf02
199 #define DLT_SERVICE_ID_TIMEZONE 0xf03
200 #define DLT_SERVICE_ID_MARKER 0xf04
201 #define DLT_SERVICE_ID_OFFLINE_LOGSTORAGE 0xf05
202 #define DLT_SERVICE_ID_PASSIVE_NODE_CONNECT 0xf0E
203 #define DLT_SERVICE_ID_PASSIVE_NODE_CONNECTION_STATUS 0xf0F
204 #define DLT_SERVICE_ID_SET_ALL_LOG_LEVEL 0xf10
205 #define DLT_SERVICE_ID_CALLSW_CINJECTION 0xFFF
207 /*
208  * Definitions of DLT service response status
209  */
210 #define DLT_SERVICE_RESPONSE_OK 0x00
211 #define DLT_SERVICE_RESPONSE_NOT_SUPPORTED 0x01
212 #define DLT_SERVICE_RESPONSE_ERROR 0x02
214 /*
215  * Definitions of DLT service connection state
216  */
217 #define DLT_CONNECTION_STATUS_DISCONNECTED 0x01
218 #define DLT_CONNECTION_STATUS_CONNECTED 0x02
224 #endif /* DLT_PROTOCOL_H */