Re-organized sub-directory by category
[staging/basesystem.git] / service / vehicle / positioning_base_library / library / include / vehicle_service / WPF_STD.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
17 #ifndef POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_VEHICLE_SERVICE_WPF_STD_H_
18 #define POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_VEHICLE_SERVICE_WPF_STD_H_
19
20 /**
21  * @file WPF_STD.h
22  * @brief Header file for system standard definitions
23  */
24
25 /** @addtogroup BaseSystem
26  *  @{
27  */
28 /** @addtogroup vehicle_service
29  *  @ingroup BaseSystem
30  *  @{
31  */
32 /** @addtogroup positioning_base_library
33  *  @ingroup vehicle_service
34  *  @{
35  */
36
37 /*---------------------------------------------------------------------------------*
38  * Incluce                                                                         *
39  *---------------------------------------------------------------------------------*/
40 #include <string.h>
41 #include <stdlib.h>
42 #include <limits.h>
43 #include <unistd.h>
44 #include <pthread.h>
45 #include <wchar.h>
46 #include <sys/prctl.h>
47 #include <sys/stat.h>
48 #include <native_service/wpf_legacy.h>
49 #include <vehicle_service/std_types.h>
50 #include <vehicle_service/pos_message_header.h>
51 #include <vehicle_service/sys_timerapi.h>
52 #include <vehicle_service/positioning_positioningbaselibrarylog.h>
53
54 /*---------------------------------------------------------------------------------*
55  * Definition                                                                      *
56  *---------------------------------------------------------------------------------*/
57 #define POS_THREAD_NAME "Positioning"    //!< \~english Positioning thread name
58
59 #ifdef  UNICODE
60 #define __TEXT(quote)     L##quote
61 #else    /* UNICODE */
62 #define __TEXT(quote)    (quote)         /* r_winnt */
63 #endif    /* UNICODE */
64
65 #define D_LTEXT(x)  __TEXT(x)
66 #define LTEXT(x)    D_LTEXT(x)
67
68 #define DEBUG_DUMP_MAX_SIZE 4096
69 //!< \~english FrameworkunifiedOnDebugDump max size
70
71 /* Sensor Log Type */
72 #define POS_SENSLOG_TYPE_NONE 0        //!< \~english sensor log type NONE
73 #define POS_SENSLOG_TYPE_SYS  1        //!< \~english sensor log type SYS
74 #define POS_SENSLOG_TYPE_GPS  2        //!< \~english sensor log type GPS
75 #define POS_SENSLOG_TYPE_NAV  3        //!< \~english sensor log type NAV
76 #define POS_SENSLOG_TYPE_CMD  4        //!< \~english sensor log type CMD
77
78 #define POS_SENSLOG_GET_ZONE(typ) \
79     (((typ) == (POS_SENSLOG_TYPE_SYS))?(ZONE_POS_SYS_IN):\
80      ((typ) == (POS_SENSLOG_TYPE_GPS))?(ZONE_POS_GPS_IN):\
81      ((typ) == (POS_SENSLOG_TYPE_NAV))?(ZONE_POS_NAV_IN):\
82      ((typ) == (POS_SENSLOG_TYPE_CMD))?(ZONE_POS_CMD_IN):\
83      (0))
84 //!< \~english get sensor log zone code
85
86 #define POS_WRITE_SENSLOG(zone, data, len) (((zone) != (0))?((void)((FRAMEWORKUNIFIEDLOG_DATA(zone, data, len)))):((void)(0)))
87 //!< \~english write sensor log output
88 #define POS_SENSLOG(typ, data, len) (POS_WRITE_SENSLOG(POS_SENSLOG_GET_ZONE(typ), data, len))
89
90 /* HW configuration type */
91 /*
92  *  Note.
93  *  This feature needs to be defined by the vendor.
94  */
95 #define UNIT_TYPE_NONE          0x00000000UL    //!< \~english type none
96 #define UNIT_TYPE_UNKNOWN       0x00000001UL    //!< \~english type unknown
97 #define UNIT_TYPE_GRADE1        0x00000002UL    //!< \~english type Grade1
98 #define UNIT_TYPE_GRADE2        0x00000004UL    //!< \~english type Grade2 
99
100 #define MAX_NAME_LEN            32              //!< \~english name max length
101 #define _CWORD31__NO_SIZE       16              //!< \~english _CWORD31_ No size
102 #define RESERVE1_SIZE           16              //!< \~english reserve 1
103 #define HELPNET_ID_SIZE         21              //!< \~english helpnet ID size
104 #define RESERVE2_SIZE           11              //!< \~english reserve 2
105 #define DATE_SIZE               32              //!< \~english make time size
106 #define SERIAL_NO_SIZE          3               //!< \~english serial No size
107 #define PRODUCT_NAME_SIZE       1               //!< \~english product name size
108
109 #define _pb_memcpy                      memcpy
110 #define _pb_memset                      memset
111
112 /*  RET_API define */
113 #define  RET_NORMAL    0        //!< \~english normal return
114 #define RET_ERROR   (-1)        //!< \~english error return
115 #define RET_ERRPARAM  (-2)      //!< \~english parameter error
116
117 #define SAPI_EVSET_ABSOLUTE 1   //!< \~english absolute vale set
118 #define SAPI_EVWAIT_VAL     1   //!< \~english event wait value set
119
120 /* sys common commandID definition */
121 #define    CID_GPS_BASE      (CID)0xF030
122 //!< \~english GPS
123
124 #define    CID_TIMER_BASE    (CID)0xF040
125 //!< \~english timer management
126
127 #define    CID_INITIAL_BASE  (CID)0xF100
128 //!< \~english initial
129
130 /* ResourceManager/CID definition */
131 #define CID_GPS_SERIAL0   (CID)0x0100
132 //!< \~english GPS reset request func definition
133
134 #define CID_GPS_REQRESET  (CID)(CID_GPS_BASE | CID_GPS_SERIAL0)
135 //!< \~english GPS reset request CID
136
137
138 /* sys common commandID detail definition */
139 #define    CID_COM_SERIAL4   (CID)0x0004
140 //!< \~english serial command ID 4
141
142 #define    CID_COM_SERIAL6   (CID)0x0006
143 //!< \~english serial command ID 6
144
145 #define    CID_COM_SERIAL7   (CID)0x0007
146 //!< \~english serial command ID 7
147
148 /* initial CID definition */
149 #define  CID_INI_SYSTEMERR        (CID)(CID_INITIAL_BASE | CID_COM_SERIAL6)
150 //!< \~english system abnormality notify
151
152 #define CID_INI_INTERNAL_ACCOFF_START  (CID)(CID_INITIAL_BASE | CID_COM_SERIAL7)
153 //!< \~english internal ACC-OFF start Indication
154
155 /* timer control CID definition */
156 #define  CID_TIMER_TOUT        (CID)(CID_TIMER_BASE | CID_COM_SERIAL4)
157 //!< \~english timeout notify
158
159
160 /* PNO definition */
161 #define     PNO_NONE                         0x0000  //!< \~english initial value
162
163 #define     PNO__CWORD88___CWORD23_                  0x0100
164 //!< \~english _CWORD23_ primary thread
165 #define     PNO_GINI_MAIN                    0x0300
166 //!< \~english G initial
167 #define     PNO_CLK_GPS                      0x0316
168 //!< \~english clock GPS thread
169 #define     PNO_VEHICLE_SENSOR               0x0363
170 //!< \~english vehicle sensor thread
171 #define     PNO_LINE_SENS_DRV                0x0364
172 //!< \~english line sensor driver thread
173 #define     PNO_NAVI_GPS_MAIN                0x0440
174 //!< \~english GPS communication manager thread
175 #define     PNO_NAVI_GPS_RCV                 0x0441
176 //!< \~english GPS receive thread
177 #define     PNO__CWORD83_                          0x0900
178 //!< \~english _CWORD83_(Intersystem Communication Message)thread
179
180 #define     SYS_PNO_MIN                      PNO__CWORD88___CWORD23_
181 //!< \~english minimum PNO.(normal process)
182 #define     SYS_PNO_MAX                      PNO__CWORD83_
183 //!< \~english maximum PNO.(normal process)
184
185 /*---------------------------------------------------------------------------------*
186  * Typedef declaration                                                             *
187  *---------------------------------------------------------------------------------*/
188 typedef u_int32            EventID;
189 typedef int32              RET_API;   //!< \~english _CWORD64_API return code
190 typedef u_int32            event_id;
191 typedef event_id           SemID;     //!< \~english semaphore ID
192 typedef u_int16            CID;       //!< \~english command ID
193
194 typedef uint32_t           UNIT_TYPE;    //!< \~english unit type data type define
195 typedef int32              ANA_RET_API;
196
197 typedef char               TCHAR;
198
199 /**
200  * @enum _RcvMsgMode
201  * \~english  mode of receive message
202  */
203 typedef enum {
204     RM_WAIT,       //!< \~english wait until received message
205     RM_CHECKRCV    //!< \~english do not wait message, return
206 } _RcvMsgMode;
207
208 /**
209  * @enum
210  * \~english definition of event reset mode
211  */
212 enum {
213     _CWORD64_EVENT_MANUALRESET_OFF = 0,              //!< \~english manual reset off
214     _CWORD64_EVENT_MANUALRESET_ON,                   //!< \~english manual reset on
215     _CWORD64_EVENT_MANUALRESET_MAX                   //!< \~english manual reset max value
216 };
217
218
219 /*---------------------------------------------------------------------------------*
220  * Struct declaration                                                              *
221  *---------------------------------------------------------------------------------*/
222 /**
223  * @struct _SECURITY_ATTRIBUTES
224  * \~english security attribute
225  */
226 typedef struct _SECURITY_ATTRIBUTES {
227   DWORD nLength;                         //!< \~english length
228   LPVOID lpSecurityDescriptor;           //!< \~english data pointer
229   BOOL bInheritHandle;                   //!< \~english inherited handle
230 } SECURITY_ATTRIBUTES;
231 typedef SECURITY_ATTRIBUTES *PSECURITY_ATTRIBUTES;   //!< \~english security attribute
232 typedef SECURITY_ATTRIBUTES *LPSECURITY_ATTRIBUTES;  //!< \~english security attribute
233
234 /*---------------------------------------------------------------------------------*
235  * Prototype Declaration                                                           *
236  *---------------------------------------------------------------------------------*/
237
238 #ifdef __cplusplus
239 extern "C" {
240 #endif
241
242 ////////////////////////////////////////////////////////////////////////////////////////////
243 /// \ingroup positioning_base_library
244 /// \~english @par Brief
245 ///     - Create event by specified name
246 ///
247 /// \~english @param [in] ucManualReset
248 ///     - u_int8  manual reset mode
249 /// \~english @param [in] lInitData
250 ///     - int32  event value
251 /// \~english @param [in] cpEventName
252 ///     - char*  event name
253 ///
254 /// \~english @par
255 ///     - manual reset mode(ucManualReset)
256 ///       - _CWORD64_EVENT_MANUALRESET_OFF  manual reset OFF
257 ///       - _CWORD64_EVENT_MANUALRESET_ON  manual reset ON
258 ///
259 /// \~english @retval 0    event create failed
260 /// \~english @retval not 0 created event ID
261 ///
262 /// \~english @par Precondition
263 ///     - positioning_base_library initialization are completed \n
264 ///       (_pb_Setup_CWORD64_API has already been called) in current process.
265 ///
266 /// \~english @par changes of the internal status
267 ///     - There is no changes of the internal status by this API
268 ///
269 /// \~english @par Failure condition
270 ///     - The parameter cpEventName is NULL
271 ///     - The parameter ucManualReset is more than or equal _CWORD64_EVENT_MANUALRESET_MAX
272 ///     - The string of parameter cpEventName has no text
273 ///     - The string length of parameter cpEventName is longer than MAX_EVENT_NAME_LEN
274 ///     - The event is created in same process, but the count of thread reference to the event is reach to the max
275 ///     - The event is created in system, but the count of process reference to the event is reach to the max
276 ///     - Memory allocate failed for creating event table
277 ///     - During create the event table, the event flag register failed
278 ///     - The event table is full
279 ///
280 /// \~english @par Detail
281 ///     - Call this API to create event and return the created event ID.
282 ///        \n
283 ///
284 /// \~english @par Classification
285 ///        - Public
286 ///
287 /// \~english @par Type
288 ///        - Sync
289 ///
290 ////////////////////////////////////////////////////////////////////////////////////////////
291 EventID _pb_CreateEvent(u_int8 ucManualReset, int32 lInitData, char *cpEventName);
292
293 ////////////////////////////////////////////////////////////////////////////////////////////
294 /// \ingroup positioning_base_library
295 /// \~english @par Brief
296 ///     - Wait for the event specified by ID
297 ///
298 /// \~english @param [in] eventID
299 ///     - EventID  event ID
300 /// \~english @param [in] lWaitMode
301 ///     - int32  event wait mode
302 /// \~english @param [in] lMinVal
303 ///     - int32  event wait min value
304 /// \~english @param [in] lMaxVal
305 ///     - int32  event wait max value
306 /// \~english @param [out] plEventVal
307 ///     - int32*  event wait value output pointer
308 /// \~english @param [in] ulMillSecTime
309 ///     - u_int32  timeout time(ms)
310 ///
311 /// \~english @par
312 ///     - event wait mode(lWaitMode)
313 ///       - SAPI_EVWAIT_VAL
314 ///
315 /// \~english @retval RET_NORMAL  normal return
316 /// \~english @retval RET_EV_NONE parameter error or specified event not exist
317 /// \~english @retval RET_ERRTIMEOUT timeout
318 /// \~english @retval RET_ERROR   other error
319 ///
320 /// \~english @par Precondition
321 ///     - positioning_base_library initialization are completed \n
322 ///       (_pb_Setup_CWORD64_API has already been called) in current process.
323 ///
324 /// \~english @par changes of the internal status
325 ///     - There is no changes of the internal status by this API
326 ///
327 /// \~english @par Failure condition
328 ///     - The parameter plEventVal is NULL
329 ///     - The parameter eventID is more than MAX_PB_EVENTS
330 ///     - The specified event has not been registered in event table
331 ///     - The count of threads which is waiting this event is reach max
332 ///     - The parameter ulMillSecTime is 0
333 ///     - The parameter ulMillSecTime is INFINITE, and wait event flag failed
334 ///     - The parameter ulMillSecTime is not INFINITE, and timeout
335 ///     - The parameter ulMillSecTime is not INFINITE, and get event flag failed
336 ///
337 /// \~english @par Detail
338 ///     - Call this API to wait event.
339 ///     - This API will return after timeout or this event been set.
340 ///        \n
341 ///
342 /// \~english @par Classification
343 ///        - Public
344 ///
345 /// \~english @par Type
346 ///        - Sync
347 ///
348 ////////////////////////////////////////////////////////////////////////////////////////////
349 RET_API _pb_WaitEvent(EventID eventID, int32 lWaitMode, int32 lMinVal,
350                         int32 lMaxVal, int32* plEventVal, u_int32 ulMillSecTime);
351
352 ////////////////////////////////////////////////////////////////////////////////////////////
353 /// \ingroup positioning_base_library
354 /// \~english @par Brief
355 ///     - Set the value of event specified by ID
356 ///
357 /// \~english @param [in] eventID
358 ///     - EventID  event ID
359 /// \~english @param [in] lSetMode
360 ///     - int32  event value set mode
361 /// \~english @param [in] iVal
362 ///     - int32  event value
363 ///
364 /// \~english @par
365 ///     - event value set mode(lSetMode)
366 ///       - SAPI_EVSET_ABSOLUTE  absolute value set(set parameter value)
367 ///       - SAPI_EVSET_RELATE  offset set(offset of current value set)
368 ///
369 /// \~english @retval RET_NORMAL  normal return
370 /// \~english @retval RET_ERRPARAM  parameter error
371 /// \~english @retval RET_EV_NONE specified event not exist
372 ///
373 /// \~english @par Precondition
374 ///     - positioning_base_library initialization are completed \n
375 ///       (_pb_Setup_CWORD64_API has already been called) in current process.
376 ///
377 /// \~english @par changes of the internal status
378 ///     - There is no changes of the internal status by this API
379 ///
380 /// \~english @par Failure condition
381 ///     - The parameter eventID is more than MAX_PB_EVENTS
382 ///     - The specified event has not been registered in event table
383 ///     - The parameter lSetMode is neither SAPI_EVSET_ABSOLUTE nor SAPI_EVSET_RELATE
384 ///
385 /// \~english @par Detail
386 ///     - Call this API to set event value.
387 ///        \n
388 ///
389 /// \~english @par Classification
390 ///        - Public
391 ///
392 /// \~english @par Type
393 ///        - Fire and Forget
394 ///
395 ////////////////////////////////////////////////////////////////////////////////////////////
396 RET_API _pb_SetEvent(EventID eventID, int32 lSetMode, int32 lval);
397
398 ////////////////////////////////////////////////////////////////////////////////////////////
399 /// \ingroup positioning_base_library
400 /// \~english @par Brief
401 ///     - Destroy the event specified by ID
402 ///
403 /// \~english @param [in] eventID
404 ///     - EventID  event ID
405 ///
406 /// \~english @retval RET_NORMAL  normal return
407 /// \~english @retval RET_ERROR  event flag destroy failed
408 /// \~english @retval RET_EV_NONE specified event not exist
409 ///
410 /// \~english @par Precondition
411 ///     - positioning_base_library initialization are completed \n
412 ///     (_pb_Setup_CWORD64_API has already been called) in current process.
413 ///
414 /// \~english @par changes of the internal status
415 ///     - There is no changes of the internal status by this API
416 ///
417 /// \~english @par Failure condition
418 ///     - The parameter eventID is more than MAX_PB_EVENTS
419 ///     - The specified event has not been registered in event table
420 ///     - Event flag destroy failed
421 ///
422 /// \~english @par Detail
423 ///     - Call this API to destroy specified event.
424 ///        \n
425 ///
426 /// \~english @par Classification
427 ///        - Public
428 ///
429 /// \~english @par Type
430 ///        - Fire and Forget
431 ///
432 ////////////////////////////////////////////////////////////////////////////////////////////
433 RET_API _pb_DeleteEvent(EventID eventID);
434
435 ////////////////////////////////////////////////////////////////////////////////////////////
436 /// \ingroup positioning_base_library
437 /// \~english @par Brief
438 ///     - Initialization before call Base API(every process used Base API should call this API firstly).
439 ///
440 /// \~english @param [in] hApp
441 ///     - HANDLE  app Handle
442 ///
443 /// \~english @retval RET_NORMAL normal return
444 ///
445 /// \~english @par Precondition
446 ///     - The creation/initialization(FrameworkunifiedCreateDispatcherWithoutLoop and etc.) of the dispatcher for App are completed.
447 ///
448 /// \~english @par changes of the internal status
449 ///     - There is no changes of the internal status by this API
450 ///
451 /// \~english @par Detail
452 ///     - Call this API to initialize Base API.
453 ///     - Every process used Base API should call this API firstly.
454 ///        \n
455 ///
456 /// \~english @par Classification
457 ///        - Public
458 ///
459 /// \~english @par Type
460 ///        - Fire and Forget
461 ///
462 ////////////////////////////////////////////////////////////////////////////////////////////
463 RET_API _pb_Setup_CWORD64_API(HANDLE hApp);
464
465 ////////////////////////////////////////////////////////////////////////////////////////////
466 /// \ingroup positioning_base_library
467 /// \~english @par Brief
468 ///     - Terminate current thread.
469 ///
470 /// \~english @param [in] dwExitCode
471 ///     - DWORD  exit code(not used)
472 ///
473 /// \~english @retval None
474 ///
475 /// \~english @par Precondition
476 ///     - None
477 ///
478 /// \~english @par changes of the internal status
479 ///     - There is no changes of the internal status by this API
480 ///
481 /// \~english @par Detail
482 ///     - Call this API to terminate current thread.
483 ///        \n
484 ///
485 /// \~english @par Classification
486 ///        - Public
487 ///
488 /// \~english @par Type
489 ///        - Fire and Forget
490 ///
491 ////////////////////////////////////////////////////////////////////////////////////////////
492 VOID  _pb_ExitThread(DWORD dwExitCode);
493
494 ////////////////////////////////////////////////////////////////////////////////////////////
495 /// \ingroup positioning_base_library
496 /// \~english @par Brief
497 ///     - Create the message queue
498 ///
499 /// \~english @param [in] eventID
500 ///     - EventID  process No
501 ///
502 /// \~english @retval RET_NORMAL  normal return
503 /// \~english @retval RET_ERRPARAM  parameter error
504 ///
505 /// \~english @par Precondition
506 ///     - positioning_base_library initialization are completed \n
507 ///        (_pb_Setup_CWORD64_API has already been called) in current process.
508 ///
509 /// \~english @par changes of the internal status
510 ///     - There is no changes of the internal status by this API
511 ///
512 /// \~english @par Failure condition
513 ///     - The parameter pno is 0
514 ///     - The name length of thread called this API is longer than MAX_QUEUE_NAME_SIZE
515 ///
516 /// \~english @par Detail
517 ///     - Call this API to create the message queue.
518 ///        \n
519 ///
520 /// \~english @par Classification
521 ///        - Public
522 ///
523 /// \~english @par Type
524 ///        - Fire and Forget
525 ///
526 ////////////////////////////////////////////////////////////////////////////////////////////
527 RET_API _pb_CreateMsg(PNO pno);
528
529 ////////////////////////////////////////////////////////////////////////////////////////////
530 /// \ingroup positioning_base_library
531 /// \~english @par Brief
532 ///     - Send message in process
533 ///
534 /// \~english @param [in] pno
535 ///     - PNO  process No
536 /// \~english @param [in] size
537 ///     - u_int16  message size
538 /// \~english @param [in] msgbuf
539 ///     - void*  message buffer
540 /// \~english @param [in] mode
541 ///     - u_int16  not used
542 ///
543 /// \~english @retval RET_NORMAL  normal return
544 /// \~english @retval RET_ERRPARAM  parameter error
545 /// \~english @retval RET_ERROR  other error
546 ///
547 /// \~english @par Precondition
548 ///     - positioning_base_library initialization are completed \n
549 ///       (_pb_Setup_CWORD64_API has already been called) in current process.
550 ///
551 /// \~english @par changes of the internal status
552 ///     - There is no changes of the internal status by this API
553 ///
554 /// \~english @par Failure condition
555 ///     - The parameter msgbuf is NULL
556 ///     - The parameter pno is 0
557 ///     - The message queue specified by parameter pno has not been created
558 ///     - Get sender Handle failed
559 ///     - Send message failed
560 ///
561 /// \~english @par Detail
562 ///     - Call this API to send message in process.
563 ///        \n
564 ///
565 /// \~english @par Classification
566 ///        - Public
567 ///
568 /// \~english @par Type
569 ///        - Fire and Forget
570 ///
571 ////////////////////////////////////////////////////////////////////////////////////////////
572 RET_API _pb_SndMsg(PNO pno, u_int16 size, void* msgbuf, u_int16 mode);
573
574 ////////////////////////////////////////////////////////////////////////////////////////////
575 /// \ingroup positioning_base_library
576 /// \~english @par Brief
577 ///     - Send message between process
578 ///
579 /// \~english @param [in] name
580 ///     - PCSTR  destination process name
581 /// \~english @param [in] cid
582 ///     - CID  command ID
583 /// \~english @param [in] size
584 ///     - u_int16  message size
585 /// \~english @param [in] msgbuf
586 ///     - const void*  message buffer
587 /// \~english @param [in] mode
588 ///     - u_int16  not used
589 ///
590 /// \~english @retval RET_NORMAL  normal return
591 /// \~english @retval RET_ERRPARAM  parameter error
592 /// \~english @retval RET_ERROR  other error
593 ///
594 /// \~english @par Precondition
595 ///     - positioning_base_library initialization are completed \n
596 ///       (_pb_Setup_CWORD64_API has already been called) in current process.
597 ///
598 /// \~english @par changes of the internal status
599 ///     - There is no changes of the internal status by this API
600 ///
601 /// \~english @par Failure condition
602 ///     - The parameter name is NULL
603 ///     - The parameter msgbuf is NULL
604 ///     - The length of parameter name is longer than MAX_QUEUE_NAME_SIZE
605 ///     - Get sender Handle failed
606 ///     - Send message failed
607 ///
608 /// \~english @par Detail
609 ///     - Call this API to send message between process.
610 ///        \n
611 ///
612 /// \~english @par Classification
613 ///        - Public
614 ///
615 /// \~english @par Type
616 ///        - Fire and Forget
617 ///
618 ////////////////////////////////////////////////////////////////////////////////////////////
619 RET_API _pb_SndMsg_Ext(PCSTR name, CID cid, u_int16 size, const void* msgbuf, u_int16 mode);
620
621 ////////////////////////////////////////////////////////////////////////////////////////////
622 /// \ingroup positioning_base_library
623 /// \~english @par Brief
624 ///     - Create semaphore by specified name
625 ///
626 /// \~english @param [in] semName
627 ///     - char*  semaphore name
628 ///
629 /// \~english @retval 0    semaphore create failed
630 /// \~english @retval not 0 created semaphore ID
631 ///
632 /// \~english @par Precondition
633 ///     - positioning_base_library initialization are completed \n
634 ///       (_pb_Setup_CWORD64_API has already been called) in current process.
635 ///
636 /// \~english @par changes of the internal status
637 ///     - There is no changes of the internal status by this API
638 ///
639 /// \~english @par Failure condition
640 ///     - The parameter semName is NULL
641 ///     - The string of parameter semName has no text
642 ///     - The string length of parameter semName is longer than MAX_SEMAPHORE_NAME_LEN
643 ///     - Memory allocate failed for creating semaphore table
644 ///     - The semaphore table is full
645 ///
646 /// \~english @par Detail
647 ///     - Call this API to create semaphore and return the created semaphore ID.
648 ///        \n
649 ///
650 /// \~english @par Classification
651 ///        - Public
652 ///
653 /// \~english @par Type
654 ///        - Sync
655 ///
656 ////////////////////////////////////////////////////////////////////////////////////////////
657 SemID   _pb_CreateSemaphore(char* semName);
658
659 ////////////////////////////////////////////////////////////////////////////////////////////
660 /// \ingroup positioning_base_library
661 /// \~english @par Brief
662 ///     - Semaphore lock
663 ///
664 /// \~english @param [in] semID
665 ///     - SemID  semaphore ID
666 ///
667 /// \~english @retval RET_NORMAL  normal return
668 /// \~english @retval RET_OSERROR  error return
669 ///
670 /// \~english @par Precondition
671 ///     - positioning_base_library initialization are completed \n
672 ///      (_pb_Setup_CWORD64_API has already been called) in current process.
673 ///
674 /// \~english @par changes of the internal status
675 ///     - There is no changes of the internal status by this API
676 ///
677 /// \~english @par Failure condition
678 ///     - The parameter semName is 0
679 ///     - The parameter semName is more than MAX_PB_SEMAPHORES
680 ///     - The specified semaphore has not been registered in semaphore table
681 ///     - The specified semaphore's mutex has not been created
682 ///     - The specified semaphore's mutex lock failed
683 ///
684 /// \~english @par Detail
685 ///     - Call this API to get semaphore.
686 ///     - This API will return after got semaphore.
687 ///        \n
688 ///
689 /// \~english @par Classification
690 ///        - Public
691 ///
692 /// \~english @par Type
693 ///        - Fire and Forget
694 ///
695 ////////////////////////////////////////////////////////////////////////////////////////////
696 RET_API _pb_SemLock(SemID semID);
697
698 ////////////////////////////////////////////////////////////////////////////////////////////
699 /// \ingroup positioning_base_library
700 /// \~english @par Brief
701 ///     - Semaphore unlock
702 ///
703 /// \~english @param [in] semID
704 ///     - SemID  semaphore ID
705 ///
706 /// \~english @retval RET_NORMAL  normal return
707 /// \~english @retval RET_OSERROR  error return
708 ///
709 /// \~english @par Precondition
710 ///     - positioning_base_library initialization are completed \n
711 ///       (_pb_Setup_CWORD64_API has already been called) in current process.
712 ///
713 /// \~english @par changes of the internal status
714 ///     - There is no changes of the internal status by this API
715 ///
716 /// \~english @par Failure condition
717 ///     - The parameter semName is 0
718 ///     - The parameter semName is more than MAX_PB_SEMAPHORES
719 ///     - The specified semaphore has not been registered in semaphore table
720 ///     - The specified semaphore's mutex has not been created
721 ///     - The specified semaphore's mutex release failed
722 ///
723 /// \~english @par Detail
724 ///     - Call this API to relesae semaphore.
725 ///        \n
726 ///
727 /// \~english @par Classification
728 ///        - Public
729 ///
730 /// \~english @par Type
731 ///        - Fire and Forget
732 ///
733 ////////////////////////////////////////////////////////////////////////////////////////////
734 RET_API _pb_SemUnlock(SemID semID);
735
736 ////////////////////////////////////////////////////////////////////////////////////////////
737 /// \ingroup positioning_base_library
738 /// \~english @par Brief
739 ///     - Create Share Data
740 ///
741 /// \~english @param [in] area_name
742 ///     - char*  share data name
743 /// \~english @param [in] size
744 ///     - u_int32  data size
745 /// \~english @param [out] mem_ptr
746 ///     - void**  share memory pointer
747 ///
748 /// \~english @retval RET_NORMAL  normal return
749 /// \~english @retval RET_ERROR  error return
750 ///
751 /// \~english @par Precondition
752 ///     - positioning_base_library initialization are completed \n
753 ///       (_pb_Setup_CWORD64_API has already been called) in current process.
754 ///
755 /// \~english @par changes of the internal status
756 ///     - There is no changes of the internal status by this API
757 ///
758 /// \~english @par Failure condition
759 ///     - The parameter area_name is NULL
760 ///     - The parameter mem_ptr is NULL
761 ///     - The string of parameter area_name has no text
762 ///     - The string length of parameter area_name is longer than MAX_AREA_NAME_LEN
763 ///     - The parameter size is 0
764 ///     - The specified share data has already been created
765 ///     - Memory allocate failed for creating share data
766 ///     - The specified share data file create failed
767 ///
768 /// \~english @par Detail
769 ///     - Call this API to create share data.
770 ///        \n
771 ///
772 /// \~english @par Classification
773 ///        - Public
774 ///
775 /// \~english @par Type
776 ///        - Sync
777 ///
778 ////////////////////////////////////////////////////////////////////////////////////////////
779 RET_API _pb_CreateShareData(char* area_name, u_int32 size, void** mem_ptr);
780
781 ////////////////////////////////////////////////////////////////////////////////////////////
782 /// \ingroup positioning_base_library
783 /// \~english @par Brief
784 ///     - Link Share Data
785 ///
786 /// \~english @param [in] area_name
787 ///     - char*  share data name
788 /// \~english @param [out] mem_ptr
789 ///     - void**  share memory pointer
790 /// \~english @param [in] size
791 ///     - u_int32*  data size
792 ///
793 /// \~english @retval RET_NORMAL  normal return
794 /// \~english @retval RET_ERROR  error return
795 ///
796 /// \~english @par Precondition
797 ///     - positioning_base_library initialization are completed \n
798 ///       (_pb_Setup_CWORD64_API has already been called) in current process.
799 ///
800 /// \~english @par changes of the internal status
801 ///     - There is no changes of the internal status by this API
802 ///
803 /// \~english @par Failure condition
804 ///     - The parameter area_name is NULL
805 ///     - The parameter mem_ptr is NULL
806 ///     - The string of parameter area_name has no text
807 ///     - The string length of parameter area_name is longer than MAX_AREA_NAME_LEN
808 ///     - The parameter size is NULL
809 ///     - Memory allocate failed for linking share data
810 ///     - The specified share data file open failed
811 ///
812 /// \~english @par Detail
813 ///     - Call this API to link share data.
814 ///        \n
815 ///
816 /// \~english @par Classification
817 ///        - Public
818 ///
819 /// \~english @par Type
820 ///        - Sync
821 ///
822 ////////////////////////////////////////////////////////////////////////////////////////////
823 RET_API _pb_LinkShareData(char* area_name, void** mem_ptr, u_int32* size);
824
825 ////////////////////////////////////////////////////////////////////////////////////////////
826 /// \ingroup positioning_base_library
827 /// \~english @par Brief
828 ///     - Start timer
829 ///
830 /// \~english @param [in] SndPno
831 ///     - PNO  source process No
832 /// \~english @param [in] TimerSeq
833 ///     - u_int16  timer sequence No
834 /// \~english @param [in] TimerType
835 ///     - u_int8  timer type
836 /// \~english @param [in] TimeOut
837 ///     - u_int32  timeout time
838 ///
839 /// \~english @par
840 ///     - timer type(TimerType)
841 ///       - TIMER_TYPE_SYN  fixed term timer
842 ///       - TIMER_TYPE_USN  asynchronous timer
843 ///
844 /// \~english @retval RET_NORMAL  normal return
845 /// \~english @retval RET_ERRPARAM  parameter error
846 /// \~english @retval RET_ERROR  other error
847 ///
848 /// \~english @par Precondition
849 ///     - positioning_base_library initialization are completed \n
850 ///       (_pb_Setup_CWORD64_API has already been called) in current process.
851 ///
852 /// \~english @par changes of the internal status
853 ///     - There is no changes of the internal status by this API
854 ///
855 /// \~english @par Failure condition
856 ///     - Initialization of positioning_base_library has not been done in current process
857 ///     - The parameter TimerType is neither TIMER_TYPE_SYN nor TIMER_TYPE_USN
858 ///     - The parameter TimeOut is 0
859 ///     - The same timer has already been started
860 ///     - Timer start failed
861 ///
862 /// \~english @par Detail
863 ///     - Call this API to start timer.
864 ///        \n
865 ///
866 /// \~english @par Classification
867 ///        - Public
868 ///
869 /// \~english @par Type
870 ///        - Fire and Forget
871 ///
872 ////////////////////////////////////////////////////////////////////////////////////////////
873 RET_API _pb_ReqTimerStart(PNO SndPno, u_int16 TimerSeq, u_int8 TimeType, u_int32 TimeOut);
874
875 ////////////////////////////////////////////////////////////////////////////////////////////
876 /// \ingroup positioning_base_library
877 /// \~english @par Brief
878 ///     - Stop timer
879 ///
880 /// \~english @param [in] SndPno
881 ///     - PNO  source process No
882 /// \~english @param [in] TimerSeq
883 ///     - u_int16  timer sequence No
884 /// \~english @param [in] TimerType
885 ///     - u_int8  timer type
886 ///
887 /// \~english @par
888 ///     - timer type(TimerType)
889 ///       - TIMER_TYPE_SYN  fixed term timer
890 ///       - TIMER_TYPE_USN  asynchronous timer
891 ///
892 /// \~english @retval RET_NORMAL  normal return
893 /// \~english @retval RET_ERROR  error return
894 ///
895 /// \~english @par Precondition
896 ///     - positioning_base_library initialization are completed \n
897 ///       (_pb_Setup_CWORD64_API has already been called) in current process.
898 ///
899 /// \~english @par changes of the internal status
900 ///     - There is no changes of the internal status by this API
901 ///
902 /// \~english @par Failure condition
903 ///     - Initialization of positioning_base_library has not been done in current process
904 ///     - Timer stop failed
905 ///
906 /// \~english @par Detail
907 ///     - Call this API to stop timer.
908 ///        \n
909 ///
910 /// \~english @par Classification
911 ///        - Public
912 ///
913 /// \~english @par Type
914 ///        - Fire and Forget
915 ///
916 ////////////////////////////////////////////////////////////////////////////////////////////
917 RET_API _pb_TimerStop(PNO SndPno, u_int16 TimerSeq, u_int8 TimeType);
918
919 ////////////////////////////////////////////////////////////////////////////////////////////
920 /// \ingroup positioning_base_library
921 /// \~english @par Brief
922 ///     - Create mutex
923 ///
924 /// \~english @param [in] lpMutexAttributes
925 ///     - LPSECURITY_ATTRIBUTES  not used
926 /// \~english @param [in] bInitialOwner
927 ///     - BOOL  not used
928 /// \~english @param [in] lpName
929 ///     - LPCTSTR  mutex name
930 ///
931 /// \~english @retval NULL  error return
932 /// \~english @retval Except NULL  created mutex Handle
933 ///
934 /// \~english @par Precondition
935 ///     - positioning_base_library initialization are completed \n
936 ///       (_pb_Setup_CWORD64_API has already been called) in current process.
937 ///
938 /// \~english @par changes of the internal status
939 ///     - There is no changes of the internal status by this API
940 ///
941 /// \~english @par Failure condition
942 ///     - The parameter lpName is NULL
943 ///     - The string length of pamareter lpName is longer than NAME_MAX
944 ///     - Mutex lock map failed
945 ///
946 /// \~english @par Detail
947 ///     - Call this API to create mutex.
948 ///        \n
949 ///
950 /// \~english @par Classification
951 ///        - Public
952 ///
953 /// \~english @par Type
954 ///        - Sync
955 ///
956 ////////////////////////////////////////////////////////////////////////////////////////////
957 HANDLE _pb_CreateMutex(LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner, LPCTSTR lpName);
958
959 ////////////////////////////////////////////////////////////////////////////////////////////
960 /// \ingroup positioning_base_library
961 /// \~english @par Brief
962 ///     - Get message management table dump info.
963 ///
964 /// \~english @param [out] pBuf
965 ///     - void*  output buffer
966 /// \~english @param [in/out] pLen
967 ///     - uint8_t*  output buffer size
968 ///
969 /// \~english @retval None
970 ///
971 /// \~english @par Precondition
972 ///     - positioning_base_library initialization are completed \n
973 ///       (_pb_Setup_CWORD64_API has already been called) in current process.
974 ///
975 /// \~english @par changes of the internal status
976 ///     - There is no changes of the internal status by this API
977 ///
978 /// \~english @par Detail
979 ///     - Call this API to get message management table dump info.
980 ///        \n
981 ///
982 /// \~english @par Classification
983 ///        - Public
984 ///
985 /// \~english @par Type
986 ///        - Sync
987 ///
988 ////////////////////////////////////////////////////////////////////////////////////////////
989 void _pb_GetDebugMsgMngTbl(void* pBuf, uint8_t* pLen);
990
991 ////////////////////////////////////////////////////////////////////////////////////////////
992 /// \ingroup positioning_base_library
993 /// \~english @par Brief
994 ///     - Get mutex management table dump info.
995 ///
996 /// \~english @param [out] pBuf
997 ///     - void*  output buffer
998 /// \~english @param [in/out] pLen
999 ///     - uint8_t*  output buffer size
1000 ///
1001 /// \~english @retval None
1002 ///
1003 /// \~english @par Precondition
1004 ///     - positioning_base_library initialization are completed \n
1005 ///       (_pb_Setup_CWORD64_API has already been called) in current process.
1006 ///
1007 /// \~english @par changes of the internal status
1008 ///     - There is no changes of the internal status by this API
1009 ///
1010 /// \~english @par Detail
1011 ///     - Call this API to get mutex management table dump info.
1012 ///        \n
1013 ///
1014 /// \~english @par Classification
1015 ///        - Public
1016 ///
1017 /// \~english @par Type
1018 ///        - Sync
1019 ///
1020 ////////////////////////////////////////////////////////////////////////////////////////////
1021 void _pb_GetDebugMutexMngTbl(void* pBuf, uint8_t* pLen);
1022
1023 ////////////////////////////////////////////////////////////////////////////////////////////
1024 /// \ingroup positioning_base_library
1025 /// \~english @par Brief
1026 ///     - Get timer management table dump info.
1027 ///
1028 /// \~english @param [out] pBuf
1029 ///     - void*  output buffer
1030 ///
1031 /// \~english @retval None
1032 ///
1033 /// \~english @par Precondition
1034 ///     - positioning_base_library initialization are completed \n
1035 ///       (_pb_Setup_CWORD64_API has already been called) in current process.
1036 ///
1037 /// \~english @par changes of the internal status
1038 ///     - There is no changes of the internal status by this API
1039 ///
1040 /// \~english @par Detail
1041 ///     - Call this API to get timer management table dump info.
1042 ///        \n
1043 ///
1044 /// \~english @par Classification
1045 ///        - Public
1046 ///
1047 /// \~english @par Type
1048 ///        - Sync
1049 ///
1050 ////////////////////////////////////////////////////////////////////////////////////////////
1051 void _pb_GetDebugTimerMngTbl(void* pBuf);
1052
1053 ////////////////////////////////////////////////////////////////////////////////////////////
1054 /// \ingroup positioning_base_library
1055 /// \~english @par Brief
1056 ///     - Get event management table dump info.
1057 ///
1058 /// \~english @param [out] pBuf
1059 ///     - void*  output buffer
1060 /// \~english @param [in/out] pLen
1061 ///     - uint8_t*  output buffer size
1062 ///
1063 /// \~english @retval None
1064 ///
1065 /// \~english @par Precondition
1066 ///     - positioning_base_library initialization are completed \n
1067 ///       (_pb_Setup_CWORD64_API has already been called) in current process.
1068 ///
1069 /// \~english @par changes of the internal status
1070 ///     - There is no changes of the internal status by this API
1071 ///
1072 /// \~english @par Detail
1073 ///     - Call this API to get event management table dump info.
1074 ///        \n
1075 ///
1076 /// \~english @par Classification
1077 ///        - Public
1078 ///
1079 /// \~english @par Type
1080 ///        - Sync
1081 ///
1082 ////////////////////////////////////////////////////////////////////////////////////////////
1083 void _pb_GetDebugEventMngTbl(void* pBuf, uint8_t* pLen);
1084
1085 ////////////////////////////////////////////////////////////////////////////////////////////
1086 /// \ingroup positioning_base_library
1087 /// \~english @par Brief
1088 ///     - Get memory management table dump info.
1089 ///
1090 /// \~english @param [out] pBuf
1091 ///     - void*  output buffer
1092 ///
1093 /// \~english @retval None
1094 ///
1095 /// \~english @par Precondition
1096 ///     - positioning_base_library initialization are completed \n
1097 ///       (_pb_Setup_CWORD64_API has already been called) in current process.
1098 ///
1099 /// \~english @par changes of the internal status
1100 ///     - There is no changes of the internal status by this API
1101 ///
1102 /// \~english @par Detail
1103 ///     - Call this API to get memory management table dump info.
1104 ///        \n
1105 ///
1106 /// \~english @par Classification
1107 ///        - Public
1108 ///
1109 /// \~english @par Type
1110 ///        - Sync
1111 ///
1112 ////////////////////////////////////////////////////////////////////////////////////////////
1113 void _pb_GetDebugMemoryMngTbl(void* pBuf);
1114
1115 ////////////////////////////////////////////////////////////////////////////////////////////
1116 /// \ingroup positioning_base_library
1117 /// \~english @par Brief
1118 ///     - Get common info management table dump info.
1119 ///
1120 /// \~english @param [out] pBuf
1121 ///     - void*  output buffer
1122 ///
1123 /// \~english @retval None
1124 ///
1125 /// \~english @par Precondition
1126 ///     - positioning_base_library initialization are completed \n
1127 ///       (_pb_Setup_CWORD64_API has already been called) in current process.
1128 ///
1129 /// \~english @par changes of the internal status
1130 ///     - There is no changes of the internal status by this API
1131 ///
1132 /// \~english @par Detail
1133 ///     - Call this API to get common info management table dump info.
1134 ///        \n
1135 ///
1136 /// \~english @par Classification
1137 ///        - Public
1138 ///
1139 /// \~english @par Type
1140 ///        - Sync
1141 ///
1142 ////////////////////////////////////////////////////////////////////////////////////////////
1143 void _pb_GetDebugOtherMngTbl(void* pBuf);
1144
1145 ////////////////////////////////////////////////////////////////////////////////////////////
1146 /// \ingroup positioning_base_library
1147 /// \~english @par Brief
1148 ///     - Get current app Handle.
1149 ///
1150 /// \~english @param None
1151 ///
1152 /// \~english @retval 0    get Handle failed
1153 /// \~english @retval not 0 Handle
1154 ///
1155 /// \~english @par Precondition
1156 ///     - positioning_base_library initialization are completed \n
1157 ///       (_pb_Setup_CWORD64_API has already been called) in current process.
1158 ///
1159 /// \~english @par changes of the internal status
1160 ///     - There is no changes of the internal status by this API
1161 ///
1162 /// \~english @par Failure condition
1163 ///     - Current app Handle has not been registered
1164 ///
1165 /// \~english @par Detail
1166 ///     - Call this API to get current app Handle.
1167 ///        \n
1168 ///
1169 /// \~english @par Classification
1170 ///        - Public
1171 ///
1172 /// \~english @par Type
1173 ///        - Sync
1174 ///
1175 ////////////////////////////////////////////////////////////////////////////////////////////
1176 HANDLE  _pb_GetAppHandle(void);
1177
1178 ////////////////////////////////////////////////////////////////////////////////////////////
1179 /// \ingroup positioning_base_library
1180 /// \~english @par Brief
1181 ///     - Set current app Handle.
1182 ///
1183 /// \~english @param [in] hApp
1184 ///     - HANDLE  app Handle
1185 ///
1186 /// \~english @retval None
1187 ///
1188 /// \~english @par Precondition
1189 ///     - positioning_base_library initialization are completed \n
1190 ///       (_pb_Setup_CWORD64_API has already been called) in current process.
1191 ///
1192 /// \~english @par changes of the internal status
1193 ///     - There is no changes of the internal status by this API
1194 ///
1195 /// \~english @par Detail
1196 ///     - Call this API to get common info management table dump info.
1197 ///        \n
1198 ///
1199 /// \~english @par Classification
1200 ///        - Public
1201 ///
1202 /// \~english @par Type
1203 ///        - Fire and Forget
1204 ///
1205 ////////////////////////////////////////////////////////////////////////////////////////////
1206 void  _pb_SetAppHandle(HANDLE hApp);
1207
1208 ////////////////////////////////////////////////////////////////////////////////////////////
1209 /// \ingroup positioning_base_library
1210 /// \~english @par Brief
1211 ///     - Base API stop process(every process used Base API should call this API before stop).
1212 ///
1213 /// \~english @param None
1214 ///
1215 /// \~english @retval None
1216 ///
1217 /// \~english @par Precondition
1218 ///     - positioning_base_library initialization are completed \n
1219 ///       (_pb_Setup_CWORD64_API has already been called) in current process.
1220 ///
1221 /// \~english @par changes of the internal status
1222 ///     - There is no changes of the internal status by this API
1223 ///
1224 /// \~english @par Detail
1225 ///     - Call this API to stop Base API.
1226 ///     - Every process used Base API should call this API before stop.
1227 ///        \n
1228 ///
1229 /// \~english @par Classification
1230 ///        - Public
1231 ///
1232 /// \~english @par Type
1233 ///        - Fire and Forget
1234 ///
1235 ////////////////////////////////////////////////////////////////////////////////////////////
1236 void  _pb_Teardown_CWORD64_API(void);
1237
1238 ////////////////////////////////////////////////////////////////////////////////////////////
1239 /// \ingroup positioning_base_library
1240 /// \~english @par Brief
1241 ///     - Terminate current process.
1242 ///
1243 /// \~english @param [in] pFunc
1244 ///     - char*  source function
1245 /// \~english @param [in] line
1246 ///     - int  source line
1247 ///
1248 /// \~english @retval None
1249 ///
1250 /// \~english @par Precondition
1251 ///     - None
1252 /// \~english @par changes of the internal status
1253 ///     - There is no changes of the internal status by this API
1254 ///
1255 /// \~english @par Detail
1256 ///     - Call this API to terminate current process.
1257 ///        \n
1258 ///
1259 /// \~english @par Classification
1260 ///        - Public
1261 ///
1262 /// \~english @par Type
1263 ///        - Fire and Forget
1264 ///
1265 ////////////////////////////////////////////////////////////////////////////////////////////
1266 void  _pb_Exit_d(const char* pFunc, int line);
1267 #define _pb_Exit() _pb_Exit_d(__func__, __LINE__)
1268
1269 ////////////////////////////////////////////////////////////////////////////////////////////
1270 /// \ingroup positioning_base_library
1271 /// \~english @par Brief
1272 ///     - Receive message.
1273 ///
1274 /// \~english @param [in] pno
1275 ///     - PNO  process No
1276 /// \~english @param [in] size
1277 ///     - u_int16  message size
1278 /// \~english @param [out] msgbuf
1279 ///     - void*  message buffer
1280 /// \~english @param [in] mode
1281 ///     - u_int16  not used
1282 ///
1283 /// \~english @retval RET_NORMAL  normal return
1284 /// \~english @retval RET_ERRPARAM  parameter error
1285 /// \~english @retval RET_ERROR  other error
1286 ///
1287 /// \~english @par Precondition
1288 ///     - positioning_base_library initialization are completed \n
1289 ///       (_pb_Setup_CWORD64_API has already been called) in current process.
1290 ///
1291 /// \~english @par changes of the internal status
1292 ///     - There is no changes of the internal status by this API
1293 ///
1294 /// \~english @par Failure condition
1295 ///     - The parameter msgbuf is NULL
1296 ///     - The parameter pno is 0
1297 ///     - The message queue specified by parameter pno has not been created
1298 ///     - Receive message failed
1299 ///     - Receive message successrully, but the received message size is longer than parameter size
1300 ///     - Get received message data failed
1301 ///
1302 /// \~english @par Detail
1303 ///     - Call this API to receive message of specified pno.
1304 ///     - This API will return after received message.
1305 ///        \n
1306 ///
1307 /// \~english @par Classification
1308 ///        - Public
1309 ///
1310 /// \~english @par Type
1311 ///        - Sync
1312 ///
1313 ////////////////////////////////////////////////////////////////////////////////////////////
1314 RET_API _pb_RcvMsg(PNO pno, u_int16 size, void** msgbuf, u_int16 mode);
1315
1316 ////////////////////////////////////////////////////////////////////////////////////////////
1317 /// \ingroup positioning_base_library
1318 /// \~english @par Brief
1319 ///     - Get send buffer for message transferring in process
1320 ///
1321 /// \~english @param [in] pno
1322 ///     - PNO  process No
1323 /// \~english @param [out] pSndBuf
1324 ///     - void**  send buffer
1325 ///
1326 /// \~english @retval RET_NORMAL  normal return
1327 /// \~english @retval RET_ERRPARAM  parameter error
1328 /// \~english @retval RET_ERROR  other error
1329 ///
1330 /// \~english @par Precondition
1331 ///     - positioning_base_library initialization are completed \n
1332 /// (_pb_Setup_CWORD64_API has already been called) in current process.
1333 ///
1334 /// \~english @par changes of the internal status
1335 ///     - There is no changes of the internal status by this API
1336 ///
1337 /// \~english @par Failure condition
1338 ///     - The parameter pno is 0
1339 ///     - The message queue specified by parameter pno has not been created
1340 ///     - Get sender Handle failed
1341 ///     - Get send buffer failed
1342 ///
1343 /// \~english @par Detail
1344 ///     - Call this API to get send buffer for message transferring in process.
1345 ///        \n
1346 ///
1347 /// \~english @par Classification
1348 ///        - Public
1349 ///
1350 /// \~english @par Type
1351 ///        - Sync
1352 ///
1353 ////////////////////////////////////////////////////////////////////////////////////////////
1354 RET_API _pb_GetZcSndBuf(PNO pno, void** pSndBuf);
1355
1356 ////////////////////////////////////////////////////////////////////////////////////////////
1357 /// \ingroup positioning_base_library
1358 /// \~english @par Brief
1359 ///     - Send message in process
1360 ///
1361 /// \~english @param [in] pno
1362 ///     - PNO  process No
1363 /// \~english @param [in] size
1364 ///     - u_int16  message size
1365 /// \~english @param [in] mode
1366 ///     - u_int16  not used
1367 ///
1368 /// \~english @retval RET_NORMAL  normal return
1369 /// \~english @retval RET_ERRPARAM  parameter error
1370 /// \~english @retval RET_ERROR  other error
1371 ///
1372 /// \~english @par Precondition
1373 ///     - positioning_base_library initialization are completed \n
1374 /// (_pb_Setup_CWORD64_API has already been called) in current process.
1375 ///
1376 /// \~english @par changes of the internal status
1377 ///     - There is no changes of the internal status by this API
1378 ///
1379 /// \~english @par Failure condition
1380 ///     - The parameter pno is 0
1381 ///     - The message queue specified by parameter pno has not been created
1382 ///     - Get sender Handle failed
1383 ///     - Get send buffer failed
1384 ///     - Set send buffer failed
1385 ///     - Send message failed
1386 ///
1387 /// \~english @par Detail
1388 ///     - Call this API to send message in process.
1389 ///        \n
1390 ///
1391 /// \~english @par Classification
1392 ///        - Public
1393 ///
1394 /// \~english @par Type
1395 ///        - Fire and Forget
1396 ///
1397 ////////////////////////////////////////////////////////////////////////////////////////////
1398 RET_API _pb_ZcSndMsg(PNO pno, u_int16 size, u_int16 mode);
1399
1400 ////////////////////////////////////////////////////////////////////////////////////////////
1401 /// \ingroup positioning_base_library
1402 /// \~english @par Brief
1403 ///     - Convert process name to pno
1404 ///
1405 /// \~english @param [in] name
1406 ///     - PCSTR  process name
1407 ///
1408 /// \~english @retval 0    convert failed
1409 /// \~english @retval not 0 converted PNO
1410 ///
1411 /// \~english @par Precondition
1412 ///     - positioning_base_library initialization are completed \n
1413 ///  (_pb_Setup_CWORD64_API has already been called) in current process.
1414 ///
1415 /// \~english @par changes of the internal status
1416 ///     - There is no changes of the internal status by this API
1417 ///
1418 /// \~english @par Failure condition
1419 ///     - The parameter name is NULL
1420 ///     - The size of parameter name is longer than THREAD_NAME_LEN_MAX
1421 ///
1422 /// \~english @par Detail
1423 ///     - Call this API to convert process name to pno.
1424 ///        \n
1425 ///
1426 /// \~english @par Classification
1427 ///        - Public
1428 ///
1429 /// \~english @par Type
1430 ///        - Sync
1431 ///
1432 ////////////////////////////////////////////////////////////////////////////////////////////
1433 PNO _pb_CnvName2Pno(PCSTR name);
1434
1435 ////////////////////////////////////////////////////////////////////////////////////////////
1436 /// \ingroup positioning_base_library
1437 /// \~english @par Brief
1438 ///     - Convert pno to process name
1439 ///
1440 /// \~english @param [in] pno
1441 ///     - PNO  process No
1442 ///
1443 /// \~english @retval NULL    convert failed
1444 /// \~english @retval not NULL converted process name
1445 ///
1446 /// \~english @par Precondition
1447 ///     - positioning_base_library initialization are completed \n
1448 ///  (_pb_Setup_CWORD64_API has already been called) in current process.
1449 ///
1450 /// \~english @par changes of the internal status
1451 ///     - There is no changes of the internal status by this API
1452 ///
1453 /// \~english @par Failure condition
1454 ///     - The parameter pno has not been registered(not the return pno of _pb_CnvName2Pno).
1455 ///
1456 /// \~english @par Detail
1457 ///     - Call this API to convert pno to process name.
1458 ///        \n
1459 ///
1460 /// \~english @par Classification
1461 ///        - Public
1462 ///
1463 /// \~english @par Type
1464 ///        - Sync
1465 ///
1466 ////////////////////////////////////////////////////////////////////////////////////////////
1467 PCSTR _pb_CnvPno2Name(PNO pno);
1468
1469 ////////////////////////////////////////////////////////////////////////////////////////////
1470 /// \ingroup positioning_base_library
1471 /// \~english @par Brief
1472 ///     - Get message resource
1473 ///
1474 /// \~english @param None
1475 ///
1476 /// \~english @retval TRUE    normal return
1477 /// \~english @retval FALSE error(lack of resource)
1478 ///
1479 /// \~english @par Precondition
1480 ///     - positioning_base_library initialization are completed \n
1481 ///  (_pb_Setup_CWORD64_API has already been called) in current process.
1482 ///
1483 /// \~english @par changes of the internal status
1484 ///     - There is no changes of the internal status by this API
1485 ///
1486 /// \~english @par Detail
1487 ///     - Call this API to get message resource.
1488 ///        \n
1489 ///
1490 /// \~english @par Classification
1491 ///        - Public
1492 ///
1493 /// \~english @par Type
1494 ///        - Fire and Forget
1495 ///
1496 ////////////////////////////////////////////////////////////////////////////////////////////
1497 BOOL _pb_GetMsgResource(void);
1498
1499 ////////////////////////////////////////////////////////////////////////////////////////////
1500 /// \ingroup positioning_base_library
1501 /// \~english @par Brief
1502 ///     - Get mutex resource
1503 ///
1504 /// \~english @param None
1505 ///
1506 /// \~english @retval TRUE    normal return
1507 /// \~english @retval FALSE error(lack of resource)
1508 ///
1509 /// \~english @par Precondition
1510 ///     - positioning_base_library initialization are completed \n
1511 ///  (_pb_Setup_CWORD64_API has already been called) in current process.
1512 ///
1513 /// \~english @par changes of the internal status
1514 ///     - There is no changes of the internal status by this API
1515 ///
1516 /// \~english @par Detail
1517 ///     - Call this API to get mutex resource.
1518 ///        \n
1519 ///
1520 /// \~english @par Classification
1521 ///        - Public
1522 ///
1523 /// \~english @par Type
1524 ///        - Fire and Forget
1525 ///
1526 ////////////////////////////////////////////////////////////////////////////////////////////
1527 BOOL _pb_GetMutexResource(void);
1528
1529 ////////////////////////////////////////////////////////////////////////////////////////////
1530 /// \ingroup positioning_base_library
1531 /// \~english @par Brief
1532 ///     - Get common resource
1533 ///
1534 /// \~english @param None
1535 ///
1536 /// \~english @retval TRUE    normal return
1537 /// \~english @retval FALSE error(lack of resource)
1538 ///
1539 /// \~english @par Precondition
1540 ///     - positioning_base_library initialization are completed \n
1541 /// (_pb_Setup_CWORD64_API has already been called) in current process.
1542 ///
1543 /// \~english @par changes of the internal status
1544 ///     - There is no changes of the internal status by this API
1545 ///
1546 /// \~english @par Detail
1547 ///     - Call this API to get common resource.
1548 ///        \n
1549 ///
1550 /// \~english @par Classification
1551 ///        - Public
1552 ///
1553 /// \~english @par Type
1554 ///        - Fire and Forget
1555 ///
1556 ////////////////////////////////////////////////////////////////////////////////////////////
1557 BOOL _pb_GetOtherResource(void);
1558
1559 ////////////////////////////////////////////////////////////////////////////////////////////
1560 /// \ingroup positioning_base_library
1561 /// \~english @par Brief
1562 ///     - Release message resource
1563 ///
1564 /// \~english @param None
1565 ///
1566 /// \~english @retval None
1567 ///
1568 /// \~english @par Precondition
1569 ///     - positioning_base_library initialization are completed \n
1570 ///  (_pb_Setup_CWORD64_API has already been called) in current process.
1571 ///
1572 /// \~english @par changes of the internal status
1573 ///     - There is no changes of the internal status by this API
1574 ///
1575 /// \~english @par Detail
1576 ///     - Call this API to release message resource.
1577 ///        \n
1578 ///
1579 /// \~english @par Classification
1580 ///        - Public
1581 ///
1582 /// \~english @par Type
1583 ///        - Fire and Forget
1584 ///
1585 ////////////////////////////////////////////////////////////////////////////////////////////
1586 void _pb_ReleaseMsgResource(void);
1587
1588 ////////////////////////////////////////////////////////////////////////////////////////////
1589 /// \ingroup positioning_base_library
1590 /// \~english @par Brief
1591 ///     - Release mutex resource
1592 ///
1593 /// \~english @param None
1594 ///
1595 /// \~english @retval None
1596 ///
1597 /// \~english @par Precondition
1598 ///     - positioning_base_library initialization are completed \n
1599 ///  (_pb_Setup_CWORD64_API has already been called) in current process.
1600 ///
1601 /// \~english @par changes of the internal status
1602 ///     - There is no changes of the internal status by this API
1603 ///
1604 /// \~english @par Detail
1605 ///     - Call this API to release mutex resource.
1606 ///        \n
1607 ///
1608 /// \~english @par Classification
1609 ///        - Public
1610 ///
1611 /// \~english @par Type
1612 ///        - Fire and Forget
1613 ///
1614 ////////////////////////////////////////////////////////////////////////////////////////////
1615 void _pb_ReleaseMutexResource(void);
1616
1617 ////////////////////////////////////////////////////////////////////////////////////////////
1618 /// \ingroup positioning_base_library
1619 /// \~english @par Brief
1620 ///     - Release common resource
1621 ///
1622 /// \~english @param None
1623 ///
1624 /// \~english @retval None
1625 ///
1626 /// \~english @par Precondition
1627 ///     - positioning_base_library initialization are completed \n
1628 ///  (_pb_Setup_CWORD64_API has already been called) in current process.
1629 ///
1630 /// \~english @par changes of the internal status
1631 ///     - There is no changes of the internal status by this API
1632 ///
1633 /// \~english @par Detail
1634 ///     - Call this API to release common resource.
1635 ///        \n
1636 ///
1637 /// \~english @par Classification
1638 ///        - Public
1639 ///
1640 /// \~english @par Type
1641 ///        - Fire and Forget
1642 ///
1643 ////////////////////////////////////////////////////////////////////////////////////////////
1644 void _pb_ReleaseOtherResource(void);
1645
1646 #ifdef __cplusplus
1647 }
1648 #endif
1649
1650 /** @}*/  // end of positioning_base_library
1651 /** @}*/  // end of vehicle_service
1652 /** @}*/  // end of BaseSystem
1653 #endif  // POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_VEHICLE_SERVICE_WPF_STD_H_