common_library: gettid is multiple declaration in cl_error
[staging/basesystem.git] / video_in_hal / stub / diag_code / library / include / stub / DiagCodeAPI.h
1 /*
2  * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 /**
18  * @file DiagCodeAPI.h
19  */
20 /*******************************************************************************
21  * FILE      : DiagCodeAPI.h
22  * SYSTEM    : LinuxPF
23  * SUBSYSTEM :
24  * TITLE     : DiagCode management function include definition
25  ******************************************************************************/
26
27 #ifndef DIAG_CODE_LIBRARY_INCLUDE_VEHICLE_SERVICE_DIAGCODEAPI_H_
28 #define DIAG_CODE_LIBRARY_INCLUDE_VEHICLE_SERVICE_DIAGCODEAPI_H_
29
30 /**
31  * @file DiagCodeAPI.h
32  * @~english
33  * @brief Diag code API header
34  */
35
36 /** @addtogroup BaseSystem
37  *  @{
38  */
39 /** @addtogroup vehicle_service
40  *  @ingroup BaseSystem
41  *  @{
42  */
43 /** @addtogroup diag_code
44  *  @ingroup vehicle_service
45  *  @{
46  */
47
48 #include <time.h>
49 #include <native_service/frameworkunified_types.h>
50 #include <native_service/frameworkunified_framework_types.h>
51
52 #ifdef  __cplusplus
53 extern  "C" {
54 #endif
55
56 /*! @~english API return value */
57 typedef int DGCODE_RET_API;
58
59 /**
60  * \~english The definition of diag code processing result
61  */
62 /*! @~english Success */
63 #define DGCODE_RET_NORMAL       (0)
64 /*! @~english Fail */
65 #define DGCODE_RET_ERROR        (-1)
66 /*! @~english Illegal parameter */
67 #define DGCODE_RET_PARA_ERR     (-2)
68
69 /**
70  * \~english Category ID definition
71  */
72
73 /*! @~english none device */
74 #define DGCODE_DIV_UNIT_NONE    (0x00)
75 /*! @~english device base */
76 #define DGCODE_DIV_UNIT_BASE    (0x10)
77 /*! @~english Your own device */
78 #define DGCODE_DIV_UNIT__CWORD92_     (DGCODE_DIV_UNIT_BASE + 0x00)
79 /*! @~english Other devices */
80 #define DGCODE_DIV_UNIT_OTHER   (DGCODE_DIV_UNIT_BASE + 0x01)
81 /*! @~english device maximum number definition */
82 #define DGCODE_DIV_UNIT_MAX     (DGCODE_DIV_UNIT_OTHER)
83
84 /*! @~english proto base */
85 #define DGCODE_DIV_PROT_BASE    (0x20)
86 /*! @~english _CWORD43_ */
87 #define DGCODE_DIV_PROT__CWORD43_   (DGCODE_DIV_PROT_BASE + 0x00)
88 /*! @~english USB */
89 #define DGCODE_DIV_PROT_USB     (DGCODE_DIV_PROT_BASE + 0x02)
90 /*! @~english _CWORD119_ */
91 #define DGCODE_DIV_PROT__CWORD119_    (DGCODE_DIV_PROT_BASE + 0x03)
92 /*! @~english proto device maximum number definition */
93 #define DGCODE_DIV_PROT_MAX     (DGCODE_DIV_PROT_USB)
94 /*! @~english Communication full selection */
95 #define DGCODE_DIV_PROT_ALL     (DGCODE_DIV_PROT_BASE + 0x0F)
96 /*! @~english All select */
97 #define DGCODE_DIV_ALL          (DGCODE_DIV_UNIT_BASE + DGCODE_DIV_PROT_BASE)
98 /*! \~english Public RoB selection */
99 #define DGCODE_DIV_ROB_PUBLIC      (1)
100 /*! \~english Private Rob selection */
101 #define DGCODE_DIV_ROB_PRIVATE     (2)
102 /*! \~english RoB All select selection*/
103 #define DGCODE_DIV_ROB_ALL      (DGCODE_DIV_ROB_PUBLIC + DGCODE_DIV_ROB_PRIVATE)
104
105 /**
106  * \~english Past present registered flag definition
107  */
108 /*! @~english Past and present */
109 #define DGCODE_TYPE_PAST_PRES       (0)
110 /*! @~english Present only */
111 #define DGCODE_TYPE_PAST            (1)
112 /*! @~english Past only */
113 #define DGCODE_TYPE_PRES            (2)
114 /*! @~english Unspecified */
115 #define DGCODE_TYPE_NOTSPECIFIED    (3)
116
117 /**
118  * \~english FF data registration flag definition
119  */
120 /*! @~english Do not register FF data */
121 #define DGCODE_FFDATA_REG_OFF           (0)
122 /*! @~english FF data registered */
123 #define DGCODE_FFDATA_REG_ON            (1)
124 /*! @~english Unspecified */
125 #define DGCODE_FFDATA_REG_NOTSPECIFIED  (2)
126
127 /**
128  * \~english Validity invalid time definition
129  */
130 /*! @~english Time information invalid */
131 #define DGCODE_TIME_INVALID         (0)
132 /*! @~english Time information valid */
133 #define DGCODE_TIME_VALID           (1)
134 /*! @~english Unspecified */
135 #define DGCODE_TIME_NOTSPECIFIED    (2)
136
137 /**
138  * \~english Diag code existence check result definition
139  */
140 /*! @~english Diag code not registered */
141 #define DGCODE_CHECK_NOT_EXIST      (0)
142 /*! @~english Diag code registered */
143 #define DGCODE_CHECK_EXIST          (1)
144
145 /**
146  * \~english Diag code type definition
147  */
148 /*! @~english Development diag code */
149 #define DGCODE_KIND_DEVELOPMENT     (0)
150 /*! @~english Service diag code */
151 #define DGCODE_KIND_SERVICE         (1)
152 /*! @~english Communication diag code */
153 #define DGCODE_KIND_COMMUNICATION   (2)
154 /*! @~english Manufacturer diag code */
155 #define DGCODE_KIND_MAKER           (3)
156
157 /**
158  * \~english RoB code type definition
159  */
160 /*! \~english Public(service use)  */
161 #define DGCODE_ROB_KIND_PUBLIC      (0)
162 /*! \~english Private(only design)  */
163 #define DGCODE_ROB_KIND_PRIVATE     (1)
164
165 /**
166  * \~english type of rob_code specification
167  */
168 /*! \~english Specify all RoB codes. */
169 #define DGCODE_GET_ALL_ROB_CODE     (0xFFFF)
170
171 /**
172  * \~english Logical unit number definition
173  */
174 /*! @~english Unit number 0X */
175 #define DGCODE_MAKER_UNIT_0         (0x00)
176 /*! @~english Unit number 1X */
177 #define DGCODE_MAKER_UNIT_1         (0x01)
178 /*! @~english Unit number 2X */
179 #define DGCODE_MAKER_UNIT_2         (0x02)
180 /*! @~english Unit number 3X */
181 #define DGCODE_MAKER_UNIT_3         (0x03)
182 /*! @~english Unit number 4X */
183 #define DGCODE_MAKER_UNIT_4         (0x04)
184 /*! @~english Unit number 5X */
185 #define DGCODE_MAKER_UNIT_5         (0x05)
186 /*! @~english Unit number 6X */
187 #define DGCODE_MAKER_UNIT_6         (0x06)
188 /*! @~english Unit number 7X */
189 #define DGCODE_MAKER_UNIT_7         (0x07)
190 /*! @~english Unit number 8X */
191 #define DGCODE_MAKER_UNIT_8         (0x08)
192 /*! @~english Unit number 9X */
193 #define DGCODE_MAKER_UNIT_9         (0x09)
194 /*! @~english Unit number AX */
195 #define DGCODE_MAKER_UNIT_A         (0x0A)
196 /*! @~english Unit number BX */
197 #define DGCODE_MAKER_UNIT_B         (0x0B)
198 /*! @~english Unit number CX */
199 #define DGCODE_MAKER_UNIT_C         (0x0C)
200 /*! @~english Unit number DX */
201 #define DGCODE_MAKER_UNIT_D         (0x0D)
202 /*! @~english Unit number EX */
203 #define DGCODE_MAKER_UNIT_E         (0x0E)
204 /*! @~english Unit number FX */
205 #define DGCODE_MAKER_UNIT_F         (0x0F)
206 /*! @~english All above */
207 #define DGCODE_MAKER_UNIT_ALL       (0x10)
208
209 /**
210  * \~english All designation definitions of registered devices
211  */
212 /*! @~english Error designation of all registered devices */
213 #define DGCODE_PHYSADR_ALL          (0xFFFF)
214
215 /**
216  * \~english Diag code registration / deletion notification type definition
217  */
218 /*! @~english Diag code registration */
219 #define DGCODE_NOTIFY_PUT           (0)
220 /*! @~english Diag code clear */
221 #define DGCODE_NOTIFY_DELETE        (1)
222 /*! \~english DTC registration */
223 #define DGCODE_NOTIFY_DTC_PUT       (2)
224 /*! \~english RoB registration */
225 #define DGCODE_NOTIFY_ROB_PUT       (3)
226 /*! \~english DTC clear */
227 #define DGCODE_NOTIFY_DTC_DELETE    (4)
228 /*! \~english RoB clear */
229 #define DGCODE_NOTIFY_ROB_DELETE    (5)
230
231 /**
232  * \~english Type of activation definition
233  */
234 /*! @~english Hot start */
235 #define DGCODE_START_KIND_HOT       (0)
236 /*! @~english Cold start */
237 #define DGCODE_START_KIND_COLD      (1)
238
239 /**
240  * \~english Analysis support log saved DTC event presence / absence flag definition
241  */
242
243 /*! 
244     @~english The unnecessary diag code of saving analysis support log
245 */
246 #define DGCODE_DTC_EVENT_LOG_OFF    (0)
247 /*! 
248     @~english The necessary diag code of saving analysis support Log
249 */
250 #define DGCODE_DTC_EVENT_LOG_ON     (1)
251
252 /**
253  * \~english Diag code registration mask setting definition
254  */
255 /*! @~english Diag code registration mask OFF */
256 #define DGCODE_PUT_MASK_OFF         (0)
257 /*! @~english Diag code registration mask ON */
258 #define DGCODE_PUT_MASK_ON          (1)
259
260 /**
261  * \~english Diag code unique count value definition
262  */
263 /*! @~english Normal count */
264 #define DGC_TIMESTAMP_NORMAL        0U
265 /*! @~english Original count */
266 #define DGC_TIMESTAMP_INDIPENDENT   1U
267
268 /**
269  * \~english Availability register id define.
270  */
271 /*! @~english Backup manager register id */
272 #define DGC_REG_AVAILABILITY_BACKUP         0x01
273 /*! @~english Clock register id */
274 #define DGC_REG_AVAILABILITY_CLOCK          0x02
275 /*! @~english diag_record register id */
276 #define DGC_REG_AVAILABILITY_PFDRECTHREAD   0x04
277 /*! @~english Vehicle register id */
278 #define DGC_REG_AVAILABILITY_VEHICLE        0x08
279 /*! @~english Postion register id */
280 #define DGC_REG_AVAILABILITY_POSITION       0x10
281
282 /**
283  * \~english Diag code registration / erasing detailed setting structure
284  */
285 typedef struct _DGCODE_MEMINFO_CUSTOM {
286   /*
287    *  Note.
288    *  This feature needs to be defined by the vendor.
289    */
290 } DGCODE_MEMINFO_CUSTOM;
291
292 /**
293  * \~english Time information for SSR information
294  */
295 typedef struct _DGCODE_SSR_INFO_TIME_INFO {
296   /*
297    *  Note.
298    *  This feature needs to be defined by the vendor.
299    */
300 } DGCODE_SSR_INFO_TIME_INFO;
301
302 /**
303  * \~english DTC SSR information
304  */
305 typedef struct _DGCODE_DTC_SSR_INFO {
306   /*
307    *  Note.
308    *  This feature needs to be defined by the vendor.
309    */
310 } DGCODE_DTC_SSR_INFO;
311
312 /**
313  * \~english RoB SSR information
314  */
315 typedef struct _DGCODE_ROB_SSR_INFO {
316   /*
317    *  Note.
318    *  This feature needs to be defined by the vendor.
319    */
320 } DGCODE_ROB_SSR_INFO;
321
322 /**
323  * \~english Diag code list acquisition setting structure
324  */
325 typedef struct _DGCODE_GET_LIST_INFO {
326   /*
327    *  Note.
328    *  This feature needs to be defined by the vendor.
329    */
330 } DGCODE_GET_LIST_INFO;
331
332 /**
333  * \~english Diag code list information structure
334  */
335 typedef struct _DGCODE_LIST_INFO {
336   /*
337    *  Note.
338    *  This feature needs to be defined by the vendor.
339    */
340 } DGCODE_LIST_INFO;
341
342 /**
343  * \~english DTC list acquisition setting structure
344  */
345 typedef struct _DGCODE_GET_DTC_LIST_INFO {
346   /*
347    *  Note.
348    *  This feature needs to be defined by the vendor.
349    */
350 } DGCODE_GET_DTC_LIST_INFO;
351
352 /**
353  * \~english DTC list information structure
354  */
355 typedef struct _DGCODE_DTC_LIST_INFO {
356   /*
357    *  Note.
358    *  This feature needs to be defined by the vendor.
359    */
360 } DGCODE_DTC_LIST_INFO;
361
362
363 /**
364  * \~english RoB list acquisition setting structure
365  */
366 typedef struct _DGCODE_GET_ROB_LIST_INFO {
367   /*
368    *  Note.
369    *  This feature needs to be defined by the vendor.
370    */
371 } DGCODE_GET_ROB_LIST_INFO;
372
373 /**
374  * \~english RoB list information structure
375  */
376 typedef struct _DGCODE_ROB_LIST_INFO {
377   /*
378    *  Note.
379    *  This feature needs to be defined by the vendor.
380    */
381 } DGCODE_ROB_LIST_INFO;
382
383 /**
384  * \~english FF data list information structure
385  */
386 typedef struct _DGCODE_FFDATA_LIST_INFO {
387   /*
388    *  Note.
389    *  This feature needs to be defined by the vendor.
390    */
391 } DGCODE_FFDATA_LIST_INFO;
392
393 /**
394  * \~english Diag code list delete setting structure
395  */
396 typedef struct _DGCODE_DELETE_INFO {
397   /*
398    *  Note.
399    *  This feature needs to be defined by the vendor.
400    */
401 } DGCODE_DELETE_INFO;
402
403 /**
404  * \~english DTC list delete setting structure
405  */
406 typedef struct _DGCODE_DELETE_DTC_INFO {
407   /*
408    *  Note.
409    *  This feature needs to be defined by the vendor.
410    */
411 } DGCODE_DELETE_DTC_INFO;
412
413 /**
414  * \~english RoB list delete setting structure
415  */
416 typedef struct _DGCODE_DELETE_ROB_INFO {
417   /*
418    *  Note.
419    *  This feature needs to be defined by the vendor.
420    */
421 } DGCODE_DELETE_ROB_INFO;
422
423 /**
424  * \~english DID change structure
425  */
426 typedef struct _DGCODE_DID_LIST {
427   /*
428    *  Note.
429    *  This feature needs to be defined by the vendor.
430    */
431 } DGCODE_DID_LIST;
432
433 /****************************************/
434 /*             DiagCodeAPI              */
435 /****************************************/
436 /// \~english Subscribe the availability of the external module
437 /////////////////////////////////////////////////////////////////////////////////////
438 /// \ingroup Diag_SubscribeAvailability
439 /// \~english @par Overview
440 ///      - Notify the availability status of the external module
441 /// \~english @param [in]   hApp            Application handle
442 /// \~english @param [in]   availabilityId  The availability id(refer to DGC_REG_AVAILABILITY_XXX)
443 /// \~english @retval  DGCODE_RET_NORMAL    Success
444 /// \~english @retval  DGCODE_RET_ERROR     Failure
445 /// \~english @par Precondition
446 ///      - None
447 /// \~english @par Changing internal state
448 ///      - No change of internal state by this API occurs.
449 /// \~english @par Processing failure condition
450 ///      - Subscribe the availability callback to NSFW failed [DGCODE_RET_ERROR]
451 /// \~english @par Classification
452 ///      - Public
453 /// \~english @par Type
454 ///      - Sync
455 /// \~english @par Details
456 ///      - Subscribe the availability of the external module
457 ///      - Use "|" to subscribe the availability of the multiply modules
458 ///        example: Use the follow way to subscribe the availability of the backup manager and the clock
459 ///        Diag_SubscribeAvailability(hApp, DGC_REG_AVAILABILITY_BACKUP | DGC_REG_AVAILABILITY_CLOCK)
460 /// \~english @see Diag_NotifyAvailability
461 ///
462 /// \~english @ref DIAGCODE.h
463 ///
464 /////////////////////////////////////////////////////////////////////////////////////
465 DGCODE_RET_API Diag_SubscribeAvailability(HANDLE hApp, uint8_t availabilityId);
466
467 /// \~english Notify the availability of external module
468 /////////////////////////////////////////////////////////////////////////////////////
469 /// \ingroup Diag_NotifyAvailability
470 /// \~english @par Overview
471 ///      - Notify the availability status of the external module
472 /// \~english @param [in]   availabilityId  The availability id(refer to DGC_REG_AVAILABILITY_XXX)
473 /// \~english @param [in]   bAvailability   Availability status(TRUE: Available, FALSE: Unavailable)
474 /// \~english @retval  DGCODE_RET_NORMAL    Success
475 /// \~english @par Precondition
476 ///      - None
477 /// \~english @par Changing internal state
478 ///      - No change of internal state by this API occurs.
479 /// \~english @par Processing failure condition
480 ///      - None
481 /// \~english @par Classification
482 ///      - Public
483 /// \~english @par Type
484 ///      - Sync
485 /// \~english @par Details
486 ///      - Notify the available status of external module
487 ///      - Use "|" to notify the availability status of the multiply modules
488 ///        example: Use the follow way to notify that the backup manager and the clock are available
489 ///        Diag_NotifyAvailability(DGC_REG_AVAILABILITY_BACKUP | DGC_REG_AVAILABILITY_CLOCK, TRUE)
490 /// \~english @see Diag_SubscribeAvailability
491 ///
492 /// \~english @ref DIAGCODE.h
493 ///
494 /////////////////////////////////////////////////////////////////////////////////////
495 DGCODE_RET_API Diag_NotifyAvailability(uint8_t availabilityId, BOOL bAvailability);
496
497 /////////////////////////////////////////////////////////////////////////////////////
498 /// \ingroup Diag_InitDiagCode
499 /// \~english @par Overview
500 ///      - Perform initialization processing of diag code management.
501 /// \~english @param [in]   hApp            Application handle
502 /// \~english @param [in]   start_kind      activation type
503 /// \~english @param [in]   fpOnCmd         fpOnCmd callback definition
504 /// \~english @retval  DGCODE_RET_NORMAL    Success
505 /// \~english @retval  DGCODE_RET_ERROR     Failure
506 /// \~english @retval  DGCODE_RET_PARA_ERR  Invalid parameter
507 /// \~english @par Precondition
508 ///      - BackupMgr is available
509 ///      - PFDRECThread is available
510 ///      - The generation/initialization of dispatcher for application(PadCreateDispatcherWithoutLoop etc.) is done.
511 /// \~english @par Changing internal state
512 ///      - No change of internal state by this API occurs.
513 /// \~english @par Processing failure condition
514 ///      - Initialization of diagcode management information is fail [DGCODE_RET_ERROR]
515 ///      - When activation type is invalid [DGCODE_RET_PARA_ERR]
516 ///      - When diag work memory allocation fails [DGCODE_RET_ERROR]
517 ///      - Failure occurs when read data from the backup area [DGCODE_RET_ERROR]
518 ///      - Failure occurs when write data to the backup area [DGCODE_RET_ERROR]
519 ///      - The sum value is invalid when write data to the backup area. [DGCODE_RET_ERROR]
520 ///      - In case acquisition of application name from argument hApp failed [DGCODE_RET_ERROR]
521 ///      - Failed to register callback information specified by argument fpOnCmd [DGCODE_RET_ERROR]
522 /// \~english @par Classification
523 ///      - Public
524 /// \~english @par Type
525 ///      - Sync only(None communication)
526 /// \~english @par Details
527 ///      - The API should be called only by DiagService
528 ///      - Call this API, before registering, deleting, checking and acquiring the code.
529 ///      - Call this API, before registering, deleting, checking and acquiring the DTC information.
530 ///      - Call this API, before registering, deleting, checking and acquiring the RoB information.
531 ///      - Call this API, before update all StatusOfDTC.
532 ///      - This API is a process that is called only once at system startup and should be called with NS_BackupMgr with
533 ///        Avalability set to TRUE.
534 ///      - Calls the specified callback function when diag code registration / deletion is executed.
535 ///      - Calls the specified callback function when DTC information registration / deletion is executed.
536 ///      - Calls the specified callback function when RoB information registration / deletion is executed.
537 ///      - You can get message data by calling FrameworkunifiedGetMsgDataOfSize in the callback function.
538 ///      - message data, a diag code registration / erasure notification structure is set.
539 /// \~english @see none
540 ///
541 /////////////////////////////////////////////////////////////////////////////////////
542 DGCODE_RET_API Diag_InitDiagCode(HANDLE hApp, uint8_t start_kind, CbFuncPtr fpOnCmd);
543
544 /// \~english Setting of diag code registration mask information
545 /////////////////////////////////////////////////////////////////////////////////////
546 /// \ingroup Diag_SetDiagCodeMask
547 /// \~english @par Overview
548 ///      - Perform diag code registration mask setting.
549 /// \~english @param [in]   onoff           Diag code registration mask setting
550 /// \~english @retval  DGCODE_RET_NORMAL    Success
551 /// \~english @retval  DGCODE_RET_ERROR     Failure
552 /// \~english @par Precondition
553 ///      - BackupMgr is available
554 ///      - The generation/initialization of dispatcher for application(PadCreateDispatcherWithoutLoop etc.) is done.
555 /// \~english @par Changing internal state
556 ///      - No change of internal state by this API occurs.
557 /// \~english @par Processing failure condition
558 ///      - Diag code registration mask setting is invalid [DGCODE_RET_ERROR]
559 ///      - Initialization of diagcode management information is fail  [DGCODE_RET_ERROR]
560 ///      - Failure occurs when write data to the backup area [DGCODE_RET_ERROR]
561 /// \~english @par Classification
562 ///      - Public
563 /// \~english @par Type
564 ///      - Sync
565 /// \~english @par Details
566 ///      - The API should be called only by DiagService
567 ///      - Set the registration mask of the diag code. If + B OFF, the setting information is held. (Initial state,
568 ///        registration mask OFF)
569 ///      - If diag code registration mask setting is ON, when Diag_PutDiagCode,
570 ///        Diag_PutDiagCode_Custom of the diag code registration API is called,
571 ///        do not register diag code and register FF data.
572 /// \~english @see Diag_PutDiagCode, Diag_PutDiagCode_Custom
573 ///
574 /////////////////////////////////////////////////////////////////////////////////////
575 DGCODE_RET_API Diag_SetDiagCodeMask(uint8_t onoff);
576
577 /// \~english Synchronization of time stamp information
578 /////////////////////////////////////////////////////////////////////////////////////
579 /// \ingroup Diag_SyncTimeStamp
580 /// \~english @par Overview
581 ///      - Synchronize time stamp information.
582 /// \~english @param [in]   time_cnt        time counter
583 /// \~english @param [in]   trip_cnt        Trip counter
584 /// \~english @retval  DGCODE_RET_NORMAL    Success
585 /// \~english @retval  DGCODE_RET_ERROR     Failure
586 /// \~english @par Precondition
587 ///      - BackupMgr is available
588 ///      - The generation/initialization of dispatcher for application(PadCreateDispatcherWithoutLoop etc.) is done.
589 /// \~english @par Changing internal state
590 ///      - No change of internal state by this API occurs.
591 /// \~english @par Processing failure condition
592 ///      - Initialization of diagcode management information is fail [DGCODE_RET_ERROR]
593 ///      - Failure occurs when export data from backup area [DGCODE_RET_ERROR]
594 /// \~english @par Classification
595 ///      - Public
596 /// \~english @par Type
597 ///      - Sync
598 /// \~english @par Details
599 ///      - The API should be called only by DiagService
600 ///      - Updates the time stamp information held by the library with the value of the specified time counter and
601 ///        Trip counter.
602 ///      - The diagnosis service should synchronize the time counter and Trip counter with this API when time
603 ///        information from the time master is received.
604 ///      - However, if any of the time counter and Trip counter specified in the argument is Fail value,
605 ///        do not perform synchronization processing and and update the time stamp information with Fail value.
606 /// \~english @see DGC_TIMESTAMP_GETTIME
607 ///
608 /////////////////////////////////////////////////////////////////////////////////////
609 DGCODE_RET_API Diag_SyncTimeStamp(uint32_t time_cnt, uint16_t trip_cnt);
610
611 /////////////////////////////////////////////////////////////////////////////////////
612 /// \ingroup Diag_SyncDcmTime
613 /// \~english @par Brief
614 ///      - Synchronize Hour information.
615 /// \~english @param [in] hour_info Hour information
616 ///      - #DGCODE_SSR_INFO_TIME_INFO : SSR infomation (Time infomation for SSR, Time infomation for RoB)
617 /// \~english @retval DGCODE_RET_NORMAL   Success
618 /// \~english @retval DGCODE_RET_ERROR    Failure
619 /// \~english @par Precondition
620 ///      - BackupMgr is available
621 /// \~english @par Changing internal state
622 ///      - No change of internal state by this API occurs.
623 /// \~english @par Processing failure condition
624 ///      - The pointer of Hour information is NULL [#DGCODE_RET_PARA_ERR]
625 ///      - Initialization of diagcode management information is fail [#DGCODE_RET_ERROR]
626 ///      - Get mutex failed [#DGCODE_RET_ERROR]
627 /// \~english @par Classification
628 ///      - Public
629 /// \~english @par Type
630 ///      - Sync only(None communication)
631 /// \~english @par Detail
632 ///      - This API should be called only by DiagService.
633 ///      - Updates the Hour information held by the library with the value of the specified Hour information.
634 ///      - DiagService should synchronize Hour information with this API,
635 ///        when DiagService received the Hour information from the DCM.
636 ///      - If any of Hour information specified is Fail value,
637 ///        do not perform synchronization processing, and update the Hour information with Fail value(0xFF).
638 /// \~english @see None
639 /////////////////////////////////////////////////////////////////////////////////////
640 DGCODE_RET_API Diag_SyncDcmTime(const DGCODE_SSR_INFO_TIME_INFO * const hour_info);
641
642 /////////////////////////////////////////////////////////////////////////////////////
643 /// \ingroup Diag_SyncOdometer
644 /// \~english @par Overview
645 ///      - Synchronize odo meter information.
646 /// \~english @param [in]   mileage         accumulative mileage
647 /// \~english @param [in]   unit            odo unit
648 /// \~english @retval  DGCODE_RET_NORMAL    Success
649 /// \~english @retval  DGCODE_RET_ERROR     Failure
650 /// \~english @retval  DGCODE_RET_PARA_ERR  Invalid parameter
651 /// \~english @par Precondition
652 ///      - BackupMgr is available
653 ///      - The generation/initialization of dispatcher for application(PadCreateDispatcherWithoutLoop etc.) is done.
654 /// \~english @par Changing internal state
655 ///      - No change of internal state by this API occurs.
656 /// \~english @par Processing failure condition
657 ///      - The accumulative mileage is invalid (mileage > 999,999) [\ref DGCODE_RET_PARA_ERR]
658 ///      - Initialization of diagcode management information is fail [\ref DGCODE_RET_ERROR]
659 ///      - Failure occurs when export data from backup area [\ref DGCODE_RET_ERROR]
660 /// \~english @par Classification
661 ///      - Public
662 /// \~english @par Type
663 ///      - Sync only(None communication)
664 /// \~english @par Details
665 ///      - The API should be called only by DiagService
666 ///      - Updates the odo meter information held by the library with the value of the specified accumulative mileage
667 ///        and odo unit.
668 ///      - The diagnosis service should synchronize the accumulative mileage and odo unit with this API when time
669 ///        information from the odo meter is received.
670 /// \~english @see None
671 ///
672 /////////////////////////////////////////////////////////////////////////////////////
673 DGCODE_RET_API Diag_SyncOdometer(const uint32_t mileage, const uint8_t unit);
674
675 /// \~english Inhibit diag code register
676 /////////////////////////////////////////////////////////////////////////////////////
677 /// \ingroup Diag_InhibitPutDiagCode
678 /// \~english @par Overview
679 ///      - Inhibit diag code register.
680 /// \~english @param   none
681 /// \~english @retval  DGCODE_RET_NORMAL     Success
682 /// \~english @retval  DGCODE_RET_ERROR      Failure
683 /// \~english @par Precondition
684 ///      - The initialization of diag memory is finished.
685 /// \~english @par Changing internal state
686 ///      - No change of internal state by this API occurs.
687 /// \~english @par Processing failure condition
688 ///      - Initialization of diagcode management information is fail [DGCODE_RET_ERROR]
689 ///      - Get mutex failed [DGCODE_RET_ERROR]
690 ///      - The diag code's inhibit flag has not been initialized [DGCODE_RET_ERROR]
691 /// \~english @par Classification
692 ///      - Public
693 /// \~english @par Type
694 ///      - Sync
695 /// \~english @par Details
696 ///      - The API should be called only by DiagService
697 ///      - Diag code register inhibit.
698 /// \~english @see none
699 ///
700 /////////////////////////////////////////////////////////////////////////////////////
701 DGCODE_RET_API Diag_InhibitPutDiagCode(void);
702
703 /////////////////////////////////////////////////////////////////////////////////////
704 /// \ingroup Diag_PutDTCInfo
705 /// \~english @par Overview
706 ///      - Register of DTC info.
707 /// \~english @param [in] hApp Application handle
708 /// \~english @param [in] dtc_id DTC ID\n
709 ///        Use diag code definition defined in DIAGCODE.h.\n
710 /// \~english @param [in] test_result StatusOfDTC\n
711 ///        testFailed(bit0 not Failed:0 Failed:1)\n
712 /// \~english @param [in] ssr_info SSR data info
713 /// \~english @param [in] spply_code Supplementary code
714 /// \~english @retval DGCODE_RET_NORMAL Success
715 /// \~english @retval DGCODE_RET_ERROR Failure
716 /// \~english @retval DGCODE_RET_PARA_ERR Invalid parameter
717 /// \~english @par Precondition
718 ///      - Diagcode mask is unset.
719 ///      - BackupMgr is available
720 ///      - PFDRECThread is available
721 ///      - The generation/initialization of dispatcher for application(PadCreateDispatcherWithoutLoop etc.) is done.
722 /// \~english @par Changing internal state
723 ///      - No change of internal state by this API occurs.
724 /// \~english @par Processing failure condition
725 ///      - Initialization of DTC management information is fail [DGCODE_RET_ERROR]
726 ///      - DTC ID does not match the defination of DTC ROM table [DGCODE_RET_PARA_ERR]
727 ///      - The communication unit ID(division) in the DTC ROM table is invalid [DGCODE_RET_ERROR]
728 ///      - The communication unit ID(division) in the DTC ROM table is
729 ///        none device(#DGCODE_DIV_UNIT_NONE) [DGCODE_RET_ERROR]
730 ///      - Allocation of work memory fails when writing the DTC. [DGCODE_RET_ERROR]
731 ///      - Failure occurs when reading data from backup area [DGCODE_RET_ERROR]
732 ///      - Failure occurs when writing to the backup area [DGCODE_RET_ERROR]
733 ///      - The sum value is invalid when writing to the backup area [DGCODE_RET_ERROR]
734 ///      - Communication unit is not _CWORD92_ or other device when registering individual Diag Code. [DGCODE_RET_PARA_ERR]
735 ///      - The pointer of DTC inhibit info is NULL [DGCODE_RET_ERROR]
736 /// \~english @par Classification
737 ///      - Public
738 /// \~english @par Type
739 ///      - Sync x Sync
740 /// \~english @par Details
741 ///      - Register DTC info.
742 ///      - When register development diag code for supplier, set the DTC ID assigned to supplier.
743 ///      - Register MM DiagRecord, too.
744 ///      - But if the register mask of DTC is set ON, this API returns DGCODE_RET_NORMAL
745 ///        not registering the DTC info.
746 ///      - diag_code sets the following bit of StatusOfDTC.\n
747 ///        bit1:testFailedThisOperationCycle\n
748 ///        bit2:pendingDTC\n
749 ///        bit3:confirmedDTC\n
750 ///        bit4:testNotCompletedSinceLastClear\n
751 ///        bit5:testFailedSinceLastClear\n
752 ///        bit6:testNotCompletedThisOperationCycle\n
753 ///      - diag_code sets TimeStamp, Odometer and clock time of SSR.
754 ///      - Treat current position longitude and current latitude of SSR as all 0 in this API.
755 ///      - Set supplementary code if it is need.
756 ///
757 /// \~english @ref DIAGCODE.h
758 ///
759 /////////////////////////////////////////////////////////////////////////////////////
760 DGCODE_RET_API Diag_PutDTCInfo(const HANDLE hApp, const uint64_t dtc_id, const uint8_t test_result,
761                                const DGCODE_DTC_SSR_INFO* ssr_info,
762                                const uint16_t spply_code);
763
764 /////////////////////////////////////////////////////////////////////////////////////
765 /// \ingroup Diag_PutRoBInfo
766 /// \~english @par Overview
767 ///      - Register of RoB info.
768 /// \~english @param [in] hApp Application handle
769 /// \~english @param [in] rob_id RoB ID\n
770 ///        Use diag code definition defined in DIAGCODE.h.\n
771 /// \~english @param [in] ssr_info SSR data info
772 /// \~english @retval DGCODE_RET_NORMAL Success
773 /// \~english @retval DGCODE_RET_ERROR Failure
774 /// \~english @retval DGCODE_RET_PARA_ERR Invalid parameter
775 /// \~english @par Precondition
776 ///      - Diagcode mask is unset.
777 ///      - BackupMgr is available
778 ///      - PFDRECThread is available
779 ///      - The generation/initialization of dispatcher for application(PadCreateDispatcherWithoutLoop etc.) is done.
780 /// \~english @par Changing internal state
781 ///      - No change of internal state by this API occurs.
782 /// \~english @par Processing failure condition
783 ///      - Initialization of RoB management information is fail [DGCODE_RET_ERROR]
784 ///      - RoB ID does not match the defination of RoB ROM table [DGCODE_RET_PARA_ERR]
785 ///      - The communication unit ID(division) in the RoB ROM table is invalid [DGCODE_RET_ERROR]
786 ///      - The communication unit ID(division) in the RoB ROM table is
787 ///        none device(#DGCODE_DIV_UNIT_NONE) [DGCODE_RET_ERROR]
788 ///      - Allocation of work memory fails when writing the diag code. [DGCODE_RET_ERROR]
789 ///      - Failure occurs when read data from backup area [DGCODE_RET_ERROR]
790 ///      - Failure occur when write to the backup area [DGCODE_RET_ERROR]
791 ///      - The sum value is invalid when write to the backup area [DGCODE_RET_ERROR]
792 ///      - The pointer of RoB inhibit info is NULL [DGCODE_RET_ERROR]
793 /// \~english @par Classification
794 ///      - Public
795 /// \~english @par Type
796 ///      - Sync x Sync
797 /// \~english @par Details
798 ///      - Register RoB info.
799 ///      - When register development diag code for supplier, set the RoB ID assigned to supplier.
800 ///      - Register MM DiagRecord, too.
801 ///      - But if the register mask of Diag Code is set ON, this API returns DGCODE_RET_NORMAL
802 ///        not registering the RoB info.
803 ///      - Set SSR info related RoB ID to SSR data info(SSR info not related RoB ID is unnecessary).\n
804 ///        diag_code sets TimeStamp, Odometer and clock time of SSR.
805 ///      - Treat current position longitude and current latitude of SSR as all 0 in this API.
806 ///
807 /// \~english @ref DIAGCODE.h
808 ///
809 /////////////////////////////////////////////////////////////////////////////////////
810 DGCODE_RET_API Diag_PutRoBInfo(const HANDLE hApp, const uint64_t rob_id, const DGCODE_ROB_SSR_INFO* ssr_info);
811
812 /////////////////////////////////////////////////////////////////////////////////////
813 /// \ingroup Diag_DeleteDTCInfo
814 /// \~english @par Overview
815 ///      - Delete specified DTC.
816 /// \~english @param [in]   hApp       Application handle
817 /// \~english @param [in]   err_id       DTC detail info
818 /// \~english @retval  DGCODE_RET_NORMAL     Success
819 /// \~english @retval  DGCODE_RET_ERROR      Failure
820 /// \~english @retval  DGCODE_RET_PARA_ERR  Invalid parameter
821 /// \~english @par Precondition
822 ///      - BackupMgr is available
823 ///      - PFDRECThread is available
824 ///      - The generation/initialization of dispatcher for application(PadCreateDispatcherWithoutLoop etc.) is done.
825 /// \~english @par Changing internal state
826 ///      - No change of internal state by this API occurs.
827 /// \~english @par Processing failure condition
828 ///      - Initialization of diagcode management information is fail [DGCODE_RET_ERROR]
829 ///      - The param[err_id] do not match the defination in the diagcode ROM table [DGCODE_RET_PARA_ERR]
830 ///      - The communication unit ID(division) in the diagcode ROM table is invalid [DGCODE_RET_ERROR]
831 ///      - If the communication unit ID(division) is other in the diagcode ROM table,
832 ///        and failure occur when getting unit number. [DGCODE_RET_ERROR]
833 /// \~english @par Classification
834 ///      - Public
835 /// \~english @par Type
836 ///      - Fire and Forget only
837 /// \~english @par Details
838 ///      - For the latest diag which has been registered, do the erase procedure due to the fact that the DTC is initialized.
839 ///      - If diagcode which specified is not registered, return DGCODE_RET_NORMAL.
840 ///      - Register removal DTC to MM Diag Record.
841 ///      - Delete SSR information,too.
842 ///      - Delete status of DTC, too.
843 ///
844 /// \~english @ref DIAGCODE.h
845 ///
846 /////////////////////////////////////////////////////////////////////////////////////
847 DGCODE_RET_API Diag_DeleteDTCInfo(const HANDLE hApp, const uint64_t err_id);
848
849 /////////////////////////////////////////////////////////////////////////////////////
850 /// \ingroup Diag_GetDTCInfoList_CWORD29_
851 /// \~english @par Overview
852 ///      - Get the List of specified DTC
853 /// \~english @param [in]   get_info      Get info of DTC list
854 ///      - #DGCODE_GET_DTC_LIST_INFO : DTC list acquisition setting structure
855 /// \~english @param [out]  list_info     List info of DTC
856 ///      - #DGCODE_DTC_LIST_INFO : DTC list information structure
857 /// \~english @retval  DGCODE_RET_NORMAL    Success
858 /// \~english @retval  DGCODE_RET_ERROR     Failure
859 /// \~english @retval  DGCODE_RET_PARA_ERR  Invalid parameter
860 /// \~english @par Precondition
861 ///      - The initialization of diag memory is finished.
862 ///      - BackupMgr is available
863 /// \~english @par Changing internal state
864 ///      - No change of internal state by this API occurs.
865 /// \~english @par Processing failure condition
866 ///      - The pointer get_info of acquisition setting is NULL [DGCODE_RET_PARA_ERR]
867 ///      - The pointer list_info of storage area is NULL [DGCODE_RET_PARA_ERR]
868 ///      - Initialization of diagcode management information is fail [DGCODE_RET_ERROR]
869 ///      - The flag of diag registration start is not OK yet(The function of diagcode is not prepared yet).
870 ///        [DGCODE_RET_ERROR]
871 ///      - The acquirement kind(diagcode) is invalid [DGCODE_RET_PARA_ERR]
872 ///      - Common Diagnosis When the Diag code definition Name acquired from the memory
873 ///        error table do not match the definition of the diagcode ROM Table [DGCODE_RET_PARA_ERR]
874 ///      - The communication unit ID(division) in the diag code ROM talble is not valid [DGCODE_RET_ERROR]
875 ///      - If the acquisition type is development or service and the division ID is other than the self device and
876 ///        other devices [DGCODE_RET_PARA_ERR]
877 /// \~english @par Classification
878 ///      - Public
879 /// \~english @par Type
880 ///      - Sync only(None communication)
881 /// \~english @par Details
882 ///      - Get the DTC list of conditions specified by get_info.
883 ///      - Acquisition type must be set to diag code type definition value.
884 ///      - StatusOfDTC information must be set to StatusOfDTC of getting DTC.\n
885 ///        Targeting bit of StatusOfDTC information that is 1, this API gets DTC
886 ///        that every target bit of StatusOfDTC is also 1.\n
887 ///        Examples of getting DTC, when StatusOfDTC information is set 0b00100111 : 0b00101111、0b00100111
888 ///      - Category ID must be set to category ID definition.
889 ///      - If category ID is other than DGCODE_DIV_UNIT__CWORD92_, error registered device physical address must be set.
890 ///      - If category ID is DGCODE_DIV_UNIT__CWORD92_, error registered device physical address is not used,
891 ///        and thus an arbitary value may be set.
892 ///      - Logic unit number for maker diag must be set DGCODE_MAKER_UNIT_ALL.
893 ///      - All DTC that matches above condition store in list_info(list_info is variable length).
894 ///      - The maximum number of DTC that can be acquired at a time is 64.
895 ///      - By setting any value from 0 to 255 as the DTC acquisition start index position,
896 ///        64 DTC can be acquired from that position.\n
897 ///        To acquire from Nth DTC, N-1 should be set.\n
898 ///        example : If the number of previous acquisitions is 64 and "DTC acquisition start index position" is
899 ///        set to 64, DTC from 65th to 128th can be acquired.
900 ///      - When the number of items remaining from DTC acquisition start index position to set
901 ///        the last registered DTC is less than 64, only the remaining items are acquired.
902 ///        example : If the case where 100 items of DTC are registered , when 64 is set
903 ///        as the "DTC acquisition start index position", 36 items from 65th to 100th can be acquired.
904 ///
905 /////////////////////////////////////////////////////////////////////////////////////
906 DGCODE_RET_API Diag_GetDTCInfoList_CWORD29_(const DGCODE_GET_DTC_LIST_INFO* const get_info,
907                                    DGCODE_DTC_LIST_INFO* const list_info);
908
909 /////////////////////////////////////////////////////////////////////////////////////
910 /// \ingroup Diag_DeleteDTCInfoList
911 /// \~english @par Overview
912 ///      - Delete the list of specified DTC.
913 /// \~english @param [in]   del_info      Deletion info of DTC list
914 /// \~english @retval  DGCODE_RET_NORMAL    Success
915 /// \~english @retval  DGCODE_RET_ERROR     Failure
916 /// \~english @retval  DGCODE_RET_PARA_ERR  Invalid parameter
917 /// \~english @par Precondition
918 ///      - BackupMgr is available.
919 ///      - The initialization of diag memory is finished.
920 /// \~english @par Changing internal state
921 ///      - No change of internal state by this API occurs.
922 /// \~english @par Processing failure condition
923 ///      - The pointer del_info of acquisition setting is NULL [DGCODE_RET_PARA_ERR]
924 ///      - Initialization of diagcode management information is fail [DGCODE_RET_ERROR]
925 ///      - The flag of diag registration start is not OK yet(The function of diagcode is not prepared yet).
926 ///        [DGCODE_RET_ERROR]
927 ///      - Failure occurs when read data from the backup area [DGCODE_RET_ERROR]
928 ///      - Failure occurs when write data to the backup area [DGCODE_RET_ERROR]
929 ///      - The sum value is invalid when export data from backup area. [DGCODE_RET_ERROR]
930 ///      - When the Category ID is invalid [DGCODE_RET_PARA_ERR]
931 ///      - Register error of own device at all deletion Device physical address is invalid [DGCODE_RET_PARA_ERR]
932 /// \~english @par Classification
933 ///      - Public
934 /// \~english @par Type
935 ///      - Sync only(None communication)
936 /// \~english @par Details
937 ///      - Delete the list of specified DTC by Category ID.
938 ///      - Delete SSR information,too.
939 ///
940 /////////////////////////////////////////////////////////////////////////////////////
941 DGCODE_RET_API Diag_DeleteDTCInfoList(const DGCODE_DELETE_DTC_INFO* const del_info);
942
943 /////////////////////////////////////////////////////////////////////////////////////
944 /// \ingroup Diag_DeleteRoBInfo
945 /// \~english @par Overview
946 ///      - Set the diagcode detail info and delete the diagcode.
947 /// \~english @param [in]   hApp       Application handle
948 /// \~english @param [in]   rob_id       RoB detail info
949 /// \~english @retval  DGCODE_RET_NORMAL     Success
950 /// \~english @retval  DGCODE_RET_ERROR      Failure
951 /// \~english @retval  DGCODE_RET_PARA_ERR  Invalid parameter
952 /// \~english @par Precondition
953 ///      - BackupMgr is available
954 ///      - PFDRECThread is available
955 ///      - The generation/initialization of dispatcher for application(PadCreateDispatcherWithoutLoop etc.) is done.
956 /// \~english @par Changing internal state
957 ///      - No change of internal state by this API occurs.
958 /// \~english @par Processing failure condition
959 ///      - Initialization of diagcode management information is fail [DGCODE_RET_ERROR]
960 ///      - The param[rob_id] do not match the defination in the diagcode ROM table [DGCODE_RET_PARA_ERR]
961 ///      - The communication unit ID(division) in the diagcode ROM table is invalid [DGCODE_RET_ERROR]
962 ///      - If the communication unit ID(division) is other in the diagcode ROM table,
963 ///        and failure occur when getting unit number. [DGCODE_RET_ERROR]
964 /// \~english @par Classification
965 ///      - Public
966 /// \~english @par Type
967 ///      - Fire and Forget only
968 /// \~english @par Details
969 ///      - For the RoB which has been registered, do the erase procedure due to the fact that the RoB is initialized.
970 ///      - If diagcode which specified is not registered, return DGCODE_RET_NORMAL.
971 ///      - Delete SSR information,too.
972 ///
973 /// \~english @ref DIAGCODE.h
974 ///
975 /////////////////////////////////////////////////////////////////////////////////////
976 DGCODE_RET_API Diag_DeleteRoBInfo(const HANDLE hApp, const uint64_t rob_id);
977
978 /////////////////////////////////////////////////////////////////////////////////////
979 /// \ingroup Diag_GetRoBInfoList
980 /// \~english @par Overview
981 ///      - Get the List of specified RoB
982 /// \~english @param [in]   get_info      Get info of RoB list
983 /// \~english @param [out]  list_info     List info of RoB
984 /// \~english @retval  DGCODE_RET_NORMAL    Success
985 /// \~english @retval  DGCODE_RET_ERROR     Failure
986 /// \~english @retval  DGCODE_RET_PARA_ERR  Invalid parameter
987 /// \~english @par Precondition
988 ///      - The initialization of diag memory is finished.
989 ///      - BackupMgr is available
990 /// \~english @par Changing internal state
991 ///      - No change of internal state by this API occurs.
992 /// \~english @par Processing failure condition
993 ///      - The pointer get_info of acquisition setting is NULL [DGCODE_RET_PARA_ERR]
994 ///      - The pointer list_info of storage area is NULL [DGCODE_RET_PARA_ERR]
995 ///      - Initialization of RoB code management information is fail [DGCODE_RET_ERROR]
996 ///      - The flag of diag registration start is not OK yet(The function of RoB code is not prepared yet).
997 ///        [DGCODE_RET_ERROR]
998 ///      - When the acquisition type is other than "RoB code type definition" [DGCODE_RET_PARA_ERR]
999 ///      - Common Diagnosis When the RoB code definition Name acquired from the memory
1000 ///        error table do not match the definition of the RoB code ROM Table [DGCODE_RET_PARA_ERR]
1001 ///      - The communication unit ID(division) in the RoB code ROM table is not valid [DGCODE_RET_ERROR]
1002 /// \~english @par Classification
1003 ///      - Public
1004 /// \~english @par Type
1005 ///      - Sync only(None communication)
1006 /// \~english @par Details
1007 ///      - Get the RoB list of conditions specified by get_info.
1008 ///      - Acquisition type must be set to RoB code type definition value.
1009 ///      - Category ID must be set DGCODE_DIV_UNIT__CWORD92_.
1010 ///      - Error registered device physical address is not used, and thus an arbitary value may be set.
1011 ///      - Logic unit number for maker diag must be set DGCODE_MAKER_UNIT_ALL.
1012 ///      - For the RoB code, set the "RoB code" described in the diag code generation tool of the RoB
1013 ///        to be acquired.
1014 ///      - When the RoB code is #DGCODE_GET_ALL_ROB_CODE, the latest  RoB is acquired one of the registered RoB
1015 ///        for each RoB define.
1016 ///      - When th RoB code is other than #DGCODE_GET_ALL_ROB_CODE,
1017 ///        the list of RoB matching the RoB code is acquired.
1018 ///      - All DTC that matches above conditions store in list_info(list_info is variable length).
1019 ///      - The maximum number of RoB that can be acquired at a time is 64.
1020 ///      - By setting any value from 0 to 255 as the RoB acquisition start index position,
1021 ///        64 RoB can be acquired from that position.\n
1022 ///        To acquire from Nth RoB, N-1 should be set.\n
1023 ///        example : If the number of previous acquisitions is 64 and "RoB acquisition start index position" is
1024 ///        set to 64, RoB from 65th to 128th can be acquired.
1025 ///      - When the number of items remaining from RoB acquisition start index position to set
1026 ///        the last registered RoB is less than 64, only the remaining items are acquired.
1027 ///        example : If the case where 100 items of RoB are registered , when 64 is set
1028 ///        as the "RoB acquisition start index position", 36 items from 65th to 100th can be acquired.
1029 ///
1030 /////////////////////////////////////////////////////////////////////////////////////
1031 DGCODE_RET_API Diag_GetRoBInfoList(const DGCODE_GET_ROB_LIST_INFO* const get_info,
1032                                    DGCODE_ROB_LIST_INFO* const list_info);
1033
1034 /////////////////////////////////////////////////////////////////////////////////////
1035 /// \ingroup Diag_GetDIDList
1036 /// \~english @par Overview
1037 ///      - Get DID list which relates DTC/RoB code.
1038 /// \~english @param [in]   code            DTC or RoB
1039 /// \~english @param [out]  list            structure of DID list
1040 /// \~english @retval  DGCODE_RET_NORMAL    Success
1041 /// \~english @retval  DGCODE_RET_ERROR     Failure
1042 /// \~english @retval  DGCODE_RET_PARA_ERR  Invalid parameter
1043 /// \~english @par Precondition
1044 ///      - None.
1045 /// \~english @par Changing internal state
1046 ///      - No change of internal state by this API occurs.
1047 /// \~english @par Processing failure condition
1048 ///      - Parameter of list is NULL. [\ref DGCODE_RET_PARA_ERR]
1049 ///      - DTC or RoB is associated parameter of code is not exist. [\ref DGCODE_RET_ERROR]
1050 ///      - Initialization of diagcode management information is fail [\ref DGCODE_RET_ERROR]
1051 /// \~english @par Classification
1052 ///      - Public
1053 /// \~english @par Type
1054 ///      - Sync only(None communication)
1055 /// \~english @par Details
1056 ///      - Return DID list which is associated parameter of DTC or RoB.
1057 /// \~english @see None
1058 ///
1059 /////////////////////////////////////////////////////////////////////////////////////
1060 DGCODE_RET_API Diag_GetDIDList(const uint64_t code, DGCODE_DID_LIST* const list);
1061
1062 /////////////////////////////////////////////////////////////////////////////////////
1063 /// \ingroup Diag_DeleteRoBInfoList
1064 /// \~english @par Overview
1065 ///      - Delete the list of specified RoB.
1066 /// \~english @param [in]   del_info      Deletion info of RoB code list
1067 /// \~english @retval  DGCODE_RET_NORMAL    Success
1068 /// \~english @retval  DGCODE_RET_ERROR     Failure
1069 /// \~english @retval  DGCODE_RET_PARA_ERR  Invalid parameter
1070 /// \~english @par Precondition
1071 ///      - BackupMgr is available.
1072 ///      - The initialization of diag memory is finished.
1073 /// \~english @par Changing internal state
1074 ///      - No change of internal state by this API occurs.
1075 /// \~english @par Processing failure condition
1076 ///      - The pointer del_info of acquisition setting is NULL [DGCODE_RET_PARA_ERR]
1077 ///      - Initialization of diagcode management information is fail [DGCODE_RET_ERROR]
1078 ///      - The flag of diag registration start is not OK yet(The function of diagcode is not prepared yet).
1079 ///        [DGCODE_RET_ERROR]
1080 ///      - Failure occurs when read data from the backup area [DGCODE_RET_ERROR]
1081 ///      - Failure occurs when write data to the backup area [DGCODE_RET_ERROR]
1082 ///      - The sum value is invalid when export data from backup area. [DGCODE_RET_ERROR]
1083 ///      - When the Category ID is invalid [DGCODE_RET_PARA_ERR]
1084 ///      - Register error of own device at all deletion Device physical address is invalid [DGCODE_RET_PARA_ERR]
1085 /// \~english @par Classification
1086 ///      - Public
1087 /// \~english @par Type
1088 ///      - Sync only(None communication)
1089 /// \~english @par Details
1090 ///      - Delete the list of specified RoB by Category ID.
1091 ///      - Delete SSR information,too.
1092 ///
1093 /////////////////////////////////////////////////////////////////////////////////////
1094 DGCODE_RET_API Diag_DeleteRoBInfoList(const DGCODE_DELETE_ROB_INFO* const del_info);
1095
1096 /////////////////////////////////////////////////////////////////////////////////////
1097 /// \ingroup Diag_StartupAllStatusOfDTC
1098 /// \~english @par Overview
1099 ///      - Update all StatusOfDTC for startup of OperationCycle.
1100 /// \~english @param none
1101 /// \~english @retval DGCODE_RET_NORMAL Success
1102 /// \~english @retval DGCODE_RET_ERROR Failure
1103 /// \~english @par Precondition
1104 ///      - BackupMgr is available
1105 /// \~english @par Changing internal state
1106 ///      - No change of internal state by this API occurs.
1107 /// \~english @par Processing failure condition
1108 ///      - DTC ID does not match the defination of DTC ROM table [DGCODE_RET_ERROR]
1109 ///      - Allocation of work memory fails when update the StatusOfDTC. [DGCODE_RET_ERROR]
1110 ///      - Failure occurs when reading data from backup area [DGCODE_RET_ERROR]
1111 ///      - Failure occurs when writing to the backup area [DGCODE_RET_ERROR]
1112 ///      - The sum value is invalid when writing to the backup area [DGCODE_RET_ERROR]
1113 ///      - The pointer of DTC inhibit info is NULL [DGCODE_RET_ERROR]
1114 /// \~english @par Classification
1115 ///      - Public
1116 /// \~english @par Type
1117 ///      - Sync only(None communication)
1118 /// \~english @par Details
1119 ///      - This API should be called only by SystemManager.
1120 ///      - Update all StatusOfDTC for startup of OperationCycle.
1121 ///      - This API sets the following bit of StatusOfDTC.\n
1122 ///        bit0:testFailed is set to '0'.\n
1123 ///        bit1:testFailedThisOperationCycle is set to '0'.\n
1124 ///        bit2:pendingDTC is set to '0' only when bit1 and bit6 (before update) are both '0'.\n
1125 ///        bit6:testNotCompletedThisOperationCycle is set to '1'.
1126 /// \~english @ref DIAGCODE.h
1127 ///
1128 /////////////////////////////////////////////////////////////////////////////////////
1129 DGCODE_RET_API Diag_StartupAllStatusOfDTC(void);
1130
1131 /////////////////////////////////////////////////////////////////////////////////////
1132 /// \ingroup Diag_ClearAllStatusOfDTC
1133 /// \~english @par Overview
1134 ///      - Update all StatusOfDTC when receiving ClearDiagnosticInformation.
1135 /// \~english @param none
1136 /// \~english @retval DGCODE_RET_NORMAL Success
1137 /// \~english @retval DGCODE_RET_ERROR Failure
1138 /// \~english @par Precondition
1139 ///      - BackupMgr is available
1140 /// \~english @par Changing internal state
1141 ///      - No change of internal state by this API occurs.
1142 /// \~english @par Processing failure condition
1143 ///      - DTC ID does not match the defination of DTC ROM table [DGCODE_RET_ERROR]
1144 ///      - Allocation of work memory fails when update the StatusOfDTC. [DGCODE_RET_ERROR]
1145 ///      - Failure occurs when reading data from backup area [DGCODE_RET_ERROR]
1146 ///      - Failure occurs when writing to the backup area [DGCODE_RET_ERROR]
1147 ///      - The sum value is invalid when writing to the backup area [DGCODE_RET_ERROR]
1148 ///      - The pointer of DTC inhibit info is NULL [DGCODE_RET_ERROR]
1149 /// \~english @par Classification
1150 ///      - Public
1151 /// \~english @par Type
1152 ///      - Sync only(None communication)
1153 /// \~english @par Details
1154 ///      - This API should be called only by DiagService.
1155 ///      - Update all StatusOfDTC for startup of OperationCycle.
1156 ///      - This API sets the following bit of StatusOfDTC.\n
1157 ///        bit0:testFailed is set to '0'.\n
1158 ///        bit1:testFailedThisOperationCycle is set to '0'.\n
1159 ///        bit2:pendingDTC is set to '0'.\n
1160 ///        bit3:confirmedDTC is set to '0'.\n
1161 ///        bit4:testNotCompletedSinceLastClear is set to '1'.\n
1162 ///        bit5:testFailedSinceLastClear is set to '0'.\n
1163 ///        bit6:testNotCompletedThisOperationCycle is set to '1'.
1164 /// \~english @ref DIAGCODE.h
1165 ///
1166 /////////////////////////////////////////////////////////////////////////////////////
1167 DGCODE_RET_API Diag_ClearAllStatusOfDTC(void);
1168
1169 /// \~english Acquire time counter value
1170 /////////////////////////////////////////////////////////////////////////////////////
1171 /// \ingroup DGC_TIMESTAMP_GETTIME
1172 /// \~english @par Overview
1173 ///      - This is a macro definition for extracting the time counter value included in the time counter information.
1174 /// \~english @param [in]   x    time counter information
1175 /// \~english @retval            time counter value
1176 /// \~english @par Precondition
1177 ///      - None.
1178 /// \~english @par Changing internal state
1179 ///      - No change of internal state by this API occurs.
1180 /// \~english @par Processing failure condition
1181 ///      - None.
1182 /// \~english @par Classification
1183 ///      - Public
1184 /// \~english @par Type
1185 ///      - Sync
1186 /// \~english @par Details
1187 ///      - Mask the unique count identification value and return only the time counter value.
1188 /// \~english @see Diag_SyncTimeStamp
1189 ///
1190 /////////////////////////////////////////////////////////////////////////////////////
1191 #define DGC_TIMESTAMP_GETTIME(x)    ((x) & (0x00FFFFFFU))
1192
1193 /// \~english Get unique count value
1194 /////////////////////////////////////////////////////////////////////////////////////
1195 /// \ingroup DGC_TIMESTAMP_GETFLAG
1196 /// \~english @par Overview
1197 ///      - This is a macro definition for extracting the unique counter identification value included in the time
1198 ///        counter information.
1199 /// \~english @param [in]   x    time counter information
1200 /// \~english @retval            unique counter identification value
1201 /// \~english @par Precondition
1202 ///      - None.
1203 /// \~english @par Changing internal state
1204 ///      - No change of internal state by this API occurs.
1205 /// \~english @par Processing failure condition
1206 ///      - None.
1207 /// \~english @par Classification
1208 ///      - Public
1209 /// \~english @par Type
1210 ///      - Sync
1211 /// \~english @par Details
1212 ///      - Mask the time counter value and return only the unique count identification value.
1213 /// \~english @see Diag_SyncTimeStamp
1214 ///
1215 /////////////////////////////////////////////////////////////////////////////////////
1216 #define DGC_TIMESTAMP_GETFLAG(x)    (((x) & (0xE0000000U)) >> (29U))
1217
1218 #ifdef  __cplusplus
1219 }
1220 #endif
1221
1222 /** @}*/  // end of diag_code
1223 /** @}*/  // end of vehicle_service
1224 /** @}*/  // end of BaseSystem
1225
1226 #endif  // DIAG_CODE_LIBRARY_INCLUDE_VEHICLE_SERVICE_DIAGCODEAPI_H_