common_library: gettid is multiple declaration in cl_error
[staging/basesystem.git] / video_in_hal / vehicleservice / positioning / client / include / vehicle_service / POS_sensor_API.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_SENSOR_API_H_
17 #define POSITIONING_CLIENT_INCLUDE_VEHICLE_SERVICE_POS_SENSOR_API_H_
18 /**
19  * @file POS_sensor_API.h
20  * @brief API definition file for Sensor function
21  */
22
23 /** @addtogroup BaseSystem
24  *  @{
25  */
26 /** @addtogroup vehicle_service
27  *  @ingroup BaseSystem
28  *  @{
29  */
30 /** @addtogroup positioning
31  *  @ingroup vehicle_service
32  *  @{
33  */
34 /*---------------------------------------------------------------------------------*
35  * Incluce                                                                         *
36  *---------------------------------------------------------------------------------*/
37 #include <vehicle_service/POS_define.h>
38
39 /*---------------------------------------------------------------------------------*
40  * Definition                                                                      *
41  *---------------------------------------------------------------------------------*/
42 /* POSITIONING_DID */
43 #define POS_DID_SPEED_PULSE     0x80000012  //!< \~english Data ID of speed pulse
44 #define POS_DID_SPEED_KMPH      0x80000013  //!< \~english Data ID of KMPH speed
45 #define POS_DID_SNS_COUNTER     0x8000001A
46 //!< \~english Data ID of sensor counter
47 #define POS_DID_GYRO_X          0x80000014  //!< \~english Data ID of X axis gyro
48 #define POS_DID_GYRO_Y          0x80000085  //!< \~english Data ID of Y axis gyro
49 #define POS_DID_GYRO_Z          0x80000086  //!< \~english Data ID of Z axis gyro
50 #define POS_DID_GYRO            POS_DID_GYRO_X
51 //!< \~english Data ID of POS_DID_GYRO is same as POS_DID_GYRO_X
52 #define POS_DID_GSNS_X          0x80000015  //!< \~english Data ID of x axis gsensor
53 #define POS_DID_GSNS_Y          0x80000016  //!< \~english Data ID of Y axis gsensor
54 #define POS_DID_GSNS_Z          0x80000026  //!< \~english Data ID of Z axis gsensor
55 #define POS_DID_REV             0x80000017  //!< \~english Data ID of reverse signal
56 #define POS_DID_GPS_ANTENNA     0x80000019
57 //!< \~english Data ID of GPS antenna status
58 #define POS_DID_SPEED_PULSE_FST 0x80000028
59 //!< \~english Data ID of first time speed pulse
60 #define POS_DID_GYRO_X_FST      0x80000029  //!< \~english Data ID of first time X axis gyro
61 #define POS_DID_GYRO_Y_FST      0x80000043  //!< \~english Data ID of first time Y axis gyro
62 #define POS_DID_GYRO_Z_FST      0x80000023  //!< \~english Data ID of first time Z axis gyro
63 #define POS_DID_GYRO_FST        POS_DID_GYRO_X_FST
64 //!< \~~english Data ID of POS_DID_GYRO_FST is same as POS_DID_GYRO_X_FST
65 #define POS_DID_REV_FST         0x8000007E
66 //!< \~english Data ID of first time reverse signal
67 #define POS_DID_GYRO_TEMP       0x80000090  //!< \~english Data ID of gyro temperature
68 #define POS_DID_GYRO_TEMP_FST   0x80000091
69 //!< \~english Data ID of first time gyro temperature
70 #define POS_DID_GSNS_X_FST      0x80000087
71 //!< \~english Data ID of first time x axis gsensor
72 #define POS_DID_GSNS_Y_FST      0x80000088
73 //!< \~english Data ID of first time Y axis gsensor
74 #define POS_DID_GSNS_Z_FST      0x80000089
75 //!< \~english Data ID of first time Z axis gsensor
76 #define POS_DID_PULSE_TIME      0x8000003A  //!< \~english Data ID of pulse time
77
78 #define POS_DID_GPS__CWORD82__NMEA    0x80000030U
79 //!< \~english Data ID of _CWORD82_ GPS NMEA sentence
80 #define POS_DID_GPS__CWORD82___CWORD44_GP4  0x80000031U
81 //!< \~english Data ID of _CWORD82_ GPS _CWORD44_GP4 data
82 #define POS_DID_GPS__CWORD82__FULLBINARY 0x80000032U
83 //!< \~english Data ID of _CWORD82_ GPS full binary data
84 #define POS_DID_GPS_NMEA        0x8000009AU
85 //!< \~english Data ID of GPS NMEA sentence
86 #define POS_DID_GPS_CLOCK_DRIFT 0x800000B3U
87 //!< \~english Data ID of GPS time drift data
88 #define POS_DID_GPS_CLOCK_FREQ  0x800000B4U
89 //!< \~english Data ID of GPS time frequency data
90
91 /**
92  * \~english @brief  Delivery sensor extra package command ID
93  * \~english @brief  If you want to catch above envents, use NSFW like below.
94  * \~english @code
95  * l_eStatus = FrameworkUnifiedAttachCallbackToDispatcher(h_app, POS_NTFY_SEND_THREAD, CID_POSIF_REGISTER_LISTENER_PKG_SENSOR_DATA, CBCallbackA);
96  * @endcode
97  */
98 #define CID_POSIF_REGISTER_LISTENER_PKG_SENSOR_DATA  0x0700
99
100 /**
101  * \~english @brief  Delivery sensor information command ID
102  * \~english @brief  If you want to catch above envents, use NSFW like below.
103  * \~english @code
104  * l_eStatus = FrameworkUnifiedAttachCallbackToDispatcher(h_app, POS_NTFY_SEND_THREAD, CID_POSIF_REGISTER_LISTENER_SENSOR_DATA, CBCallbackA);
105  * @endcode
106  */
107 #define CID_POSIF_REGISTER_LISTENER_SENSOR_DATA      0x0200
108
109 #define  SENSOR_MSGBUF_DSIZE    4096
110 //!< \~english message body maximum size
111
112 #define  SENSOR_VSHEAD_DSIZE    36
113 //!< \~english vehicle sensor header size(1+3+16*2)
114
115 #define  SENSOR_VSINFO_DSIZE    (SENSOR_MSGBUF_DSIZE - SENSOR_VSHEAD_DSIZE)
116 //!< \~english vehicle sensor data size
117
118 // Same name/value is defined, but client doesn't include HAL header.
119 // It defines SENSOR_MSG_VSINFO_DSIZE if not included HAL.
120 #ifndef HAL_API_POSITIONING_HAL_H_
121 #define  SENSOR_MSG_VSINFO_DSIZE  1904u
122 //!< \~english vehicle sensor message body maximum size
123 #endif
124
125 #define  SENSOR_PKG_DELIVERY_MAX  16
126 //!< \~english number of data ID per a package
127
128 /*---------------------------------------------------------------------------------*
129  * Typedef declaration                                                             *
130  *---------------------------------------------------------------------------------*/
131
132 /*---------------------------------------------------------------------------------*
133  * Struct declaration                                                              *
134  *---------------------------------------------------------------------------------*/
135 /**
136  * @struct SENSOR_PKG_MSG_VSINFO
137  * \~english positioning sensor notification message (to User)
138  */
139 typedef struct {
140   uint8_t  ucDNum;         //!< \~english number of data
141   uint8_t  ucDataBreak;    //!< \~english data lack infomation
142   uint8_t  ucDivideCnt;    //!< \~english total partition
143   uint8_t  ucDivideSendCnt;    //!< \~english partition transmit count
144   uint16_t usOffset[SENSOR_PKG_DELIVERY_MAX];    //!< \~english offset
145   uint8_t  ucData[SENSOR_VSINFO_DSIZE];    //!< \~english data body
146 } SENSOR_PKG_MSG_VSINFO;
147
148 /**
149  * @struct SENSOR_MSG_VSINFO
150  * \~english message delivery positioning sensor information
151  */
152 typedef struct {
153   DID       did;    //!< \~english data ID
154   uint16_t  size;    //!< \~english data size
155   uint8_t   rcvFlag;    //!< \~english reception flag
156   uint8_t   reserve;    //!< \~english reserve
157   uint8_t   data[SENSOR_MSG_VSINFO_DSIZE];    //!< \~english data body
158 } SENSOR_MSG_VSINFO;
159
160 /*---------------------------------------------------------------------------------*
161  * Prototype Declaration                                                           *
162  *---------------------------------------------------------------------------------*/
163 /* SENSOR_API public API */
164 #ifdef __cplusplus
165 extern "C" {
166 #endif
167 ////////////////////////////////////////////////////////////////////////////////////////////
168 /// \ingroup tag_Positioning
169 /// \~english @par Brief
170 ///        - Send the extra package when first delivery.
171 ///
172 /// \~english @param [in] hApp
173 ///        - HANDLE - App Handle
174 /// \~english @param [in] notifyName
175 ///        - PCSTR - Destination thread name
176 /// \~english @param [in] ucPkgNum
177 ///        - uint8_t - data number in package(1 to 16)
178 /// \~english @param [in] pulDid
179 ///        - DID * - buffer pointer of the data ID array in package
180 /// \~english @param [in] ucCtrlFlg
181 ///        - uint8_t - Delivery control flag(register)
182 /// \~english @param [in] ucDeliveryTiming
183 ///        - uint8_t - Delivery timing(change/update)
184 ///
185 /// \~english @par
186 ///        - data number in package(ucPkgNum) \n
187 ///          The following 8 data ID can be registered. And the register data number range is 1~16.
188 ///        - buffer pointer of the data ID array in package(pulDid) \n
189 ///          The data ID set to the first in pulDid is the delivery key. \n
190 ///          If the data ID not one of the following be set, return SENSOR_RET_ERROR_PARAM.
191 ///        - POS_DID_SNS_COUNTER - sensor counter
192 ///        - POS_DID_GYRO_X - gyro output (X axis)
193 ///        - POS_DID_GYRO_Y - gyro output (Y axis)
194 ///        - POS_DID_GYRO_Z - gyro output (Z axis)
195 ///        - POS_DID_SPEED_PULSE - speed pulse
196 ///        - POS_DID_REV - REV signal(0:forward 1:backward)
197 ///        - POS_DID_GSNS_X - Gsensor output X axis
198 ///        - POS_DID_GSNS_Y - Gsensor output Y axis
199 ///        - POS_DID_GSNS_Z - Gsensor output Z axis
200 ///        - POS_DID_GYRO_TEMP - gyro temperature
201 ///        - POS_DID_PULSE_TIME - pulse time\n
202 /// \~english @par
203 ///        - Because positioning is G/W between Navi and HAL, value depends on the design of HAL.
204 /// \~english @par
205 ///        - Note:The Gsensor output is 0 in the environment without Gsensor hardware.\n
206 /// \~english @par
207 ///        - Delivery control flag(ucCtrlFlg)
208 ///        - SENSOR_DELIVERY_REGIST - register
209 ///        - Register specified LonLat delivery
210 ///        - Please note that if the same data delivery has been registered for multiple times, \n
211 ///          the data will also be deliveried for registered multiple times.
212 ///        - The specified LonLat will be deliveried at register time no matter what delivery  \n
213 ///          timing has been registered (first delivery).
214 ///        - Delivery timing(ucDeliveryTiming)
215 ///        - SENSOR_DELIVERY_TIMING_CHANGE - change  Specified LonLat be deliveried only when it is changed.
216 ///        - SENSOR_DELIVERY_TIMING_UPDATE - update  Specified Lonlat be deliveried as long as \n
217 ///          it is updated by vehicle sensor.
218 ///
219 ///
220 /// \~english @retval SENSOR_RET_NORMAL normal end
221 /// \~english @retval SENSOR_RET_ERROR_CREATE_EVENT event create failed
222 /// \~english @retval SENSOR_RET_ERROR_PARAM parameter error
223 /// \~english @retval SENSOR_RET_ERROR_INNER internal error
224 /// \~english @retval SENSOR_RET_ERROR_NOSUPPORT unsupported
225 /// \~english @retval SENSOR_RET_ERROR_RESOURCE lack of resource
226 ///
227 /// \~english @par Precondition
228 ///        - The creation/initialization \n
229 ///          (FrameworkunifiedCreateDispatcherWithoutLoop and etc.) of the Dispatcher for App are completed.
230 ///        - Availability of service positioning is TRUE.
231 ///
232 /// \~english @par change of internal status
233 ///        - There is no change of internal status
234 ///
235 /// \~english @par Failure condition
236 ///        - The parameter hApp is NULL [SENSOR_RET_ERROR_PARAM]
237 ///        - The parameter ucCtrlFlg is not register(SENSOR_DELIVERY_REGIST) [SENSOR_RET_ERROR_PARAM]
238 ///        - The parameter ucDeliveryTiming is neither update(SENSOR_DELIVERY_TIMING_UPDATE) \n
239 ///          nor change(SENSOR_DELIVERY_TIMING_CHANGE) [SENSOR_RET_ERROR_PARAM]
240 ///        - The parameter notifyName is NULL [SENSOR_RET_ERROR_PARAM]
241 ///        - The parameter ucPkgNum is 0 or it is larger than 16 [SENSOR_RET_ERROR_PARAM]
242 ///        - The parameter pulDid is NULL [SENSOR_RET_ERROR_PARAM]
243 ///        - The data ID in paramter buffer pulDid is not avaliable value [SENSOR_RET_ERROR_PARAM]
244 ///        - The count of message in message queue is reach to max [SENSOR_RET_ERROR_RESOURCE]
245 ///        - The count of mutex is reach to max [SENSOR_RET_ERROR_RESOURCE]
246 ///        - The count of item in ProcessName-ProcessNo convert table is reach to max [SENSOR_RET_ERROR_RESOURCE]
247 ///        - The event has been registered in event table and created in same process, \n
248 ///          but the count of reference is reach to max [SENSOR_RET_ERROR_CREATE_EVENT]
249 ///        - The event has been registered in event table and created in system, but the \n
250 ///          count of reference is reach to max  [SENSOR_RET_ERROR_CREATE_EVENT]
251 ///        - The event has been registered in event table, but memory for the thread event table \n
252 ///          creation allocate falied. [SENSOR_RET_ERROR_CREATE_EVENT]
253 ///        - The event has been registered in event table, but the thread can not be registered in \n
254 ///          event table. [SENSOR_RET_ERROR_CREATE_EVENT]
255 ///        - The event has been registered in event table, but memory for thread table creation \n
256 ///          allocate falied. [SENSOR_RET_ERROR_CREATE_EVENT]
257 ///        - The event has been registered in event table, and the event flag has already been \n
258 ///          registered. [SENSOR_RET_ERROR_CREATE_EVENT]
259 ///        - The event has been registered in event table, and the event flag register failed. \n
260 ///          [SENSOR_RET_ERROR_CREATE_EVENT]
261 ///        - No empty field for registering the event HANDLE into event table. [SENSOR_RET_ERROR_CREATE_EVENT]
262 ///        - Memory for event HANDLE get failed. [SENSOR_RET_ERROR_CREATE_EVENT]
263 ///        - The event has not been registered in event table and not finished registering \n
264 ///          [SENSOR_RET_ERROR_CREATE_EVENT]
265 ///        - The event has not been registered in event table, and memory for thread table \n
266 ///          creation allocate falied. [SENSOR_RET_ERROR_CREATE_EVENT]
267 ///        - The event has not been registered in event table, and the event flag has already been \n
268 ///          registered. [SENSOR_RET_ERROR_CREATE_EVENT]
269 ///        - The event has not been registered in event table, and the event flag register failed. \n
270 ///          [SENSOR_RET_ERROR_CREATE_EVENT]
271 ///        - ProcessNo has not been registered in message control table when message transfered \n
272 ///          between processes. [SENSOR_RET_ERROR_INNER]
273 ///        - Message transfer HANDLE get failed when message transfered in process. [SENSOR_RET_ERROR_INNER]
274 ///        - Message transfer failed in process. [SENSOR_RET_ERROR_INNER]
275 ///        - The destination process name is NULL. [SENSOR_RET_ERROR_INNER]
276 ///        - The destination process name size is larger than 20 characters when message transfer \n
277 ///          between processes. [SENSOR_RET_ERROR_INNER]
278 ///        - The message queue name has not been registered in control table when message \n
279 ///          transfer between processes. [SENSOR_RET_ERROR_INNER]
280 ///        - Message transfer HANDLE create failed when message transfered between processes. [SENSOR_RET_ERROR_INNER]
281 ///        - Message transfer HANDLE get failed from internal table when message transfered \n
282 ///          between processes. [SENSOR_RET_ERROR_INNER]
283 ///        - Message transfer failed between processes. [SENSOR_RET_ERROR_INNER]
284 ///        - Specified event HANDLE has not been registered in event HANDLE table during event \n
285 ///          waiting. [SENSOR_RET_ERROR_CREATE_EVENT]
286 ///        - The count of thread is reach to max in event management table during event \n
287 ///          waiting. [SENSOR_RET_ERROR_CREATE_EVENT]
288 ///        - The EV_FLAG_BIT is not set in flagID during event getting. [SENSOR_RET_ERROR_CREATE_EVENT]
289 ///        - The ID of message event queue has not been created during event getting. [SENSOR_RET_ERROR_CREATE_EVENT]
290 ///        - The flagID has not been registered during event getting. [SENSOR_RET_ERROR_CREATE_EVENT]
291 ///        - The interruption happened during event getting [SENSOR_RET_ERROR_CREATE_EVENT]
292 ///        - Whatever error happened during event getting. [SENSOR_RET_ERROR_CREATE_EVENT]
293 ///        - Got event is SENSOR_RET_ERROR_INNER. [SENSOR_RET_ERROR_INNER]
294 ///
295 /// \~english @par Detial
296 ///        - Call this API to register vehicle sensor data delivery. \n
297 ///          This API return the result of registering. \n
298 ///          The data from sensor data received to registering will be deliveried. \n
299 ///          The first delivery data is the sensor data(max 64 number of sensor counter, \n
300 ///          reverse signal,gyro temperature, max 640 number of gyro output(X axis), gyro output(X axis), gyro output(Z axis), \n
301 ///          speed pulse,Gsensor output(X axis), Gsensor output(Y axis), Gsensor output(Z axis), max 2048 number of pulse time) in 6.4 second. \n
302 ///          If the data number is more than max number, delivery the data in newest 6.4 second. \n
303 ///          If the sensor data accumulated more than max number, set VEHICLE_SNS_BREAK to data missing information. \n
304 ///          If sensor data number is more than the data number send in one time(10 number of \n
305 ///          sensor counter,reverse signal,gyro temperature, 100 number of gyro output(X axis), gyro output(X axis), gyro output(Z axis), \n
306 ///          speed pulse, Gsensor output(X axis),Gsensor output(Y axis), Gsensor output(Z axis), 320 number of pulse time), \n
307 ///          the old data is divided into partitions(every partition with 10 number of sensor counter, \n
308 ///          reverse signal,gyro temperature, 100 number of gyro output(X axis), gyro output(X axis), gyro output(Z axis), \n
309 ///          speed pulse,Gsensor output(X axis), Gsensor output(Y axis), Gsensor output(Z axis), 320 number of pulse time) to delivery. \n
310 ///          The last message for first delivery is the message that the partition count equal to partition No. \n
311 ///          After first delivery, the message data(1 number of sensor counter,reverse signal, \n
312 ///          gyro temperature, 10 number of gyro output(X axis), gyro output(X axis), gyro output(Z axis),speed pulse, \n
313 ///          Gsensor output(X axis), Gsensor output(Y axis), Gsensor output(Z axis), 32 number of pulse time) deliveried. \n
314 ///          And because the data missing information, divided partition count, \n
315 ///          diveided partition No is not used, they will be set to 0 in message.\n
316 ///         (sample)The sensor data in 6.4 second divided to delivery
317 ///        - 1st message(sensor counter, reverse signal, gyro temperature=10 number, gyro output(X axis), gyro output(Y axis), gyro output(Z axis), speed pulse, \n
318 ///          Gsensor output(X axis), Gsensor output(Y axis), Gsensor output(Z axis)=100 number, pulse time=320 number), divided  \n
319 ///          partition count=7, divided partition No=1)
320 ///        - 2nd message(sensor counter, reverse signal, gyro temperature=10 number, gyro output(X axis), gyro output(Y axis), gyro output(Z axis), speed pulse, \n
321 ///          Gsensor output(X axis), Gsensor output(Y axis), Gsensor output(Z axis)=100 number, pulse time=320 number), divided  \n
322 ///          partition count=7, divided partition No=2)
323 ///        - 3rd message(sensor counter, reverse signal, gyro temperature=10 number, gyro output(X axis), gyro output(Y axis), gyro output(Z axis), speed pulse, \n
324 ///          Gsensor output(X axis), Gsensor output(Y axis), Gsensor output(Z axis)=100 number, pulse time=320 number), divided  \n
325 ///          partition count=7,divided partition No=3)
326 ///        - 4th message(sensor counter, reverse signal, gyro temperature=10 number, gyro output(X axis), gyro output(Y axis), gyro output(Z axis), speed pulse, \n
327 ///          Gsensor output(X axis), Gsensor output(Y axis), Gsensor output(Z axis)=100 number, pulse time=320 number), divided  \n
328 ///          partition count=7,divided partition No=4)
329 ///        - 5th message(sensor counter, reverse signal, gyro temperature=10 number, gyro output(X axis), gyro output(Y axis), gyro output(Z axis), speed pulse, \n
330 ///          Gsensor output(X axis), Gsensor output(Y axis), Gsensor output(Z axis)=100 number, pulse time=320 number), divided  \n
331 ///          partition count=7,divided partition No=5)
332 ///        - 6th message(sensor counter, reverse signal, gyro temperature=10 number, gyro output(X axis), gyro output(Y axis), gyro output(Z axis), speed pulse, \n
333 ///          Gsensor output(X axis), Gsensor output(Y axis), Gsensor output(Z axis)=100 number, pulse time=320 number), divided  \n
334 ///          partition count=7,divided partition No=6)
335 ///        - 7th message(sensor counter, reverse signal, gyro temperature=4 number, gyro output(X axis), gyro output(Y axis), gyro output(Z axis), speed pulse, \n
336 ///          Gsensor output(X axis), Gsensor output(Y axis), Gsensor output(Z axis)=40 number, pulse time=128 number), divided  \n
337 ///          partition count=7,divided partition No=7)
338 ///
339 /// \~english @par
340 ///        - Please note the following points when use this API.
341 ///        - Duplication registering
342 ///        - The same destination thread name has already been registered
343 ///        - The registered delivery data updated and normal return.(first delivery)
344 ///        - To one delivery destination, the same data will not be duplication deliveried at same timing.
345 ///        - After delivery the sensor data accumulated in 6.4 second(first delivery), the sensor data \n
346 ///          will not be accumulated any more. So the same data will be deliveried as first \n
347 ///          delivery when registered again.
348 ///        - This API is only called by Navi proxy.
349 ///        - After call this API, if the delivery destination thread name is changed, please call this API again.
350 ///
351 /// \~english @par
352 ///          message structure
353 ///        - After success to register, vehicle sensor will send message as system API message with following format.
354 ///          Command ID : @ref CID_POSIF_REGISTER_LISTENER_PKG_SENSOR_DATA \n
355 ///          Definition of structure
356 /// \~english @code
357 ///  #define  SENSOR_MSGBUF_DSIZE        4096  /* max size of message body */
358 ///  #define  SENSOR_VSHEAD_DSIZE        36  /* vehicle sensor header size(1+3+16*2) */
359 ///  #define  SENSOR_PKG_DELIVERY_MAX        16  /* max number of Data ID in package */
360 ///  #define  SENSOR_VSINFO_DSIZE    (SENSOR_MSGBUF_DSIZE - SENSOR_VSHEAD_DSIZE)
361 ///  typedef struct {
362 ///    uint8_t    ucDNum;          /* number of data */
363 ///    uint8_t    ucDataBreak;        /* data missing information */
364 ///    uint8_t    ucDivideCnt;        /* divided partition count */
365 ///    uint8_t    ucDivideSendCnt;      /* divided partition No. */
366 ///    uint16_t  usOffset[SENSOR_PKG_DELIVERY_MAX];  /* offset */
367 ///    uint8_t    ucData[SENSOR_VSINFO_DSIZE];    /* vehicle sensor data */
368 ///  } SENSOR_PKG_MSG_VSINFO;
369 /// @endcode
370 ///        - number of data \n
371 ///          Data number in package
372 ///        - data missing information \n
373 ///          VEHICLE_SNS_BREAK:not continuous data \n
374 ///          VEHICLE_SNS_NORMAL:continuous data
375 ///        - divided partition count \n
376 ///          All divided partition count \n
377 ///          If it is more than 1, data divided to delivery
378 ///        - divided partition No. \n
379 ///          The No. of the divided partition. If it equal to the divided partition count, \n
380 ///          that meanings this message is the last divided partition of the package.
381 ///        - offset \n
382 ///          The array of the offset from the head of vehicle sensor data
383 ///        - vehicle sensor data
384 ///        - Data ID(4Byte)
385 ///        - Data size(2Byte)
386 ///        - reception flag(1Byte)
387 ///        - If the data get from CAN, direct line, GPS, set to 0x01
388 ///        - If data has not been received, set to 0x00
389 ///        - reserve(1Byte)\n
390 ///        - Data body is cycle fit with the packaged data.
391 ///
392 /// \~english @par Classification
393 ///        - Public
394 ///
395 /// \~english @par Type
396 ///        - Method
397 ///
398 /// \~english @see
399 ///        - POS_RegisterListenerSensData, POS_GetSensData
400 ///
401 ////////////////////////////////////////////////////////////////////////////////////////////
402 SENSOR_RET_API  POS_RegisterListenerPkgSensData(HANDLE hApp, PCSTR  notifyName, uint8_t  ucPkgNum, DID    *pulDid,
403                                             uint8_t  ucCtrlFlg, uint8_t  ucDeliveryTiming);
404
405 ////////////////////////////////////////////////////////////////////////////////////////////
406 /// \ingroup tag_Positioning
407 /// \~english @par Brief
408 ///        - Register sensor data delivery.
409 ///
410 /// \~english @param [in] hApp
411 ///        - HANDLE - App Handle
412 /// \~english @param [in] notifyName
413 ///        - PCSTR - Destination thread name
414 /// \~english @param [in] ulDid
415 ///        - DID - Data ID of vehicle info
416 /// \~english @param [in] ucCtrlFlg
417 ///        - uint8_t - Delivery control flag(register)
418 /// \~english @param [in] ucDeliveryTiming
419 ///        - uint8_t - Delivery timing(change/update)
420 ///
421 /// \~english @par
422 ///        - Data ID of vehicle info(ulDid) \n
423 ///
424 /// \~english @par
425 ///        - Note:The Gsensor output is 0 in the environment without Gsensor hardware.
426 /// \~english @par
427 ///        - Delivery control flag(ucCtrlFlg)
428 ///        - SENSOR_DELIVERY_REGIST - register
429 ///        - Register specified LonLat delivery
430 ///        - Please note that if the same data delivery has been registered for multiple times, \n
431 ///          the data will also be deliveried for registered multiple times.
432 ///        - The specified LonLat will be deliveried at register time no matter what delivery  \n
433 ///          timing has been registered (first delivery).
434 ///        - Delivery timing(ucDeliveryTiming)
435 ///        - SENSOR_DELIVERY_TIMING_CHANGE - change  Specified LonLat be deliveried only when it is changed.
436 ///        - SENSOR_DELIVERY_TIMING_UPDATE - update  Specified Lonlat be deliveried  \n
437 ///          as long as it is updated by vehicle sensor.
438 ///
439 /// \~english @retval SENSOR_RET_NORMAL normal end
440 /// \~english @retval SENSOR_RET_ERROR_CREATE_EVENT event create failed
441 /// \~english @retval SENSOR_RET_ERROR_PARAM parameter error
442 /// \~english @retval SENSOR_RET_ERROR_INNER internal error
443 /// \~english @retval SENSOR_RET_ERROR_NOSUPPORT unsupported
444 /// \~english @retval SENSOR_RET_ERROR_RESOURCE lack of resource
445 ///
446 /// \~english @par Precondition
447 ///        - The creation/initialization(FrameworkunifiedCreateDispatcherWithoutLoop and etc.) \n
448 ///          of the Dispatcher for App are completed.
449 ///        - Availability of service positioning is TRUE.
450 ///
451 /// \~english @par change of internal status
452 ///        - There is no change of internal status
453 ///
454 /// \~english @par Failure condition
455 ///        - The parameter ucDeliveryTiming is neither update \n
456 ///          (SENSOR_DELIVERY_TIMING_UPDATE) nor change(SENSOR_DELIVERY_TIMING_CHANGE) [SENSOR_RET_ERROR_PARAM]
457 ///        - The parameter ucCtrlFlg is not register(SENSOR_DELIVERY_REGIST) [SENSOR_RET_ERROR_PARAM]
458 ///        - The parameter hApp is NULL [SENSOR_RET_ERROR_PARAM]
459 ///        - The parameter notifyName is NULL [SENSOR_RET_ERROR_PARAM]
460 ///        - The parameter ulDID is not avaliable value [SENSOR_RET_ERROR_PARAM]
461 ///        - The parameter ulDID is a value can not specified [SENSOR_RET_ERROR_PARAM]
462 ///        - The count of message in message queue is reach to max [SENSOR_RET_ERROR_RESOURCE]
463 ///        - The count of mutex is reach to max [SENSOR_RET_ERROR_RESOURCE]
464 ///        - The count of item in ProcessName-ProcessNo convert table is reach to \n
465 ///          max [SENSOR_RET_ERROR_RESOURCE]
466 ///        - The event has been registered in event table and created in same process, \n
467 ///          but the count of reference is reach to max [SENSOR_RET_ERROR_CREATE_EVENT]
468 ///        - The event has been registered in event table and created in system, but the count \n
469 ///          of reference is reach to max  [SENSOR_RET_ERROR_CREATE_EVENT]
470 ///        - The event has been registered in event table, but memory for the thread event table \n
471 ///          creation allocate falied. [SENSOR_RET_ERROR_CREATE_EVENT]
472 ///        - The event has been registered in event table, but the thread can not be registered \n
473 ///          in event table. [SENSOR_RET_ERROR_CREATE_EVENT]
474 ///        - The event has been registered in event table, but memory for thread table creation \n
475 ///          allocate falied. [SENSOR_RET_ERROR_CREATE_EVENT]
476 ///        - The event has been registered in event table, and the event flag has already been \n
477 ///          registered. [SENSOR_RET_ERROR_CREATE_EVENT]
478 ///        - The event has been registered in event table, and the event flag register failed. \n
479 ///          [SENSOR_RET_ERROR_CREATE_EVENT]
480 ///        - No empty field for registering the event HANDLE into event table. [SENSOR_RET_ERROR_CREATE_EVENT]
481 ///        - Memory for event HANDLE get failed. [SENSOR_RET_ERROR_CREATE_EVENT]
482 ///        - The event has not been registered in event table and not finished registering \n
483 ///          [SENSOR_RET_ERROR_CREATE_EVENT]
484 ///        - The event has not been registered in event table, and memory for thread table \n
485 ///          creation allocate falied. [SENSOR_RET_ERROR_CREATE_EVENT]
486 ///        - The event has not been registered in event table, and the event flag has already \n
487 ///          been registered. [SENSOR_RET_ERROR_CREATE_EVENT]
488 ///        - The event has not been registered in event table, and the event flag register \n
489 ///          failed. [SENSOR_RET_ERROR_CREATE_EVENT]
490 ///        - ProcessNo has not been registered in message control table when message transfered \n
491 ///          in process. [SENSOR_RET_ERROR_INNER]
492 ///        - Message transfer HANDLE get failed when message transfered in process. [SENSOR_RET_ERROR_INNER]
493 ///        - Message transfer failed in process. [SENSOR_RET_ERROR_INNER]
494 ///        - The destination process name is NULL. [SENSOR_RET_ERROR_INNER]
495 ///        - The destination process name size is larger than 20 characters when message \n
496 ///          transfer between process. [SENSOR_RET_ERROR_INNER]
497 ///        - The message queue name has not been registered in control table when message \n
498 ///          transfer between process. [SENSOR_RET_ERROR_INNER]
499 ///        - Message transfer HANDLE create failed when message transfered between process. [SENSOR_RET_ERROR_INNER]
500 ///        - Message transfer HANDLE get failed from internal table when message transfered \n
501 ///          between process. [SENSOR_RET_ERROR_INNER]
502 ///        - Message transfer failed between process. [SENSOR_RET_ERROR_INNER]
503 ///        - Specified event HANDLE has not been registered in event HANDLE table during waiting \n
504 ///          event. [SENSOR_RET_ERROR_CREATE_EVENT]
505 ///        - The count of thread is reach to max in event management table during waiting \n
506 ///          event. [SENSOR_RET_ERROR_CREATE_EVENT]
507 ///        - The EV_FLAG_BIT is not set in flagID during getting event. [SENSOR_RET_ERROR_CREATE_EVENT]
508 ///        - The ID of message event queue has not been created during getting event. [SENSOR_RET_ERROR_CREATE_EVENT]
509 ///        - The flagID has not been registered during getting event. [SENSOR_RET_ERROR_CREATE_EVENT]
510 ///        - The interruption happened during getting event [SENSOR_RET_ERROR_CREATE_EVENT]
511 ///        - Whatever error happened during getting event. [SENSOR_RET_ERROR_CREATE_EVENT]
512 ///
513 /// \~english @par Detial
514 ///        - Call this API to register vehicle sensor data delivery. \n
515 ///          This API return the result of registering.
516 ///
517 /// \~english @par
518 ///          Please note the following points when use this API.
519 ///        - Duplication registering
520 ///        - The same destination thread name has already been registered
521 ///        - The registered delivery data updated and normal return.(first delivery)
522 ///        - To one delivery destination, the same data will not be duplication deliveried at same timing.
523 ///        - After call this API, if the delivery destination thread name is changed, please call this API again.
524 ///
525 /// \~english @par
526 ///        message structure
527 ///        - After success to register, vehicle sensor will send message as system API message with following format.
528 ///        - If the register successed, certainly delivery first data. And then delivery data according to
529 ///          the delivery timing. \n
530 ///          Command ID : @ref CID_POSIF_REGISTER_LISTENER_SENSOR_DATA \n
531 ///
532 /// \~english @code
533 ///     #define  SENSOR_MSG_VSINFO_DSIZE  1904      /* max size of message body */
534 ///     typedef struct
535 ///     {
536 ///       DID       did;         /* data ID */
537 ///       uint16_t  size;        /* data size of vehicle sensor data */
538 ///       uint8_t   rcvFlag;     /* reception flag */
539 ///       uint8_t   reserve;     /* reserve */
540 ///       uint8_t   data[SENSOR_MSG_VSINFO_DSIZE];  /* vehicle sensor data */
541 ///     } SENSOR_MSG_VSINFO;
542 /// @endcode
543 ///        - reception flag(1Byte)
544 ///        - If the data get from CAN or direct line, set to 0x01
545 ///        - If data has not been received, set to 0x00
546 ///
547 /// \~english @par Classification
548 ///        - Public
549 ///
550 /// \~english @par Type
551 ///        - Method
552 ///
553 /// \~english @see
554 ///        - POS_RegisterListenerPkgSensData, POS_GetSensData
555 ///
556 ////////////////////////////////////////////////////////////////////////////////////////////
557 SENSOR_RET_API  POS_RegisterListenerSensData(HANDLE  hApp, PCSTR  notifyName, DID ulDid, uint8_t ucCtrlFlg,
558                                             uint8_t  ucDeliveryTiming);
559
560 ////////////////////////////////////////////////////////////////////////////////////////////
561 /// \ingroup tag_Positioning
562 /// \~english @par Brief
563 ///        - Get vehicle sensor data.
564 ///
565 /// \~english @param [in] hApp
566 ///        - HANDLE - App Handle
567 /// \~english @param [in] ulDid
568 ///        - DID - Data ID of vehicle info
569 /// \~english @param [out] pDestData
570 ///        - void* - pointer of buffer for storing vehicle sensor data
571 /// \~english @param [in] usDestSize
572 ///        - uint16_t - vehicle sensor data buffer size
573 ///
574 /// \~english @par
575 ///        - Data ID of vehicle info(ulDid)
576 ///        - POS_DID_SPEED_PULSE - speed pulse(count of pulse)
577 ///        - POS_DID_GYRO_X - gyro output (X axis)
578 ///        - POS_DID_GYRO_Y - gyro output (Y axis)
579 ///        - POS_DID_GYRO_Z - gyro output (Z axis)
580 ///        - POS_DID_GSNS_X - Gsensor output (X axis)
581 ///        - POS_DID_GSNS_Y - Gsensor output (Y axis)
582 ///        - POS_DID_GSNS_Z - Gsensor output (Z axis)
583 ///        - POS_DID_GPS_ANTENNA - GPS antenna connection status
584 ///        - POS_DID_GPS__CWORD82__NMEA - GPS NMEA(_CWORD82_)
585 ///        - POS_DID_GPS__CWORD82__FULLBINARY - GPS _CWORD82_ full binary(_CWORD82_)
586 ///        - POS_DID_GPS_NMEA - GPS NMEA
587 ///        - POS_DID_GYRO_TEMP - gyro temperature
588 ///        - POS_DID_GPS_CLOCK_DRIFT - GPS clock drift
589 ///        - POS_DID_GPS_CLOCK_FREQ - GPS clock frequency
590 ///        - The avaliable data ID of each hardware type is as following.
591 /// \~english @par
592 ///        - Because positioning is G/W between Navi and HAL, value depends on the design of HAL.
593 /// \~english @par
594 ///        - Note:The Gsensor output is 0 in the environment without Gsensor hardware.
595 ///        - vehicle sensor data buffer size(usDestSize) \n
596 ///          Please note it is the size of output buffer, not the size of data.
597 ///
598 /// \~english @retval more than 0  data size
599 /// \~english @retval POS_RET_ERROR_CREATE_EVENT event create failed
600 /// \~english @retval POS_RET_ERROR_OUTOF_MEMORY share memory guarantee failed
601 /// \~english @retval POS_RET_ERROR_PARAM parameter error
602 /// \~english @retval POS_RET_ERROR_SIZE buffer size error
603 /// \~english @retval POS_RET_ERROR_INNER internal error
604 /// \~english @retval POS_RET_ERROR_NOSUPPORT unsupported
605 /// \~english @retval POS_RET_ERROR_RESOURCE lack of resource
606 ///
607 /// \~english @par Precondition
608 ///        - The creation/initialization(FrameworkunifiedCreateDispatcherWithoutLoop and etc.) \n
609 ///          of the Dispatcher for App are completed.
610 ///        - Availability of service positioning is TRUE.
611 ///
612 /// \~english @par change of internal status
613 ///        - There is no change of internal status
614 ///
615 /// \~english @par Failure condition
616 ///        - The parameter hApp is NULL [POS_RET_ERROR_PARAM]
617 ///        - The parameter pDestData is NULL [POS_RET_ERROR_PARAM]
618 ///        - The parameter ulDid is not avaliable value in current hardware environment [POS_RET_ERROR_PARAM]
619 ///        - The count of message in message queue is reach to max [POS_RET_ERROR_RESOURCE]
620 ///        - The count of mutex is reach to max [POS_RET_ERROR_RESOURCE]
621 ///        - The count of item in ProcessName-ProcessNo convert table is reach to max [POS_RET_ERROR_RESOURCE]
622 ///        - The event is created in same process, but the count of reference is reach to max \n
623 ///          [POS_RET_ERROR_CREATE_EVENT]
624 ///        - The event is created in system, but the count of reference is reach to max  [POS_RET_ERROR_CREATE_EVENT]
625 ///        - Memory allocate falied during the event table creation for \n
626 ///          event registering. [POS_RET_ERROR_CREATE_EVENT]
627 ///        - The thread can not register in the event table. [POS_RET_ERROR_CREATE_EVENT]
628 ///        - Memory allocate failed in event table during the thread table creation. [POS_RET_ERROR_CREATE_EVENT]
629 ///        - After register the thread table in event table, the event flag has already \n
630 ///          been registered. [POS_RET_ERROR_CREATE_EVENT]
631 ///        - After register the thread table in event table, the event flag register \n
632 ///          failed. [POS_RET_ERROR_CREATE_EVENT]
633 ///        - The event table is full during event creation. [POS_RET_ERROR_CREATE_EVENT]
634 ///        - The memory for event HANDLE allocate failed during event table creation. [POS_RET_ERROR_CREATE_EVENT]
635 ///        - The thread can not be registered in event table. [POS_RET_ERROR_CREATE_EVENT]
636 ///        - In event table, to allocate the memory of the thread table creation, \n
637 ///          but failed. [POS_RET_ERROR_CREATE_EVENT]
638 ///        - After register the thread in event table, the event flag has already been \n
639 ///          registered. [POS_RET_ERROR_CREATE_EVENT]
640 ///        - After register the thread in event table, the event flag register failed. [POS_RET_ERROR_CREATE_EVENT]
641 ///        - Specified event ID has not been registered in table. [POS_RET_ERROR_CREATE_EVENT]
642 ///        - Initialize event object failed. [POS_RET_ERROR_CREATE_EVENT]
643 ///        - There is no empty field in semaphore table for semaphore creation [POS_RET_ERROR_OUTOF_MEMORY]
644 ///        - The memory for storing semaphore control data allocate failed. [POS_RET_ERROR_OUTOF_MEMORY]
645 ///        - Specified semaphore ID has not been registered when semaphore lock. [POS_RET_ERROR_OUTOF_MEMORY]
646 ///        - Internal mutex HANDLE is NULL when mutex lock. [POS_RET_ERROR_OUTOF_MEMORY]
647 ///        - Internal mutex HANDLE has not been registered in mutex table when mutex lock. [POS_RET_ERROR_OUTOF_MEMORY]
648 ///        - The owner of specified mutex is not itself when mutex lock. [POS_RET_ERROR_OUTOF_MEMORY]
649 ///        - Mutex has been multiple locked [POS_RET_ERROR_OUTOF_MEMORY]
650 ///        - The HANDLE is NULL when getting usable share memory address. [POS_RET_ERROR_OUTOF_MEMORY]
651 ///        - Can not get usable share memory address. [POS_RET_ERROR_OUTOF_MEMORY]
652 ///        - Memory allocate failed for share memory map. [POS_RET_ERROR_OUTOF_MEMORY]
653 ///        - Memory allocate failed for share memory management. [POS_RET_ERROR_OUTOF_MEMORY]
654 ///        - Can not open share memory. [POS_RET_ERROR_OUTOF_MEMORY]
655 ///        - Failed to mapping share memory. [POS_RET_ERROR_OUTOF_MEMORY]
656 ///        - No empty field in share memory. [POS_RET_ERROR_OUTOF_MEMORY]
657 ///        - ProcessNo has not been registered in message control table when message \n
658 ///          transfered between processes. [POS_RET_ERROR_CREATE_EVENT]
659 ///        - Message transfer HANDLE get failed when message transfered between processes. [POS_RET_ERROR_CREATE_EVENT]
660 ///        - Message transfer failed between processes. [POS_RET_ERROR_CREATE_EVENT]
661 ///        - The destination process name size is larger than 20 characters when message \n
662 ///          transfer between processes. [POS_RET_ERROR_CREATE_EVENT]
663 ///        - The message queue name has not been registered in control table when message \n
664 ///          transfer between processes. [POS_RET_ERROR_CREATE_EVENT]
665 ///        - Message transfer HANDLE create failed when message transfered between processes. \n
666 ///          [POS_RET_ERROR_CREATE_EVENT]
667 ///        - Message transfer HANDLE get failed from internal table when message transfered \n
668 ///          between processes. [POS_RET_ERROR_CREATE_EVENT]
669 ///        - Message transfer failed between processes. [POS_RET_ERROR_CREATE_EVENT]
670 ///        - Specified event HANDLE has not been registered in event HANDLE table during \n
671 ///          event waiting. [POS_RET_ERROR_INNER]
672 ///        - The count of thread is reach to max in event management table during event waiting. [POS_RET_ERROR_INNER]
673 ///        - The EV_FLAG_BIT is not set in flagID during event waiting. [POS_RET_ERROR_INNER]
674 ///        - The ID of message event queue has not been created during event waiting. [POS_RET_ERROR_INNER]
675 ///        - The flagID has not been registered during event waiting. [POS_RET_ERROR_INNER]
676 ///        - The interruption happened during event waiting [POS_RET_ERROR_INNER]
677 ///        - Whatever error happened during event waiting. [POS_RET_ERROR_INNER]
678 ///        - The EV_FLAG_BIT is not set in flagID during getting event. [POS_RET_ERROR_INNER]
679 ///        - The ID of message event queue has not been created during getting event. [POS_RET_ERROR_INNER]
680 ///        - The flagID has not been registered during getting event. [POS_RET_ERROR_INNER]
681 ///        - The interruption happened during getting event [POS_RET_ERROR_INNER]
682 ///        - Whatever error happened during getting event. [POS_RET_ERROR_INNER]
683 ///        - The HANDLE is NULL when getting usable share memory address for accessing \n
684 ///          received data. [POS_RET_ERROR_OUTOF_MEMORY]
685 ///        - Can not get usable share memory address for accessing received data. [POS_RET_ERROR_OUTOF_MEMORY]
686 ///        - Memory for share memory map allocate failed for accessing received data. [POS_RET_ERROR_OUTOF_MEMORY]
687 ///        - Memory for share memory management allocate failed for accessing received \n
688 ///          data. [POS_RET_ERROR_OUTOF_MEMORY]
689 ///        - Can not open share memory for accessing received data. [POS_RET_ERROR_OUTOF_MEMORY]
690 ///        - Failed to mapping share memory for accessing received data. [POS_RET_ERROR_OUTOF_MEMORY]
691 ///        - Can not get share memory normally [POS_RET_ERROR_OUTOF_MEMORY]
692 ///        - The size of data stored in share memory is larger than the size of received data. [POS_RET_ERROR_SIZE]
693 ///
694 /// \~english @par Detial
695 ///        - Call this API to get vehicle sensor data. \n
696 ///          This vehicle sensor data stored in the output buffer of the parameter, this API return.
697 ///
698 /// \~english @par Classification
699 ///        - Public
700 ///
701 /// \~english @par Type
702 ///        - Sync
703 ///
704 /// \~english @see
705 ///        - POS_RegisterListenerPkgSensData, POS_RegisterListenerSensData
706 ///
707
708 POS_RET_API POS_GetSensData(HANDLE hApp, DID ulDid, void *pDestData, uint16_t usDestSize);
709
710 #ifdef __cplusplus
711 }
712 #endif
713 /** @}*/  // end of positioning
714 /** @}*/  // end of vehicle_service
715 /** @}*/  // end of BaseSystem
716 #endif  // POSITIONING_CLIENT_INCLUDE_VEHICLE_SERVICE_POS_SENSOR_API_H_