summaryrefslogtreecommitdiffstats
path: root/positioning/client/include/DR_API.h
blob: fde5034e74ff27785a644275f39b4e71de458c57 (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
/*
 * @copyright Copyright (c) 2016-2019 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       DR_API.h
@detail     DR_API external header file<BR>
            DR_API External public header
******************************************************************************/
#ifndef POSITIONING_CLIENT_INCLUDE_DR_API_H_
#define POSITIONING_CLIENT_INCLUDE_DR_API_H_

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

/*****************************************************************************
 *      Define                                                               *
 *****************************************************************************/
/* Command ID */
#define CID_DR_MAP_MATCHING_DATA        (0x0209)
#define CID_DR_CLEAR_BACKUP_DATA        (0x020F)

/* DR_EXT_RET_API definition */
#define DR_EXT_RET_NORMAL               (0)        /* Successful completion    */
#define DR_EXT_RET_ERROR                (-1)       /* Setup failure        */

/*****************************************************************************
 *      Typedef                                                              *
 *****************************************************************************/
typedef int32 DR_EXT_RET_API;

/*****************************************************************************
 *      Enumeration                                                          *
 *****************************************************************************/
typedef enum {
    NAVI_DATA_STATUS_2D_FIX = 0x00,
    NAVI_DATA_STATUS_3D_FIX,
    NAVI_DATA_STATUS_DR_COMBINED,
    NAVI_DATA_STATUS_DR_ONLY,
    NAVI_DATA_STATUS_MAP_2D_GPS_FIX,
    NAVI_DATA_STATUS_MAP_3D_GPS_FIX,
    NAVI_DATA_STATUS_MAP_DR_COMBINED,
    NAVI_DATA_STATUS_MAP_DR_ONLY,
    NAVI_DATA_STATUS_MAP_NO_FIX,
    NAVI_DATA_STATUS_AWAITING_FIRST_FIX,
    NAVI_DATA_STATUS_DATA_INVALID,
    NAVI_DATA_STATUS_NO_FIX,
    NAVI_DATA_STATUS_TIME_ONLY_FIX
} NAVI_DATA_STATUS;

typedef enum {
    NAVI_DATA_INVALID = 0x00,
    NAVI_DATA_VALID
} NAVI_DATA_AVAILABLE;

/*****************************************************************************
 *      Struct                                                               *
 *****************************************************************************/
/*****************************************************************************
 * TAG     : POSITION_INFO
 * ABSTRACT   : Position information structure
 * NOTE     :
 *****************************************************************************/
typedef struct {
    int32                  latitude;               /* 10^-7deg    North : plus, South : minus */
    int32                  longitude;              /* 10^-7deg    East  : plus, West  : minus */
    NAVI_DATA_AVAILABLE    status;                 /* Status of data */
} POSITION_INFO;

/*****************************************************************************
 * TAG     : RATE_INFO
 * ABSTRACT   : Rate information  structure
 * NOTE     :
 *****************************************************************************/
typedef struct {
    u_int16                rate;                   /* 10^-2m/sec */
    u_int8                 reserve[2];             /* reserve */
    NAVI_DATA_AVAILABLE    status;                 /* Status of data */
} RATE_INFO;

/*****************************************************************************
 * TAG     : ORIENT_INFO
 * ABSTRACT   : Orient information structure
 * NOTE     :
 *****************************************************************************/
typedef struct {
    u_int16                orient;                 /* 10^-2deg    N : 0, E : 90, S : 180, W : 270 */
    u_int8                 reserve[2];             /* reserve */
    NAVI_DATA_AVAILABLE    status;                 /* Status of data */
} ORIENT_INFO;

/*****************************************************************************
 * TAG     : MAP_MATCHING_DATA
 * ABSTRACT   : Map-Matching information data structure
 * NOTE     :
 *****************************************************************************/
typedef struct {
    POSITION_INFO          position_info;          /* Position information */
    RATE_INFO              rate_info;              /* Rate information */
    ORIENT_INFO            orient_info;            /* Orient information */
    NAVI_DATA_STATUS       status;                 /* Status */
} MAP_MATCHING_DATA;

/*****************************************************************************
 * TAG     : DR_MSG_MAP_MATCHING_DATA
 * ABSTRACT   : Map-Matching information data message buffer structure
 * NOTE     : Message structure(User -> VehicleSens)
 *****************************************************************************/
typedef struct {
    T_APIMSG_MSGBUF_HEADER    hdr;                 /* Message header */
    MAP_MATCHING_DATA         data;                /* Message data (Map-Matching information) */
} DR_MSG_MAP_MATCHING_DATA;

/*****************************************************************************
 * TAG     : DR_MSG_CLEAR_BACKUP_DATA
 * ABSTRACT   : Clear backup data message buffer structure
 * NOTE     : Message structure(User -> VehicleSens)
 *****************************************************************************/
typedef struct {
    T_APIMSG_MSGBUF_HEADER    hdr;                 /* Message header */
} DR_MSG_CLEAR_BACKUP_DATA;

/*****************************************************************************
*      Function prototypes                                                   *
*****************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
extern DR_EXT_RET_API DrSetMapMatchingData(PNO pno, MAP_MATCHING_DATA* map_matching_data);
extern DR_EXT_RET_API DrClearBackupData(PNO pno);
#ifdef __cplusplus
}
#endif

#endif  // POSITIONING_CLIENT_INCLUDE_DR_API_H_