summaryrefslogtreecommitdiffstats
path: root/positioning/client/include/SensorMotion_API.h
blob: 2db5511bf8d283273c8c26173790012ca4ce97e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
/*
 * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/******************************************************************************
@file       SensorMotion_API.h
@detail     SensorMotion_API external header file<BR>
            SensorMotion_API External public header
******************************************************************************/
#ifndef POSITIONING_CLIENT_INCLUDE_SENSORMOTION_API_H_
#define POSITIONING_CLIENT_INCLUDE_SENSORMOTION_API_H_

/*****************************************************************************
 *                              Include                                      *
 *****************************************************************************/

/*****************************************************************************
 *                               Define                                      *
 *****************************************************************************/
/* Command ID */
/* Vehicle sensor information notification CID (Rate information) */
#define CID_VEHICLE_SENSORMOTION_SPEED                  (0x0203)
/* Vehicle sensor information notification CID (Orientation information) */
#define CID_VEHICLE_SENSORMOTION_HEADING                (0x0204)

/* Vehicle sensor information notification CID (GyroTrouble information) */
#define CID_VEHICLE_SENSORMOTION_GYROTROUBLE            (0x020A)
/* Vehicle sensor information notification CID (GyroParameter information) */
#define CID_VEHICLE_SENSORMOTION_GYROPARAMETER          (0x020B)
/* Vehicle sensor information notification CID (SpeedParameter information) */
#define CID_VEHICLE_SENSORMOTION_SPEEDPULSEPARAMETER    (0x020C)

/* SENSORMOTION_RET_API definition */
#define SENSORMOTION_RET_NORMAL                         (0)     /* Successful completion  */
#define SENSORMOTION_RET_ERROR_PARAM                    (-1)    /* Parameter error    */
#define SENSORMOTION_RET_ERROR_BUFFULL                  (-2)    /* Number of registered FULL */
#define SENSORMOTION_RET_ERROR_INNER                    (-3)    /* Internal error    */

/* Delivery opportunity definition */
#define SENSORMOTION_DELIVERY_TIMING_CHANGE             (0)     /* Change    */
#define SENSORMOTION_DELIVERY_TIMING_UPDATE             (1)     /* UpDate    */

/* Presence information definitions DR */
#define SENSORMOTION_EXISTDR_NODR                       (0)     /* Without DR   */
#define SENSORMOTION_EXISTDR_DR                         (1)     /* There DR    */

/* DR state definition */
#define SENSORMOTION_DRSTATUS_INVALID                   (0)     /* Invalid            */
#define SENSORMOTION_DRSTATUS_GPS_NODR                  (1)     /* Information use GPS, not yet implemented DR */
#define SENSORMOTION_DRSTATUS_NOGPS_DR                  (2)     /* No information available GPS, DR implementation */
#define SENSORMOTION_DRSTATUS_GPS_DR                    (3)     /* Information use GPS, DR implementation */

/*----------------------------------------------------------------------*
 * General Purpose Definition
 *----------------------------------------------------------------------*/
#define SENSORMOTION_NORMAL                             (0U)
#define SENSORMOTION_ERROR                              (1U)
#define SENSORMOTION_UNFIXED                            (2U)

/*****************************************************************************
 *                                  Typedef                                  *
 *****************************************************************************/
typedef int32 SENSORMOTION_RET_API;

/*****************************************************************************
 *                                  Struct                                   *
 *****************************************************************************/
/*****************************************************************************
 * TAG   : SENSORMOTION_SPEEDINFO_DAT
 * ABSTRACT  : Vehicle speed information data structure
 * NOTE   :
 *****************************************************************************/
typedef struct {
    u_int16                                   size;           /* Size          */
    u_int8                                    sensor_cnt;     /* Sensor counter value      */
    u_int8                                    is_exist_dr;    /* Presence or absence information DR  */
    u_int8                                    dr_status;      /* DR state         */
    u_int8                                    reserve;        /* Reserve         */
    u_int16                                   speed;          /* Speed(0.01m/sec)       */
} SENSORMOTION_MSG_SPEEDINFO_DAT;

/*****************************************************************************
 * TAG   : SENSORMOTION_MSG_HEADINGINFO_DAT
 * ABSTRACT  : Orientation information data structure
 * NOTE   :
 *****************************************************************************/
typedef struct {
    u_int16                                   size;           /* Size          */
    u_int8                                    sensor_cnt;     /* Sensor counter value      */
    u_int8                                    is_exist_dr;    /* Presence or absence information DR  */
    u_int8                                    dr_status;      /* DR state         */
    u_int8                                    reserve;        /* Reserve         */
    u_int16                                   heading;        /* Heading         */
} SENSORMOTION_MSG_HEADINGINFO_DAT;

/*****************************************************************************
 * TAG   : SENSORMOTION_MSG_GYROTROUBLEINFO_DAT
 * ABSTRACT  : GyroTrouble information data structure
 * NOTE   :
 *****************************************************************************/
typedef struct {
    u_int16                                   size;           /* Size          */
    u_int8                                    gyro_trouble;   /* Gyro Trouble Status      */
    u_int8                                    reserve;        /* Reserve         */
} SENSORMOTION_MSG_GYROTROUBLEINFO_DAT;

/*****************************************************************************
 * TAG   : SENSORMOTION_MSG_GYROTROUBLEINFO
 * ABSTRACT  : Delivery of the message GyroTrouble information
 * NOTE   : Message structure(VehicleSens -> User)
 *****************************************************************************/
typedef struct {
    T_APIMSG_MSGBUF_HEADER                    hdr;            /* Message header    */
    SENSORMOTION_MSG_GYROTROUBLEINFO_DAT      data;           /* Delivery data (GyroTrouble) */
} SENSORMOTION_MSG_GYROTROUBLEINFO;

/*****************************************************************************
 * TAG   : SENSORMOTION_MSG_GYROPARAMETERINFO_DAT
 * ABSTRACT  : GyroParameter information data structure
 * NOTE   :
 *****************************************************************************/
typedef struct {
    u_int16                                   size;           /* Size          */
    u_int16                                   gyro_offset;    /* Gyro Offset        */
    u_int8                                    gyro_scale_factor;          /* Gyro Scale Factor */
    u_int8                                    gyro_scale_factor_level;    /* Gyro Scale Factor Level */
    u_int8                                    reserve[2];     /* Reserve         */
} SENSORMOTION_MSG_GYROPARAMETERINFO_DAT;

/*****************************************************************************
 * TAG   : SENSORMOTION_MSG_GYROPARAMETERINFO
 * ABSTRACT  : Delivery of the message GyroParameter information
 * NOTE   : Message structure(VehicleSens -> User)
 *****************************************************************************/
typedef struct {
    T_APIMSG_MSGBUF_HEADER                    hdr;            /* Message header     */
    SENSORMOTION_MSG_GYROPARAMETERINFO_DAT    data;           /* Delivery data (GyroParameter) */
} SENSORMOTION_MSG_GYROPARAMETERINFO;

/*****************************************************************************
 * TAG   : SENSORMOTION_MSG_SPEEDPULSEPARAMETERINFO_DAT
 * ABSTRACT  : SpeedPulseParameter information data structure
 * NOTE   :
 *****************************************************************************/
typedef struct {
    u_int16                                   size;           /* Size          */
    u_int16                                   speed_pulse_scale_factor;          /* Speed Pulse Scale Factor */
    u_int8                                    speed_pulse_scale_factor_level;    /* Speed Pulse Scale Factor Level */
    u_int8                                    reserve[3];     /* Reserve         */
} SENSORMOTION_MSG_SPEEDPULSEPARAMETERINFO_DAT;

/*****************************************************************************
 * TAG   : SENSORMOTION_MSG_SPEEDPULSEPARAMETERINFO
 * ABSTRACT  : Delivery of the message SpeedPulseParameter information
 * NOTE   : Message structure(VehicleSens -> User)
 *****************************************************************************/
typedef struct {
    T_APIMSG_MSGBUF_HEADER                          hdr;      /* Message header      */
    SENSORMOTION_MSG_SPEEDPULSEPARAMETERINFO_DAT    data;     /* Delivery data (SpeedPulseParameter) */
} SENSORMOTION_MSG_SPEEDPULSEPARAMETERINFO;

/*****************************************************************************
 *                              Function prototypes                          *
 *****************************************************************************/

#endif  // POSITIONING_CLIENT_INCLUDE_SENSORMOTION_API_H_