2 * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 /******************************************************************************
18 @file SensorMotion_API.h
19 @detail SensorMotion_API external header file<BR>
20 SensorMotion_API External public header
21 ******************************************************************************/
22 #ifndef POSITIONING_CLIENT_INCLUDE_SENSORMOTION_API_H_
23 #define POSITIONING_CLIENT_INCLUDE_SENSORMOTION_API_H_
25 /*****************************************************************************
27 *****************************************************************************/
29 /*****************************************************************************
31 *****************************************************************************/
33 /* Vehicle sensor information notification CID (Rate information) */
34 #define CID_VEHICLE_SENSORMOTION_SPEED (0x0203)
35 /* Vehicle sensor information notification CID (Orientation information) */
36 #define CID_VEHICLE_SENSORMOTION_HEADING (0x0204)
38 /* Vehicle sensor information notification CID (GyroTrouble information) */
39 #define CID_VEHICLE_SENSORMOTION_GYROTROUBLE (0x020A)
40 /* Vehicle sensor information notification CID (GyroParameter information) */
41 #define CID_VEHICLE_SENSORMOTION_GYROPARAMETER (0x020B)
42 /* Vehicle sensor information notification CID (SpeedParameter information) */
43 #define CID_VEHICLE_SENSORMOTION_SPEEDPULSEPARAMETER (0x020C)
45 /* SENSORMOTION_RET_API definition */
46 #define SENSORMOTION_RET_NORMAL (0) /* Successful completion */
47 #define SENSORMOTION_RET_ERROR_PARAM (-1) /* Parameter error */
48 #define SENSORMOTION_RET_ERROR_BUFFULL (-2) /* Number of registered FULL */
49 #define SENSORMOTION_RET_ERROR_INNER (-3) /* Internal error */
51 /* Delivery opportunity definition */
52 #define SENSORMOTION_DELIVERY_TIMING_CHANGE (0) /* Change */
53 #define SENSORMOTION_DELIVERY_TIMING_UPDATE (1) /* UpDate */
55 /* Presence information definitions DR */
56 #define SENSORMOTION_EXISTDR_NODR (0) /* Without DR */
57 #define SENSORMOTION_EXISTDR_DR (1) /* There DR */
59 /* DR state definition */
60 #define SENSORMOTION_DRSTATUS_INVALID (0) /* Invalid */
61 #define SENSORMOTION_DRSTATUS_GPS_NODR (1) /* Information use GPS, not yet implemented DR */
62 #define SENSORMOTION_DRSTATUS_NOGPS_DR (2) /* No information available GPS, DR implementation */
63 #define SENSORMOTION_DRSTATUS_GPS_DR (3) /* Information use GPS, DR implementation */
65 /*----------------------------------------------------------------------*
66 * General Purpose Definition
67 *----------------------------------------------------------------------*/
68 #define SENSORMOTION_NORMAL (0U)
69 #define SENSORMOTION_ERROR (1U)
70 #define SENSORMOTION_UNFIXED (2U)
72 /*****************************************************************************
74 *****************************************************************************/
75 typedef int32 SENSORMOTION_RET_API;
77 /*****************************************************************************
79 *****************************************************************************/
80 /*****************************************************************************
81 * TAG : SENSORMOTION_SPEEDINFO_DAT
82 * ABSTRACT : Vehicle speed information data structure
84 *****************************************************************************/
86 u_int16 size; /* Size */
87 u_int8 sensor_cnt; /* Sensor counter value */
88 u_int8 is_exist_dr; /* Presence or absence information DR */
89 u_int8 dr_status; /* DR state */
90 u_int8 reserve; /* Reserve */
91 u_int16 speed; /* Speed(0.01m/sec) */
92 } SENSORMOTION_MSG_SPEEDINFO_DAT;
94 /*****************************************************************************
95 * TAG : SENSORMOTION_MSG_HEADINGINFO_DAT
96 * ABSTRACT : Orientation information data structure
98 *****************************************************************************/
100 u_int16 size; /* Size */
101 u_int8 sensor_cnt; /* Sensor counter value */
102 u_int8 is_exist_dr; /* Presence or absence information DR */
103 u_int8 dr_status; /* DR state */
104 u_int8 reserve; /* Reserve */
105 u_int16 heading; /* Heading */
106 } SENSORMOTION_MSG_HEADINGINFO_DAT;
108 /*****************************************************************************
109 * TAG : SENSORMOTION_MSG_GYROTROUBLEINFO_DAT
110 * ABSTRACT : GyroTrouble information data structure
112 *****************************************************************************/
114 u_int16 size; /* Size */
115 u_int8 gyro_trouble; /* Gyro Trouble Status */
116 u_int8 reserve; /* Reserve */
117 } SENSORMOTION_MSG_GYROTROUBLEINFO_DAT;
119 /*****************************************************************************
120 * TAG : SENSORMOTION_MSG_GYROTROUBLEINFO
121 * ABSTRACT : Delivery of the message GyroTrouble information
122 * NOTE : Message structure(VehicleSens -> User)
123 *****************************************************************************/
125 T_APIMSG_MSGBUF_HEADER hdr; /* Message header */
126 SENSORMOTION_MSG_GYROTROUBLEINFO_DAT data; /* Delivery data (GyroTrouble) */
127 } SENSORMOTION_MSG_GYROTROUBLEINFO;
129 /*****************************************************************************
130 * TAG : SENSORMOTION_MSG_GYROPARAMETERINFO_DAT
131 * ABSTRACT : GyroParameter information data structure
133 *****************************************************************************/
135 u_int16 size; /* Size */
136 u_int16 gyro_offset; /* Gyro Offset */
137 u_int8 gyro_scale_factor; /* Gyro Scale Factor */
138 u_int8 gyro_scale_factor_level; /* Gyro Scale Factor Level */
139 u_int8 reserve[2]; /* Reserve */
140 } SENSORMOTION_MSG_GYROPARAMETERINFO_DAT;
142 /*****************************************************************************
143 * TAG : SENSORMOTION_MSG_GYROPARAMETERINFO
144 * ABSTRACT : Delivery of the message GyroParameter information
145 * NOTE : Message structure(VehicleSens -> User)
146 *****************************************************************************/
148 T_APIMSG_MSGBUF_HEADER hdr; /* Message header */
149 SENSORMOTION_MSG_GYROPARAMETERINFO_DAT data; /* Delivery data (GyroParameter) */
150 } SENSORMOTION_MSG_GYROPARAMETERINFO;
152 /*****************************************************************************
153 * TAG : SENSORMOTION_MSG_SPEEDPULSEPARAMETERINFO_DAT
154 * ABSTRACT : SpeedPulseParameter information data structure
156 *****************************************************************************/
158 u_int16 size; /* Size */
159 u_int16 speed_pulse_scale_factor; /* Speed Pulse Scale Factor */
160 u_int8 speed_pulse_scale_factor_level; /* Speed Pulse Scale Factor Level */
161 u_int8 reserve[3]; /* Reserve */
162 } SENSORMOTION_MSG_SPEEDPULSEPARAMETERINFO_DAT;
164 /*****************************************************************************
165 * TAG : SENSORMOTION_MSG_SPEEDPULSEPARAMETERINFO
166 * ABSTRACT : Delivery of the message SpeedPulseParameter information
167 * NOTE : Message structure(VehicleSens -> User)
168 *****************************************************************************/
170 T_APIMSG_MSGBUF_HEADER hdr; /* Message header */
171 SENSORMOTION_MSG_SPEEDPULSEPARAMETERINFO_DAT data; /* Delivery data (SpeedPulseParameter) */
172 } SENSORMOTION_MSG_SPEEDPULSEPARAMETERINFO;
174 /*****************************************************************************
175 * Function prototypes *
176 *****************************************************************************/
178 #endif // POSITIONING_CLIENT_INCLUDE_SENSORMOTION_API_H_