Init basesystem source codes.
[staging/basesystem.git] / video_in_hal / vehicleservice / positioning / client / include / SensorLocation_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       SensorLocation_API.h
19 @detail     SensorLocation_API external header file<BR>
20             SensorLocation_API External public header
21 ******************************************************************************/
22 #ifndef POSITIONING_CLIENT_INCLUDE_SENSORLOCATION_API_H_
23 #define POSITIONING_CLIENT_INCLUDE_SENSORLOCATION_API_H_
24
25 /*****************************************************************************
26  *                                 Include                                   *
27  *****************************************************************************/
28
29 /*****************************************************************************
30  *                              Define                                       *
31  *****************************************************************************/
32 /* Command ID */
33 #define CID_VEHICLE_SENSORLOCATION_LONLAT        (0x0201)
34 /* Vehicle sensor information notification CID (Latitude and longitude information)*/
35 #define CID_VEHICLE_SENSORLOCATION_ALTITUDE      (0x0202)
36 /* Vehicle sensor information notification CID (Altitude Information) */
37
38 /* SENSORLOCATION_RET_API definition */
39 #define SENSORLOCATION_RET_NORMAL                (0)    /* Successful completion  */
40 #define SENSORLOCATION_RET_ERROR_PARAM           (-1)   /* Parameter error    */
41 #define SENSORLOCATION_RET_ERROR_BUFFULL         (-2)   /* Number of registered FULL */
42 #define SENSORLOCATION_RET_ERROR_INNER           (-3)   /* Internal error    */
43
44 /* Delivery opportunity definition */
45 #define SENSORLOCATION_DELIVERY_TIMING_CHANGE    (0)    /* Change    */
46 #define SENSORLOCATION_DELIVERY_TIMING_UPDATE    (1)    /* UpDate    */
47
48 /* Presence information definitions DR */
49 #define SENSORLOCATION_EXISTDR_NODR              (0)    /* Without DR   */
50 #define SENSORLOCATION_EXISTDR_DR                (1)    /* There DR    */
51
52 /* DR state definition */
53 #define SENSORLOCATION_DRSTATUS_INVALID          (0)    /* Invalid            */
54 #define SENSORLOCATION_DRSTATUS_GPS_NODR         (1)    /* Information use GPS, not yet implemented DR   */
55 #define SENSORLOCATION_DRSTATUS_NOGPS_DR         (2)    /* No information available GPS, DR implementation */
56 #define SENSORLOCATION_DRSTATUS_GPS_DR           (3)    /* Information use GPS, DR implementation    */
57
58 /* LONLAT initial value definition */
59 #define SENSORLOCATION_LATITUDE_INIT_VALUE       0x7FFFFFFFL    /* initial value       */
60 #define SENSORLOCATION_LONGITUDE_INIT_VALUE      0x7FFFFFFFL    /* initial value       */
61
62 /*****************************************************************************
63  *                            Typedef                                        *
64  *****************************************************************************/
65 typedef int32 SENSORLOCATION_RET_API;
66
67 /*****************************************************************************
68  *                            Struct                                         *
69  *****************************************************************************/
70 /*****************************************************************************
71  * TAG   : SENSORLOCATION_LONLATINFO_DAT
72  * ABSTRACT  : Latitude and longitude information data structure
73  * NOTE   :
74  *****************************************************************************/
75 typedef struct {
76     u_int16                                size;           /* Size          */
77     u_int8                                 sensor_cnt;     /* Sensor counter value      */
78     u_int8                                 is_exist_dr;    /* Presence or absence information DR  */
79     u_int8                                 dr_status;      /* DR state         */
80     u_int8                                 reserve[3];     /* Reserve         */
81     int32                                  longitude;      /* Longitude        */
82     int32                                  latitude;       /* Latitude         */
83 } SENSORLOCATION_MSG_LONLATINFO_DAT;
84
85 /*****************************************************************************
86  * TAG   : SENSORLOCATION_ALTITUDEINFO_DAT
87  * ABSTRACT  : Altitude information data structure
88  * NOTE   :
89  *****************************************************************************/
90 typedef struct {
91     u_int16                                size;           /* Size          */
92     u_int8                                 sensor_cnt;     /* Sensor counter value      */
93     u_int8                                 is_exist_dr;    /* Presence or absence information DR  */
94     u_int8                                 dr_status;      /* DR state         */
95     u_int8                                 reserve[3];     /* Reserve         */
96     int32                                  altitude;       /* Altitude(0.01m)       */
97 } SENSORLOCATION_MSG_ALTITUDEINFO_DAT;
98
99 /*****************************************************************************
100  * TAG   : LONLAT
101  * ABSTRACT  : Latitude and Longitude data structure
102  * NOTE   :
103  *****************************************************************************/
104 typedef struct {
105     int32                                  latitude;       /* Latitude         */
106     int32                                  longitude;      /* Longitude        */
107 } LONLAT;
108
109 /*****************************************************************************
110 *   Function prototypes               *
111 *****************************************************************************/
112 #ifdef __cplusplus
113 extern "C" {
114 #endif
115 extern SENSORLOCATION_RET_API SensorLocationRegisterListenerLonLat(PNO pno, u_int8 delivery_timing);
116 extern SENSORLOCATION_RET_API SensorLocationRegisterListenerAltitude(PNO pno, u_int8 delivery_timing);
117 extern SENSORLOCATION_RET_API SensorLocationGetLonLat(SENSORLOCATION_MSG_LONLATINFO_DAT *dat);
118 extern SENSORLOCATION_RET_API SensorLocationGetAltitude(SENSORLOCATION_MSG_ALTITUDEINFO_DAT *dat);
119 extern SENSORLOCATION_RET_API SensorLocationGetLonLatOnShutdown(LONLAT *lonlat);
120 #ifdef __cplusplus
121 }
122 #endif
123
124 #endif  // POSITIONING_CLIENT_INCLUDE_SENSORLOCATION_API_H_