]> rtime.felk.cvut.cz Git - arc.git/blob - include/Dcm_Lcfg.h
58a6d6d6e76d7949c64f5cd550e9a0890dd34d62
[arc.git] / include / Dcm_Lcfg.h
1 /* -------------------------------- Arctic Core ------------------------------\r
2  * Arctic Core - the open source AUTOSAR platform http://arccore.com\r
3  *\r
4  * Copyright (C) 2009  ArcCore AB <contact@arccore.com>\r
5  *\r
6  * This source code is free software; you can redistribute it and/or modify it\r
7  * under the terms of the GNU General Public License version 2 as published by the\r
8  * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.\r
9  *\r
10  * This program is distributed in the hope that it will be useful, but\r
11  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
12  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License\r
13  * for more details.\r
14  * -------------------------------- Arctic Core ------------------------------*/\r
15 \r
16 #ifndef DCM_LCFG_H_\r
17 #define DCM_LCFG_H_\r
18 \r
19 /*\r
20  *  General requirements\r
21  */\r
22 /** @req DCM075 */ /** @req DCM076 */\r
23 \r
24 \r
25 #include "ComStack_Types.h"\r
26 #include "Dcm_Types.h"\r
27 \r
28 // TODO: Where to place these definitions?\r
29 typedef uint8 Dcm_ProtocolTransTypeType;\r
30 #define DCM_PROTOCOL_TRANS_TYPE_1               1\r
31 #define DCM_PROTOCOL_TRANS_TYPE_2               2\r
32 \r
33 typedef uint8 Dcm_ProtocolAddrTypeType;\r
34 #define DCM_PROTOCOL_FUNCTIONAL_ADDR_TYPE       1\r
35 #define DCM_PROTOCOL_PHYSICAL_ADDR_TYPE         2\r
36 \r
37 #define DCM_PROTOCAL_TP_MAX_LENGTH 0x1000\r
38 \r
39 /*\r
40  * Callback function prototypes\r
41  */\r
42 \r
43 // SessionControl\r
44 typedef Std_ReturnType (*Dcm_CallbackGetSesChgPermissionFncType)(Dcm_SesCtrlType sesCtrlTypeActive, Dcm_SesCtrlType sesCtrlTypeNew);\r
45 typedef Std_ReturnType (*Dcm_CallbackChangeIndicationFncType)(Dcm_SesCtrlType sesCtrlTypeOld, Dcm_SesCtrlType sesCtrlTypeNew);\r
46 typedef Std_ReturnType (*Dcm_CallbackConfirmationRespPendFncType)(Dcm_ConfirmationStatusType status);\r
47 \r
48 // SecurityAccess_<LEVEL>\r
49 typedef Std_ReturnType (*Dcm_CallbackGetSeedFncType)(uint8 *securityAccessDataRecord, uint8 *seed, Dcm_NegativeResponseCodeType *errorCode);\r
50 typedef Std_ReturnType (*Dcm_CallbackCompareKeyFncType)(uint8 *key);\r
51 \r
52 // PidServices_<PID>\r
53 typedef Std_ReturnType (*Dcm_CallbackGetPIDValueFncType)(uint8 *dataValueBuffer);\r
54 \r
55 // DidServices_<DID>\r
56 typedef Std_ReturnType (*Dcm_CallbackReadDataFncType)(uint8 *data);\r
57 typedef Std_ReturnType (*Dcm_CallbackWriteDataFncType)(uint8 *data, uint16 dataLength, Dcm_NegativeResponseCodeType *errorCode);\r
58 typedef Std_ReturnType (*Dcm_CallbackReadDataLengthFncType)(uint16 *didLength);\r
59 typedef Std_ReturnType (*Dcm_CallbackConditionCheckReadFncType)(Dcm_NegativeResponseCodeType *errorCode);\r
60 typedef Std_ReturnType (*Dcm_CallbackConditionCheckWriteFncType)(Dcm_NegativeResponseCodeType *errorCode);\r
61 typedef Std_ReturnType (*Dcm_CallbackReturnControlToECUFncType)(uint8 *controlOptionRecord, uint8 *controlEnableMaskRecord, uint8 *controlStatusRecord, Dcm_NegativeResponseCodeType *errorCode);\r
62 typedef Std_ReturnType (*Dcm_CallbackResetToDefaultFncType)(uint8 *controlOptionRecord, uint8 *controlEnableMaskRecord, uint8 *controlStatusRecord, Dcm_NegativeResponseCodeType *errorCode);\r
63 typedef Std_ReturnType (*Dcm_CallbackFreezeCurrentStateFncType)(uint8 *controlOptionRecord, uint8 *controlEnableMaskRecord, uint8 *controlStatusRecord, Dcm_NegativeResponseCodeType *errorCode);\r
64 typedef Std_ReturnType (*Dcm_CallbackShortTermAdjustmentFncType)(uint8 *controlOptionRecord, uint8 *controlEnableMaskRecord, uint8 *controlStatusRecord, Dcm_NegativeResponseCodeType *errorCode);\r
65 typedef Std_ReturnType (*Dcm_CallbackGetScalingInformationFncType)(uint8 *scalingInfo, Dcm_NegativeResponseCodeType *errorCode);\r
66 \r
67 // InfoTypeServices_<INFOTYPENUMBER>\r
68 typedef Std_ReturnType (*Dcm_CallbackGetInfoTypeValueFncType)(uint8 *dataValueBuffer);\r
69 \r
70 // DTRServices\r
71 typedef Std_ReturnType (*Dcm_CallbackGgetDTRValueFncType)(uint16 *testval, uint16 *minlimit, uint16 *maxlimit, uint8 *status);\r
72 \r
73 // RoutineServices_<ROUTINENAME>\r
74 typedef Std_ReturnType (*Dcm_CallbackStartRoutineFncType)(uint8 *inBuffer, uint8 *outBuffer, Dcm_NegativeResponseCodeType *errorCode);\r
75 typedef Std_ReturnType (*Dcm_CallbackStopRoutineFncType)(uint8 *inBuffer, uint8 *outBuffer, Dcm_NegativeResponseCodeType *errorCode);\r
76 typedef Std_ReturnType (*Dcm_CallbackRequestResultRoutineFncType)(uint8 *outBuffer, Dcm_NegativeResponseCodeType *errorCode);\r
77 \r
78 // RequestControlServices_<TID>\r
79 typedef Std_ReturnType (*Dcm_CallbackRequestControlType)(uint8 *outBuffer, uint8 *inBuffer);\r
80 \r
81 // CallBackDCMRequestServices\r
82 typedef Std_ReturnType (*Dcm_CallbackStartProtocolFncType)(Dcm_ProtocolType protocolID);\r
83 typedef Std_ReturnType (*Dcm_CallbackStopProtocolFncType)(Dcm_ProtocolType protocolID);\r
84 \r
85 // ServiceRequestIndication\r
86 typedef Std_ReturnType (*Dcm_CallbackIndicationFncType)(uint8 *requestData, uint16 dataSize);\r
87 \r
88 // ResetService\r
89 typedef Std_ReturnType (*Dcm_CallbackEcuResetType)(uint8 resetType,     Dcm_NegativeResponseCodeType *errorCode);\r
90 \r
91 \r
92 /*\r
93  * DCM configurations\r
94  */\r
95 \r
96 /*******\r
97  * DSP *\r
98  *******/\r
99 \r
100 // 10.2.44\r
101 typedef struct {\r
102         Dcm_SesCtrlType DspSessionLevel;                        // (1)\r
103         uint16                  DspSessionP2ServerMax;          // (1)\r
104         uint16                  DspSessionP2StarServerMax;      // (1)\r
105         boolean                 Arc_EOL;\r
106 } Dcm_DspSessionRowType; /** @req DCM072 */\r
107 \r
108 // 10.2.42\r
109 typedef struct {\r
110         Dcm_SecLevelType                                DspSecurityLevel;                       // (1)\r
111         uint16                                                  DspSecurityDelayTimeOnBoot;     // (1)\r
112         uint8                                                   DspSecurityNumAttDelay;         // (1)\r
113         uint16                                                  DspSecurityDelayTime;           // (1)\r
114         uint8                                                   DspSecurityNumAttLock;          // (1)\r
115         uint8                                                   DspSecurityADRSize;                     // (0..1)\r
116         uint8                                                   DspSecuritySeedSize;            // (1)\r
117         uint8                                                   DspSecurityKeySize;                     // (1)\r
118         Dcm_CallbackGetSeedFncType              GetSeed;\r
119         Dcm_CallbackCompareKeyFncType   CompareKey;\r
120         boolean                                                 Arc_EOL;\r
121 } Dcm_DspSecurityRowType; /** @req DCM073 */\r
122 \r
123 // 10.2.23\r
124 typedef struct {\r
125         uint8 DspDidControlEnableMaskRecordSize;                        // (1)\r
126         uint8 DspDidControlOptionRecordSize;    // (1)\r
127         uint8 DspDidControlStatusRecordSize;    // (1)\r
128 } Dcm_DspDidControlRecordSizesType;\r
129 \r
130 // 10.2.26\r
131 typedef struct {\r
132         const Dcm_DspSessionRowType                             **DspDidControlSessionRef;                      // (1..*)       /** @req DCM621 */\r
133         const Dcm_DspSecurityRowType                    **DspDidControlSecurityLevelRef;        // (1..*)       /** @req DCM620 */\r
134         const Dcm_DspDidControlRecordSizesType  *DspDidFreezeCurrentState;                      // (0..1)       /** @req DCM624 */\r
135         const Dcm_DspDidControlRecordSizesType  *DspDidResetToDefault;                          // (0..1)       /** @req DCM623 */\r
136         const Dcm_DspDidControlRecordSizesType  *DspDidReturnControlToEcu;                      // (0..1)       /** @req DCM622 */\r
137         const Dcm_DspDidControlRecordSizesType  *DspDidShortTermAdjustment;                     // (0..1)       /** @req DCM625 */\r
138 } Dcm_DspDidControlType; /** @req DCM619 */\r
139 \r
140 // 10.2.27\r
141 typedef struct {\r
142         const Dcm_DspSessionRowType             **DspDidReadSessionRef;                 // (1..*)       /** @req DCM615 */\r
143         const Dcm_DspSecurityRowType    **DspDidReadSecurityLevelRef;   // (1..*)       /** @req DCM614 */\r
144 } Dcm_DspDidReadType; /** @req DCM613 */\r
145 \r
146 // 10.2.28\r
147 typedef struct {\r
148         const Dcm_DspSessionRowType             **DspDidWriteSessionRef;                // (1..*)       /** @req DCM618 */\r
149         const Dcm_DspSecurityRowType    **DspDidWriteSecurityLevelRef;  // (1..*)       /** @req DCM617 */\r
150 } Dcm_DspDidWriteType; /** @req DCM616 */\r
151 \r
152 // 10.2.25\r
153 typedef struct {\r
154         // Containers\r
155         const Dcm_DspDidReadType                *DspDidRead;    // (0..1)\r
156         const Dcm_DspDidWriteType               *DspDidWrite;   // (0..1)\r
157         const Dcm_DspDidControlType             *DspDidControl; // (0..1)\r
158 } Dcm_DspDidAccessType; /** @req DCM609 */\r
159 \r
160 // 10.2.24\r
161 typedef struct {\r
162         boolean                                 DspDidDynamicllyDefined;        // (1)          /** @req DCM612 */\r
163         boolean                                 DspDidFixedLength;                      // (1)          /** @req DCM608 */\r
164         uint8                                   DspDidScalingInfoSize;          // (0..1)       /** @req DCM611 */\r
165         // Containers\r
166         Dcm_DspDidAccessType    DspDidAccess;                           // (1)\r
167 } Dcm_DspDidInfoType; /** @req DCM607 */\r
168 \r
169 // 10.2.22\r
170 typedef struct Dcm_DspDidType {\r
171         boolean                                                                         DspDidUsePort;                                  // (1)\r
172         uint16                                                                          DspDidIdentifier;                               // (1)          /** @req DCM602 */\r
173         const Dcm_DspDidInfoType                                        *DspDidInfoRef;                                 // (1)          /** @req DCM604 */\r
174         const struct Dcm_DspDidType                                     **DspDidRef;                                    // (0..*)       /** @req DCM606 */\r
175         uint16                                                                          DspDidSize;                                             // (1)          /** @req DCM605 */\r
176         Dcm_CallbackReadDataLengthFncType                       DspDidReadDataLengthFnc;                // (0..1)       /** @req DCM671 */\r
177         Dcm_CallbackConditionCheckReadFncType           DspDidConditionCheckReadFnc;    // (0..1)       /** @req DCM677 */\r
178         Dcm_CallbackReadDataFncType                                     DspDidReadDataFnc;                              // (0..1)       /** @req DCM669 */\r
179         Dcm_CallbackConditionCheckWriteFncType          DspDidConditionCheckWriteFnc;   // (0..1)       /** @req DCM678 */\r
180         Dcm_CallbackWriteDataFncType                            DspDidWriteDataFnc;                             // (0..1)       /** @req DCM670 */\r
181         Dcm_CallbackGetScalingInformationFncType        DspDidGetScalingInfoFnc;                // (0..1)       /** @req DCM676 */\r
182         Dcm_CallbackFreezeCurrentStateFncType           DspDidFreezeCurrentStateFnc;    // (0..1)       /** @req DCM674 */\r
183         Dcm_CallbackResetToDefaultFncType                       DspDidResetToDefaultFnc;                        // (0..1)       /** @req DCM673 */\r
184         Dcm_CallbackReturnControlToECUFncType           DspDidReturnControlToEcuFnc;    // (0..1)       /** @req DCM672 */\r
185         Dcm_CallbackShortTermAdjustmentFncType          DspDidShortTermAdjustmentFnc;   // (0..1)       /** @req DCM675 */\r
186         // Containers\r
187         const Dcm_DspDidControlRecordSizesType          *DspDidControlRecordSize;               // (0..*)\r
188         boolean                                                                         Arc_EOL;\r
189 } Dcm_DspDidType; /** @req DCM601 */\r
190 \r
191 // 10.2.30\r
192 typedef struct {\r
193         const Dcm_DspSessionRowType             **DspEcuResetSessionRef;                // (1..*)\r
194         const Dcm_DspSecurityRowType    **DspEcuResetSecurityLevelRef;  // (1..*)\r
195 } Dcm_DspEcuResetType; /** @req DCM657 */\r
196 \r
197 // 10.2.31\r
198 typedef struct {\r
199         boolean                                                 DspPidUsePort;          // (1)\r
200         uint8                                                   DspPidIdentifier;       // (1)  /** @req DCM627 */\r
201         uint8                                                   DspPidSize;             // (1)  /** @req DCM628 */\r
202         Dcm_CallbackGetPIDValueFncType  DspGetPidValFnc;        // (1)  /** @req DCM629 */\r
203 } Dcm_DspPidType; /** @req DCM626 */\r
204 \r
205 // 10.2.33\r
206 typedef struct {\r
207         boolean                                                 DspDTCInfoSubFuncSupp;          // (1)\r
208         uint8                                                   DspDTCInfoSubFuncLevel;         // (1)\r
209         const Dcm_DspSecurityRowType    **DspDTCInfoSecLevelRef;        // (1..*)\r
210 } Dcm_DspReadDTCRowType; /** @req DCM073 */\r
211 \r
212 // 10.2.32\r
213 typedef struct {\r
214         // Containers\r
215         Dcm_DspReadDTCRowType *DspReadDTCRow; // (0..*)\r
216 } Dcm_DspReadDTCType; /** @req DCM074 */\r
217 \r
218 // 10.2.34\r
219 typedef struct {\r
220         uint8 DspRequestControl;                                // (1)\r
221         uint8 DspRequestControlOutBufferSize;   // (1)\r
222         uint8 DspRequestControlTestId;                  // (1)  /** @req DCM656 */\r
223 } Dcm_DspRequestControlType; /** @req DCM637 */\r
224 \r
225 // 10.2.37\r
226 typedef struct {\r
227         const Dcm_DspSessionRowType             **DspRoutineSessionRef;                 // (1..*)       /** @req DCM649 */\r
228         const Dcm_DspSecurityRowType    **DspRoutineSecurityLevelRef;   // (1..*)       /** @req DCM648 */\r
229 } Dcm_DspRoutineAuthorizationType; /** @req DCM644 */\r
230 \r
231 // 10.2.38\r
232 typedef struct {\r
233         uint8 DspReqResRtnCtrlOptRecSize; // (1)        /** @req DCM652 */\r
234 } Dcm_DspRoutineRequestResType; /** @req DCM646 */\r
235 \r
236 // 10.2.39\r
237 typedef struct {\r
238         uint8 DspStopRoutineCtrlOptRecSize;     // (1)  /** @req DCM650 */\r
239         uint8 DspStopRoutineStsOptRecSize;      // (1)  /** @req DCM651 */\r
240 } Dcm_DspRoutineStopType; /** @req DCM645 */\r
241 \r
242 // 10.2.40\r
243 typedef struct {\r
244         uint8 DspStartRoutineCtrlOptRecSize;    // (1)  /** @req DCM654 */\r
245         uint8 DspStartRoutineStsOptRecSize;             // (1)  /** @req DCM655 */\r
246 } Dcm_DspStartRoutineType; /** @req DCM647 */\r
247 \r
248 // 10.2.36\r
249 typedef struct {\r
250         // Containers\r
251         const Dcm_DspRoutineAuthorizationType   DspRoutineAuthorization;        // (1)\r
252         const Dcm_DspStartRoutineType                   *DspStartRoutine;                       // (1)\r
253         const Dcm_DspRoutineStopType                    *DspRoutineStop;                        // (0..1)\r
254         const Dcm_DspRoutineRequestResType              *DspRoutineRequestRes;          // (0..1)\r
255 } Dcm_DspRoutineInfoType; /** @req DCM643 */\r
256 \r
257 // 10.2.35\r
258 typedef struct {\r
259         boolean                                                                 DspRoutineUsePort;                      // (1)\r
260         uint16                                                                  DspRoutineIdentifier;           // (1)          /** @req DCM641 */\r
261         const Dcm_DspRoutineInfoType                    *DspRoutineInfoRef;                     // (1)          /** @req DCM642 */\r
262         Dcm_CallbackStartRoutineFncType                 DspStartRoutineFnc;                     // (0..1)       /** @req DCM664 */\r
263         Dcm_CallbackStopRoutineFncType                  DspStopRoutineFnc;                      // (0..1)       /** @req DCM665 */\r
264         Dcm_CallbackRequestResultRoutineFncType DspRequestResultRoutineFnc;     // (0..1)       /** @req DCM665 */\r
265         boolean                                                                 Arc_EOL;\r
266 } Dcm_DspRoutineType; /** @req DCM640 */\r
267 \r
268 // 10.2.41\r
269 typedef struct {\r
270         // Containers\r
271         const Dcm_DspSecurityRowType *DspSecurityRow; // (0..31)\r
272 } Dcm_DspSecurityType; /** @req DCM073 */\r
273 \r
274 // 10.2.43\r
275 typedef struct {\r
276         // Containers\r
277         const Dcm_DspSessionRowType *DspSessionRow; // (0..31)\r
278 } Dcm_DspSessionType; /** @req DCM072 */\r
279 \r
280 // 10.2.47\r
281 typedef struct {\r
282         uint8 DspTestResultTestId;      // (1)  /** @req DCM635 */\r
283         uint8 DspTestResultUaSid;       // (1)  /** @req DCM686 */\r
284 } Dcm_DspTestResultTidType; /** @req DCM634 */\r
285 \r
286 // 10.2.46\r
287 typedef struct {\r
288         uint8                                                   DspTestResultObdmid;                    // (1)          /** @req DCM684 */\r
289         const Dcm_DspTestResultTidType  **DspTestResultObdmidTidRef;    // (1..*)       /** @req DCM685 */\r
290 } Dcm_DspTestResultObdmidTidType; /** @req DCM683 */\r
291 \r
292 // 10.2.45\r
293 typedef struct {\r
294         // Containers\r
295         const Dcm_DspTestResultObdmidTidType    *DspTestResultObdmidTid;        // (0..*)\r
296         const Dcm_DspTestResultTidType                  *DspTestResultTid;                      // (0..*)\r
297 } Dcm_DspTestResultByObdmidType; /** @req DCM682 */\r
298 \r
299 // 10.2.48\r
300 typedef struct {\r
301         boolean                                                         DspVehInfoUsePort;              // (1)\r
302         uint8                                                           DspVehInfoType;                 // (1)  /** @req DCM631 */\r
303         uint8                                                           DspVehInfoSize;                 // (1)  /** @req DCM632 */\r
304         Dcm_CallbackGetInfoTypeValueFncType     DspGetVehInfoTypeFnc;   // (1)  /** @req DCM633 */\r
305 } Dcm_DspVehInfoType; /** @req DCM630 */\r
306 \r
307 // 10.2.21\r
308 typedef struct {\r
309         uint32 MemoryAddressHigh;\r
310         uint32 MemoryAddressLow;\r
311         /*DcmDspMemoryRangeRuleRef * pRule;*/\r
312         const Dcm_DspSecurityRowType **pSecurityLevel;\r
313 } Dcm_DspMemoryRangeInfo;\r
314 \r
315 typedef struct {\r
316       uint8 MemoryIdValue;\r
317      const Dcm_DspMemoryRangeInfo *pReadMemoryInfo;\r
318      const Dcm_DspMemoryRangeInfo *pWriteMemoryInfo;\r
319      boolean                                                                            Arc_EOL;\r
320 } Dcm_DspMemoryIdInfo;\r
321 \r
322 \r
323 typedef struct {\r
324         boolean                                                         DcmDspUseMemoryId;\r
325         const Dcm_DspMemoryIdInfo                       *DspMemoryIdInfo;\r
326         \r
327 }Dcm_DspMemoryType;\r
328 \r
329 // 10.2.21\r
330 typedef struct {\r
331         uint8                                                           DspMaxDidToRead; // (0..1)      /** @req DCM638 */\r
332         // Containers\r
333         const Dcm_DspDidType                            *DspDid;        // (0..*)\r
334         const Dcm_DspDidInfoType                        *DspDidInfo;                    // (0..*)\r
335         const Dcm_DspEcuResetType                       *DspEcuReset;                   // (0..*)\r
336         const Dcm_DspPidType                            *DspPid;                                // (0..*)\r
337         const Dcm_DspReadDTCType                        *DspReadDTC;                    // (1)\r
338         const Dcm_DspRequestControlType         *DspRequestControl;             // (0..*)\r
339         const Dcm_DspRoutineType                        *DspRoutine;                    // (0..*)\r
340         const Dcm_DspRoutineInfoType            *DspRoutineInfo;                // (0..*)\r
341         const Dcm_DspSecurityType                       *DspSecurity;                   // (0..*)\r
342         const Dcm_DspSessionType                        *DspSession;                    // (1)\r
343         const Dcm_DspTestResultByObdmidType     *DspTestResultByObdmid; // (0..*)\r
344         const Dcm_DspVehInfoType                        *DspVehInfo;\r
345         const Dcm_DspMemoryType             *DspMemory;\r
346 } Dcm_DspType;\r
347 \r
348 /*******\r
349  * DSD *\r
350  *******/\r
351 // 10.2.4 DcmDsdService\r
352 typedef struct {\r
353         uint8                                                   DsdSidTabServiceId;                             // (1)\r
354         boolean                                                 DsdSidTabSubfuncAvail;                  // (1)\r
355         const Dcm_DspSecurityRowType    **DsdSidTabSecurityLevelRef;    // (1..*)\r
356         const Dcm_DspSessionRowType             **DsdSidTabSessionLevelRef;             // (1..*)\r
357         // Containers\r
358         boolean                                                 Arc_EOL;\r
359 } Dcm_DsdServiceType;\r
360 \r
361 // 10.2.3 DcmDsdServiceTable\r
362 typedef struct {\r
363         uint8                                           DsdSidTabId; // (1)\r
364         // Containers\r
365         const Dcm_DsdServiceType        *DsdService; // (1..*)\r
366         boolean                                         Arc_EOL;\r
367 } Dcm_DsdServiceTableType; /** @req DCM071 */\r
368 \r
369 // 10.2.2 DcmDsd\r
370 typedef struct {\r
371         // Containers\r
372         const Dcm_DsdServiceTableType *DsdServiceTable; // (1..256)\r
373 } Dcm_DsdType;\r
374 \r
375 /*******\r
376  * DSL *\r
377  *******/\r
378 \r
379 typedef enum\r
380 {\r
381         BUFFER_AVAILABLE,\r
382         BUFFER_BUSY\r
383 }Dcm_DslBufferStatusType;\r
384 \r
385 \r
386 typedef enum\r
387 {\r
388         NOT_IN_USE,     // The buffer is not used (it is available).\r
389         IN_USE,\r
390         PROVIDED_TO_PDUR, // The buffer is currently in use by PDUR.\r
391         DSD_PENDING_RESPONSE_SIGNALED, // Signals have been received saying the buffer contain valid data.\r
392         DCM_TRANSMIT_SIGNALED, // The DCM has been asked to transfer the response, system is now waiting for TP layer to reqest Tx buffer.\r
393         PROVIDED_TO_DSD,        // The buffer is currently in use by DSD.\r
394         UNDEFINED_USAGE\r
395 }Dcm_DslBufferUserType;\r
396 \r
397 typedef struct {\r
398         Dcm_DslBufferStatusType status; // Flag for buffer in use.\r
399 } Dcm_DslBufferRuntimeType;\r
400 \r
401 // 10.2.6\r
402 typedef struct {\r
403         uint8                                           DslBufferID;    // (1) // Kept for reference, will be removed (polite calls will be made).\r
404         uint16                                          DslBufferSize;  // (1)\r
405         PduInfoType                                     pduInfo;\r
406         Dcm_DslBufferRuntimeType        *externalBufferRuntimeData;\r
407 } Dcm_DslBufferType; /** @req DCM032 */\r
408 \r
409 // 10.2.7\r
410 typedef struct {\r
411         Dcm_CallbackStartProtocolFncType        StartProtocol;\r
412         Dcm_CallbackStopProtocolFncType         StopProtocol;\r
413         boolean                                                         Arc_EOL;\r
414 } Dcm_DslCallbackDCMRequestServiceType; /** @req DCM679 */\r
415 \r
416 // 10.2.8\r
417 typedef struct {\r
418         boolean DslDiagRespForceRespPendEn;     // (1)\r
419         uint8   DslDiagRespMaxNumRespPend;      // (1)\r
420 } Dcm_DslDiagRespType;\r
421 \r
422 // 10.2.18\r
423 typedef struct {\r
424         uint16                  TimStrP2ServerMax;              // (1)\r
425         uint16                  TimStrP2ServerMin;              // (1)\r
426         uint16                  TimStrP2StarServerMax;  // (1)\r
427         uint16                  TimStrP2StarServerMin;  // (1)\r
428         uint16                  TimStrS3Server;                 // (1)\r
429         const boolean   Arc_EOL;\r
430 } Dcm_DslProtocolTimingRowType;\r
431 \r
432 // 10.2.17\r
433 typedef struct {\r
434         const Dcm_DslProtocolTimingRowType *DslProtocolTimingRow; // (0..*)\r
435 } Dcm_DslProtocolTimingType; /** @req DCM031 */\r
436 \r
437 // 10.2.15\r
438 typedef struct {\r
439 // TODO: Add this? (only needed for type2 periodic transmission configuration)\r
440 } Dcm_DslPeriodicTransmissionType;\r
441 \r
442 // 10.2.16\r
443 typedef struct {\r
444 // TODO: Add this? (only needed for type2 periodic transmission configuration)\r
445 } Dcm_DslResponseOnEventType;\r
446 \r
447 /* Makes it possible to cross-reference structures. */\r
448 typedef struct Dcm_DslMainConnectionType_t Dcm_DslMainConnectionType;\r
449 typedef struct Dcm_DslProtocolRxType_t Dcm_DslProtocolRxType;\r
450 \r
451 // 10.2.13\r
452 struct Dcm_DslProtocolRxType_t {\r
453         const Dcm_DslMainConnectionType *DslMainConnectionParent;                               // (1) /* Cross reference. */\r
454         const Dcm_ProtocolAddrTypeType  DslProtocolAddrType;                                    // (1)\r
455         const PduIdType                                 DcmDslProtocolRxPduId;                                  // (1)\r
456         const uint32                                    DcmDslProtocolRxTesterSourceAddr_v4;    // (1)\r
457         const uint8                                             DcmDslProtocolRxChannelId_v4;                   // (1)\r
458         const boolean                                   Arc_EOL;\r
459 };\r
460 \r
461 /* Makes it possible to cross-reference structures. */\r
462 //typedef struct Dcm_DslMainConnectionType_t Dcm_DslMainConnectionType;\r
463 typedef struct Dcm_DslProtocolTxType_t Dcm_DslProtocolTxType;\r
464 \r
465 // 10.2.14\r
466 struct Dcm_DslProtocolTxType_t {\r
467         const Dcm_DslMainConnectionType *DslMainConnectionParent;       // (1) /* Cross reference. */\r
468         const PduIdType                                 DcmDslProtocolTxPduId;          // (1) /* Will be removed (polite), kept for reference. */\r
469         const boolean                                   Arc_EOL;\r
470 };\r
471 \r
472 // -- UH\r
473 \r
474 /*\r
475 PduR_DcmDslTxPduId\r
476 \r
477 // 10.2.14\r
478 typedef struct {\r
479         const uint32 PduR_DcmDslTxPduId; // Polite PDUID ("list index") to be used when writing to PduR.\r
480         // TODO: Add ref to PDU.\r
481         const boolean Arc_EOL;\r
482 } Dcm_DslProtocolTxType;\r
483 \r
484 */\r
485 \r
486 /* Make it possible to cross reference. */\r
487 typedef struct Dcm_DslConnectionType_t Dcm_DslConnectionType;\r
488 \r
489 // 10.2.12\r
490 struct Dcm_DslMainConnectionType_t { // Cross referenced from Dcm_DslProtocolRxType_t.\r
491         const Dcm_DslConnectionType                             *DslConnectionParent; // Cross reference.\r
492         const Dcm_DslPeriodicTransmissionType   *DslPeriodicTransmissionConRef; // (0..1)\r
493         const Dcm_DslResponseOnEventType                *DslROEConnectionRef;                   // (0..*)\r
494         // Containers\r
495         const Dcm_DslProtocolRxType                             *DslProtocolRx;                                 // (1..*) Remove?\r
496         const Dcm_DslProtocolTxType                             *DslProtocolTx;                                 // (1)\r
497 };\r
498 \r
499 /* Make it possible to cross reference. */\r
500 typedef struct Dcm_DslProtocolRowType_t Dcm_DslProtocolRowType;\r
501 \r
502 // 10.2.11\r
503 struct Dcm_DslConnectionType_t {\r
504         // Containers\r
505         const Dcm_DslProtocolRowType                    *DslProtocolRow;                        // Cross reference.\r
506         const Dcm_DslMainConnectionType                 *DslMainConnection;                     // (1)\r
507         const Dcm_DslPeriodicTransmissionType   *DslPeriodicTransmission;       // (0..1)\r
508         const Dcm_DslResponseOnEventType                *DslResponseOnEvent;            // (0..1)\r
509         boolean                                                                 Arc_EOL;\r
510 };\r
511 \r
512 typedef enum {\r
513         DCM_IDLE = 0, /* Not in use. */\r
514         DCM_WAITING_DIAGNOSTIC_RESPONSE, /* A diagnostic request has been forwarded to the DSD, and DSL is waiting for response. */\r
515         DCM_DIAGNOSTIC_RESPONSE_PENDING, /* A diagnostic response has been deployed to the external buffer and is waiting to be transmitted. */\r
516         DCM_TRANSMITTING_EXTERNAL_BUFFER_DATA_TO_PDUR, /* We are in the process of transmitting a diagnostic response most likely that reside in the external buffer, from DSD to PDUR. */\r
517         DCM_TRANSMITTING_LOCAL_BUFFER_DATA_TO_PDUR /*  */\r
518 } Dcm_DslProtocolStateType;\r
519 \r
520 typedef enum {\r
521         DCM_DSL_PDUR_DCM_IDLE = 0,\r
522 \r
523         DCM_DSL_PDUR_TRANSMIT_INDICATED = 1,\r
524         DCM_DSL_PDUR_TRANSMIT_TX_BUFFER_PROVIDED = 2,\r
525 \r
526         DCM_DSL_RECEPTION_INDICATED = 3,\r
527         DCM_DSL_RX_BUFFER_PROVIDED = 4\r
528 } Dcm_DslPdurCommuncationState;\r
529 \r
530 \r
531 // This buffer is used for implement 7.2.4.3 (Concurrent "tester present").\r
532 \r
533 #define DCM_DSL_LOCAL_BUFFER_LENGTH 8\r
534 \r
535 typedef struct {\r
536         Dcm_DslBufferUserType   status;\r
537         uint8                                   buffer[DCM_DSL_LOCAL_BUFFER_LENGTH];\r
538         PduLengthType                   messageLenght;\r
539         PduInfoType                             PduInfo;\r
540 } Dcm_DslLocalBufferType;\r
541 \r
542 \r
543 typedef struct {\r
544         PduIdType                               diagReqestRxPduId;  // Tester request PduId.\r
545         uint32                                  stateTimeoutCount; // Counter for timeout.\r
546         Dcm_DslBufferUserType   externalRxBufferStatus;\r
547         PduInfoType                             diagnosticRequestFromTester;\r
548         PduInfoType                             diagnosticResponseFromDsd;\r
549         Dcm_DslBufferUserType   externalTxBufferStatus;\r
550         boolean                                 protocolStarted; // Has the protocol been started?\r
551         Dcm_DslLocalBufferType  localRxBuffer;\r
552         Dcm_DslLocalBufferType  localTxBuffer;\r
553         boolean                                 diagnosticActiveComM; //\r
554         uint16                                  S3ServerTimeoutCount;\r
555         uint8                                   responsePendingCount;\r
556         Dcm_SecLevelType                securityLevel;\r
557         Dcm_SesCtrlType                 sessionControl;\r
558         Dcm_DslLocalBufferType      PeriodicTxBuffer;\r
559 } Dcm_DslRunTimeProtocolParametersType;\r
560 \r
561 // 10.2.10\r
562 struct Dcm_DslProtocolRowType_t { // Cross referenced from Dcm_DslConnectionType_t.\r
563         Dcm_ProtocolType                                                DslProtocolID; // (1)\r
564         boolean                                                                 DslProtocolIsParallelExecutab; // (1)\r
565         uint16                                                                  DslProtocolPreemptTimeout; // (1)\r
566         uint8                                                                   DslProtocolPriority; // (1)\r
567         Dcm_ProtocolTransTypeType                               DslProtocolTransType; // (1)\r
568         const Dcm_DslBufferType                                 *DslProtocolRxBufferID; // (1)\r
569         const Dcm_DslBufferType                                 *DslProtocolTxBufferID; // (1)\r
570         const Dcm_DsdServiceTableType                   *DslProtocolSIDTable; // (1)\r
571         const Dcm_DslProtocolTimingRowType              *DslProtocolTimeLimit; // (0..1)\r
572         // Containers\r
573         const Dcm_DslConnectionType                             *DslConnection; // (1..*)\r
574         // Reference to runtime parameters to this protocol.\r
575         Dcm_DslRunTimeProtocolParametersType    *DslRunTimeProtocolParameters; // Maybe this needs to change to index.\r
576         boolean                                                                 Arc_EOL;\r
577 };\r
578 \r
579 // 10.2.9\r
580 typedef struct {\r
581         // Containers\r
582         const Dcm_DslProtocolRxType             *DslProtocolRxGlobalList;       // (1..*)  A polite list for all RX protocol configurations.\r
583         const Dcm_DslProtocolTxType             *DslProtocolTxGlobalList;       // (1..*)  A polite list for all TX protocol configurations.\r
584         const Dcm_DslProtocolRowType    *DslProtocolRowList;            // (1..*)\r
585 } Dcm_DslProtocolType;\r
586 \r
587 // 10.2.19\r
588 typedef struct {\r
589         Dcm_CallbackIndicationFncType   Indication;\r
590         boolean                                                 Arc_EOL;\r
591 } Dcm_DslServiceRequestIndicationType; /** @req DCM681 */\r
592 \r
593 // 10.2.20\r
594 typedef struct {\r
595         Dcm_CallbackGetSesChgPermissionFncType  GetSesChgPermission;\r
596         Dcm_CallbackChangeIndicationFncType             ChangeIndication;\r
597         Dcm_CallbackConfirmationRespPendFncType ConfirmationRespPend;\r
598         boolean                                                                 Arc_EOL;\r
599 } Dcm_DslSessionControlType; /** @req DCM680 */\r
600 \r
601 // 10.2.5\r
602 typedef struct {\r
603         // Containers\r
604         const Dcm_DslBufferType                                         *DslBuffer;                                             // (1..256)\r
605         const Dcm_DslCallbackDCMRequestServiceType      *DslCallbackDCMRequestService;  // (1..*)\r
606         const Dcm_DslDiagRespType                                       *DslDiagResp;                                   // (1)\r
607         const Dcm_DslProtocolType                                       *DslProtocol;                                   // (1)\r
608         const Dcm_DslProtocolTimingType                         *DslProtocolTiming;                             // (1)\r
609         const Dcm_DslServiceRequestIndicationType       *DslServiceRequestIndication;   // (0..*)\r
610         const Dcm_DslSessionControlType                         *DslSessionControl;                             // (1..*)\r
611 } Dcm_DslType;\r
612 \r
613 // 10.2.1 Dcm\r
614 typedef struct {\r
615         // Containers\r
616         const Dcm_DspType *Dsp; //      (1)\r
617         const Dcm_DsdType *Dsd; //      (1)\r
618         const Dcm_DslType *Dsl; //      (1)\r
619 } Dcm_ConfigType;\r
620 \r
621 /*\r
622  * Make the DCM_Config visible for others.\r
623  */\r
624 \r
625 \r
626 extern const Dcm_ConfigType DCM_Config;\r
627 \r
628 \r
629 #endif /*DCM_LCFG_H_*/\r