summaryrefslogtreecommitdiffstats
path: root/stub/clock/client_clock/include/stub/Clock_API.h
blob: 375354e3634d677f3564981c623afebc33e0d3eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
/*
 * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/**
 * @file Clock_API.h
 * @brief System community functions header file.
 */

/*******************************************************************************
* $Header::                                                                   $
* $Revision::                                                                 $
*******************************************************************************/

 /******************************************************************************
 * file name            : Clock_API.h
 *  system name         : PND-A
 *  sub system name     : system common function group header file
 *  program name        :
****************************************************************************/
#ifndef CLOCK_CLIENT_CLOCK_INCLUDE_VEHICLE_SERVICE_CLOCK_API_H_
#define CLOCK_CLIENT_CLOCK_INCLUDE_VEHICLE_SERVICE_CLOCK_API_H_

#include <time.h>

/** @addtogroup BaseSystem
 *  @{
 */
/** @addtogroup vehicle_service
 *  @ingroup BaseSystem
 *  @{
 */
/** @addtogroup clock
 *  @ingroup vehicle_service
 *  @{
 */

#ifdef  __cplusplus
extern "C" {
#endif

/**
 * \~english The time corrected by GPS.
 */
#define CLOCK_CORRECTED_TIME      (0U)

/**
 * \~english The time not corrected by GPS.
 */
#define CLOCK_NOT_CORRECTED_TIME  (1U)

/**
 * \~english The time synchronized by GPS RTC.
 */
#define CLOCK_RTC_TIME            (2U)

/**
 * \~english GPS time error.
 */
#define CLOCK_INVALID_TIME        (3U)

/**
 * \~english The max size memory for time zone.
 */
#define TIME_ZONE_MAX_SIZE        256

/**
 * \~english Return value define.
 */
typedef enum tagCLOCK_RETURN {
          CLOCK_OK,              //!< \~english Return successful
          CLOCK_ERROR,           //!< \~english Return failed
          CLOCK_ERROR_ARGUMENTS  //!< \~english Arguments error
} CLOCK_RETURN;
/*
 data type definition
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

/*
 \~english API function prototype defined
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**
 * \ingroup Clock_getSystemTime
 * \~english @par Brief
 *      - Get the system time.
 * \~english @param [out]  time       Store system time data
 * \~english @param [out]  status     Store time data status\n
 *                                    Time status:\n
 *                                     Valid time  : CLOCK_CORRECTED_TIME\n
 *                                     Invalid time: CLOCK_INVALID_TIME\n
 *                                       NOTE:When can't communication with Clock service, return "CLOCK_INVALID_TIME"
 * \~english @retval  CLOCK_OK               success
 * \~english @retval  CLOCK_ERROR            fail
 * \~english @retval  CLOCK_ERROR_ARGUMENTS  arguments error
 * \~english @par Prerequisite
 *      - Clock service's availability is TRUE.
 * \~english @par Change of internal state
 *      - Change of internal state according to the API does not occur.
 * \~english @par Conditions of processing failure
 *      - The argument used for store system time data is NULL. [CLOCK_ERROR_ARGUMENTS]
 *      - The argument used for store time data status is NULL. [CLOCK_ERROR_ARGUMENTS]
 *      - Get system time error. [CLOCK_ERROR]
 * \~english @par Classification
 *      - Public
 * \~english @par Type
 *      - Sync
 * \~english @par Detail
 *      - The API is sync(return after call end), please check it when used the API.
 *      - Call this API to get the system time and status.
 *      - NOTE:Local time can be got by calling Clock_getLocalTime which parameter is the result of this API.
 *      - The time returned by calling this API is UTC time, its range is from\n
 *        "1970-01-01 00:00:00" to "2038-01-19 03:14:07".
 *      - Clock_getSystemTimeY2K38 can be used to get time later than "2038-01-19 03:14:08".
 *      - Result : "System time and time status" to "System time and status" will be stored in arguments.
 * \~english @see Clock_getLocalTime, Clock_getSystemTimeY2K38, McOpenSender,\n
 *                McCreateInvokerName, McOpenSyncReceiver, McInvokeSync
 */
CLOCK_RETURN Clock_getSystemTime(struct timespec* time, uint8_t* status);

/**
 * \ingroup Clock_getLocalTime
 * \~english @par Brief
 *      - Get the local time.
 * \~english @param [in]   base_time       Pointer to store base time(seconds)
 * \~english @param [out]  local_time      Pointer to store local time
 * \~english @retval  CLOCK_OK               success
 * \~english @retval  CLOCK_ERROR            fail
 * \~english @retval  CLOCK_ERROR_ARGUMENTS  arguments error
 * \~english @par Prerequisite
 *      - Clock service's availability is TRUE.
 * \~english @par Change of internal state
 *      - Change of internal state according to the API does not occur.
 * \~english @par Conditions of processing failure
 *      - The argument used to store base time(seconds) is NULL. [CLOCK_ERROR_ARGUMENTS]
 *      - The argument used to store local time is NULL. [CLOCK_ERROR_ARGUMENTS]
 *      - Get local time failed. [CLOCK_ERROR]
 * \~english @par Classification
 *      - Public
 * \~english @par Type
 *      - Sync
 * \~english @par Detail
 *      - The API is sync(return before call end), please check it when used the API.
 *      - Call this API to get local time.
 *      - The time returned by calling this API is UTC time, its range is from\n
 *        "1970-01-01 00:00:00" to "2038-01-19 03:14:07".
 *      - Clock_getSystemTimeY2K38 can be used to get time later than "2038-01-19 03:14:08".
 *      - Result : Local time will be stored in arguments.
 *      -          tm which is changed base on base_time will be returned when the timezone is not set.
 * \~english @see Clock_getSystemTime, Clock_getSystemTimeY2K38
 */
CLOCK_RETURN Clock_getLocalTime(const time_t* base_time, struct tm* local_time);

/**
 * \ingroup Clock_CnvSecToDate
 * \~english @par Brief
 *      - Convert specified elapsed seconds to date and time.\n
 *        The specified elapsed seconds are regarded as elapsed time from 1970/01/01 00:00:00.
 * \~english @param [in]   timep       The pointer to store the seconds
 * \~english @param [out]  result      The pointer to store date time
 * \~english @retval  CLOCK_OK               success
 * \~english @retval  CLOCK_ERROR            fail
 * \~english @retval  CLOCK_ERROR_ARGUMENTS  arguments error
 * \~english @par Prerequisite
 *      - Clock service's availability is TRUE.
 * \~english @par Change of internal state
 *      - Change of internal state according to the API does not occur.
 * \~english @par Conditions of processing failure
 *      - The pointer used to store the seconds from base date time is NULL. [CLOCK_ERROR_ARGUMENTS]
 *      - The pointer used to store the date time is NULL. [CLOCK_ERROR_ARGUMENTS]
 *      - Convert the seconds from base date time to date time failed. [CLOCK_ERROR]
 * \~english @par Classification
 *      - Public
 * \~english @par Type
 *      - Sync
 * \~english @par Detail
 *      - The API is sync(return before call end), please check it when used the API.
 *      - Call this API to convert the seconds which is "1970-01-01 00:00:00" to date time.
 *      - The time returned by calling this API is UTC time, its range is from\n
 *        "1970-01-01 00:00:00" to "2038-01-19 03:14:07".
 *      - Clock_getSystemTimeY2K38 can be used to get time later than "2038-01-19 03:14:08".
 *      - Result :Convert the seconds to date time. The seconds is from "1970-01-01 00:00:00".
 * \~english @see Clock_CnvDateToSec, Clock_CnvSecToDateY2K38
 */
CLOCK_RETURN Clock_CnvSecToDate(const time_t* timep, struct tm *result);

/**
 * \ingroup Clock_CnvDateToSec
 * \~english @par Brief
 *      - Convert specified date and time to elapsed seconds from 1970/01/01 00:00:00.
 * \~english @param [in]   tm          The pointer to store date time to convert
 * \~english @param [out]  result      The pointer to store seconds from base time
 * \~english @retval  CLOCK_OK               success
 * \~english @retval  CLOCK_ERROR_ARGUMENTS  arguments error
 * \~english @par Prerequisite
 *      - Clock service's availability is TRUE.
 * \~english @par Change of internal state
 *      - Change of internal state according to the API does not occur.
 * \~english @par Conditions of processing failure
 *      - The pointer used to store the date time is NULL. [CLOCK_ERROR_ARGUMENTS]
 *      - The pointer used to store the seconds from base date time is NULL. [CLOCK_ERROR_ARGUMENTS]
 * \~english @par Classification
 *      - Public
 * \~english @par Type
 *      - Sync
 * \~english @par Detail
 *      - The API is sync(return before call end), please check it when used the API.
 *      - Call this API to convert the seconds which from "1970-01-01 00:00:00" to date time.
 *      - The API is used when UTC time is in the range from "1970-01-01 00:00:00" to "2038-01-19 03:14:07".
 *      - For more then "2038-01-19 03:14:08", please use Clock_CnvDateToSecY2K38.
 *      - Result : Convert date time to seconds from "1970-01-01 00:00:00".
 * \~english @see Clock_CnvSecToDate, Clock_CnvDateToSecY2K38
 */
CLOCK_RETURN Clock_CnvDateToSec(const struct tm* tm, time_t* result);

/**
 * \ingroup Clock_setUserTime
 * \~english @par Brief
 *      - Set the display time when GPS synchronization setting is off.
 * \~english @param [in]   user_time       The pointer to store the time(second from base time)
 * \~english @retval  CLOCK_OK               success
 * \~english @retval  CLOCK_ERROR            fail
 * \~english @retval  CLOCK_ERROR_ARGUMENTS  arguments error
 * \~english @par Prerequisite
 *      - Clock service's availability is TRUE.
 * \~english @par Change of internal state
 *      - Change of internal state according to the API does not occur.
 * \~english @par Conditions of processing failure
 *      - The pointer used to store the time from base date time is NULL. [CLOCK_ERROR_ARGUMENTS]
 *      - Get thread name of caller failed. [CLOCK_ERROR]
 *      - Get handle of Clock service message queue failed. [CLOCK_ERROR]
 *      - Generate message queue name for sync call failed. [CLOCK_ERROR]
 *      - Generate message queue for receiving failed. [CLOCK_ERROR]
 *      - Message sync communicate failed. [CLOCK_ERROR]
 *      - Message buffer received sync communicate message is error. [CLOCK_ERROR]
 *      - Clock service handle failed. [CLOCK_ERROR]
 * \~english @par Classification
 *      - Public
 * \~english @par Type
 *      - Sync
 * \~english @par Detail
 *      - The API is sync(return before call end), please check it when used the API.
 *      - This API called for user set time to user time when GPS corrected off.
 *      - Result : Set user time when GPS corrected off.
 * \~english @see Clock_getUserTime, Clock_addUserTimeOffset, McOpenSender,\n
 *                McCreateInvokerName, McOpenSyncReceiver, McInvokeSync
 */
CLOCK_RETURN Clock_setUserTime(const time_t* user_time);

/**
 * \ingroup Clock_getUserTime
 * \~english @par Brief
 *      - Get the display time when GPS synchronization setting is off.
 * \~english @param [out]   user_time       The pointer to store the time(second from base time)
 * \~english @param [out]   status          The pointer to store time status\n
 *                                           time status\n
 *                                           Valid time: CLOCK_CORRECTED_TIME\n
 *                                           Invalid time: CLOCK_INVALID_TIME\n
 * \~english @retval  CLOCK_OK               success
 * \~english @retval  CLOCK_ERROR            fail
 * \~english @retval  CLOCK_ERROR_ARGUMENTS  arguments error
 * \~english @par Prerequisite
 *      - Clock service's availability is TRUE.
 * \~english @par Change of internal state
 *      - Change of internal state according to the API does not occur.
 * \~english @par Conditions of processing failure
 *      - When GPS corrected off, the pointer to store user time date is NULL. [CLOCK_ERROR_ARGUMENTS]
 *      - The pointer to store time status is NULL. [CLOCK_ERROR_ARGUMENTS]
 *      - The caller thread name get failed. [CLOCK_ERROR]
 *      - Get Clock service message queue handle failed. [CLOCK_ERROR]
 *      - Generate message queue name for sync call failed. [CLOCK_ERROR]
 *      - Generate message queue handle for sync call failed. [CLOCK_ERROR]
 *      - Message sync communicate failed. [CLOCK_ERROR]
 *      - Message buffer received sync communicate message is error. [CLOCK_ERROR]
 * \~english @par Classification
 *      - Public
 * \~english @par Type
 *      - Sync
 * \~english @par Detail
 *      - The API is sync(return before call end), please check it when used the API.
 *      - Call the API, can get the status for user time invalid or valid, when GPS corrected off.
 *      - Note : Get local time, use Clock_getLocalTIme with arguments.\n
 *        The API used to get user time when GPS corrected off.
 *      - Result : Get user time when GPS corrected off.
 * \~english @see Clock_setUserTime, Clock_addUserTimeOffset, Clock_getLocalTime,\n
 *                 McOpenSender, McCreateInvokerName, McOpenSyncReceiver, McInvokeSync
 */
CLOCK_RETURN Clock_getUserTime(time_t* user_time, uint8_t* status);

/**
 * \ingroup Clock_addUserTimeOffset
 * \~english @par Brief
 *      - Adjust the display time when GPS synchronization setting is off.
 * \~english @param [in]   offset        The pointer to store offset for add(sub) user time.\n
 *                                       Note : Member has limit as follow. \n
 *                                       int tm_hour: hour(-12 to 12)\n
 *                                       int tm_min : minute(-59 to 59)\n
 *                                       year, month, day, second and so on not used, please set 0.
 * \~english @retval  CLOCK_OK               success
 * \~english @retval  CLOCK_ERROR            fail
 * \~english @retval  CLOCK_ERROR_ARGUMENTS  arguments error
 * \~english @par Prerequisite
 *      - Clock service's availability is TRUE.
 * \~english @par Change of internal state
 *      - Change of internal state according to the API does not occur.
 * \~english @par Conditions of processing failure
 *      - The pointer to store offset for add(sub) user time is NULL. [CLOCK_ERROR_ARGUMENTS]
 *      - The parameter offset->tm_sec set second not 0. [CLOCK_ERROR_ARGUMENTS]
 *      - The parameter offset->tm_mday set day not 0. [CLOCK_ERROR_ARGUMENTS]
 *      - The parameter offset->tm_mon set month not 0. [CLOCK_ERROR_ARGUMENTS]
 *      - The parameter offset->tm_year set year not 0. [CLOCK_ERROR_ARGUMENTS]
 *      - The parameter offset->tm_wday set day in week not 0. [CLOCK_ERROR_ARGUMENTS]
 *      - The parameter offset->tm_yday set day in year not 0. [CLOCK_ERROR_ARGUMENTS]
 *      - The parameter offset->tm_isdst set daylight save time not 0. [CLOCK_ERROR_ARGUMENTS]
 *      - The parameter offset->tm_hour set hour bigger then 12. [CLOCK_ERROR_ARGUMENTS]
 *      - The parameter offset->tm_hour set hour smaller then -12. [CLOCK_ERROR_ARGUMENTS]
 *      - The parameter offset->tm_min set minute bigger then 59. [CLOCK_ERROR_ARGUMENTS]
 *      - The parameter offset->tm_min set minute smaller then -59. [CLOCK_ERROR_ARGUMENTS]
 *      - The caller thread name get failed. [CLOCK_ERROR]
 *      - Get Clock service message queue handle failed. [CLOCK_ERROR]
 *      - Generate message queue name for sync call failed. [CLOCK_ERROR]
 *      - Generate message queue handle for sync call failed. [CLOCK_ERROR]
 *      - Message sync communicate failed. [CLOCK_ERROR]
 *      - Clock service handle failed. [CLOCK_ERROR]
 *      - Message buffer received sync communicate message is error. [CLOCK_ERROR]
 * \~english @par Classification
 *      - Public
 * \~english @par Type
 *      - Sync
 * \~english @par Detail
 *      - The API is sync(return before call end), please check it when used the API.
 *      - The API used for add(sub) user time when user set GPS correct off.
 *      - Result : User time add(sub) offset when GPS correct off.
 * \~english @see Clock_setUserTime, Clock_getUserTime, McOpenSender, McCreateInvokerName,\n
 *                McOpenSyncReceiver, McInvokeSync
 */
CLOCK_RETURN Clock_addUserTimeOffset(const struct tm* offset);

/* Clock_getSystemTimeY2K38 can be used to get time later than "2038-01-19 03:14:08"(UTC). */
/**
 * \ingroup Clock_getSystemTimeY2K38
 * \~english @par Brief
 *      - Get the system time(2038 issue fixed).
 * \~english @param [out]   time       Store system time data
 * \~english @param [out]   status     Store time data status\n
 *                                    Time status:\n
 *                                     Valid time  : CLOCK_CORRECTED_TIME\n
 *                                     Invalid time: CLOCK_INVALID_TIME\n
 *                                     Note : When can't communication with Clock service, return "CLOCK_INVALID_TIME".
 * \~english @retval  CLOCK_OK               success
 * \~english @retval  CLOCK_ERROR            fail
 * \~english @retval  CLOCK_ERROR_ARGUMENTS  arguments error
 * \~english @par Prerequisite
 *      - Clock service's availability is TRUE.
 * \~english @par Change of internal state
 *      - Change of internal state according to the API does not occur.
 * \~english @par Conditions of processing failure
 *      - When the storage area of the system time data is NULL. [CLOCK_ERROR_ARGUMENTS]
 *      - When the time data status storage area is NULL. [CLOCK_ERROR_ARGUMENTS]
 *      - In case of system time acquisition failure. [CLOCK_ERROR]
 * \~english @par Classification
 *      - Public
 * \~english @par Type
 *      - Sync
 * \~english @par Detail
 *      - The API is sync(return before call end), please check it when used the API.
 *      - Call the API, can get the status for system time invalid or valid.
 *      - Get local time, use Clock_getLocalTIme with arguments. The API used to get system time.
 *      - The API is used when UTC time is in the range from "1970-01-01 00:00:00" to "2016-01-19 03:14:07".
 *      - Result : System time and time status will be stored in arguments.
 * \~english @see Clock_getSystemTime, Clock_getLocalTimeY2K38, McOpenSender,\n
 *                McCreateInvokerName, McOpenSyncReceiver, McInvokeSync
 */
CLOCK_RETURN Clock_getSystemTimeY2K38(uint32_t* time, uint8_t* status);

/**
 * \ingroup Clock_getLocalTimeY2K38
 * \~english @par Brief
 *      - Get the local time(2038 issue fixed).
 * \~english @param [in]    base_time     Pointer to store base time(seconds)
 * \~english @param [out]   local_time    Pointer to store local time
 * \~english @retval  CLOCK_OK               success
 * \~english @retval  CLOCK_ERROR            fail
 * \~english @retval  CLOCK_ERROR_ARGUMENTS  arguments error
 * \~english @par Prerequisite
 *      - Clock service's availability is TRUE.
 * \~english @par Change of internal state
 *      - Change of internal state according to the API does not occur.
 * \~english @par Conditions of processing failure
 *      - The argument used to store base time(seconds) is NULL. [CLOCK_ERROR_ARGUMENTS]
 *      - The argument used to store local time is NULL. [CLOCK_ERROR_ARGUMENTS]
 *      - The argument named base_time bigger then up limit(4293400447) of fixed 2038 issue. [CLOCK_ERROR_ARGUMENTS]
 *      - Get local time failed. [CLOCK_ERROR]
 * \~english @par Classification
 *      - Public
 * \~english @par Type
 *      - Sync
 * \~english @par Detail
 *      - The API is sync(return before call end), please check it when used the API.
 *      - Call this API to get local time.
 *      - Return local time by add time zone information to base time.
 *      - The API is used when UTC time is in the range from "1970-01-01 00:00:00" to "2106-01-19 03:14:07".
 *      - The parameter base_time bigger then up limit(4293400447), convert error.
 *      - Also, this API does not support day of the week (Member tm_wday acquired always stores -1.)\n
 *        what the caller sought from year/nomth/data information.
 *      - Result : Local time will be stored in arguments.
 *      -          If time zone not set, it will return change base_time type to tm
 * \~english @see Clock_getLocalTime, Clock_getSystemTimeY2K38
 */
CLOCK_RETURN Clock_getLocalTimeY2K38(const uint32_t* base_time, struct tm* local_time);

/**
 * \ingroup Clock_CnvSecToDateY2K38
 * \~english @par Brief
 *      - Convert specified elapsed seconds to date and time(2038 issue fixed).\n
 *        The specified elapsed seconds are regarded as elapsed time from 1970/01/01 00:00:00.
 * \~english @param [in]    time     Pointer to the storage destination
 * \~english @param [out]   result   Pointer to storage location of converted date/time
 * \~english @retval  CLOCK_OK               success
 * \~english @retval  CLOCK_ERROR            fail
 * \~english @retval  CLOCK_ERROR_ARGUMENTS  arguments error
 * \~english @par Prerequisite
 *      - Clock service's availability is TRUE.
 * \~english @par Change of internal state
 *      - Change of internal state according to the API does not occur.
 * \~english @par Conditions of processing failure
 *      - When the accumulated second storage area from the date conuting point to be converted is NULL.\n
 *        [CLOCK_ERROR_ARGUMENTS]
 *      - When the converted date/time storage area is NULL. [CLOCK_ERROR_ARGUMENTS]
 *      - When the regerence time (seconds) specified by the argument time is greater than\n
 *        the conuntermeasure upper limit value (4293400447) of the 2038 root problem. [CLOCK_ERROR_ARGUMENTS]
 *      - In case of a date/time conversion failure as a cumulative second from the specified date\n
 *        in the specified integration seconds. [CLOCK_ERROR]
 * \~english @par Classification
 *      - Public
 * \~english @par Type
 *      - Sync
 * \~english @par Detail
 *      - The API is sync(return before call end), please check it when used the API.
 *      - Call this API to convert the specified integration seconds to the date and\n
 *        time as the integration seconds from "1970-01-01 00:00:00" at the date conuting point.
 *      - The API is used when UTC time is in the range from "1970-01-01 00:00:00" to "2106-01-19 03:14:07".
 *      - If the argument time exceeds the above upper limit(4293400447), it can not be converted properly.
 *      - Also, this API does not support day of the week (Member tm_wday acquired always stores -1.)\n
 *        what the caller sought from year/nomth/data information.
 *      - Result: Converts the specified integration seconds to the date and time\n
 *        as the integration seconds from "1970-01-01 00:00:00" at the date conuting point.
 * \~english @see Clock_CnvSecToDate, Clock_CnvDateToSecY2K38
 */
CLOCK_RETURN Clock_CnvSecToDateY2K38(const uint32_t* time, struct tm *result);

/**
 * \ingroup Clock_CnvDateToSecY2K38
 * \~english @par Brief
 *      - Convert specified date and time to elapsed seconds from 1970/01/01 00:00:00.(2038 issue fixed)
 * \~english @param [in]    tm       Pointer to the storage location of the date and time to be converted.
 * \~english @param [out]   result   Pointer to storage detination of accumulated seconds from date counting point.
 * \~english @retval  CLOCK_OK               success
 * \~english @retval  CLOCK_ERROR_ARGUMENTS  Invalide parameter
 * \~english @par Prerequisite
 *      - Clock service's availability is TRUE.
 * \~english @par Change of internal state
 *      - Change of internal state according to the API does not occur.
 * \~english @par Conditions of processing failure
 *      - When the date time storage area to be converted is NULL. [CLOCK_ERROR_ARGUMENTS]
 *      - When the accumulated second storage area from the date conuting point is NULL. [CLOCK_ERROR_ARGUMENTS]
 *      - When the conversion result (result) is greater than the conuntermeasure upper\n
 *        limit value (4293400447) of the 2038 root problem. [CLOCK_ERROR_ARGUMENTS]
 * \~english @par Classification
 *      - Public
 * \~english @par Type
 *      - Sync
 * \~english @par Detail
 *      - The API is sync(return before call end), please check it when used the API.
 *      - Call this API to convert the specified time to integration seconds from "1970-01-01 00:00:00"\n
 *        (date conuting point).
 *      - The API is used when UTC time is in the range from "1970-01-01 00:00:00" to "2106-01-19 03:14:07".
 *      - The maximum value of result that can be obtained is 4293400447(sec).
 *      - Result: Converts the specified date and time to integration seconds from "1970-01-01 00:00:00"\n
 *        (date counting point).
 * \~english @see Clock_CnvDateToSec, Clock_CnvSecToDateY2K38
 */
CLOCK_RETURN Clock_CnvDateToSecY2K38(const struct tm* tm, uint32_t* result);

#ifdef  __cplusplus
}
#endif  // __cplusplus

/** @}*/  // end of clock
/** @}*/  // end of vehicle_service
/** @}*/  // end of BaseSystem

#endif  // CLOCK_CLIENT_CLOCK_INCLUDE_VEHICLE_SERVICE_CLOCK_API_H_