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 #ifndef POSITIONING_CLIENT_INCLUDE_DEAD_RECKONING_LOCAL_API_H_
18 #define POSITIONING_CLIENT_INCLUDE_DEAD_RECKONING_LOCAL_API_H_
19 /****************************************************************************
20 * File name :Dead_Reckoning_Local_Api.h
21 * System name :PastModel002
23 ******************************************************************************/
25 #include <vehicle_service/positioning_base_library.h>
26 #include "Sensor_Common_API.h"
27 #include "SensorLocation_API.h"
28 #include "SensorMotion_API.h"
31 /************************************************************************
33 ************************************************************************/
35 /*----------------------------------------------------------------------*
36 * DEADRECKONING_RET_API define *
37 *----------------------------------------------------------------------*/
39 #define DEAD_RECKONING_RET_NORMAL 0 /* Normal completion */
41 #define DEADRECKONING_RET_ERROR_PID (-1) /* Thread ID error */
42 #define DEADRECKONING_RET_ERROR_DID (-2) /* Unregistered DID */
43 #define DEADRECKONING_RET_ERROR_PARAM (-4) /* Parameter error */
44 #define DEADRECKONING_RET_ERROR_BUFFULL (-5) /* FULL of registered numbers */
45 #define DEADRECKONING_RET_ERROR_CREATE_EVENT (-6) /* Event generation failure */
46 #define DEADRECKONING_RET_ERROR_OUTOF_MEMORY (-8) /* Shared memory allocation failed */
47 #define DEADRECKONING_RET_ERROR_SIZE (-9) /* Storage destination size error */
48 #define DEADRECKONING_RET_ERROR_MIN (-10)
50 /*----------------------------------------------------------------------*
51 * DEADRECKONING delivery registry APIs *
52 *----------------------------------------------------------------------*/
53 /* Delivery control */
54 #define DEADRECKONING_DELIVERY_REGIST 0x01 /* Delivery registration */
57 #define DEADRECKONING_DELIVERY_TIMING_UPDATE 0x01 /* Updating */
59 /*----------------------------------------------------------------------*
61 *----------------------------------------------------------------------*/
62 /* Vehicle Sensor -> Vehicle Sensor(DR) */
63 #define CID_DEAD_RECKONING_DELIVERY_ENTRY 0x0310 /* DR Transmission Registration Signal Notification */
65 /* Vehicle Sensor -> Vehicle Sensor(DR) */
66 #define CID_DEAD_RECKONING_SENS_DATA 0x0311 /* DR data signal notification */
67 #define CID_DEAD_RECKONING_GPS_DATA 0x0312 /* DR data signal notification */
68 #define CID_DEAD_RECKONING_SENS_FST_DATA 0x0313 /* DR data signal notification */
70 /* Message Data Size(byte) */
71 #define DEADRECKONING_MSGBUF_DSIZE 512 /* Message body MAX */
73 /*----------------------------------------------------------------------*
74 * Shared Memory Related Extensions *
75 *----------------------------------------------------------------------*/
76 /* Semaphore name(MAX 32Byte) Synchronize with VehicleDebug_API_private.h */
77 #define SENSOR_LOG_SETTING_SEMAPHO_NAME ("SEBSIR_GET_LOG_SETTING_SEMAPHO")
79 /* Shared memory name(MAX 32Byte) Synchronize with VehicleDebug_API_private */
80 #define LOG_SETTING_SHARE_MEMORY_NAME ("LOG_SETTING_SHARE_MEMORY")
82 /************************************************************************
83 * typedef Definition *
84 ************************************************************************/
85 typedef RET_API DEAD_RECKONING_RET_API; /* API return value */
87 /************************************************************************
88 * Struct definitions *
89 ************************************************************************/
91 /************************************************************************
92 * TAG : DEADRECKONING_MSG_BUF
93 * ABSTRACT : message buffer
94 ************************************************************************/
97 T_APIMSG_MSGBUF_HEADER hdr; /* Message header */
98 u_int8 data[DEADRECKONING_MSGBUF_DSIZE]; /* Message data */
99 } DEADRECKONING_MSG_BUF;
101 /************************************************************************
102 * TAG : DEADRECKONING_MSG_DELIVERY_ENTRY
103 * ABSTRACT : Registration message delivery vehicle sensor information(->Vehicle sensor)
104 ************************************************************************/
106 DID did; /* ID data corresponding to the vehicle sensor information */
107 PNO pno; /* Shipping addressPNO */
108 u_int8 delivery_timing; /* Delivery opportunity */
109 u_int8 ctrl_flg; /* Delivery control */
110 EventID event_id; /* Event ID */
111 } DEADRECKONING_MSG_DELIVERY_ENTRY_DAT;
114 T_APIMSG_MSGBUF_HEADER hdr; /* Message header */
115 DEADRECKONING_MSG_DELIVERY_ENTRY_DAT data; /* Message data */
116 } DEADRECKONING_MSG_DELIVERY_ENTRY;
118 /************************************************************************
119 * TAG : DEADRECKONING_MSG_GET_DR_DATA
120 * ABSTRACT : Vehicle sensor information acquisition message(->Vehicle sensor)
121 ************************************************************************/
123 DID did; /* Data ID corresponding to vehicle sensor information */
124 PNO pno; /* Destination PNO */
125 u_int16 offset; /* Offset to shared memory storage area */
126 u_int16 size; /* Size of shared memory storage area */
128 EventID event_id; /* Event ID */
129 } DEADRECKONING_MSG_GET_DR_DATA_DAT;
132 T_APIMSG_MSGBUF_HEADER hdr; /* Message header */
133 DEADRECKONING_MSG_GET_DR_DATA_DAT data; /* Message data */
134 } DEADRECKONING_MSG_GET_DR_DATA;
136 /************************************************************************
137 * Function prototype *
138 ************************************************************************/
147 #endif // POSITIONING_CLIENT_INCLUDE_DEAD_RECKONING_LOCAL_API_H_