]> rtime.felk.cvut.cz Git - arc.git/blob - include/Dcm_Lcfg.h
Dcm, added boolean Arc_EOL to Dcm_DspMemoryRangeInfo type.
[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         boolean Arc_EOL;\r
314 } Dcm_DspMemoryRangeInfo;\r
315 \r
316 typedef struct {\r
317       uint8 MemoryIdValue;\r
318      const Dcm_DspMemoryRangeInfo *pReadMemoryInfo;\r
319      const Dcm_DspMemoryRangeInfo *pWriteMemoryInfo;\r
320      boolean                                                                            Arc_EOL;\r
321 } Dcm_DspMemoryIdInfo;\r
322 \r
323 \r
324 typedef struct {\r
325         boolean                                                         DcmDspUseMemoryId;\r
326         const Dcm_DspMemoryIdInfo                       *DspMemoryIdInfo;\r
327         \r
328 }Dcm_DspMemoryType;\r
329 \r
330 // 10.2.21\r
331 typedef struct {\r
332         uint8                                                           DspMaxDidToRead; // (0..1)      /** @req DCM638 */\r
333         // Containers\r
334         const Dcm_DspDidType                            *DspDid;        // (0..*)\r
335         const Dcm_DspDidInfoType                        *DspDidInfo;                    // (0..*)\r
336         const Dcm_DspEcuResetType                       *DspEcuReset;                   // (0..*)\r
337         const Dcm_DspPidType                            *DspPid;                                // (0..*)\r
338         const Dcm_DspReadDTCType                        *DspReadDTC;                    // (1)\r
339         const Dcm_DspRequestControlType         *DspRequestControl;             // (0..*)\r
340         const Dcm_DspRoutineType                        *DspRoutine;                    // (0..*)\r
341         const Dcm_DspRoutineInfoType            *DspRoutineInfo;                // (0..*)\r
342         const Dcm_DspSecurityType                       *DspSecurity;                   // (0..*)\r
343         const Dcm_DspSessionType                        *DspSession;                    // (1)\r
344         const Dcm_DspTestResultByObdmidType     *DspTestResultByObdmid; // (0..*)\r
345         const Dcm_DspVehInfoType                        *DspVehInfo;\r
346         const Dcm_DspMemoryType             *DspMemory;\r
347 } Dcm_DspType;\r
348 \r
349 /*******\r
350  * DSD *\r
351  *******/\r
352 // 10.2.4 DcmDsdService\r
353 typedef struct {\r
354         uint8                                                   DsdSidTabServiceId;                             // (1)\r
355         boolean                                                 DsdSidTabSubfuncAvail;                  // (1)\r
356         const Dcm_DspSecurityRowType    **DsdSidTabSecurityLevelRef;    // (1..*)\r
357         const Dcm_DspSessionRowType             **DsdSidTabSessionLevelRef;             // (1..*)\r
358         // Containers\r
359         boolean                                                 Arc_EOL;\r
360 } Dcm_DsdServiceType;\r
361 \r
362 // 10.2.3 DcmDsdServiceTable\r
363 typedef struct {\r
364         uint8                                           DsdSidTabId; // (1)\r
365         // Containers\r
366         const Dcm_DsdServiceType        *DsdService; // (1..*)\r
367         boolean                                         Arc_EOL;\r
368 } Dcm_DsdServiceTableType; /** @req DCM071 */\r
369 \r
370 // 10.2.2 DcmDsd\r
371 typedef struct {\r
372         // Containers\r
373         const Dcm_DsdServiceTableType *DsdServiceTable; // (1..256)\r
374 } Dcm_DsdType;\r
375 \r
376 /*******\r
377  * DSL *\r
378  *******/\r
379 \r
380 typedef enum\r
381 {\r
382         BUFFER_AVAILABLE,\r
383         BUFFER_BUSY\r
384 }Dcm_DslBufferStatusType;\r
385 \r
386 \r
387 typedef enum\r
388 {\r
389         NOT_IN_USE,     // The buffer is not used (it is available).\r
390         IN_USE,\r
391         PROVIDED_TO_PDUR, // The buffer is currently in use by PDUR.\r
392         DSD_PENDING_RESPONSE_SIGNALED, // Signals have been received saying the buffer contain valid data.\r
393         DCM_TRANSMIT_SIGNALED, // The DCM has been asked to transfer the response, system is now waiting for TP layer to reqest Tx buffer.\r
394         PROVIDED_TO_DSD,        // The buffer is currently in use by DSD.\r
395         UNDEFINED_USAGE\r
396 }Dcm_DslBufferUserType;\r
397 \r
398 typedef struct {\r
399         Dcm_DslBufferStatusType status; // Flag for buffer in use.\r
400 } Dcm_DslBufferRuntimeType;\r
401 \r
402 // 10.2.6\r
403 typedef struct {\r
404         uint8                                           DslBufferID;    // (1) // Kept for reference, will be removed (polite calls will be made).\r
405         uint16                                          DslBufferSize;  // (1)\r
406         PduInfoType                                     pduInfo;\r
407         Dcm_DslBufferRuntimeType        *externalBufferRuntimeData;\r
408 } Dcm_DslBufferType; /** @req DCM032 */\r
409 \r
410 // 10.2.7\r
411 typedef struct {\r
412         Dcm_CallbackStartProtocolFncType        StartProtocol;\r
413         Dcm_CallbackStopProtocolFncType         StopProtocol;\r
414         boolean                                                         Arc_EOL;\r
415 } Dcm_DslCallbackDCMRequestServiceType; /** @req DCM679 */\r
416 \r
417 // 10.2.8\r
418 typedef struct {\r
419         boolean DslDiagRespForceRespPendEn;     // (1)\r
420         uint8   DslDiagRespMaxNumRespPend;      // (1)\r
421 } Dcm_DslDiagRespType;\r
422 \r
423 // 10.2.18\r
424 typedef struct {\r
425         uint16                  TimStrP2ServerMax;              // (1)\r
426         uint16                  TimStrP2ServerMin;              // (1)\r
427         uint16                  TimStrP2StarServerMax;  // (1)\r
428         uint16                  TimStrP2StarServerMin;  // (1)\r
429         uint16                  TimStrS3Server;                 // (1)\r
430         const boolean   Arc_EOL;\r
431 } Dcm_DslProtocolTimingRowType;\r
432 \r
433 // 10.2.17\r
434 typedef struct {\r
435         const Dcm_DslProtocolTimingRowType *DslProtocolTimingRow; // (0..*)\r
436 } Dcm_DslProtocolTimingType; /** @req DCM031 */\r
437 \r
438 // 10.2.15\r
439 typedef struct {\r
440 // TODO: Add this? (only needed for type2 periodic transmission configuration)\r
441 } Dcm_DslPeriodicTransmissionType;\r
442 \r
443 // 10.2.16\r
444 typedef struct {\r
445 // TODO: Add this? (only needed for type2 periodic transmission configuration)\r
446 } Dcm_DslResponseOnEventType;\r
447 \r
448 /* Makes it possible to cross-reference structures. */\r
449 typedef struct Dcm_DslMainConnectionType_t Dcm_DslMainConnectionType;\r
450 typedef struct Dcm_DslProtocolRxType_t Dcm_DslProtocolRxType;\r
451 \r
452 // 10.2.13\r
453 struct Dcm_DslProtocolRxType_t {\r
454         const Dcm_DslMainConnectionType *DslMainConnectionParent;                               // (1) /* Cross reference. */\r
455         const Dcm_ProtocolAddrTypeType  DslProtocolAddrType;                                    // (1)\r
456         const PduIdType                                 DcmDslProtocolRxPduId;                                  // (1)\r
457         const uint32                                    DcmDslProtocolRxTesterSourceAddr_v4;    // (1)\r
458         const uint8                                             DcmDslProtocolRxChannelId_v4;                   // (1)\r
459         const boolean                                   Arc_EOL;\r
460 };\r
461 \r
462 /* Makes it possible to cross-reference structures. */\r
463 //typedef struct Dcm_DslMainConnectionType_t Dcm_DslMainConnectionType;\r
464 typedef struct Dcm_DslProtocolTxType_t Dcm_DslProtocolTxType;\r
465 \r
466 // 10.2.14\r
467 struct Dcm_DslProtocolTxType_t {\r
468         const Dcm_DslMainConnectionType *DslMainConnectionParent;       // (1) /* Cross reference. */\r
469         const PduIdType                                 DcmDslProtocolTxPduId;          // (1) /* Will be removed (polite), kept for reference. */\r
470         const boolean                                   Arc_EOL;\r
471 };\r
472 \r
473 // -- UH\r
474 \r
475 /*\r
476 PduR_DcmDslTxPduId\r
477 \r
478 // 10.2.14\r
479 typedef struct {\r
480         const uint32 PduR_DcmDslTxPduId; // Polite PDUID ("list index") to be used when writing to PduR.\r
481         // TODO: Add ref to PDU.\r
482         const boolean Arc_EOL;\r
483 } Dcm_DslProtocolTxType;\r
484 \r
485 */\r
486 \r
487 /* Make it possible to cross reference. */\r
488 typedef struct Dcm_DslConnectionType_t Dcm_DslConnectionType;\r
489 \r
490 // 10.2.12\r
491 struct Dcm_DslMainConnectionType_t { // Cross referenced from Dcm_DslProtocolRxType_t.\r
492         const Dcm_DslConnectionType                             *DslConnectionParent; // Cross reference.\r
493         const Dcm_DslPeriodicTransmissionType   *DslPeriodicTransmissionConRef; // (0..1)\r
494         const Dcm_DslResponseOnEventType                *DslROEConnectionRef;                   // (0..*)\r
495         // Containers\r
496         const Dcm_DslProtocolRxType                             *DslProtocolRx;                                 // (1..*) Remove?\r
497         const Dcm_DslProtocolTxType                             *DslProtocolTx;                                 // (1)\r
498 };\r
499 \r
500 /* Make it possible to cross reference. */\r
501 typedef struct Dcm_DslProtocolRowType_t Dcm_DslProtocolRowType;\r
502 \r
503 // 10.2.11\r
504 struct Dcm_DslConnectionType_t {\r
505         // Containers\r
506         const Dcm_DslProtocolRowType                    *DslProtocolRow;                        // Cross reference.\r
507         const Dcm_DslMainConnectionType                 *DslMainConnection;                     // (1)\r
508         const Dcm_DslPeriodicTransmissionType   *DslPeriodicTransmission;       // (0..1)\r
509         const Dcm_DslResponseOnEventType                *DslResponseOnEvent;            // (0..1)\r
510         boolean                                                                 Arc_EOL;\r
511 };\r
512 \r
513 typedef enum {\r
514         DCM_IDLE = 0, /* Not in use. */\r
515         DCM_WAITING_DIAGNOSTIC_RESPONSE, /* A diagnostic request has been forwarded to the DSD, and DSL is waiting for response. */\r
516         DCM_DIAGNOSTIC_RESPONSE_PENDING, /* A diagnostic response has been deployed to the external buffer and is waiting to be transmitted. */\r
517         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
518         DCM_TRANSMITTING_LOCAL_BUFFER_DATA_TO_PDUR /*  */\r
519 } Dcm_DslProtocolStateType;\r
520 \r
521 typedef enum {\r
522         DCM_DSL_PDUR_DCM_IDLE = 0,\r
523 \r
524         DCM_DSL_PDUR_TRANSMIT_INDICATED = 1,\r
525         DCM_DSL_PDUR_TRANSMIT_TX_BUFFER_PROVIDED = 2,\r
526 \r
527         DCM_DSL_RECEPTION_INDICATED = 3,\r
528         DCM_DSL_RX_BUFFER_PROVIDED = 4\r
529 } Dcm_DslPdurCommuncationState;\r
530 \r
531 \r
532 // This buffer is used for implement 7.2.4.3 (Concurrent "tester present").\r
533 \r
534 #define DCM_DSL_LOCAL_BUFFER_LENGTH 8\r
535 \r
536 typedef struct {\r
537         Dcm_DslBufferUserType   status;\r
538         uint8                                   buffer[DCM_DSL_LOCAL_BUFFER_LENGTH];\r
539         PduLengthType                   messageLenght;\r
540         PduInfoType                             PduInfo;\r
541 } Dcm_DslLocalBufferType;\r
542 \r
543 \r
544 typedef struct {\r
545         PduIdType                               diagReqestRxPduId;  // Tester request PduId.\r
546         uint32                                  stateTimeoutCount; // Counter for timeout.\r
547         Dcm_DslBufferUserType   externalRxBufferStatus;\r
548         PduInfoType                             diagnosticRequestFromTester;\r
549         PduInfoType                             diagnosticResponseFromDsd;\r
550         Dcm_DslBufferUserType   externalTxBufferStatus;\r
551         boolean                                 protocolStarted; // Has the protocol been started?\r
552         Dcm_DslLocalBufferType  localRxBuffer;\r
553         Dcm_DslLocalBufferType  localTxBuffer;\r
554         boolean                                 diagnosticActiveComM; //\r
555         uint16                                  S3ServerTimeoutCount;\r
556         uint8                                   responsePendingCount;\r
557         Dcm_SecLevelType                securityLevel;\r
558         Dcm_SesCtrlType                 sessionControl;\r
559         Dcm_DslLocalBufferType      PeriodicTxBuffer;\r
560 } Dcm_DslRunTimeProtocolParametersType;\r
561 \r
562 // 10.2.10\r
563 struct Dcm_DslProtocolRowType_t { // Cross referenced from Dcm_DslConnectionType_t.\r
564         Dcm_ProtocolType                                                DslProtocolID; // (1)\r
565         boolean                                                                 DslProtocolIsParallelExecutab; // (1)\r
566         uint16                                                                  DslProtocolPreemptTimeout; // (1)\r
567         uint8                                                                   DslProtocolPriority; // (1)\r
568         Dcm_ProtocolTransTypeType                               DslProtocolTransType; // (1)\r
569         const Dcm_DslBufferType                                 *DslProtocolRxBufferID; // (1)\r
570         const Dcm_DslBufferType                                 *DslProtocolTxBufferID; // (1)\r
571         const Dcm_DsdServiceTableType                   *DslProtocolSIDTable; // (1)\r
572         const Dcm_DslProtocolTimingRowType              *DslProtocolTimeLimit; // (0..1)\r
573         // Containers\r
574         const Dcm_DslConnectionType                             *DslConnection; // (1..*)\r
575         // Reference to runtime parameters to this protocol.\r
576         Dcm_DslRunTimeProtocolParametersType    *DslRunTimeProtocolParameters; // Maybe this needs to change to index.\r
577         boolean                                                                 Arc_EOL;\r
578 };\r
579 \r
580 // 10.2.9\r
581 typedef struct {\r
582         // Containers\r
583         const Dcm_DslProtocolRxType             *DslProtocolRxGlobalList;       // (1..*)  A polite list for all RX protocol configurations.\r
584         const Dcm_DslProtocolTxType             *DslProtocolTxGlobalList;       // (1..*)  A polite list for all TX protocol configurations.\r
585         const Dcm_DslProtocolRowType    *DslProtocolRowList;            // (1..*)\r
586 } Dcm_DslProtocolType;\r
587 \r
588 // 10.2.19\r
589 typedef struct {\r
590         Dcm_CallbackIndicationFncType   Indication;\r
591         boolean                                                 Arc_EOL;\r
592 } Dcm_DslServiceRequestIndicationType; /** @req DCM681 */\r
593 \r
594 // 10.2.20\r
595 typedef struct {\r
596         Dcm_CallbackGetSesChgPermissionFncType  GetSesChgPermission;\r
597         Dcm_CallbackChangeIndicationFncType             ChangeIndication;\r
598         Dcm_CallbackConfirmationRespPendFncType ConfirmationRespPend;\r
599         boolean                                                                 Arc_EOL;\r
600 } Dcm_DslSessionControlType; /** @req DCM680 */\r
601 \r
602 // 10.2.5\r
603 typedef struct {\r
604         // Containers\r
605         const Dcm_DslBufferType                                         *DslBuffer;                                             // (1..256)\r
606         const Dcm_DslCallbackDCMRequestServiceType      *DslCallbackDCMRequestService;  // (1..*)\r
607         const Dcm_DslDiagRespType                                       *DslDiagResp;                                   // (1)\r
608         const Dcm_DslProtocolType                                       *DslProtocol;                                   // (1)\r
609         const Dcm_DslProtocolTimingType                         *DslProtocolTiming;                             // (1)\r
610         const Dcm_DslServiceRequestIndicationType       *DslServiceRequestIndication;   // (0..*)\r
611         const Dcm_DslSessionControlType                         *DslSessionControl;                             // (1..*)\r
612 } Dcm_DslType;\r
613 \r
614 // 10.2.1 Dcm\r
615 typedef struct {\r
616         // Containers\r
617         const Dcm_DspType *Dsp; //      (1)\r
618         const Dcm_DsdType *Dsd; //      (1)\r
619         const Dcm_DslType *Dsl; //      (1)\r
620 } Dcm_ConfigType;\r
621 \r
622 /*\r
623  * Make the DCM_Config visible for others.\r
624  */\r
625 \r
626 \r
627 extern const Dcm_ConfigType DCM_Config;\r
628 \r
629 \r
630 #endif /*DCM_LCFG_H_*/\r