Init basesystem source codes.
[staging/basesystem.git] / vehicleservice / positioning / client / include / Vehicle_API_Dummy.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 #ifndef POSITIONING_CLIENT_INCLUDE_VEHICLE_API_DUMMY_H_
18 #define POSITIONING_CLIENT_INCLUDE_VEHICLE_API_DUMMY_H_
19 /******************************************************************************
20  * File name        : Vehicle_API_Dummy.h
21  * System name        : GPF
22  * Sub System name    : Vehicle I/F Liblary
23  ******************************************************************************/
24
25 #include "Sensor_Common_API.h"
26
27 /****************************************************************************
28 *            Definition                                                     *
29 *****************************************************************************/
30 /*--------------------------------------------------------------------------*
31  *    VECHILE_RET_API Definition                                            *
32  *--------------------------------------------------------------------------*/
33 /* Normal system */
34 #define VEHICLE_RET_NORMAL                0       /* Successful completion */
35
36 /* Abnormal system */
37 #define VEHICLE_RET_ERROR_PID             (-1)    /* Abnormal thread ID        */
38 #define VEHICLE_RET_ERROR_DID             (-2)    /* NoneDID                    */
39 #define VEHICLE_RET_ERROR_DID_DIS         (-3)    /* Non-ID data CANID        */
40 #define VEHICLE_RET_ERROR_PARAM           (-4)    /* Parameter error            */
41 #define VEHICLE_RET_ERROR_BUFFULL         (-5)    /* registration number FULL    */
42 #define VEHICLE_RET_ERROR_CREATE_EVENT    (-6)    /* Failure event generation    */
43 #define VEHICLE_RET_ERROR_TIMER           (-7)    /* Generation failure timer    */
44 #define VEHICLE_RET_ERROR_OUTOF_MEMORY    (-8)    /* Shared memory allocation failure    */
45 #define VEHICLE_RET_ERROR_SIZE            (-9)    /* Size error destination    */
46 #define VEHICLE_RET_ERROR_INVALID         (-10)   /* CANID undetermined        */
47 #define VEHICLE_RET_ERROR_MIN             POS_RET_ERROR_MIN
48
49 /*----------------------------------------------------------------------*
50  *    API-related registration information delivery vehicle sensor      *
51  *----------------------------------------------------------------------*/
52 /* Delivery control */
53 #define VEHICLE_DELIVERY_REGIST           0x01    /* Shipping register    */
54
55 /* Delivery opportunity */
56 #define VEHICLE_DELIVERY_TIMING_UPDATE    0x01    /* Update                */
57 #define VEHICLE_DELIVERY_TIMING_CHANGE    0x02    /* Change                */
58
59 /*----------------------------------------------------------------------*
60  *    Message Definition                                                *
61  *----------------------------------------------------------------------*/
62 /* Command ID */
63
64 /* Registration information delivery vehicle sensor CID    */
65 #define CID_VEHICLEIF_DELIVERY_ENTRY      0x0101
66
67 /* Vehicle sensor information notification CID            */
68 #define CID_VEHICLESENS_VEHICLE_INFO      0x0200
69
70 #define CID_VEHICLEIF_GET_DR_DATA         0x0205
71
72 /* The message body size data(byte) */
73 #define VEHICLE_MSGBUF_DSIZE              (SENSOR_MSG_VSINFO_DSIZE + 12)
74 /* Header size of SENSOR_MSG_VSINFO_DSIZE + SENSOR_MSG_GPSDATA_DAT (12) */
75
76 /************************************************************************
77 *            typedef Definition                                         *
78 ************************************************************************/
79
80 /************************************************************************
81 *            struct Definition                                          *
82 ************************************************************************/
83
84 /************************************************************************
85 * TAG       : VEHICLE_MSG_BUF
86 * ABSTRACT  : Message buffer
87 ************************************************************************/
88 typedef struct {
89     T_APIMSG_MSGBUF_HEADER                hdr;                           /* Message header    */
90     u_int8                                data[VEHICLE_MSGBUF_DSIZE];    /* Message data        */
91 } VEHICLE_MSG_BUF;
92
93 /************************************************************************
94 * TAG       : VEHICLE_MSG_GET_VEHICLE_DATA
95 * ABSTRACT  : Vehicle sensor information acquisition message(-> Vehicle sensor)
96 ************************************************************************/
97 typedef struct {
98     DID                                   did;                /* Data ID corresponding to vehicle sensor information */
99     PNO                                   pno;                /* Destination PNO                        */
100     u_int16                               offset;             /* Offset to shared memory storage area    */
101     u_int16                               size;               /* Size of shared memory storage area            */
102     u_int8                                reserve[2];
103     EventID                               event_id;           /* Event ID                        */
104 } VEHICLE_MSG_GET_VEHICLE_DATA_DAT;
105
106 typedef struct {
107     T_APIMSG_MSGBUF_HEADER                hdr;                /* Message header    */
108     VEHICLE_MSG_GET_VEHICLE_DATA_DAT      data;               /* Message data    */
109 } VEHICLE_MSG_GET_VEHICLE_DATA;
110
111 /************************************************************************
112 * TAG       : VEHICLE_MSG_DELIVERY_ENTRY
113 * ABSTRACT  : Registration message delivery vehicle sensor information(->Vehicle sensor)
114 ************************************************************************/
115 typedef struct {
116     DID                                   did;    /* ID data corresponding to the vehicle sensor information */
117     PNO                                   pno;                /* Shipping addressPNO                */
118     u_int8                                delivery_timing;    /* Delivery opportunity                */
119     u_int8                                ctrl_flg;           /* Delivery control                    */
120     EventID                               event_id;           /* Event ID                            */
121 } VEHICLE_MSG_DELIVERY_ENTRY_DAT;
122
123 typedef struct {
124     T_APIMSG_MSGBUF_HEADER                hdr;                /* Message header    */
125     VEHICLE_MSG_DELIVERY_ENTRY_DAT        data;               /* Message data        */
126 } VEHICLE_MSG_DELIVERY_ENTRY;
127
128 /************************************************************************
129 *            Function prototypes                                        *
130 ************************************************************************/
131 #ifdef __cplusplus
132 extern "C" {
133 #endif
134 /*[VEHICLE_API Public API]*/
135
136 int32 VehicleGetDrData(PNO pno, DID did, void *dest_data, u_int16 dest_size);
137
138 #ifdef __cplusplus
139 }
140 #endif
141
142 #endif  // POSITIONING_CLIENT_INCLUDE_VEHICLE_API_DUMMY_H_