Re-organized sub-directory by category
[staging/basesystem.git] / service / vehicle / positioning / client / include / vehicle_service / POS_define.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 #ifndef POSITIONING_CLIENT_INCLUDE_VEHICLE_SERVICE_POS_DEFINE_H_
17 #define POSITIONING_CLIENT_INCLUDE_VEHICLE_SERVICE_POS_DEFINE_H_
18
19 /**
20  * @file POS_define.h
21  * @brief Header file to define the constants and structure
22  */
23
24 /** @addtogroup BaseSystem
25  *  @{
26  */
27 /** @addtogroup vehicle_service
28  *  @ingroup BaseSystem
29  *  @{
30  */
31 /** @addtogroup positioning
32  *  @ingroup vehicle_service
33  *  @{
34  */
35
36 #include <native_service/frameworkunified_types.h>
37 #include <gps_hal.h>
38
39 /*---------------------------------------------------------------------------------*
40  * Definition                                                                      *
41  *---------------------------------------------------------------------------------*/
42 #define POS_AVAILABILITY            "Positioning/Availability"  //!< \~english Availability
43
44 /* message sender thread */
45 #define POS_NTFY_SEND_THREAD        "POS_Main"  //!< \~english POS_Main thread
46 #define POS_NTFY_SEND_THREAD_GPS    "POS_Gps"   //!< \~english POS_Gps thread
47
48 /* SENSOR_RET_API */
49 #define SENSOR_RET_NORMAL             0     //!< \~english normal finish
50 #define SENSOR_RET_ERROR_PID          (-1)  //!< \~english thread ID error
51 #define SENSOR_RET_ERROR_DID          (-2)  //!< \~english unregistered data ID error
52 #define SENSOR_RET_ERROR_DID_DIS      (-3)  //!< \~english data ID not CAN ID
53 #define SENSOR_RET_ERROR_PARAM        (-4)  //!< \~english parameter error
54 #define SENSOR_RET_ERROR_BUFFULL      (-5)  //!< \~english buffer full error
55 #define SENSOR_RET_ERROR_CREATE_EVENT (-6)  //!< \~english create event error
56 #define SENSOR_RET_ERROR_TIMER        (-7)  //!< \~english create timer error
57 #define SENSOR_RET_ERROR_OUTOF_MEMORY (-8)
58 //!< \~english share memory allocation size error
59
60 #define SENSOR_RET_ERROR_SIZE         (-9)  //!< \~english memory size error
61 #define SENSOR_RET_ERROR              (-10)  //!< \~english error occured
62 #define SENSOR_RET_ERROR_NOSUPPORT    (-11)  //!< \~english no support
63 #define SENSOR_RET_ERROR_INNER        (-12)  //!< \~english Internal error
64 #define SENSOR_RET_ERROR_RESOURCE     (-13)  //!< \~english lack of resources
65 #define SENSOR_RET_ERROR_MIN  POS_RET_ERROR_MIN  //!< \~english min value of error
66
67 /* Data Status Definition */
68 #define POS_LOC_INFO_LAT              0x01
69 //!< \~english current position latitude(bit0) 1:valid 0:invalid
70
71 #define POS_LOC_INFO_LON              0x02
72 //!< \~english current position longitude(bit1) 1:valid 0:invalid
73
74 #define POS_LOC_INFO_ALT              0x04
75 //!< \~english current position altitude(bit2) 1:valid 0:invalid
76
77 #define POS_LOC_INFO_HEAD             0x08
78 //!< \~english current position heading(bit3) 1:valid 0:invalid
79
80 /* Definition of positioning system */
81 #define POS_LOC_INFO_USE_GSP          0x01
82 //!< \~english GPS data used result(bit0) 1:valid 0:invalid
83
84 #define POS_LOC_INFO_USE_DGPS         0x02
85 //!< \~english DGPS data used result(bit1) 1:valid 0:invalid
86
87 #define POS_LOC_INFO_USE_DR           0x04
88 //!< \~english Dead Reckoning used result(bit2) 1:valid 0:invalid
89
90 #define POS_LOC_INFO_USE_MAPMATCHING  0x08
91 //!< \~english MapMatching result(bit3) 1:valid 0:invalid
92
93 /*--- for message ---*/
94 /* message body size (byte) */
95 /* move to gps_hal.h */
96
97 /*--- for register listener API ---*/
98 /* control delivery */
99 #define  SENSOR_DELIVERY_REGIST       0x01  //!< \~english register delivery
100
101 /* delivery timing control */
102 #define  SENSOR_DELIVERY_TIMING_UPDATE  0x01  //!< \~english delivery update timing
103 #define  SENSOR_DELIVERY_TIMING_CHANGE  0x02  //!< \~english delivery change timing
104
105 /* POS_RET_API */
106 #define POS_RET_NORMAL              0       //!< \~english normal finish
107 #define POS_RET_ERROR               (-1)    //!< \~english error occured
108 #define POS_RET_ERROR_DID           (-2)    //!< \~english data ID error
109 #define POS_RET_ERROR_INNER         (-3)    //!< \~english internal error
110 #define POS_RET_ERROR_PARAM         (-4)    //!< \~english parameter error
111 #define POS_RET_ERROR_BUFFULL       (-5)    //!< \~english buffer full error
112 #define POS_RET_ERROR_CREATE_EVENT  (-6)    //!< \~english create event error
113 #define POS_RET_ERROR_OUTOF_MEMORY  (-8)
114 //!< \~english share memory allocation size error
115
116 #define POS_RET_ERROR_SIZE          (-9)    //!< \~english memory size error
117 #define POS_RET_ERROR_TIMEOUT       (-10)   //!< \~english timeout error
118 #define POS_RET_ERROR_NOSUPPORT     (-11)   //!< \~english no support
119 #define POS_RET_ERROR_BUSY          (-12)   //!< \~english busy
120 #define POS_RET_ERROR_RESOURCE      (-13)   //!< \~english lack of resources
121 #define POS_RET_ERROR_MIN           (-13)   //!< \~english min value of error
122
123 /*---------------------------------------------------------------------------------*
124  * Typedef declaration                                                             *
125  *---------------------------------------------------------------------------------*/
126 typedef int32_t   SENSOR_RET_API;    //!< \~english API return value
127 typedef int32_t   POS_RET_API;       //!< \~english API return value
128 typedef uint32_t  DID;               //!< \~english data ID
129 typedef int32_t   RET_API;           //!< \~english _CWORD64_ API return value
130
131 /** @}*/  // end of positioning
132 /** @}*/  // end of vehicle_service
133 /** @}*/  // end of BaseSystem
134 #endif  // POSITIONING_CLIENT_INCLUDE_VEHICLE_SERVICE_POS_DEFINE_H_