Re-organized sub-directory by category
[staging/basesystem.git] / service / vehicle / positioning / client / include / Vehicle_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 #ifndef POSITIONING_CLIENT_INCLUDE_VEHICLE_API_H_
18 #define POSITIONING_CLIENT_INCLUDE_VEHICLE_API_H_
19 /******************************************************************************
20  * File name        :Vehicle_API.h
21  * System name        :GPF
22  * Sub System name    :Vehicle I/F Liblary
23  ******************************************************************************/
24 #include <vehicle_service/positioning_base_library.h>
25 #include <vehicle_service/POS_define.h>
26 #include "Sensor_Common_API.h"
27
28 /****************************************************************************
29 *            Definition                                                     *
30 *****************************************************************************/
31 /*--------------------------------------------------------------------------*
32  *    VECHILE_RET_API Definition                                            *
33  *--------------------------------------------------------------------------*/
34 /* Normal system */
35 #define VEHICLE_RET_NORMAL                       0       /* Successful completion */
36
37 /* Abnormal system */
38 #define VEHICLE_RET_ERROR_DID                    (-2)    /* NoneDID                    */
39 #define VEHICLE_RET_ERROR_PARAM                  (-4)    /* Parameter error            */
40 #define VEHICLE_RET_ERROR_BUFFULL                (-5)    /* registration number FULL    */
41 #define VEHICLE_RET_ERROR_CREATE_EVENT           (-6)    /* Failure event generation    */
42 #define VEHICLE_RET_ERROR_MIN                    POS_RET_ERROR_MIN
43
44 /*----------------------------------------------------------------------*
45  *    API-related registration information delivery vehicle sensor        *
46  *----------------------------------------------------------------------*/
47 /* Delivery control */
48 #define VEHICLE_DELIVERY_REGIST                  0x01    /* Shipping register    */
49
50 /* Delivery opportunity */
51 #define VEHICLE_DELIVERY_TIMING_UPDATE           0x01    /* Update                */
52 #define VEHICLE_DELIVERY_TIMING_CHANGE           0x02    /* Change                */
53
54 /*----------------------------------------------------------------------*
55  *    Message Definition                                                    *
56  *----------------------------------------------------------------------*/
57 /* Command ID */
58
59 /* Registration information delivery vehicle sensor CID    */
60 #define CID_VEHICLEIF_DELIVERY_ENTRY             0x0101
61
62 /* Vehicle sensor information notification CID            */
63 #define CID_VEHICLESENS_VEHICLE_INFO             0x0200
64
65 /* GPS time notification CID                             */
66 #define CID_VEHICLESENS_VEHICLE_INFO_GPS_TIME    0x0201
67
68 /************************************************************************
69 *            typedef Definition                                         *
70 ************************************************************************/
71 typedef RET_API VEHICLE_RET_API;                         /* API return value    */
72
73 /************************************************************************
74 *            struct Definition                                          *
75 ************************************************************************/
76
77 /************************************************************************
78 * TAG       : VEHICLE_MSG_VSINFO_DAT
79 * ABSTRACT  : message delivery vehicle sensor information
80 ************************************************************************/
81 typedef struct {
82     DID                       did;
83     u_int16                   size;
84     u_int8                    rcv_flag;
85     u_int8                    sensor_cnt;
86     u_int8                    data[256];
87 } VEHICLE_MSG_VSINFO_DAT;
88
89 /* ++ GPS _CWORD82_ support */
90
91 /************************************************************************
92 * TAG       : VEHICLE_MSG_SEND_DAT
93 * ABSTRACT  : Vehicle sensor information setting message(-> Vehicle sensor)
94 ************************************************************************/
95 typedef struct {
96     T_APIMSG_MSGBUF_HEADER    hdr;          /* Message header */
97     VEHICLE_MSG_SEND_DAT      data;         /* Message data */
98 } VEHICLE_MSG_SEND;
99
100 /* -- GPS _CWORD82_ support */
101
102 /************************************************************************
103 *            Function prototypes                                        *
104 ************************************************************************/
105 #ifdef __cplusplus
106 extern "C" {
107 #endif
108 /*[VEHICLE_API Public API]*/
109 VEHICLE_RET_API VehicleInitialize(u_int32(*sighand)(void)); /* QAC 3001 */
110
111 #ifdef __cplusplus
112 }
113 #endif
114
115 #endif  // POSITIONING_CLIENT_INCLUDE_VEHICLE_API_H_