Add gitlab issue/merge request templates
[staging/basesystem.git] / service / vehicle / positioning / client / include / CanInput_API.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 name          : CanInput_API.h
19  * System name        : PastModel002
20  * Sub System name    : CanInput_API library
21  ******************************************************************************/
22 #ifndef POSITIONING_CLIENT_INCLUDE_CANINPUT_API_H_
23 #define POSITIONING_CLIENT_INCLUDE_CANINPUT_API_H_
24
25 /************************************************************************
26  *            Include                                                   *
27  ***********************************************************************/
28 #include <vehicle_service/positioning_base_library.h>        /* for type definitions            */
29
30 /************************************************************************
31 *            Definition                                                 *
32 ************************************************************************/
33 /*----------------------------------------------------------------------*
34  *    CAN_INPUT_RET_API Definition                                      *
35  *----------------------------------------------------------------------*/
36 /* Normal */
37 #define CAN_INPUT_RET_NORMAL                    0       /* Successful completion    */
38
39 /* Abnormal */
40 #define CAN_INPUT_RET_ERROR                     (-1)    /* An error has occurred    */
41 #define CAN_INPUT_RET_ERROR_PARAM               (-2)    /* Parameter error          */
42
43 /*----------------------------------------------------------------------*
44  *    Message Definition                                                *
45  *----------------------------------------------------------------------*/
46 /* Command ID */
47 #define CANINPUT_CID_LOCALTIME_NOTIFICATION     0x0220
48
49 /*----------------------------------------------------------------------*
50  *    Localtime status Definition                                       *
51  *----------------------------------------------------------------------*/
52 #define CANINPUT_LOCALTIME_STATUS_INVALID       0U
53 #define CANINPUT_LOCALTIME_STATUS_INIT          1U
54 #define CANINPUT_LOCALTIME_STATUS_PLAUSIBLE     2U
55 #define CANINPUT_LOCALTIME_STATUS_NEW           3U
56 #define CANINPUT_LOCALTIME_STATUS_DIAG          4U
57 #define CANINPUT_LOCALTIME_STATUS_INCOMPLETE    5U
58
59 /************************************************************************
60 *            type Definition                                            *
61 ************************************************************************/
62 typedef RET_API CAN_INPUT_RET_API;    /* API return value    */
63
64 /************************************************************************
65 *            struct Definition                                          *
66 ************************************************************************/
67 /************************************************************************
68  * TAG         : CANINPUT_MSG_LOCALTIMEINFO_DAT
69  * ABSTRACT     : Localtime data structure
70  * NOTE         :
71  ************************************************************************/
72 typedef struct {
73     u_int8    status;     /* status    : Refer to Localtime status Definition   */
74     u_int8    year;       /* year      : 0..99 (FFh:invalid)                    */
75     u_int8    month;      /* month     : 1..12 (FFh:invalid)                    */
76     u_int8    date;       /* date      : 1..31 (FFh:invalid)                    */
77     u_int8    hour;       /* hour      : 0..23 (FFh:invalid)                    */
78     u_int8    minute;     /* minute    : 0..59 (FFh:invalid)                    */
79     u_int8    second;     /* second    : 0..59 (FFh:invalid)                    */
80     u_int8    reserve;    /* reserve                                            */
81 } CANINPUT_MSG_LOCALTIMEINFO_DAT;
82
83 /************************************************************************
84  *            Function prototypes                                       *
85  ************************************************************************/
86 #ifdef __cplusplus
87 extern "C" {
88 #endif
89
90 /*[CanInput_API Public API]*/
91 CAN_INPUT_RET_API CanInputInitialize(void);
92 CAN_INPUT_RET_API CanInputSndMsg(PNO pno, CID cid, u_int16 msg_len, const void *msg_data);
93
94 #ifdef __cplusplus
95 }
96 #endif
97
98 #endif  // POSITIONING_CLIENT_INCLUDE_CANINPUT_API_H_