diff options
author | Tadao Tanikawa <tanikawa.tadao@jp.panasonic.com> | 2020-11-20 23:36:23 +0900 |
---|---|---|
committer | Tadao Tanikawa <tanikawa.tadao@jp.panasonic.com> | 2020-11-22 09:02:55 +0900 |
commit | 17cf21bcf8a2e29d2cbcf0a313474d2a4ee44f5d (patch) | |
tree | 582a9768558d9eaf261ca5df6136e9de54c95816 /service/vehicle/positioning_base_library/library/include | |
parent | 9e86046cdb356913ae026f616e5bf17f6f238aa5 (diff) |
Re-organized sub-directory by category
Since all the sub-directories were placed in the
first level, created sub-directories, "hal", "module",
and "service" for classification and relocated each component.
Signed-off-by: Tadao Tanikawa <tanikawa.tadao@jp.panasonic.com>
Change-Id: Ifdf743ac0d1893bd8e445455cf0d2c199a011d5c
Diffstat (limited to 'service/vehicle/positioning_base_library/library/include')
17 files changed, 3547 insertions, 0 deletions
diff --git a/service/vehicle/positioning_base_library/library/include/DEV_TimerEntryDrv_if.h b/service/vehicle/positioning_base_library/library/include/DEV_TimerEntryDrv_if.h new file mode 100755 index 0000000..141c8d8 --- /dev/null +++ b/service/vehicle/positioning_base_library/library/include/DEV_TimerEntryDrv_if.h @@ -0,0 +1,76 @@ +/* + * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/**************************************************************************** + * File name : DEV_TimerEntryDrv_if.h + * System name : Integrated PF + * Subsystem name : Timer registry drivers + * Title : APIs for Timer registry drivers + ****************************************************************************/ +#ifndef POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_DEV_TIMERENTRYDRV_IF_H_ +#define POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_DEV_TIMERENTRYDRV_IF_H_ + +#include <vehicle_service/positioning_base_library.h> + +/*----------------------------------------------------------------------------- + * Constant definition + *----------------------------------------------------------------------------*/ +/* Return value */ +#define DEV_TED_INVALID (u_int32)0 /* Timer start failure */ +#define DEV_TED_STOP_NG (u_int32)0 /* Timer stop failure */ +#define DEV_TED_STOP_OK (u_int32)1 /* Timer stop success */ + +/* Definitions for event Handle names */ +#define DEV_TED_EVTNAME_MAX (u_int32)32 /* _CWORD64_ Events HANDLE Name */ + +/*----------------------------------------------------------------------------- + * Structure Definition + *----------------------------------------------------------------------------*/ +/* Structures for timer setting instructions (_CWORD64_ messages) */ +typedef struct { + int32 set_time; /* Count time */ + PNO pno; /* _CWORD64_ Messages Destination PNOs */ + u_int32 ext_data; /* Extended Info for _CWORD64_ Messages */ +} stTED_SetTime__CWORD64_msg; + +/* Structures for timer setting directives (Windows events) */ +typedef struct { + int32 set_time; /* Count time */ + char evob_name[DEV_TED_EVTNAME_MAX]; /* _CWORD64_ Events HANDLE Name */ + int32 ext_data; /* _CWORD64_ Events Extended Info */ +} stTED_SetTime__CWORD64_evt; + +/* Structures for sending _CWORD64_ messages */ +typedef struct { + T_APIMSG_MSGBUF_HEADER header; /* _CWORD64_ Message header */ + u_int32 timer_id; /* Timer IDs for _CWORD64_ messages */ + u_int32 us_data; /* Extended Info for _CWORD64_ Messages */ +} stTimer_CWORD64_msg; + +/* Structures for timer setting directives (Windows events) */ +typedef struct { + int32 set_time; /* Count time */ + wchar_t evob_name[DEV_TED_EVTNAME_MAX]; /* _CWORD64_ Events HANDLE Name */ +} stTED_SetTime_winevt; +/* + API Function Prototype +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +u_int32 DEVSetTimer_CWORD64_msg(stTED_SetTime__CWORD64_msg *p_set_data); +u_int32 DEVSetTimer_CWORD64_event(stTED_SetTime__CWORD64_evt *p_set_data); +u_int32 DEVStopTimer(u_int32 time_id); + +#endif // POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_DEV_TIMERENTRYDRV_IF_H_ + diff --git a/service/vehicle/positioning_base_library/library/include/TimerEntryDrv_If.h b/service/vehicle/positioning_base_library/library/include/TimerEntryDrv_If.h new file mode 100755 index 0000000..d20d6f0 --- /dev/null +++ b/service/vehicle/positioning_base_library/library/include/TimerEntryDrv_If.h @@ -0,0 +1,111 @@ +/* + * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * File name : TimerDrv_If.h + * System name : Integrated PF + * Process name : Timer registry driversI/F + * Overview : Timer registry drivers I/F Header file + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +#ifndef POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_TIMERENTRYDRV_IF_H_ +#define POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_TIMERENTRYDRV_IF_H_ + +#include <vehicle_service/positioning_base_library.h> +#include "DEV_TimerEntryDrv_if.h" + +/* + Constant definition +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#define TED_DRV_NAME "TED" /* Channel names of drivers registered in the Timer */ +/* The channel name cannot be a leading slash. Location is under /dev/name/local */ + +/*----------------------------------------------------------------------------- + * CTRL CODE definitions + *----------------------------------------------------------------------------*/ +/* IOCTRL internal-processing sort codes */ +#define TED_IOCTRL_TIMREQ __DIOTF(_DCMD_MISC, 1, stTedApidt) /* Timer start */ +#define TED_IOCTRL_STPREQ __DIOT(_DCMD_MISC, 2, stTedApidt) /* Timer stop */ + +#define TED_IF_SETTIME_MIN (int32)1 /* Minimum count time(1ms) */ + +#define TED_IF_SETPNO_NG (PNO)0 /* PNO invalid value for _CWORD64_ messages */ +#define TED_IF_MMEVENT_INVALID_ID 0 /* Invalid _CWORD64_ EventID */ + +#define TED_IF_RET__CWORD64_MSG (u_int16)1 /* How Users Are Notified on Timeouts: _CWORD64_ Messages */ +#define TED_IF_RET_WINEVT (u_int16)2 /* How Users Are Notified on Timeouts: Windows Events */ + +/* Timer type */ +#define TED_IF_TIMERTYPE_CYCLE 1 /* Fixed period Timer Specified in [10ms] */ +#define TED_IF_TIMERTYPE_SINGLE 2 /* Single occurrence Timer Specified in [10ms] */ + +/* API type(Distinguishing between API Functions Used at Timer Startup) */ +#define TED_IF_APITYPE_SYS 1 /* Timer start by _pb_ReqTimerStart() */ +#define TED_IF_APITYPE_DEV 2 /* Timer start by DEV_SetTimer_XXX() */ + +/* + Data type definition +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* Timer registration data by user(Timer register driver IF -> timer register driver) */ +typedef struct { + int32 time_rem; /* User's remaining timer count time(count value in 10 [msec] units) */ + u_int32 timer_id; /* User's timer ID */ + u_int32 ret_data; /* User's extended information */ + PNO ret_pno; /* User's _CWORD64_ message-destination process number */ + u_int16 fin_mode; /* User Timeout Notification Method */ + char wev_ob_name[DEV_TED_EVTNAME_MAX]; /* Event name(32 characters) */ + u_int32 timer_seq; /* Timer Sequence Number */ + u_int8 time_type; /* Timer type(Fixed period/single occurrence) */ + u_int8 api_type; /* API type(_pb_ReqTimerStart/DEV_SetTimer) */ + u_int8 reserve[2]; +} stTedApidt; +typedef stTedApidt *PTED_IFDT; + +/* Timer Start/Stop Messages Structures, */ +typedef struct { + int32 time_rem; /* User's remaining timer count time(count value in 10 [msec] units) */ + u_int32 timer_id; /* User's timer ID */ + u_int32 ret_data; /* User's extended information */ + PNO ret_pno; /* User's _CWORD64_ message-destination process number */ + u_int16 fin_mode; /* User Timeout Notification Method */ + char wev_ob_name[DEV_TED_EVTNAME_MAX]; /* Event name(32 characters) */ + u_int32 timer_seq; /* Timer Sequence Number */ + u_int8 time_type; /* Timer type(Fixed period/single occurrence) */ + u_int8 api_type; /* API type(_pb_ReqTimerStart/DEV_SetTimer) */ + u_int8 reserve[2]; +} TIMERUSERDATA; + +/* Structures for sending _CWORD64_ message timer START */ +typedef struct { + T_APIMSG_MSGBUF_HEADER header; /* _CWORD64_ Message header */ + /* Extended Info for _CWORD64_ Messages */ + TIMERUSERDATA st_us_data; +} stTimerStart_CWORD64_msg; + +/* Structures for sending _CWORD64_ message timer STOP */ +typedef struct { + T_APIMSG_MSGBUF_HEADER header; /* _CWORD64_ Message header */ + /* Extended Info for _CWORD64_ Messages */ + TIMERUSERDATA st_us_data; +} stTimerStop_CWORD64_msg; + +#endif // POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_TIMERENTRYDRV_IF_H_ +/* +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + End of File : TimerEntryDrv_If.h +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +*/ + diff --git a/service/vehicle/positioning_base_library/library/include/WPF_STD_private.h b/service/vehicle/positioning_base_library/library/include/WPF_STD_private.h new file mode 100755 index 0000000..87f57cd --- /dev/null +++ b/service/vehicle/positioning_base_library/library/include/WPF_STD_private.h @@ -0,0 +1,295 @@ +/* + * @copyright Copyright (c) 2019-2020 TOYOTA MOTOR CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file WPF_STD_private.h + * @brief Header file for system standard definitions + */ + +#ifndef POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_WPF_STD_PRIVATE_H_ +#define POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_WPF_STD_PRIVATE_H_ + +/*---------------------------------------------------------------------------------* + * Incluce * + *---------------------------------------------------------------------------------*/ +#include <vehicle_service/positioning_base_library.h> + +/* _CWORD64_ non-OS managed areas */ +#define SDRAM__CWORD64__NOTOS_AREA 0x00000000 +#define SDRAM__CWORD64__NOTOS_AREA_SIZE 0x0 + +#define BLVER_SIZE 0x00000008 /* BootLoader version information area size */ +#define FROM_FIX_VER_SIZE BLVER_SIZE /* Mask(BootLoder)Version size */ + +/* Start address of the _CWORD64_ non-OS management area */ +#define TOP_ADDR_NOTOS SDRAM__CWORD64__NOTOS_AREA +/* Size of the non-OS management area */ +#define NOTOS_SISE SDRAM__CWORD64__NOTOS_AREA_SIZE + +/* Reserved(32KB)Unavailable */ +#define SRAMDRAM_RESERVE2_SIZE 0x00008000 + +#define WINAPI + +#define STATUS_WAIT_0 ((DWORD)0x00000000L) +#define STATUS_ABANDONED_WAIT_0 ((DWORD)0x00000080L) +#define STATUS_TIMEOUT ((DWORD)0x00000102L) +#define WAIT_TIMEOUT STATUS_TIMEOUT +#define WAIT_OBJECT_0 ((STATUS_WAIT_0) + 0) +#define WAIT_ABANDONED ((STATUS_ABANDONED_WAIT_0) + 0) +#define WAIT_FAILED ((DWORD)0xFFFFFFFF) + +#define SHARED_MEMORY_DIRECTORY ("/tmp/shm/navigation/") + +#define _pb_strcmp(pleft, pright)((strcmp(pleft, pright) == 0) ?(0) :(-1)) + +/* For heap allocation method control */ +#define HEAP_ZERO_MEMORY (0x00000008) + +#define EV_RXCHAR 0x0001 +#define EV_ERROR 0x0080 + +#define EV_DSR 0x0010 + +/* Systems API External Public Functions Prototype Definitions */ +#define VUP_DISC_PATHNAME _T("/Z01") /* VUP DISC paths */ +#define VUP_USB_PATHNAME _T("/U") /* VUP USB paths */ +#define VUP_PATHNAME_SYSTEM _T("/agl/system") /* Storage path name */ +#define VUP_FNAME_TOP _T("/NA_D0_") /* VUPFile name(front) */ +#define VUP_FNAME_BTM _T(".bin") /* VUPFile name(rear) */ +#define VUP_FNAME_FORCEVUP _T("/forcevup.dat") /* Forced VUP file name */ + +#define FROM_VARI_VER_SIZE 8 +#define WRITE_FLAG_ON 0x01 /* Write permission status for the file */ +#define FSNOACCESS 0x00 /* File system access disabled state */ +#define VUP_GETNAME_MEDIA_DISC 0x01 /* VUP media:disc */ + +/* Function Code(Normal completion) */ +#define RET_RCVMSG 1 /* Receive only message */ +#define RET_RCVSIG 2 /* Receive only signal */ +#define RET_RCVBOTH 3 /* Receive both messages and signals */ +#define RET_NOMSG 4 /* No received message */ +/* User-side signal handling return values */ +#define RET_QUE 5 /* Queue a signal */ +#define RET_NOTQUE 6 /* Do not queue signals */ +#define RET_PROCDOWN 7 /* Detect DOWN of children */ +#define RET_SLEEP 100 + +/* Error code system */ +#define RET_OSERROR (-127) /* OS System call error */ +/* Actual error in _sys_GetOSErrorCode() */ +/* Code can be retrieved */ +#define RET_ERRNOTRDY (-3) /* Specified port ID and semaphore ID are not created.*/ +#define RET_ERRPROC (-4) /* Error in API processing */ +#define RET_ERRTIMEOUT (-5) /* Timeout with Processing Not Complete */ +/* (D type API only) */ +#define RET_ERRMSGFULL (-6) /* Message table full */ +#define RET_ERROVERFLW (-7) /* Receive message is larger than the receive buffer size */ +#define RET_ERRINIT (-8) +#define RET_ERRREGQUE (-9) + +#define RET_EV_NONE (-20) /* No specified event */ +#define RET_EV_MAX (-21) /* Event value exceeds the specified maximum value */ +#define RET_EV_MIN (-22) /* The event value is less than the specified minimum value. */ + +#define SAPI_EVSET_RELATE 2 + + +/*---------------------------------------------------------------------------------* + * Typedef declaration * + *---------------------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------------------* + * Struct declaration * + *---------------------------------------------------------------------------------*/ +typedef struct FileTime { + DWORD dw_low_date_time; + DWORD dw_high_date_time; +} FILETIME; +typedef FILETIME *PFILETIME; +typedef FILETIME *LPFILETIME; + +typedef struct Overlapped { + ULONG_PTR internal; + ULONG_PTR internal_high; + union { + struct { + DWORD offset; + DWORD offset_high; + }; + + PVOID pointer; + }; + + HANDLE h_event; +} OVERLAPPED; +typedef OVERLAPPED *LPOVERLAPPED; + +typedef struct ComStat { + DWORD f_cts_hold : 1; + DWORD f_dsr_hold : 1; + DWORD f_rlsd_hold : 1; + DWORD f_x_off_hold : 1; + DWORD f_x_off_sent : 1; + DWORD f_eof : 1; + DWORD f_txim : 1; + DWORD f_reserved : 25; + DWORD cb_in_que; + DWORD cb_out_que; +} COMSTAT; +typedef COMSTAT *LPCOMSTAT; + +typedef struct Dcb { + DWORD dcb_length; /* sizeof(DCB) */ + DWORD baud_rate; /* Baudrate at which running */ + DWORD f_binary: 1; /* Binary Mode (skip EOF check) */ + DWORD f_parity: 1; /* Enable parity checking */ + DWORD f_out_x_cts_flow: 1; /* CTS handshaking on output */ + DWORD f_out_x_dsr_flow: 1; /* DSR handshaking on output */ + DWORD f_dtr_control: 2; /* DTR Flow control */ + DWORD f_dsr_sensitivity: 1; /* DSR Sensitivity */ + DWORD f_tx_continue_on_x_off: 1; /* Continue TX when Xoff sent */ + DWORD f_out_x: 1; /* Enable output X-ON/X-OFF */ + DWORD f_in_x: 1; /* Enable input X-ON/X-OFF */ + DWORD f_error_char: 1; /* Enable Err Replacement */ + DWORD f_null: 1; /* Enable Null stripping */ + DWORD f_rts_control: 2; /* Rts Flow control */ + DWORD f_abort_on_error: 1; /* Abort all reads and writes on Error */ + DWORD f_dummy2: 17; /* Reserved */ + WORD w_reserved; /* Not currently used */ + WORD x_on_lim; /* Transmit X-ON threshold */ + WORD x_off_lim; /* Transmit X-OFF threshold */ + BYTE byte_size; /* Number of bits/byte, 4-8 */ + BYTE parity; /* 0-4=None,Odd,Even,Mark,Space */ + BYTE stop_bits; /* 0,1,2 = 1, 1.5, 2 */ + char x_on_char; /* Tx and Rx X-ON character */ + char x_off_char; /* Tx and Rx X-OFF character */ + char error_char; /* Error replacement char */ + char eof_char; /* End of Input character */ + char evt_char; /* Received Event character */ + WORD w_reserved1; /* Fill for now. */ +} DCB; +typedef DCB *LPDCB; + +typedef struct CommTimeouts { + DWORD read_interval_timeout; /* Maximum time between read chars. */ + DWORD read_total_timeout_multiplier; /* Multiplier of characters. */ + DWORD read_total_timeout_constant; /* Constant in milliseconds. */ + DWORD write_total_timeout_multiplier; /* Multiplier of characters. */ + DWORD write_total_timeout_constant; /* Constant in milliseconds. */ +} COMMTIMEOUTS; +typedef COMMTIMEOUTS *LPCOMMTIMEOUTS; + +typedef struct { + DWORD size; /* Allocated shared memory size */ + DWORD phy_addr; /* Physical address */ + HANDLE h_map; /* +8: Handle of file mapping object. */ + void* p_memory; /* Shared Memory Mapped Address */ + DWORD owner; /* +16: Owner flag. */ + HANDLE h_heap; /* +20: Handle of heap for oneself. */ +} SHARED_MEMORY; + +typedef DWORD (WINAPI *PTHREAD_START_ROUTINE)( + LPVOID lpThreadParameter +); +typedef PTHREAD_START_ROUTINE LPTHREAD_START_ROUTINE; + +/* Program version storage */ +typedef struct { + u_int8 mask_ver[ FROM_FIX_VER_SIZE ]; /* BootLoader programming versions */ + u_int8 flash_ver1[ FROM_VARI_VER_SIZE ]; /* NK1 programming versions */ + u_int8 flash_ver2[ FROM_VARI_VER_SIZE ]; /* NK2 programming versions */ + u_int8 flash_ver3[ FROM_VARI_VER_SIZE ]; /* NK3 programming versions */ +} T_SYS_PRGVER; + +/* Device information storage */ +typedef struct { + u_int8 _CWORD31__no[ _CWORD31__NO_SIZE ]; /* _CWORD31_ product number */ + u_int8 reserve1[ RESERVE1_SIZE ]; /* RESERVE1 */ + u_int8 helpnet_id[ HELPNET_ID_SIZE ]; /* HELPNET ID */ + u_int8 reserve2[ RESERVE2_SIZE ]; /* RESERVE2 */ + u_int8 date[ DATE_SIZE ]; /* Manufacturing date and time */ +} T_SYS_DEVINFO; + +/* Structure for storing display information */ +typedef struct { + int i_width_size; /* Width */ + int i_height_size; /* Height */ +} DISPLAY_INFO; + +/* System error notification message structure */ +typedef struct { + T_APIMSG_MSGBUF_HEADER bhead; /* Message buffer header */ + PNO pno; /* Process No. */ + u_int8 dummy[2]; /* Dummy */ + int32 errcode; /* Error code */ +} T_SYS_SYSTEMERROR; + + +/*---------------------------------------------------------------------------------* + * Prototype Declaration * + *---------------------------------------------------------------------------------*/ +/* Configuration Functions (_pbCommon.cpp) */ +void PbReset(void); /* Soft reset process */ + +/* Message Sending/Receiving Functions (_pbMsg.cpp) */ +RET_API PbDeleteMsg(PNO pno); + +/* SRAM Control Functions (_pbSram.cpp) */ +RET_API PbSramFil32(u_int8 id, u_int32 off, u_int8 pat, u_int32 size); +RET_API PbSramRd32(u_int8 id, u_int32 off, void *pbuf, u_int32 size); +RET_API PbSramSz32(u_int8 id, u_int32 *psize); + +/* DRAM Control Functions (_pbDram.cpp) */ +RET_API PbDramWt32(u_int8 id, void *pbuf, u_int32 off, u_int32 size); + +/* Semaphore(_pbSem.cpp) */ +RET_API PbDeleteSemaphore(SemID sem_id); +DWORD PbDeleteMutex(HANDLE h_mutex); +DWORD PbMutexLock(HANDLE h_mutex, DWORD timeout); +BOOL PbMutexUnlock(HANDLE h_mutex); + +/* Shared Memory Access Functions(_pbMem.cpp) */ +RET_API PbDeleteShareData(char* area_name); +/* Accessing Physical Memory Area Allocation Data */ +RET_API PbAccessPhysicalMem(u_int32 addr, void **mem_ptr, u_int32 size, u_int32 mode); +/* Releases access to the physical memory area allocation data. */ +RET_API PbFreePhysicalMem(u_int32 addr, void *mem_ptr, u_int32 size); + +LPVOID PbProcessHeapAlloc(DWORD dw_flags, SIZE_T dw_bytes); /* Allocating Memory from the Process Heap */ +BOOL PbProcessHeapFree(DWORD dw_flags, LPVOID lp_mem); /* Free Memory Allocated from Process Heap */ + +/* Functions Related to Analysis Support Functions(_pbOther.cpp) */ +uint32_t PbGetTid(void); +uint32_t PbGetLocalTid(void); + +/* Other Functions(_pbMisc.cpp) */ +RET_API PbMilliSecSleep(u_int32 ul_mill_time); /* Sleeping of the calling process */ + +/* TODO As defined in _pbCSection--> */ +VOID PbDeleteCriticalSection(LPCRITICAL_SECTION lp_critical_section); +VOID PbEnterCriticalSection(LPCRITICAL_SECTION lp_critical_section); +VOID PbInitializeCriticalSection(LPCRITICAL_SECTION lp_critical_section); +VOID PbLeaveCriticalSection(LPCRITICAL_SECTION lp_critical_section); + +BOOL PbSystemTimeToFileTime(CONST SYSTEMTIME *lp_system_time, LPFILETIME lp_file_time); + + +/* Memory copy Bus release support */ +void* Memset64pSync(void* dest, int c, size_t count); + +#endif // POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_WPF_STD_PRIVATE_H_ + diff --git a/service/vehicle/positioning_base_library/library/include/_pbCommon.h b/service/vehicle/positioning_base_library/library/include/_pbCommon.h new file mode 100755 index 0000000..8cd1591 --- /dev/null +++ b/service/vehicle/positioning_base_library/library/include/_pbCommon.h @@ -0,0 +1,36 @@ +/* + * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/**************************************************************************** + * File name : _sysCommon.h + * System name : System API + * Subsystem name : Common system + * Title : Internal header for system API infrastructure management + ****************************************************************************/ +#ifndef POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE__PBCOMMON_H_ +#define POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE__PBCOMMON_H_ + +#define PBCOM_CONFIGFILE "config" /* Configuration file */ +#define PBCOM_CONFIGSIZE_MAX (1024) /* Configuration file maximum size */ +#define PBCOM_API_NORMAL (0) /* API processing result normal */ +#define PBCOM_API_ERROR (-1) /* API processing result error */ +#define PBCOM_UNICODE_NUL (0x00) /* NULL character codes */ +#define PBCOM_UNICODE_LF (0x0A) /* Line feed character code */ +#define PBCOM_UTOIMAX_NUM (8) /* Maximum font size */ +#define PBCOM_CONFIG_INDEX_SCRWIDTH "[ScreenWidth]" /* Data information "Screen width" */ +#define PBCOM_CONFIG_INDEX_SCRHEIGHT "[ScreenHeight]" /* Data information "Screen Height" */ + +#endif // POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE__PBCOMMON_H_ diff --git a/service/vehicle/positioning_base_library/library/include/_pbEvent_Internal.h b/service/vehicle/positioning_base_library/library/include/_pbEvent_Internal.h new file mode 100755 index 0000000..d0b6d44 --- /dev/null +++ b/service/vehicle/positioning_base_library/library/include/_pbEvent_Internal.h @@ -0,0 +1,128 @@ +/* + * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/******************************************************************************* +* $Header:: $ +* $Revision:: $ +*******************************************************************************/ + +/**************************************************************************** + * File name : _pbEvent_Internal.h + * System name : GPF + * Subsystem name : _CWORD64_API Events Feature + * Title : Internal definition file for event function + ****************************************************************************/ +#ifndef POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE__PBEVENT_INTERNAL_H_ +#define POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE__PBEVENT_INTERNAL_H_ + +#include <other_service/ev_lib.h> + +/* + Constant definition +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +#define MAX_PB_EVENTS 16 +#define MAX_EVENT_NAME_LEN 32 +#define MIN_EVENT_VAL 0x80000000 /* Minimum event value(-2147483648) */ +#define MAX_EVENT_VAL 0x7FFFFFFF /* Maximum event value( 2147483647) */ +#define EVENT_BIT_ZERO 0x00000000 /* Event value All Bit Zero Definition */ +#define MAX_PB_EVENT_WAIT_THREADS 1 /* Values other than 1 are not designed while the EV library is being used. */ +#define EVSET_ABSOLUTE 1 /* Absolute setting */ +#define EVSET_RELATE 2 /* Relative value setting */ +#define EVSET_AND 3 /* AND value setting */ +#define EVSET_OR 4 /* OR setting */ +#define EVWAIT_VAL 1 /* Waiting mode for an event by specifying a range */ +#define EVWAIT_ALLCLR 2 /* Mode to wait for an event when the specified bit is cleared */ +#define EVWAIT_ANYSET 3 /* Mode to wait for an event with a specified set of bits */ + +#define _CWORD64_EVENT_MAXOPEN_IN_PROCESS 0x7FFFFFFF /* Maximum number of open events in the same process */ +#define _CWORD64_EVENT_MAXOPEN_IN_SYSTEM 0x7FFFFFFF /* Maximum number of the same event open in the system */ + +#define MAX_EVENT_PROC_NUM (32) /* EVENT Max Processes Used */ + +/* + Structure Definition +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/***************************************************************************** + * TAG : WAITING_CONDITION + * ABSTRACT : Event Status Settings +******************************************************************************/ +typedef struct { + u_int8 uc_use_flag; /* Table Usage Flags(TRUE:Use FALSE:Not used) */ + u_int8 uc_waiting; /* Event Waiting Flag */ + /* TRUE Waiting for event */ + /* FALSE Release Event Wait */ + u_int16 us_mode; /* Waiting mode */ + /* EVWAIT_VAL Wait for Value Range */ + /* EVWAIT_ALLCLR Wait for specified bit to be cleared */ + /* EVWAIT_ANYSET Waiting for setting the specified bit */ + u_int32 ul_mask; /* Mask value when waiting for specified bit */ + int32 l_min_val; /* Minimum value of condition when waiting for value range */ + int32 l_max_val; /* Maximum value of condition when waiting for value range */ + int32 l_last_val; /* Events at WaitEvent Return */ + EV_ID flag_id[MAX_EVENT_PROC_NUM]; /* Event flags(CLS event library) */ +} WAITING_CONDITION; /* Total 28 Bytes. */ + +/***************************************************************************** + * TAG : WAITING_CONDITION + * ABSTRACT : Event information storage area +******************************************************************************/ +typedef struct { + TCHAR event_name[MAX_EVENT_NAME_LEN]; /* Maximum number of characters + NULL area */ + int32 l_event_val; + WAITING_CONDITION st_condition[MAX_PB_EVENT_WAIT_THREADS]; + int32 l_process_ref; + int32 l_reset_data; + u_int8 uc_manual_reset; + u_int8 uc_reserve[3]; + char name_of_mutex[NAME_MAX]; + /* TODO: Members for the following EV library use:Structurely strange, but borrowed shared space.Correction is required. */ + u_int8 proc_cnt; +} PB_EVENT; + +/***************************************************************************** + * TAG : PB_EVENT_OPEN_HANDLE + * ABSTRACT : Generated event management information +******************************************************************************/ +typedef struct { + HANDLE h_heap; + PB_EVENT* p_sys_event; + DWORD index; + int32 l_thread_ref; +} PB_EVENT_OPEN_HANDLE; + +/***************************************************************************** + * TAG : PB_EVENT_INSTANCE + * ABSTRACT : Event management table +******************************************************************************/ +typedef struct { + PB_EVENT_OPEN_HANDLE* p_handle_table[MAX_PB_EVENTS]; + HANDLE h_shared_memory; + SemID id_event_table_sem; + PB_EVENT* p_event_table; +} PB_EVENT_INSTANCE; + +/* + Prototype declaration +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + +#endif // POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE__PBEVENT_INTERNAL_H_ diff --git a/service/vehicle/positioning_base_library/library/include/_pbInternalProc.h b/service/vehicle/positioning_base_library/library/include/_pbInternalProc.h new file mode 100755 index 0000000..03bcd03 --- /dev/null +++ b/service/vehicle/positioning_base_library/library/include/_pbInternalProc.h @@ -0,0 +1,41 @@ +/* + * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE__PBINTERNALPROC_H_ +#define POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE__PBINTERNALPROC_H_ + +#define POSITIONINGBASELIBRARY_NON_FD (-1) //!< \~english invalid fd +#define POSITIONINGBASELIBRARY_MAP_NON_INIT (0) //!< \~english init flag for mmap + +#ifdef __cplusplus +extern "C" { +#endif + + int32 InitMutexObject(pthread_mutex_t *p_st_mutex); + + HANDLE CreateSharedMemory(TCHAR* name, DWORD size); + HANDLE OpenSharedMemory(TCHAR* name, DWORD size); + void DeleteAllSharedMemory(void); + void* GetSharedMemoryPtr(HANDLE h_shm); + void CloseSharedMemory(HANDLE h_shm); + void DeleteSharedMemory(TCHAR* name); + HANDLE OpenSharedMemoryAtPhysical(DWORD physical_address, DWORD size, DWORD protect); + +#ifdef __cplusplus +} +#endif + +#endif // POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE__PBINTERNALPROC_H_ diff --git a/service/vehicle/positioning_base_library/library/include/_pbSerial.h b/service/vehicle/positioning_base_library/library/include/_pbSerial.h new file mode 100755 index 0000000..1bedfe8 --- /dev/null +++ b/service/vehicle/positioning_base_library/library/include/_pbSerial.h @@ -0,0 +1,32 @@ +/* + * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#ifndef POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE__PBSERIAL_H_ +#define POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE__PBSERIAL_H_ + +#include <vehicle_service/positioning_base_library.h> + +/* Prototype */ +BOOL SerialTableInit(void); /* Initialization process for each process */ +BOOL SerialTableTerm(void); /* Termination process for each process */ +BOOL SerialObjectTimeoutAdd(HANDLE h_obj, DWORD dw_read_timeout, DWORD dw_write_timeout); /* Timeout registration process */ +BOOL SerialObjectTimeoutGet(HANDLE h_obj, DWORD*, DWORD*); /* Timeout acquisition processing */ +BOOL SerialObjectWaitmaskAdd(HANDLE h_obj, DWORD dw_mask); /* Mask registration process */ +BOOL SerialObjectWaitmaskGet(HANDLE h_obj, DWORD*); /* Mask acquisition processing */ +BOOL SerialObjectDel(HANDLE h_obj); /* Deletion process */ + +#endif // POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE__PBSERIAL_H_ diff --git a/service/vehicle/positioning_base_library/library/include/_pbWaitforsingleobject.h b/service/vehicle/positioning_base_library/library/include/_pbWaitforsingleobject.h new file mode 100755 index 0000000..e4f8eb1 --- /dev/null +++ b/service/vehicle/positioning_base_library/library/include/_pbWaitforsingleobject.h @@ -0,0 +1,40 @@ +/* + * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#ifndef POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE__PBWAITFORSINGLEOBJECT_H_ +#define POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE__PBWAITFORSINGLEOBJECT_H_ + +#include <vehicle_service/positioning_base_library.h> + +typedef enum { + PB_HANDLE_INVAL = 0, + PB_HANDLE_MUTEX, + PB_HANDLE_PROC_SEMAPHORE, + PB_HANDLE_EVENT, + PB_HANDLE_THREAD, + PB_HANDLE_PROCESS, + + PB_HANDLE_KIND_MAX /* Maximum value range check */ +} HANDLE_KIND; + +/* Prototype */ +BOOL WaitObjectInit(void); /* Initialization process for each process */ +BOOL WaitObjectTerm(void); /* Termination process for each process */ +BOOL WaitObjectAdd(HANDLE h_obj, HANDLE_KIND l_kind); /* Registration process */ +BOOL WaitObjectDel(HANDLE h_obj); /* Deletion process */ + +#endif // POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE__PBWAITFORSINGLEOBJECT_H_ diff --git a/service/vehicle/positioning_base_library/library/include/sysup.h b/service/vehicle/positioning_base_library/library/include/sysup.h new file mode 100755 index 0000000..eafca8e --- /dev/null +++ b/service/vehicle/positioning_base_library/library/include/sysup.h @@ -0,0 +1,24 @@ +/* + * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_SYSUP_H_ +#define POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_SYSUP_H_ + +#define SYS_RESET (int32)1 /* Make reset */ +#define SYS_ONLY_RESET (int)2 /* Reset only */ + +#endif // POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_SYSUP_H_ + diff --git a/service/vehicle/positioning_base_library/library/include/sysup_addr.h b/service/vehicle/positioning_base_library/library/include/sysup_addr.h new file mode 100755 index 0000000..9e73bf0 --- /dev/null +++ b/service/vehicle/positioning_base_library/library/include/sysup_addr.h @@ -0,0 +1,227 @@ +/* + * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/************************************************************************ +* File name : sysup_addr.h +* System name : Integrated PF +* Subsystem name : Common system +* Title : Boot-Related Address Definition Header Files +************************************************************************/ + +#ifndef POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_SYSUP_ADDR_H_ +#define POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_SYSUP_ADDR_H_ + +/***************************************************** + * + * Initial management area address space definition + * A: Address, S: Size + ****************************************************/ +/* Note : Don't forget to change sysup_addr.inc at the same time! */ + +/* SDRAM startup identification table (1) A Offset from the beginning 0x0 */ +#define ADDR_SYSUP_DRAM1 ((SDRAM_INITIAL_AREA & ADDR_MASK) | ADDR_P2) // NOLINT(runtime/references) +/* SDRAM startup identification table (1) S */ +#define SIZE_SYSUP_DRAM1 0x00000004 + +/* SDRAM Start Identification Table A Offset from the beginning 0x4 */ +#define ADDR_SYSUP_DRAM_FIX (ADDR_SYSUP_DRAM1 + SIZE_SYSUP_DRAM1) +/* SDRAM Start Identification Table S */ +#define SIZE_SYSUP_DRAM_FIX 0x00000004 + +/* Startup Status Table A Offset from the beginning 0x8 */ +#define ADDR_SYSUP_STS (ADDR_SYSUP_DRAM_FIX + SIZE_SYSUP_DRAM_FIX) +/* Startup Status Table S */ +#define SIZE_SYSUP_STS 0x00000002 + +#define ADDR_SYS_DUMMY1 (ADDR_SYSUP_STS + SIZE_SYSUP_STS) /* Dummy1 A Offset from the beginning 0xa */ +#define SIZE_SYS_DUMMY1 0x00000002 /* Dummy1 S */ + +#define ADDR_UPMODE (ADDR_SYS_DUMMY1 + SIZE_SYS_DUMMY1) /* Boot Mode Save Table A Offset from the beginning 0xc */ +#define SIZE_UPMODE 0x00000004 /* Boot Mode Save Table S */ + +#define ADDR_SYSUP_STS_GINI (ADDR_UPMODE + SIZE_UPMODE) /* System startup status table A Offset from the beginning 0x10 */ +#define SIZE_SYSUP_STS_GINI 0x00000002 /* System startup status table S */ + +/* Fork Failures Recording Table A Offset from the beginning 0x12 */ +#define ADDR_SYSUP_RST_CNT (ADDR_SYSUP_STS_GINI + SIZE_SYSUP_STS_GINI) +/* Fork Failures Recording Table S */ +#define SIZE_SYSUP_RST_CNT 0x00000002 + +/* System anomaly process No. table A Offset from the beginning 0x14 */ +#define ADDR_SYS_ERR_PNO (ADDR_SYSUP_RST_CNT + SIZE_SYSUP_RST_CNT) +/* System anomaly process No. table S */ +#define SIZE_SYS_ERR_PNO 0x00000004 + +/* System error reset cause table A Offset from the beginning 0x18 */ +#define ADDR_SYS_ERR_RST (ADDR_SYS_ERR_PNO + SIZE_SYS_ERR_PNO) +/* System error reset cause table S */ +#define SIZE_SYS_ERR_RST 0x00000004 + +/* System startup failure table A Offset from the beginning 0x1c */ +#define ADDR_SYSUP_ERR_STS (ADDR_SYS_ERR_RST + SIZE_SYS_ERR_RST) +/* System startup failure table S */ +#define SIZE_SYSUP_ERR_STS 0x00000004 + +/* Navigation activation state table A Offset from the beginning 0x20 */ +#define ADDR_NAVIUP_STS (ADDR_SYSUP_ERR_STS + SIZE_SYSUP_ERR_STS) +/* Navigation activation state table S */ +#define SIZE_NAVIUP_STS 0x00000002 + +/* Navigation fork Failed Count Recording Table A Offset from the beginning 0x22*/ +#define ADDR_NAVIUP_RST_CNT (ADDR_NAVIUP_STS + SIZE_NAVIUP_STS) +/* Navigation fork Failed Count Recording Table S */ +#define SIZE_NAVIUP_RST_CNT 0x00000002 + +/* Navigation error process No. table A Offset from the beginning 0x24 */ +#define ADDR_NAVI_ERR_PNO (ADDR_NAVIUP_RST_CNT + SIZE_NAVIUP_RST_CNT) +/* Navigation error process No. table S */ +#define SIZE_NAVI_ERR_PNO 0x00000004 + +/* Navigation Error Cause Table A Offset from the beginning 0x28 */ +#define ADDR_NAVI_ERR (ADDR_NAVI_ERR_PNO + SIZE_NAVI_ERR_PNO) +/* Navigation Error Cause Table S */ +#define SIZE_NAVI_ERR 0x00000004 + +#define ADDR_NAVIUP_ERR_STS (ADDR_NAVI_ERR + SIZE_NAVI_ERR) /* Navigation start failure table A Offset from the beginning 0x2c */ +#define SIZE_NAVIUP_ERR_STS 0x00000004 /* Navigation start failure table S */ + +/* SDRAM startup identification table (2) A Offset from the beginning 0x30 */ +#define ADDR_SYSUP_DRAM2 (ADDR_NAVIUP_ERR_STS + SIZE_NAVIUP_ERR_STS) +/* SDRAM startup identification table (2) S */ +#define SIZE_SYSUP_DRAM2 0x00000004 + +/* SDRAM Backup Status Table A Offset from the beginning 0x34 */ +#define ADDR_SYS_BUP_STS (ADDR_SYSUP_DRAM2 + SIZE_SYSUP_DRAM2) +/* SDRAM Backup Status Table S */ +#define SIZE_SYS_BUP_STS 0x00000004 + +/* NAVI-SYS communication error recording table A Offset from the beginning 0x38 */ +#define ADDR_SYSCOM_STS (ADDR_SYS_BUP_STS + SIZE_SYS_BUP_STS) +/* NAVI-SYS communication error recording table S */ +#define SIZE_SYSCOM_STS 0x00000004 + +/* SDRAM Power Supply Fault Detection Table A Offset from the beginning 0x3c */ +#define ADDR_SYS_PW_STS (ADDR_SYSCOM_STS + SIZE_SYSCOM_STS) +/* SDRAM Power Supply Fault Detection Table S */ +#define SIZE_SYS_PW_STS 0x00000004 + +/* Hard WDT generation table A Offset from the beginning 0x40 */ +#define ADDR_HWDT_STS (ADDR_SYS_PW_STS + SIZE_SYS_PW_STS) +/* Hard WDT generation table S */ +#define SIZE_HWDT_STS 0x00000004 + +/* SDRAM Labels Destruct Status Detection Table A Offset from the beginning 0x44 */ +#define ADDR_DRAMLABEL_STS (ADDR_HWDT_STS + SIZE_HWDT_STS) +/* SDRAM Labels Destruct Status Detection Table S */ +#define SIZE_DRAMLABEL_STS 0x00000004 + +#define ADDR_SSB_MNG (ADDR_DRAMLABEL_STS + SIZE_DRAMLABEL_STS) /* SSB management table A Offset from the beginning 0x48 */ +#define SIZE_SSB_MNG 0x00000004 /* SSB management table S */ + +#define ADDR_NMI_END (ADDR_SSB_MNG + SIZE_SSB_MNG) /* NMI completion flag A Offset from the beginning 0x4c */ +#define SIZE_NMI_END 0x00000004 /* NMI completion flag S */ + +/* Opening indication determination table A Offset from the beginning 0x50 */ +#define ADDR_OPDSP_CHK (ADDR_NMI_END + SIZE_NMI_END) +/* Opening indication determination table S */ +#define SIZE_OPDSP_CHK 0x00000004 + +#define ADDR_SYS_FROM_STS (ADDR_OPDSP_CHK + SIZE_OPDSP_CHK) /* FROM destruction status table A Offset from the beginning 0x54 */ +#define SIZE_SYS_FROM_STS 0x00000004 /* FROM destruction status table S */ + +/* BootLoader status A Offset from the beginning 0x58 */ +#define ADDR_BOOT_STS (ADDR_SYS_FROM_STS + SIZE_SYS_FROM_STS) +/* BootLoader status S */ +#define SIZE_BOOT_STS 0x00000004 + +/* BootLoader Exceptions Recording Table A Offset from the beginning 0x5c */ +#define ADDR_BOOTEXP_LOG (ADDR_BOOT_STS + SIZE_BOOT_STS) +/* BootLoader Exceptions Recording Table S */ +#define SIZE_BOOTEXP_LOG 0x00000004 + +/* SDRAM startup identification table (3) A Offset from the beginning0x60 */ +#define ADDR_SYSUP_DRAM3 (ADDR_BOOTEXP_LOG + SIZE_BOOTEXP_LOG) +/* SDRAM startup identification table (3) S */ +#define SIZE_SYSUP_DRAM3 0x00000004 + +/* Error Logging Table in BootLoader Drivers A Offset from the beginning 0x64 */ +#define ADDR_BOOTERR_LOG (ADDR_SYSUP_DRAM3 + SIZE_SYSUP_DRAM3) +/* Error Logging Table in BootLoader Drivers S */ +#define SIZE_BOOTERR_LOG 0x00000004 + +/* EPC register values at the time of exceptions in the BootLoader A Offset from the beginning 0x68 */ +#define ADDR_BOOT_EPC (ADDR_BOOTERR_LOG + SIZE_BOOTERR_LOG) +/* EPC register values at the time of exceptions in the BootLoader S */ +#define SIZE_BOOT_EPC 0x00000004 + +/* Status register when exceptions occur in the BootLoader A Offset from the beginning 0x6c */ +#define ADDR_BOOT_SR (ADDR_BOOT_EPC + SIZE_BOOT_EPC) +/* Status register when exceptions occur in the BootLoader S */ +#define SIZE_BOOT_SR 0x00000004 + +/* Cause Register Values When Internal BootLoader Exceptions Occur A Offset from the beginning 0x70 */ +#define ADDR_BOOT_CAUSE (ADDR_BOOT_SR + SIZE_BOOT_SR) +/* Cause Register Values When Internal BootLoader Exceptions Occur S */ +#define SIZE_BOOT_CAUSE 0x00000004 + +/* NMI completion flag(Copying) A Offset from the beginning 0x74 */ +#define ADDR_NMI_END_CPY (ADDR_BOOT_CAUSE + SIZE_BOOT_CAUSE) +/* NMI completion flag(Copying) S */ +#define SIZE_NMI_END_CPY 0x00000004 + +/* Target Type A Offset from the beginning 0x78 */ +#define ADDR_TARGET (ADDR_NMI_END_CPY + SIZE_NMI_END_CPY) +/* Target Type S */ +#define SIZE_TARGET 0x00000004 + +#define ADDR_SYS_NR_RST (ADDR_TARGET + SIZE_TARGET) /* Normal reset factor table A 0x7c */ +#define SIZE_SYS_NR_RST 0x00000004 /* Normal reset factor table S */ + +#define ADDR_NK_LOAD_STS (ADDR_SYS_NR_RST + SIZE_SYS_NR_RST) /* NK Load Status Table A 0x80 */ +#define SIZE_NK_LOAD_STS 0x00000004 /* NK Load Status Table S */ + +#define ADDR_CRC_RETRY (ADDR_NK_LOAD_STS + SIZE_NK_LOAD_STS) /* CRC retry count table A 0x84 */ +#define SIZE_CRC_RETRY 0x00000004 /* CRC retry count table S */ + +#define ADDR_BOOT_VBR (ADDR_CRC_RETRY + SIZE_CRC_RETRY) /* VBR-saved table in BootLoaderr A 0x88 */ +#define SIZE_BOOT_VBR 0x00000004 /* VBR-saved table in BootLoaderr S */ + +#define ADDR_MONI_TYPE (ADDR_BOOT_VBR + SIZE_BOOT_VBR) /* Monitor Type Table A 0x8C */ +#define SIZE_MONI_TYPE 0x00000004 /* Monitor Type Table S */ + +#define ADDR_B_FLAG (ADDR_MONI_TYPE + SIZE_MONI_TYPE) /* B genuine flag A 0x90 */ +#define SIZE_B_FLAG 0x00000010 /* B genuine flag S */ + +#define ADDR_RGBCABLE_TYPE (ADDR_B_FLAG + SIZE_B_FLAG) /* Connection RGB Cable Type Table A 0xA0 */ +#define SIZE_RGBCABLE_TYPE 0x0000004 /* Connection RGB Cable Type Table S */ + +#define ADDR_RESET_LABEL (ADDR_RGBCABLE_TYPE + SIZE_RGBCABLE_TYPE) /* Normal reset label area A 0xA4 */ +#define SIZE_RESET_LABEL 0x00000010 /* Normal reset label area S */ + +#define ADDR_NK_VUP_FLAG (ADDR_RESET_LABEL + SIZE_RESET_LABEL) /* NK version upgrade flag A 0xB4 */ +#define SIZE_NK_VUP_FLAG 0x00000004 /* NK version upgrade flag S */ + +#define ADDR_TRANS_VUP (ADDR_NK_VUP_FLAG + SIZE_NK_VUP_FLAG) /* VUP migration flag A */ +#define SIZE_TRANS_VUP 0x00000004 /* VUP migration flag S */ + +#define ADDR_PRG_SPAR_BOOT (ADDR_TRANS_VUP + SIZE_TRANS_VUP) /* Preliminary program start occurrence flag A */ +#define SIZE_ADDR_PRG_SPAR_BOOT 0x00000004 /* Preliminary program start occurrence flag S */ + +#define ADDR_BOOT_ERR (ADDR_PRG_SPAR_BOOT + SIZE_ADDR_PRG_SPAR_BOOT) /* OS Pre-boot Error Information Storage Table A */ +#define SIZE_BOOT_ERR 0x00000004 /* OS Pre-boot Error Information Storage Table S */ + +#endif // POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_SYSUP_ADDR_H_ + diff --git a/service/vehicle/positioning_base_library/library/include/tchar.h b/service/vehicle/positioning_base_library/library/include/tchar.h new file mode 100755 index 0000000..ee45e4d --- /dev/null +++ b/service/vehicle/positioning_base_library/library/include/tchar.h @@ -0,0 +1,256 @@ +/* + * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + + +#ifndef POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_TCHAR_H_ +#define POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_TCHAR_H_ + +#include <stdlib.h> + +#ifdef __cplusplus +extern "C" { +#endif + +#define _T(x) __TEXT(x) + +#ifdef UNICODE + /* ++++++++++++++++++++ UNICODE ++++++++++++++++++++ */ + +#define _TEOF WEOF + +#define _tmain wmain + +#ifdef UNDER_CE +# define _tWinMain WinMain +#else +# define _tWinMain wWinMain +#endif + + /* Formatted i/o */ +#define _tprintf wprintf +#define _ftprintf fwprintf +#define _stprintf swprintf +#define _sntprintf _snwprintf +#define _vtprintf vwprintf +#define _vftprintf vfwprintf +#define _vstprintf vswprintf +#define _vsntprintf _vsnwprintf +#define _tscanf wscanf +#define _ftscanf fwscanf +#define _stscanf swscanf + + /* Unformatted i/o */ +#define _fgettc fgetwc +#define _fgetts fgetws +#define _fputtc fputwc +#define _fputts fputws +#define _gettc getwc +#define _gettchar getwchar +#define _getts _getws +#define _puttc putwc +#define _puttchar putwchar +#define _putts _putws +#define _ungettc ungetwc + +#define _tfopen _wfopen +#define _tfreopen _wfreopen + + /* String conversion functions */ +#define _tcstod wcstod +#define _tcstol wcstol +#define _tcstoul wcstoul + +#define _itot _itow +#define _ltot _ltow +#define _ultot _ultow +#define _ttoi _wtoi +#define _ttol _wtol +#define _ttoi64 _wtoi64 + + /* String functions */ +#define _tcscat wcscat +#define _tcschr wcschr +#define _tcscmp wcscmp +#define _tcscpy wcscpy +#define _tcscspn wcscspn +#define _tcslen wcslen +#define _tcsclen wcslen + +#define _tcsncat wcsncat +#define _tcsnccat wcsncat +#define _tcsnccmp wcsncmp +#define _tcsncmp wcsncmp +#define _tcsncpy wcsncpy +#define _tcsnccpy wcsncpy +#define _tcspbrk wcspbrk +#define _tcsrchr wcsrchr +#define _tcsspn wcsspn +#define _tcsstr wcsstr +#define _tcstok wcstok +#define _tcsdup _wcsdup +#define _tcsicmp _wcsicmp +#define _tcsncicmp _wcsnicmp +#define _tcsnicmp _wcsnicmp +#define _tcsnset _wcsnset +#define _tcsncset _wcsnset +#define _tcsrev _wcsrev +#define _tcsset _wcsset + +#define _tcslwr _wcslwr +#define _tcsupr _wcsupr + +#define _istalpha iswalpha +#define _istupper iswupper +#define _istlower iswlower +#define _istdigit iswdigit +#define _istxdigit iswxdigit +#define _istspace iswspace +#define _istpunct iswpunct +#define _istalnum iswalnum +#define _istprint iswprint +#define _istgraph iswgraph +#define _istcntrl iswcntrl +#define _istascii iswascii + +#define _totupper towupper +#define _totlower towlower + +#define _istlegal(_c) (1) +#define _istlead(_c) (0) +#define _istleadbyte(_c) (0) + +#else /* ndef UNICODE */ + + /* ++++++++++++++++++++ SBCS (MBCS in Not supported) ++++++++++++++++++++ */ + +#define _TEOF EOF + + /* Program */ +#define _tmain main +#define _tWinMain WinMain + + /* Formatted i/o */ +#define _tprintf printf +#define _ftprintf fprintf +#define _stprintf sprintf +#define _sntprintf _snprintf +#define _vtprintf vprintf +#define _vftprintf vfprintf +#define _vstprintf vsprintf +#define _vsntprintf _vsnprintf +#define _tscanf scanf +#define _ftscanf fscanf +#define _stscanf sscanf + + /* Unformatted i/o */ +#define _fgettc fgetc +#define _fgetts fgets +#define _fputtc fputc +#define _fputts fputs +#define _gettc getc +#define _gettchar getchar +#define _getts gets +#define _puttc putc +#define _puttchar putchar +#define _putts puts +#define _ungettc ungetc + +#define _tfopen _wfopen +#define _tfreopen _wfreopen + +#ifndef UNDER_CE + +#define _tcstod strtod +#define _tcstol strtol +#define _tcstoul strtoul +#endif + +#define _itot _itoa +#define _ltot _ltoa +#define _ultot _ultoa +#define _ttoi atoi +#define _ttol atol + +#ifndef UNDER_CE +#define _ttoi64 atoi64 +#endif + + /* String functions */ +#define _tcscat strcat +#define _tcschr strchr +#define _tcscmp strcmp +#define _tcscpy strcpy +#define _tcscspn strcspn +#define _tcslen strlen +#define _tcsclen strlen + +#define _tcsncat strncat +#define _tcsnccat strncat +#define _tcsnccmp strncmp +#define _tcsncmp strncmp +#define _tcsncpy strncpy +#define _tcsnccpy strncpy + +#ifndef UNDER_CE + +#define _tcspbrk strpbrk +#define _tcsrchr strrchr +#define _tcsspn strspn +#endif + +#define _tcsstr strstr +#define _tcstok strtok + +#ifndef UNDER_CE + +#define _tcsdup _strdup +#define _tcsicmp _stricmp +#define _tcsncicmp _strnicmp +#define _tcsnicmp _strnicmp +#define _tcsnset _strnset +#define _tcsncset _strnset +#define _tcsrev _strrev +#define _tcsset _strset +#define _tcslwr _strlwr +#define _tcsupr _strupr +#endif + +#ifndef UNDER_CE + +#define _istalpha isalpha +#define _istupper isupper +#define _istlower islower +#define _istdigit isdigit +#define _istxdigit isxdigit +#define _istspace isspace +#define _istpunct ispunct +#define _istalnum isalnum +#define _istprint isprint +#define _istgraph isgraph +#define _istcntrl iscntrl +#define _istascii isascii +#define _totupper toupper +#define _totlower tolower +#endif + +#endif /* UNICODE */ + +#ifdef __cplusplus +} +#endif + +#endif // POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_TCHAR_H_ diff --git a/service/vehicle/positioning_base_library/library/include/vehicle_service/WPF_STD.h b/service/vehicle/positioning_base_library/library/include/vehicle_service/WPF_STD.h new file mode 100755 index 0000000..085640a --- /dev/null +++ b/service/vehicle/positioning_base_library/library/include/vehicle_service/WPF_STD.h @@ -0,0 +1,1653 @@ +/* + * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_VEHICLE_SERVICE_WPF_STD_H_ +#define POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_VEHICLE_SERVICE_WPF_STD_H_ + +/** + * @file WPF_STD.h + * @brief Header file for system standard definitions + */ + +/** @addtogroup BaseSystem + * @{ + */ +/** @addtogroup vehicle_service + * @ingroup BaseSystem + * @{ + */ +/** @addtogroup positioning_base_library + * @ingroup vehicle_service + * @{ + */ + +/*---------------------------------------------------------------------------------* + * Incluce * + *---------------------------------------------------------------------------------*/ +#include <string.h> +#include <stdlib.h> +#include <limits.h> +#include <unistd.h> +#include <pthread.h> +#include <wchar.h> +#include <sys/prctl.h> +#include <sys/stat.h> +#include <native_service/wpf_legacy.h> +#include <vehicle_service/std_types.h> +#include <vehicle_service/pos_message_header.h> +#include <vehicle_service/sys_timerapi.h> +#include <vehicle_service/positioning_positioningbaselibrarylog.h> + +/*---------------------------------------------------------------------------------* + * Definition * + *---------------------------------------------------------------------------------*/ +#define POS_THREAD_NAME "Positioning" //!< \~english Positioning thread name + +#ifdef UNICODE +#define __TEXT(quote) L##quote +#else /* UNICODE */ +#define __TEXT(quote) (quote) /* r_winnt */ +#endif /* UNICODE */ + +#define D_LTEXT(x) __TEXT(x) +#define LTEXT(x) D_LTEXT(x) + +#define DEBUG_DUMP_MAX_SIZE 4096 +//!< \~english FrameworkunifiedOnDebugDump max size + +/* Sensor Log Type */ +#define POS_SENSLOG_TYPE_NONE 0 //!< \~english sensor log type NONE +#define POS_SENSLOG_TYPE_SYS 1 //!< \~english sensor log type SYS +#define POS_SENSLOG_TYPE_GPS 2 //!< \~english sensor log type GPS +#define POS_SENSLOG_TYPE_NAV 3 //!< \~english sensor log type NAV +#define POS_SENSLOG_TYPE_CMD 4 //!< \~english sensor log type CMD + +#define POS_SENSLOG_GET_ZONE(typ) \ + (((typ) == (POS_SENSLOG_TYPE_SYS))?(ZONE_POS_SYS_IN):\ + ((typ) == (POS_SENSLOG_TYPE_GPS))?(ZONE_POS_GPS_IN):\ + ((typ) == (POS_SENSLOG_TYPE_NAV))?(ZONE_POS_NAV_IN):\ + ((typ) == (POS_SENSLOG_TYPE_CMD))?(ZONE_POS_CMD_IN):\ + (0)) +//!< \~english get sensor log zone code + +#define POS_WRITE_SENSLOG(zone, data, len) (((zone) != (0))?((void)((FRAMEWORKUNIFIEDLOG_DATA(zone, data, len)))):((void)(0))) +//!< \~english write sensor log output +#define POS_SENSLOG(typ, data, len) (POS_WRITE_SENSLOG(POS_SENSLOG_GET_ZONE(typ), data, len)) + +/* HW configuration type */ +/* + * Note. + * This feature needs to be defined by the vendor. + */ +#define UNIT_TYPE_NONE 0x00000000UL //!< \~english type none +#define UNIT_TYPE_UNKNOWN 0x00000001UL //!< \~english type unknown +#define UNIT_TYPE_GRADE1 0x00000002UL //!< \~english type Grade1 +#define UNIT_TYPE_GRADE2 0x00000004UL //!< \~english type Grade2 + +#define MAX_NAME_LEN 32 //!< \~english name max length +#define _CWORD31__NO_SIZE 16 //!< \~english _CWORD31_ No size +#define RESERVE1_SIZE 16 //!< \~english reserve 1 +#define HELPNET_ID_SIZE 21 //!< \~english helpnet ID size +#define RESERVE2_SIZE 11 //!< \~english reserve 2 +#define DATE_SIZE 32 //!< \~english make time size +#define SERIAL_NO_SIZE 3 //!< \~english serial No size +#define PRODUCT_NAME_SIZE 1 //!< \~english product name size + +#define _pb_memcpy memcpy +#define _pb_memset memset + +/* RET_API define */ +#define RET_NORMAL 0 //!< \~english normal return +#define RET_ERROR (-1) //!< \~english error return +#define RET_ERRPARAM (-2) //!< \~english parameter error + +#define SAPI_EVSET_ABSOLUTE 1 //!< \~english absolute vale set +#define SAPI_EVWAIT_VAL 1 //!< \~english event wait value set + +/* sys common commandID definition */ +#define CID_GPS_BASE (CID)0xF030 +//!< \~english GPS + +#define CID_TIMER_BASE (CID)0xF040 +//!< \~english timer management + +#define CID_INITIAL_BASE (CID)0xF100 +//!< \~english initial + +/* ResourceManager/CID definition */ +#define CID_GPS_SERIAL0 (CID)0x0100 +//!< \~english GPS reset request func definition + +#define CID_GPS_REQRESET (CID)(CID_GPS_BASE | CID_GPS_SERIAL0) +//!< \~english GPS reset request CID + + +/* sys common commandID detail definition */ +#define CID_COM_SERIAL4 (CID)0x0004 +//!< \~english serial command ID 4 + +#define CID_COM_SERIAL6 (CID)0x0006 +//!< \~english serial command ID 6 + +#define CID_COM_SERIAL7 (CID)0x0007 +//!< \~english serial command ID 7 + +/* initial CID definition */ +#define CID_INI_SYSTEMERR (CID)(CID_INITIAL_BASE | CID_COM_SERIAL6) +//!< \~english system abnormality notify + +#define CID_INI_INTERNAL_ACCOFF_START (CID)(CID_INITIAL_BASE | CID_COM_SERIAL7) +//!< \~english internal ACC-OFF start Indication + +/* timer control CID definition */ +#define CID_TIMER_TOUT (CID)(CID_TIMER_BASE | CID_COM_SERIAL4) +//!< \~english timeout notify + + +/* PNO definition */ +#define PNO_NONE 0x0000 //!< \~english initial value + +#define PNO__CWORD88___CWORD23_ 0x0100 +//!< \~english _CWORD23_ primary thread +#define PNO_GINI_MAIN 0x0300 +//!< \~english G initial +#define PNO_CLK_GPS 0x0316 +//!< \~english clock GPS thread +#define PNO_VEHICLE_SENSOR 0x0363 +//!< \~english vehicle sensor thread +#define PNO_LINE_SENS_DRV 0x0364 +//!< \~english line sensor driver thread +#define PNO_NAVI_GPS_MAIN 0x0440 +//!< \~english GPS communication manager thread +#define PNO_NAVI_GPS_RCV 0x0441 +//!< \~english GPS receive thread +#define PNO__CWORD83_ 0x0900 +//!< \~english _CWORD83_(Intersystem Communication Message)thread + +#define SYS_PNO_MIN PNO__CWORD88___CWORD23_ +//!< \~english minimum PNO.(normal process) +#define SYS_PNO_MAX PNO__CWORD83_ +//!< \~english maximum PNO.(normal process) + +/*---------------------------------------------------------------------------------* + * Typedef declaration * + *---------------------------------------------------------------------------------*/ +typedef u_int32 EventID; +typedef int32 RET_API; //!< \~english _CWORD64_API return code +typedef u_int32 event_id; +typedef event_id SemID; //!< \~english semaphore ID +typedef u_int16 CID; //!< \~english command ID + +typedef uint32_t UNIT_TYPE; //!< \~english unit type data type define +typedef int32 ANA_RET_API; + +typedef char TCHAR; + +/** + * @enum _RcvMsgMode + * \~english mode of receive message + */ +typedef enum { + RM_WAIT, //!< \~english wait until received message + RM_CHECKRCV //!< \~english do not wait message, return +} _RcvMsgMode; + +/** + * @enum + * \~english definition of event reset mode + */ +enum { + _CWORD64_EVENT_MANUALRESET_OFF = 0, //!< \~english manual reset off + _CWORD64_EVENT_MANUALRESET_ON, //!< \~english manual reset on + _CWORD64_EVENT_MANUALRESET_MAX //!< \~english manual reset max value +}; + + +/*---------------------------------------------------------------------------------* + * Struct declaration * + *---------------------------------------------------------------------------------*/ +/** + * @struct _SECURITY_ATTRIBUTES + * \~english security attribute + */ +typedef struct _SECURITY_ATTRIBUTES { + DWORD nLength; //!< \~english length + LPVOID lpSecurityDescriptor; //!< \~english data pointer + BOOL bInheritHandle; //!< \~english inherited handle +} SECURITY_ATTRIBUTES; +typedef SECURITY_ATTRIBUTES *PSECURITY_ATTRIBUTES; //!< \~english security attribute +typedef SECURITY_ATTRIBUTES *LPSECURITY_ATTRIBUTES; //!< \~english security attribute + +/*---------------------------------------------------------------------------------* + * Prototype Declaration * + *---------------------------------------------------------------------------------*/ + +#ifdef __cplusplus +extern "C" { +#endif + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Create event by specified name +/// +/// \~english @param [in] ucManualReset +/// - u_int8 manual reset mode +/// \~english @param [in] lInitData +/// - int32 event value +/// \~english @param [in] cpEventName +/// - char* event name +/// +/// \~english @par +/// - manual reset mode(ucManualReset) +/// - _CWORD64_EVENT_MANUALRESET_OFF manual reset OFF +/// - _CWORD64_EVENT_MANUALRESET_ON manual reset ON +/// +/// \~english @retval 0 event create failed +/// \~english @retval not 0 created event ID +/// +/// \~english @par Precondition +/// - positioning_base_library initialization are completed \n +/// (_pb_Setup_CWORD64_API has already been called) in current process. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Failure condition +/// - The parameter cpEventName is NULL +/// - The parameter ucManualReset is more than or equal _CWORD64_EVENT_MANUALRESET_MAX +/// - The string of parameter cpEventName has no text +/// - The string length of parameter cpEventName is longer than MAX_EVENT_NAME_LEN +/// - The event is created in same process, but the count of thread reference to the event is reach to the max +/// - The event is created in system, but the count of process reference to the event is reach to the max +/// - Memory allocate failed for creating event table +/// - During create the event table, the event flag register failed +/// - The event table is full +/// +/// \~english @par Detail +/// - Call this API to create event and return the created event ID. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Sync +/// +//////////////////////////////////////////////////////////////////////////////////////////// +EventID _pb_CreateEvent(u_int8 ucManualReset, int32 lInitData, char *cpEventName); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Wait for the event specified by ID +/// +/// \~english @param [in] eventID +/// - EventID event ID +/// \~english @param [in] lWaitMode +/// - int32 event wait mode +/// \~english @param [in] lMinVal +/// - int32 event wait min value +/// \~english @param [in] lMaxVal +/// - int32 event wait max value +/// \~english @param [out] plEventVal +/// - int32* event wait value output pointer +/// \~english @param [in] ulMillSecTime +/// - u_int32 timeout time(ms) +/// +/// \~english @par +/// - event wait mode(lWaitMode) +/// - SAPI_EVWAIT_VAL +/// +/// \~english @retval RET_NORMAL normal return +/// \~english @retval RET_EV_NONE parameter error or specified event not exist +/// \~english @retval RET_ERRTIMEOUT timeout +/// \~english @retval RET_ERROR other error +/// +/// \~english @par Precondition +/// - positioning_base_library initialization are completed \n +/// (_pb_Setup_CWORD64_API has already been called) in current process. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Failure condition +/// - The parameter plEventVal is NULL +/// - The parameter eventID is more than MAX_PB_EVENTS +/// - The specified event has not been registered in event table +/// - The count of threads which is waiting this event is reach max +/// - The parameter ulMillSecTime is 0 +/// - The parameter ulMillSecTime is INFINITE, and wait event flag failed +/// - The parameter ulMillSecTime is not INFINITE, and timeout +/// - The parameter ulMillSecTime is not INFINITE, and get event flag failed +/// +/// \~english @par Detail +/// - Call this API to wait event. +/// - This API will return after timeout or this event been set. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Sync +/// +//////////////////////////////////////////////////////////////////////////////////////////// +RET_API _pb_WaitEvent(EventID eventID, int32 lWaitMode, int32 lMinVal, + int32 lMaxVal, int32* plEventVal, u_int32 ulMillSecTime); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Set the value of event specified by ID +/// +/// \~english @param [in] eventID +/// - EventID event ID +/// \~english @param [in] lSetMode +/// - int32 event value set mode +/// \~english @param [in] iVal +/// - int32 event value +/// +/// \~english @par +/// - event value set mode(lSetMode) +/// - SAPI_EVSET_ABSOLUTE absolute value set(set parameter value) +/// - SAPI_EVSET_RELATE offset set(offset of current value set) +/// +/// \~english @retval RET_NORMAL normal return +/// \~english @retval RET_ERRPARAM parameter error +/// \~english @retval RET_EV_NONE specified event not exist +/// +/// \~english @par Precondition +/// - positioning_base_library initialization are completed \n +/// (_pb_Setup_CWORD64_API has already been called) in current process. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Failure condition +/// - The parameter eventID is more than MAX_PB_EVENTS +/// - The specified event has not been registered in event table +/// - The parameter lSetMode is neither SAPI_EVSET_ABSOLUTE nor SAPI_EVSET_RELATE +/// +/// \~english @par Detail +/// - Call this API to set event value. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Fire and Forget +/// +//////////////////////////////////////////////////////////////////////////////////////////// +RET_API _pb_SetEvent(EventID eventID, int32 lSetMode, int32 lval); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Destroy the event specified by ID +/// +/// \~english @param [in] eventID +/// - EventID event ID +/// +/// \~english @retval RET_NORMAL normal return +/// \~english @retval RET_ERROR event flag destroy failed +/// \~english @retval RET_EV_NONE specified event not exist +/// +/// \~english @par Precondition +/// - positioning_base_library initialization are completed \n +/// (_pb_Setup_CWORD64_API has already been called) in current process. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Failure condition +/// - The parameter eventID is more than MAX_PB_EVENTS +/// - The specified event has not been registered in event table +/// - Event flag destroy failed +/// +/// \~english @par Detail +/// - Call this API to destroy specified event. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Fire and Forget +/// +//////////////////////////////////////////////////////////////////////////////////////////// +RET_API _pb_DeleteEvent(EventID eventID); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Initialization before call Base API(every process used Base API should call this API firstly). +/// +/// \~english @param [in] hApp +/// - HANDLE app Handle +/// +/// \~english @retval RET_NORMAL normal return +/// +/// \~english @par Precondition +/// - The creation/initialization(FrameworkunifiedCreateDispatcherWithoutLoop and etc.) of the dispatcher for App are completed. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Detail +/// - Call this API to initialize Base API. +/// - Every process used Base API should call this API firstly. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Fire and Forget +/// +//////////////////////////////////////////////////////////////////////////////////////////// +RET_API _pb_Setup_CWORD64_API(HANDLE hApp); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Terminate current thread. +/// +/// \~english @param [in] dwExitCode +/// - DWORD exit code(not used) +/// +/// \~english @retval None +/// +/// \~english @par Precondition +/// - None +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Detail +/// - Call this API to terminate current thread. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Fire and Forget +/// +//////////////////////////////////////////////////////////////////////////////////////////// +VOID _pb_ExitThread(DWORD dwExitCode); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Create the message queue +/// +/// \~english @param [in] eventID +/// - EventID process No +/// +/// \~english @retval RET_NORMAL normal return +/// \~english @retval RET_ERRPARAM parameter error +/// +/// \~english @par Precondition +/// - positioning_base_library initialization are completed \n +/// (_pb_Setup_CWORD64_API has already been called) in current process. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Failure condition +/// - The parameter pno is 0 +/// - The name length of thread called this API is longer than MAX_QUEUE_NAME_SIZE +/// +/// \~english @par Detail +/// - Call this API to create the message queue. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Fire and Forget +/// +//////////////////////////////////////////////////////////////////////////////////////////// +RET_API _pb_CreateMsg(PNO pno); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Send message in process +/// +/// \~english @param [in] pno +/// - PNO process No +/// \~english @param [in] size +/// - u_int16 message size +/// \~english @param [in] msgbuf +/// - void* message buffer +/// \~english @param [in] mode +/// - u_int16 not used +/// +/// \~english @retval RET_NORMAL normal return +/// \~english @retval RET_ERRPARAM parameter error +/// \~english @retval RET_ERROR other error +/// +/// \~english @par Precondition +/// - positioning_base_library initialization are completed \n +/// (_pb_Setup_CWORD64_API has already been called) in current process. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Failure condition +/// - The parameter msgbuf is NULL +/// - The parameter pno is 0 +/// - The message queue specified by parameter pno has not been created +/// - Get sender Handle failed +/// - Send message failed +/// +/// \~english @par Detail +/// - Call this API to send message in process. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Fire and Forget +/// +//////////////////////////////////////////////////////////////////////////////////////////// +RET_API _pb_SndMsg(PNO pno, u_int16 size, void* msgbuf, u_int16 mode); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Send message between process +/// +/// \~english @param [in] name +/// - PCSTR destination process name +/// \~english @param [in] cid +/// - CID command ID +/// \~english @param [in] size +/// - u_int16 message size +/// \~english @param [in] msgbuf +/// - const void* message buffer +/// \~english @param [in] mode +/// - u_int16 not used +/// +/// \~english @retval RET_NORMAL normal return +/// \~english @retval RET_ERRPARAM parameter error +/// \~english @retval RET_ERROR other error +/// +/// \~english @par Precondition +/// - positioning_base_library initialization are completed \n +/// (_pb_Setup_CWORD64_API has already been called) in current process. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Failure condition +/// - The parameter name is NULL +/// - The parameter msgbuf is NULL +/// - The length of parameter name is longer than MAX_QUEUE_NAME_SIZE +/// - Get sender Handle failed +/// - Send message failed +/// +/// \~english @par Detail +/// - Call this API to send message between process. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Fire and Forget +/// +//////////////////////////////////////////////////////////////////////////////////////////// +RET_API _pb_SndMsg_Ext(PCSTR name, CID cid, u_int16 size, const void* msgbuf, u_int16 mode); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Create semaphore by specified name +/// +/// \~english @param [in] semName +/// - char* semaphore name +/// +/// \~english @retval 0 semaphore create failed +/// \~english @retval not 0 created semaphore ID +/// +/// \~english @par Precondition +/// - positioning_base_library initialization are completed \n +/// (_pb_Setup_CWORD64_API has already been called) in current process. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Failure condition +/// - The parameter semName is NULL +/// - The string of parameter semName has no text +/// - The string length of parameter semName is longer than MAX_SEMAPHORE_NAME_LEN +/// - Memory allocate failed for creating semaphore table +/// - The semaphore table is full +/// +/// \~english @par Detail +/// - Call this API to create semaphore and return the created semaphore ID. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Sync +/// +//////////////////////////////////////////////////////////////////////////////////////////// +SemID _pb_CreateSemaphore(char* semName); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Semaphore lock +/// +/// \~english @param [in] semID +/// - SemID semaphore ID +/// +/// \~english @retval RET_NORMAL normal return +/// \~english @retval RET_OSERROR error return +/// +/// \~english @par Precondition +/// - positioning_base_library initialization are completed \n +/// (_pb_Setup_CWORD64_API has already been called) in current process. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Failure condition +/// - The parameter semName is 0 +/// - The parameter semName is more than MAX_PB_SEMAPHORES +/// - The specified semaphore has not been registered in semaphore table +/// - The specified semaphore's mutex has not been created +/// - The specified semaphore's mutex lock failed +/// +/// \~english @par Detail +/// - Call this API to get semaphore. +/// - This API will return after got semaphore. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Fire and Forget +/// +//////////////////////////////////////////////////////////////////////////////////////////// +RET_API _pb_SemLock(SemID semID); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Semaphore unlock +/// +/// \~english @param [in] semID +/// - SemID semaphore ID +/// +/// \~english @retval RET_NORMAL normal return +/// \~english @retval RET_OSERROR error return +/// +/// \~english @par Precondition +/// - positioning_base_library initialization are completed \n +/// (_pb_Setup_CWORD64_API has already been called) in current process. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Failure condition +/// - The parameter semName is 0 +/// - The parameter semName is more than MAX_PB_SEMAPHORES +/// - The specified semaphore has not been registered in semaphore table +/// - The specified semaphore's mutex has not been created +/// - The specified semaphore's mutex release failed +/// +/// \~english @par Detail +/// - Call this API to relesae semaphore. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Fire and Forget +/// +//////////////////////////////////////////////////////////////////////////////////////////// +RET_API _pb_SemUnlock(SemID semID); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Create Share Data +/// +/// \~english @param [in] area_name +/// - char* share data name +/// \~english @param [in] size +/// - u_int32 data size +/// \~english @param [out] mem_ptr +/// - void** share memory pointer +/// +/// \~english @retval RET_NORMAL normal return +/// \~english @retval RET_ERROR error return +/// +/// \~english @par Precondition +/// - positioning_base_library initialization are completed \n +/// (_pb_Setup_CWORD64_API has already been called) in current process. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Failure condition +/// - The parameter area_name is NULL +/// - The parameter mem_ptr is NULL +/// - The string of parameter area_name has no text +/// - The string length of parameter area_name is longer than MAX_AREA_NAME_LEN +/// - The parameter size is 0 +/// - The specified share data has already been created +/// - Memory allocate failed for creating share data +/// - The specified share data file create failed +/// +/// \~english @par Detail +/// - Call this API to create share data. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Sync +/// +//////////////////////////////////////////////////////////////////////////////////////////// +RET_API _pb_CreateShareData(char* area_name, u_int32 size, void** mem_ptr); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Link Share Data +/// +/// \~english @param [in] area_name +/// - char* share data name +/// \~english @param [out] mem_ptr +/// - void** share memory pointer +/// \~english @param [in] size +/// - u_int32* data size +/// +/// \~english @retval RET_NORMAL normal return +/// \~english @retval RET_ERROR error return +/// +/// \~english @par Precondition +/// - positioning_base_library initialization are completed \n +/// (_pb_Setup_CWORD64_API has already been called) in current process. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Failure condition +/// - The parameter area_name is NULL +/// - The parameter mem_ptr is NULL +/// - The string of parameter area_name has no text +/// - The string length of parameter area_name is longer than MAX_AREA_NAME_LEN +/// - The parameter size is NULL +/// - Memory allocate failed for linking share data +/// - The specified share data file open failed +/// +/// \~english @par Detail +/// - Call this API to link share data. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Sync +/// +//////////////////////////////////////////////////////////////////////////////////////////// +RET_API _pb_LinkShareData(char* area_name, void** mem_ptr, u_int32* size); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Start timer +/// +/// \~english @param [in] SndPno +/// - PNO source process No +/// \~english @param [in] TimerSeq +/// - u_int16 timer sequence No +/// \~english @param [in] TimerType +/// - u_int8 timer type +/// \~english @param [in] TimeOut +/// - u_int32 timeout time +/// +/// \~english @par +/// - timer type(TimerType) +/// - TIMER_TYPE_SYN fixed term timer +/// - TIMER_TYPE_USN asynchronous timer +/// +/// \~english @retval RET_NORMAL normal return +/// \~english @retval RET_ERRPARAM parameter error +/// \~english @retval RET_ERROR other error +/// +/// \~english @par Precondition +/// - positioning_base_library initialization are completed \n +/// (_pb_Setup_CWORD64_API has already been called) in current process. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Failure condition +/// - Initialization of positioning_base_library has not been done in current process +/// - The parameter TimerType is neither TIMER_TYPE_SYN nor TIMER_TYPE_USN +/// - The parameter TimeOut is 0 +/// - The same timer has already been started +/// - Timer start failed +/// +/// \~english @par Detail +/// - Call this API to start timer. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Fire and Forget +/// +//////////////////////////////////////////////////////////////////////////////////////////// +RET_API _pb_ReqTimerStart(PNO SndPno, u_int16 TimerSeq, u_int8 TimeType, u_int32 TimeOut); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Stop timer +/// +/// \~english @param [in] SndPno +/// - PNO source process No +/// \~english @param [in] TimerSeq +/// - u_int16 timer sequence No +/// \~english @param [in] TimerType +/// - u_int8 timer type +/// +/// \~english @par +/// - timer type(TimerType) +/// - TIMER_TYPE_SYN fixed term timer +/// - TIMER_TYPE_USN asynchronous timer +/// +/// \~english @retval RET_NORMAL normal return +/// \~english @retval RET_ERROR error return +/// +/// \~english @par Precondition +/// - positioning_base_library initialization are completed \n +/// (_pb_Setup_CWORD64_API has already been called) in current process. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Failure condition +/// - Initialization of positioning_base_library has not been done in current process +/// - Timer stop failed +/// +/// \~english @par Detail +/// - Call this API to stop timer. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Fire and Forget +/// +//////////////////////////////////////////////////////////////////////////////////////////// +RET_API _pb_TimerStop(PNO SndPno, u_int16 TimerSeq, u_int8 TimeType); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Create mutex +/// +/// \~english @param [in] lpMutexAttributes +/// - LPSECURITY_ATTRIBUTES not used +/// \~english @param [in] bInitialOwner +/// - BOOL not used +/// \~english @param [in] lpName +/// - LPCTSTR mutex name +/// +/// \~english @retval NULL error return +/// \~english @retval Except NULL created mutex Handle +/// +/// \~english @par Precondition +/// - positioning_base_library initialization are completed \n +/// (_pb_Setup_CWORD64_API has already been called) in current process. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Failure condition +/// - The parameter lpName is NULL +/// - The string length of pamareter lpName is longer than NAME_MAX +/// - Mutex lock map failed +/// +/// \~english @par Detail +/// - Call this API to create mutex. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Sync +/// +//////////////////////////////////////////////////////////////////////////////////////////// +HANDLE _pb_CreateMutex(LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner, LPCTSTR lpName); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Get message management table dump info. +/// +/// \~english @param [out] pBuf +/// - void* output buffer +/// \~english @param [in/out] pLen +/// - uint8_t* output buffer size +/// +/// \~english @retval None +/// +/// \~english @par Precondition +/// - positioning_base_library initialization are completed \n +/// (_pb_Setup_CWORD64_API has already been called) in current process. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Detail +/// - Call this API to get message management table dump info. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Sync +/// +//////////////////////////////////////////////////////////////////////////////////////////// +void _pb_GetDebugMsgMngTbl(void* pBuf, uint8_t* pLen); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Get mutex management table dump info. +/// +/// \~english @param [out] pBuf +/// - void* output buffer +/// \~english @param [in/out] pLen +/// - uint8_t* output buffer size +/// +/// \~english @retval None +/// +/// \~english @par Precondition +/// - positioning_base_library initialization are completed \n +/// (_pb_Setup_CWORD64_API has already been called) in current process. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Detail +/// - Call this API to get mutex management table dump info. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Sync +/// +//////////////////////////////////////////////////////////////////////////////////////////// +void _pb_GetDebugMutexMngTbl(void* pBuf, uint8_t* pLen); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Get timer management table dump info. +/// +/// \~english @param [out] pBuf +/// - void* output buffer +/// +/// \~english @retval None +/// +/// \~english @par Precondition +/// - positioning_base_library initialization are completed \n +/// (_pb_Setup_CWORD64_API has already been called) in current process. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Detail +/// - Call this API to get timer management table dump info. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Sync +/// +//////////////////////////////////////////////////////////////////////////////////////////// +void _pb_GetDebugTimerMngTbl(void* pBuf); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Get event management table dump info. +/// +/// \~english @param [out] pBuf +/// - void* output buffer +/// \~english @param [in/out] pLen +/// - uint8_t* output buffer size +/// +/// \~english @retval None +/// +/// \~english @par Precondition +/// - positioning_base_library initialization are completed \n +/// (_pb_Setup_CWORD64_API has already been called) in current process. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Detail +/// - Call this API to get event management table dump info. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Sync +/// +//////////////////////////////////////////////////////////////////////////////////////////// +void _pb_GetDebugEventMngTbl(void* pBuf, uint8_t* pLen); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Get memory management table dump info. +/// +/// \~english @param [out] pBuf +/// - void* output buffer +/// +/// \~english @retval None +/// +/// \~english @par Precondition +/// - positioning_base_library initialization are completed \n +/// (_pb_Setup_CWORD64_API has already been called) in current process. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Detail +/// - Call this API to get memory management table dump info. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Sync +/// +//////////////////////////////////////////////////////////////////////////////////////////// +void _pb_GetDebugMemoryMngTbl(void* pBuf); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Get common info management table dump info. +/// +/// \~english @param [out] pBuf +/// - void* output buffer +/// +/// \~english @retval None +/// +/// \~english @par Precondition +/// - positioning_base_library initialization are completed \n +/// (_pb_Setup_CWORD64_API has already been called) in current process. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Detail +/// - Call this API to get common info management table dump info. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Sync +/// +//////////////////////////////////////////////////////////////////////////////////////////// +void _pb_GetDebugOtherMngTbl(void* pBuf); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Get current app Handle. +/// +/// \~english @param None +/// +/// \~english @retval 0 get Handle failed +/// \~english @retval not 0 Handle +/// +/// \~english @par Precondition +/// - positioning_base_library initialization are completed \n +/// (_pb_Setup_CWORD64_API has already been called) in current process. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Failure condition +/// - Current app Handle has not been registered +/// +/// \~english @par Detail +/// - Call this API to get current app Handle. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Sync +/// +//////////////////////////////////////////////////////////////////////////////////////////// +HANDLE _pb_GetAppHandle(void); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Set current app Handle. +/// +/// \~english @param [in] hApp +/// - HANDLE app Handle +/// +/// \~english @retval None +/// +/// \~english @par Precondition +/// - positioning_base_library initialization are completed \n +/// (_pb_Setup_CWORD64_API has already been called) in current process. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Detail +/// - Call this API to get common info management table dump info. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Fire and Forget +/// +//////////////////////////////////////////////////////////////////////////////////////////// +void _pb_SetAppHandle(HANDLE hApp); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Base API stop process(every process used Base API should call this API before stop). +/// +/// \~english @param None +/// +/// \~english @retval None +/// +/// \~english @par Precondition +/// - positioning_base_library initialization are completed \n +/// (_pb_Setup_CWORD64_API has already been called) in current process. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Detail +/// - Call this API to stop Base API. +/// - Every process used Base API should call this API before stop. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Fire and Forget +/// +//////////////////////////////////////////////////////////////////////////////////////////// +void _pb_Teardown_CWORD64_API(void); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Terminate current process. +/// +/// \~english @param [in] pFunc +/// - char* source function +/// \~english @param [in] line +/// - int source line +/// +/// \~english @retval None +/// +/// \~english @par Precondition +/// - None +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Detail +/// - Call this API to terminate current process. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Fire and Forget +/// +//////////////////////////////////////////////////////////////////////////////////////////// +void _pb_Exit_d(const char* pFunc, int line); +#define _pb_Exit() _pb_Exit_d(__func__, __LINE__) + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Receive message. +/// +/// \~english @param [in] pno +/// - PNO process No +/// \~english @param [in] size +/// - u_int16 message size +/// \~english @param [out] msgbuf +/// - void* message buffer +/// \~english @param [in] mode +/// - u_int16 not used +/// +/// \~english @retval RET_NORMAL normal return +/// \~english @retval RET_ERRPARAM parameter error +/// \~english @retval RET_ERROR other error +/// +/// \~english @par Precondition +/// - positioning_base_library initialization are completed \n +/// (_pb_Setup_CWORD64_API has already been called) in current process. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Failure condition +/// - The parameter msgbuf is NULL +/// - The parameter pno is 0 +/// - The message queue specified by parameter pno has not been created +/// - Receive message failed +/// - Receive message successrully, but the received message size is longer than parameter size +/// - Get received message data failed +/// +/// \~english @par Detail +/// - Call this API to receive message of specified pno. +/// - This API will return after received message. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Sync +/// +//////////////////////////////////////////////////////////////////////////////////////////// +RET_API _pb_RcvMsg(PNO pno, u_int16 size, void** msgbuf, u_int16 mode); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Get send buffer for message transferring in process +/// +/// \~english @param [in] pno +/// - PNO process No +/// \~english @param [out] pSndBuf +/// - void** send buffer +/// +/// \~english @retval RET_NORMAL normal return +/// \~english @retval RET_ERRPARAM parameter error +/// \~english @retval RET_ERROR other error +/// +/// \~english @par Precondition +/// - positioning_base_library initialization are completed \n +/// (_pb_Setup_CWORD64_API has already been called) in current process. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Failure condition +/// - The parameter pno is 0 +/// - The message queue specified by parameter pno has not been created +/// - Get sender Handle failed +/// - Get send buffer failed +/// +/// \~english @par Detail +/// - Call this API to get send buffer for message transferring in process. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Sync +/// +//////////////////////////////////////////////////////////////////////////////////////////// +RET_API _pb_GetZcSndBuf(PNO pno, void** pSndBuf); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Send message in process +/// +/// \~english @param [in] pno +/// - PNO process No +/// \~english @param [in] size +/// - u_int16 message size +/// \~english @param [in] mode +/// - u_int16 not used +/// +/// \~english @retval RET_NORMAL normal return +/// \~english @retval RET_ERRPARAM parameter error +/// \~english @retval RET_ERROR other error +/// +/// \~english @par Precondition +/// - positioning_base_library initialization are completed \n +/// (_pb_Setup_CWORD64_API has already been called) in current process. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Failure condition +/// - The parameter pno is 0 +/// - The message queue specified by parameter pno has not been created +/// - Get sender Handle failed +/// - Get send buffer failed +/// - Set send buffer failed +/// - Send message failed +/// +/// \~english @par Detail +/// - Call this API to send message in process. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Fire and Forget +/// +//////////////////////////////////////////////////////////////////////////////////////////// +RET_API _pb_ZcSndMsg(PNO pno, u_int16 size, u_int16 mode); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Convert process name to pno +/// +/// \~english @param [in] name +/// - PCSTR process name +/// +/// \~english @retval 0 convert failed +/// \~english @retval not 0 converted PNO +/// +/// \~english @par Precondition +/// - positioning_base_library initialization are completed \n +/// (_pb_Setup_CWORD64_API has already been called) in current process. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Failure condition +/// - The parameter name is NULL +/// - The size of parameter name is longer than THREAD_NAME_LEN_MAX +/// +/// \~english @par Detail +/// - Call this API to convert process name to pno. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Sync +/// +//////////////////////////////////////////////////////////////////////////////////////////// +PNO _pb_CnvName2Pno(PCSTR name); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Convert pno to process name +/// +/// \~english @param [in] pno +/// - PNO process No +/// +/// \~english @retval NULL convert failed +/// \~english @retval not NULL converted process name +/// +/// \~english @par Precondition +/// - positioning_base_library initialization are completed \n +/// (_pb_Setup_CWORD64_API has already been called) in current process. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Failure condition +/// - The parameter pno has not been registered(not the return pno of _pb_CnvName2Pno). +/// +/// \~english @par Detail +/// - Call this API to convert pno to process name. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Sync +/// +//////////////////////////////////////////////////////////////////////////////////////////// +PCSTR _pb_CnvPno2Name(PNO pno); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Get message resource +/// +/// \~english @param None +/// +/// \~english @retval TRUE normal return +/// \~english @retval FALSE error(lack of resource) +/// +/// \~english @par Precondition +/// - positioning_base_library initialization are completed \n +/// (_pb_Setup_CWORD64_API has already been called) in current process. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Detail +/// - Call this API to get message resource. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Fire and Forget +/// +//////////////////////////////////////////////////////////////////////////////////////////// +BOOL _pb_GetMsgResource(void); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Get mutex resource +/// +/// \~english @param None +/// +/// \~english @retval TRUE normal return +/// \~english @retval FALSE error(lack of resource) +/// +/// \~english @par Precondition +/// - positioning_base_library initialization are completed \n +/// (_pb_Setup_CWORD64_API has already been called) in current process. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Detail +/// - Call this API to get mutex resource. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Fire and Forget +/// +//////////////////////////////////////////////////////////////////////////////////////////// +BOOL _pb_GetMutexResource(void); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Get common resource +/// +/// \~english @param None +/// +/// \~english @retval TRUE normal return +/// \~english @retval FALSE error(lack of resource) +/// +/// \~english @par Precondition +/// - positioning_base_library initialization are completed \n +/// (_pb_Setup_CWORD64_API has already been called) in current process. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Detail +/// - Call this API to get common resource. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Fire and Forget +/// +//////////////////////////////////////////////////////////////////////////////////////////// +BOOL _pb_GetOtherResource(void); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Release message resource +/// +/// \~english @param None +/// +/// \~english @retval None +/// +/// \~english @par Precondition +/// - positioning_base_library initialization are completed \n +/// (_pb_Setup_CWORD64_API has already been called) in current process. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Detail +/// - Call this API to release message resource. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Fire and Forget +/// +//////////////////////////////////////////////////////////////////////////////////////////// +void _pb_ReleaseMsgResource(void); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Release mutex resource +/// +/// \~english @param None +/// +/// \~english @retval None +/// +/// \~english @par Precondition +/// - positioning_base_library initialization are completed \n +/// (_pb_Setup_CWORD64_API has already been called) in current process. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Detail +/// - Call this API to release mutex resource. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Fire and Forget +/// +//////////////////////////////////////////////////////////////////////////////////////////// +void _pb_ReleaseMutexResource(void); + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup positioning_base_library +/// \~english @par Brief +/// - Release common resource +/// +/// \~english @param None +/// +/// \~english @retval None +/// +/// \~english @par Precondition +/// - positioning_base_library initialization are completed \n +/// (_pb_Setup_CWORD64_API has already been called) in current process. +/// +/// \~english @par changes of the internal status +/// - There is no changes of the internal status by this API +/// +/// \~english @par Detail +/// - Call this API to release common resource. +/// \n +/// +/// \~english @par Classification +/// - Public +/// +/// \~english @par Type +/// - Fire and Forget +/// +//////////////////////////////////////////////////////////////////////////////////////////// +void _pb_ReleaseOtherResource(void); + +#ifdef __cplusplus +} +#endif + +/** @}*/ // end of positioning_base_library +/** @}*/ // end of vehicle_service +/** @}*/ // end of BaseSystem +#endif // POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_VEHICLE_SERVICE_WPF_STD_H_ diff --git a/service/vehicle/positioning_base_library/library/include/vehicle_service/pos_message_header.h b/service/vehicle/positioning_base_library/library/include/vehicle_service/pos_message_header.h new file mode 100755 index 0000000..b6af335 --- /dev/null +++ b/service/vehicle/positioning_base_library/library/include/vehicle_service/pos_message_header.h @@ -0,0 +1,77 @@ +/* + * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _POS_MESSAGE_HEADER_ // NOLINT(build/header_guard) +#define _POS_MESSAGE_HEADER_ + +/** + * @file pos_message_header.h + * @brief Header file for message data definitions + */ + +/** @addtogroup BaseSystem + * @{ + */ +/** @addtogroup vehicle_service + * @ingroup BaseSystem + * @{ + */ +/** @addtogroup positioning_base_library + * @ingroup vehicle_service + * @{ + */ + +#include <sys/types.h> + +/** + * @struct T_APIMSG_HEADER + * \~english _CWORD64_API message header structure + */ +typedef struct { + uint16_t replyid; //!< \~english message send result notify dest ID + uint16_t sndpno; //!< \~english message send source process No + uint16_t respno; //!< \~english message response process No + uint16_t cid; //!< \~english message command ID + uint16_t msgbodysize; //!< \~english message body size + uint8_t rid; //!< \~english message resource ID */ + uint8_t reserve; //!< \~english reserve + uint8_t filler[2]; //!< \~english filter +} T_APIMSG_HEADER; + +/** + * @struct T_APIMSG_MSGBUF_HEADER + * \~english _CWORD64_API message buffer header structure + */ +typedef struct { + uint32_t signo; //!< \~english signal No, _pb_SndMsg to set 0 + T_APIMSG_HEADER hdr; //!< \~english message header +} T_APIMSG_MSGBUF_HEADER; + +/** + * @struct _CWORD64_MSG_LOG_HDR + * \~english _CWORD64_API message log header structure + */ +typedef struct { + uint32_t kickTime; //!< \~english kick time + uint32_t srCid; //!< \~english message command ID + uint32_t pno; //!< \~english process No + uint32_t dataBytes; //!< \~english data size +} _CWORD64_MSG_LOG_HDR; + +/** @}*/ // end of positioning_base_library +/** @}*/ // end of vehicle_service +/** @}*/ // end of BaseSystem +#endif // _POS_MESSAGE_HEADER_ diff --git a/service/vehicle/positioning_base_library/library/include/vehicle_service/positioning_base_library.h b/service/vehicle/positioning_base_library/library/include/vehicle_service/positioning_base_library.h new file mode 100755 index 0000000..c6ce3ce --- /dev/null +++ b/service/vehicle/positioning_base_library/library/include/vehicle_service/positioning_base_library.h @@ -0,0 +1,46 @@ +// +// @copyright Copyright (c) 2017-2020 TOYOTA MOTOR CORPORATION. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + + +#ifndef VEHICLESERVICE_POSITIONINGBASELIBRARY_H_ // NOLINT(build/header_guard) +#define VEHICLESERVICE_POSITIONINGBASELIBRARY_H_ // NOLINT(build/header_guard) + +/** + * @file positioning_base_library.h + * @brief Common header of positioning_base_library + */ + +/** @addtogroup BaseSystem + * @{ + */ +/** @addtogroup vehicle_service + * @ingroup BaseSystem + * @{ + */ +/** @addtogroup positioning_base_library + * @ingroup vehicle_service + * @{ + */ + +#include <vehicle_service/WPF_STD.h> +#include <vehicle_service/sys_timerapi.h> +#include <vehicle_service/std_types.h> +#include <vehicle_service/pos_message_header.h> + +/** @}*/ // end of positioning_base_library +/** @}*/ // end of vehicle_service +/** @}*/ // end of BaseSystem +#endif // VEHICLESERVICE_POSITIONINGBASELIBRARY_H_ diff --git a/service/vehicle/positioning_base_library/library/include/vehicle_service/positioning_positioningbaselibrarylog.h b/service/vehicle/positioning_base_library/library/include/vehicle_service/positioning_positioningbaselibrarylog.h new file mode 100755 index 0000000..b0fd4e1 --- /dev/null +++ b/service/vehicle/positioning_base_library/library/include/vehicle_service/positioning_positioningbaselibrarylog.h @@ -0,0 +1,91 @@ +/* + * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * This file has been generated automatically. + * User hand written code entry is not allowed. Do not modify the file content. + * + */ +#ifndef POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_POSITIONING_POSITIONINGBASELIBRARYLOG_H_ +#define POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_POSITIONING_POSITIONINGBASELIBRARYLOG_H_ + +/* Include Files */ +#include <native_service/ns_logger_if.h> + +#define ZONE_INIT ZONEMASK(10) +#define ZONE_FUNC ZONEMASK(11) +#define ZONE_MEM ZONEMASK(12) +#define ZONE_APP ZONEMASK(13) +#define ZONE_14 ZONEMASK(14) +#define ZONE_15 ZONEMASK(15) +#define ZONE_16 ZONEMASK(16) +#define ZONE_17 ZONEMASK(17) +#define ZONE_18 ZONEMASK(18) +#define ZONE_19 ZONEMASK(19) +#define ZONE_20 ZONEMASK(20) +#define ZONE_21 ZONEMASK(21) +#define ZONE_22 ZONEMASK(22) +#define ZONE_23 ZONEMASK(23) +#define ZONE_24 ZONEMASK(24) +#define ZONE_25 ZONEMASK(25) +#define ZONE_26 ZONEMASK(26) +#define ZONE_27 ZONEMASK(27) +#define ZONE_28 ZONEMASK(28) +#define ZONE_INFO ZONEMASK(29) +#define ZONE_WARN ZONEMASK(30) +#define ZONE_ERR ZONEMASK(31) + +#define ZONE_POS_SYS_IN ZONE_SP_ZONE_99 +#define ZONE_POS_GPS_IN ZONE_SP_ZONE_100 +#define ZONE_POS_CMD_IN ZONE_SP_ZONE_101 +#define ZONE_POS_NAV_IN ZONE_SP_ZONE_102 + +#define ZONE_TEXT_10 "Init" +#define ZONE_TEXT_11 "Function" +#define ZONE_TEXT_12 "Memory" +#define ZONE_TEXT_13 "StateMachine Example" +#define ZONE_TEXT_14 "" +#define ZONE_TEXT_15 "" +#define ZONE_TEXT_16 "" +#define ZONE_TEXT_17 "" +#define ZONE_TEXT_18 "" +#define ZONE_TEXT_19 "" +#define ZONE_TEXT_20 "" +#define ZONE_TEXT_21 "" +#define ZONE_TEXT_22 "" +#define ZONE_TEXT_23 "" +#define ZONE_TEXT_24 "" +#define ZONE_TEXT_25 "" +#define ZONE_TEXT_26 "" +#define ZONE_TEXT_27 "" +#define ZONE_TEXT_28 "" +#define ZONE_TEXT_29 "Info" +#define ZONE_TEXT_30 "Warning" +#define ZONE_TEXT_31 "Error" + +#ifndef FRAMEWORKUNIFIEDLOGOPTIONS +#define FRAMEWORKUNIFIEDLOGOPTIONS (LPRINT) /* LPRINT, LMSGQ, LSLOGGER */ +#endif + +#ifndef FRAMEWORKUNIFIEDLOGAPPZONES +#define FRAMEWORKUNIFIEDLOGAPPZONES ZONE_INIT, ZONE_ERR, ZONE_14, ZONE_INFO, ZONE_POS_SYS_IN, ZONE_POS_GPS_IN, ZONE_POS_CMD_IN, \ + ZONE_POS_NAV_IN +#endif + +#define PS_APPNAME_MAX 12 +extern const CHAR kAppName[PS_APPNAME_MAX]; + +#endif // POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_POSITIONING_POSITIONINGBASELIBRARYLOG_H_ diff --git a/service/vehicle/positioning_base_library/library/include/vehicle_service/std_types.h b/service/vehicle/positioning_base_library/library/include/vehicle_service/std_types.h new file mode 100755 index 0000000..41ebbc8 --- /dev/null +++ b/service/vehicle/positioning_base_library/library/include/vehicle_service/std_types.h @@ -0,0 +1,55 @@ +/* + * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_VEHICLE_SERVICE_STD_TYPES_H_ +#define POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_VEHICLE_SERVICE_STD_TYPES_H_ + +/** + * @file std_types.h + * @brief Header file for base type definitions + */ + +/** @addtogroup BaseSystem + * @{ + */ +/** @addtogroup vehicle_service + * @ingroup BaseSystem + * @{ + */ +/** @addtogroup positioning_base_library + * @ingroup vehicle_service + * @{ + */ + +typedef signed char int8; +typedef unsigned char u_int8; +typedef signed short int int16; +typedef unsigned short int u_int16; +typedef signed int int32; +typedef unsigned int u_int32; +typedef float float_t; +typedef double double_t; + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif +/** @}*/ // end of positioning_base_library +/** @}*/ // end of vehicle_service +/** @}*/ // end of BaseSystem +#endif // POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_VEHICLE_SERVICE_STD_TYPES_H_ diff --git a/service/vehicle/positioning_base_library/library/include/vehicle_service/sys_timerapi.h b/service/vehicle/positioning_base_library/library/include/vehicle_service/sys_timerapi.h new file mode 100755 index 0000000..03a24ff --- /dev/null +++ b/service/vehicle/positioning_base_library/library/include/vehicle_service/sys_timerapi.h @@ -0,0 +1,359 @@ +/* + * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_VEHICLE_SERVICE_SYS_TIMERAPI_H_ +#define POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_VEHICLE_SERVICE_SYS_TIMERAPI_H_ + +/** + * @file sys_timerapi.h + * @brief Header file for timer management + */ + +/** @addtogroup BaseSystem + * @{ + */ +/** @addtogroup vehicle_service + * @ingroup BaseSystem + * @{ + */ +/** @addtogroup positioning_base_library + * @ingroup vehicle_service + * @{ + */ + +/*---------------------------------------------------------------------------------* + * Definition * + *---------------------------------------------------------------------------------*/ + +#define WTM_DUPTIME_MAX 5 //!< \~english duplication timer max count + +#define TIMER_TYPE_SYN 1 +//!< \~english fixing cycle timer(unit: 100ms) +#define TIMER_TYPE_USN 2 +//!< \~english asynchronous timer(unit: 100ms) +#define TIMER_TYPE_ALM 5 //!< \~english specific time timer + +#define SUN 0 //!< \~english sunday +#define MON 1 //!< \~english monday +#define TUE 2 //!< \~english tuesday +#define WED 3 //!< \~english wednesday +#define THU 4 //!< \~english thursday +#define FRI 5 //!< \~english friday +#define SAT 6 //!< \~english saturday +#define DEFAULT_DIFFTIME 0x00 //!< \~english time difference value of japan + +#define GPS_SAT 0x00 //!< \~english corrected GPS time +#define GPS_IST 0x01 //!< \~english not corrected GPS time +#define GPS_RTC 0x02 //!< \~english RTC time +#define GPS_IRG 0x03 //!< \~english initial time +#define GPS_NON 0x7E //!< \~english GPS unused +#define GPS_IGN 0x7F //!< \~english time not received + +#define END_TIMER_RPT_OFF 0 //!< \~english No continuation +#define END_TIMER_RPT_ON 1 //!< \~english With continuation + +#define CID_TIMER_SETGPS 0x4040 +//!< \~english command ID of GPS setting timer +#define CID_TIMER_DIFSET 0x4045 +//!< \~english command ID of time difference setting timer +#define CID_TIMER_CYCLE (CID)(CID_TIMER_BASE | CID_COM_SERIAL5) +//!< \~english command ID of cycle data receive timer + +#define CNV_YEAR_MAX 136 +//!< \~english max value of conversion year(number of years + 1) +#define SEC_PER_MIN 60 //!< \~english 60[sec] +#define SEC_PER_HOUR 3600 //!< \~english 60[min] * 60[sec] +#define SEC_PER_DAY 86400 //!< \~english 24[h] * 60[min] * 60[sec] + +#define TIM_ROLOVR_DISABLE 0 //!< \~english GPS week rollover correct prohibition +#define TIM_ROLOVR_ENABLE 1 //!< \~english GPS week rollover correct permission + +/* + * Definition + * \~english timer manager error definition + */ +#define RET_ERR_NONEINIT (-30) //!< \~english initialization untreated error +#define RET_ERR_SEMLOCK (-31) //!< \~english get semaphore error +#define RET_ERR_SEMUNLOCK (-32) //!< \~english open semaphore error +#define RET_ERR_SRAMREAD (-33) //!< \~english read SRAM error + +/* + * Definition + * \~english command notify information definition(almanac abnormality notify, and time enable notify) + */ +#define TIM_NUM_SNDCMD 4 //!< \~english command send number + +#define NON_TIMEUNIT_INVALID_TIME 0 +//!< \~english No time manager unit - system time not set +#define NON_TIMEUNIT_VALID_TIME 1 +//!< \~english No time manager unit - system time set complete +#define GPS_INVALID_TIME 2 +//!< \~english With GPS unit - system time not set +#define GPS_VALID_TIME 3 +//!< \~english With GPS unit - system time set complete + +#define TMT_RETRY 3 //!< \~english retry count +#define TMT_RETRY_INTERVAL 500 //!< \~english retry interval(500[msec]) + + +/*---------------------------------------------------------------------------------* + * Struct declaration * + *---------------------------------------------------------------------------------*/ + +/** + * \~english define data type + */ +typedef struct { + u_int32 TimeOut[WTM_DUPTIME_MAX]; //!< \~english timeout value + u_int8 ContFlg; //!< \~english continue flag + u_int8 Dummy1; //!< \~english dummy data + u_int16 Dummy2; //!< \~english dummy data +} TimerDupData; + +/** + * @struct RealTimeData + * \~english current time data + */ +typedef struct { + u_int16 Yyear; //!< \~english current time(year:A.D.) + u_int8 Mmonth; //!< \~english (month) + u_int8 Dday; //!< \~english (day) + u_int8 Hhour; //!< \~english (hour) + u_int8 Mmin; //!< \~english (min) + u_int8 Ssec; //!< \~english (sec) + u_int8 Wweek; //!< \~english (week) + u_int8 CrtFlg; //!< \~english GPS time not corrected/corrected flag + u_int8 CrtHou; //!< \~english the last correction(hour) + u_int8 CrtMin; //!< \~english min + u_int8 CrtSec; //!< \~english sec +} RealTimeData; + +/** + * @struct RealTimeDataBcd + * \~english current time data(BCD format) + */ +typedef struct { + u_int16 Yyear; //!< \~english current time(year:A.D.BCD ex.0x1998) + u_int8 Mmonth; //!< \~english (month BCD 0x01 to 0x12) + u_int8 Dday; //!< \~english (day BCD 0x01 to 0x31) + u_int8 Hhour; //!< \~english (hour BCD 0x00 to 0x23) + u_int8 Mmin; //!< \~english (min BCD 0x00 to 0x59) + u_int8 Ssec; //!< \~english (sec BCD 0x00 to 0x59) + u_int8 Wweek; //!< \~english (week BIN 0x00 to 0x06) + u_int8 CrtFlg; + //!< \~english GPS time not corrected or corrected flag(BIN 0x00 to 0x03) + u_int8 CrtHou; //!< \~english the last correction(hour BCD 0x00 to 0x23) + u_int8 CrtMin; //!< \~english (min BCD 0x00 to 0x59) + u_int8 CrtSec; //!< \~english (sec BCD 0x00 to 0x59) +} RealTimeDataBcd; + +/** + * @struct GpsSetData + * \~english GPS time setting data + */ +typedef struct { + u_int16 Yyear; //!< \~english current time(year:A.D.) + u_int8 Mmonth; //!< \~english (month) + u_int8 Dday; //!< \~english (day) + u_int8 Hhour; //!< \~english (hour) + u_int8 Mmin; //!< \~english (min) + u_int8 Ssec; //!< \~english (sec) + u_int8 Dummy; //!< \~english dummy data +} GpsSetData; + +/** + * @struct TimerToutMsg + * \~english timeout message + */ +typedef struct { + T_APIMSG_MSGBUF_HEADER Header; //!< \~english message header + u_int16 TimerSeq; //!< \~english timer sequence No.(claimant specific) + u_int16 Dummy; //!< \~english dummy +} TimerToutMsg; + +/** + * @struct TimerTimeReq + * \~english timer start request + */ +typedef struct { + T_APIMSG_MSGBUF_HEADER Header; //!< \~english message header + PNO SndPno; //!< \~english process No.(claimant specific) + u_int16 TimerSeq; //!< \~english timer sequence No.(claimant specific) + u_int8 TimeType; //!< \~english timer type + u_int8 Dummy[3]; //!< \~english dummy data + TimerDupData DupData; //!< \~english timeout value +} TimerTimeReq; + +/** + * @struct TimerAlrmReq + * \~english time specified timer start request + */ +typedef struct { + T_APIMSG_MSGBUF_HEADER Header; //!< \~english message header + PNO SndPno; //!< \~english process No.(claimant specific) + u_int16 TimerSeq; //!< \~english timer sequence No.(claimant specific) + u_int8 TimeHou; //!< \~english specific timeout hour + u_int8 TimeMin; //!< \~english min + u_int8 TimeSec; //!< \~english sec + u_int8 Dummy; //!< \~english dummy +} TimerAlrmReq; + +/** + * @struct TimerStopReq + * \~english timer stop request + */ +typedef struct { + T_APIMSG_MSGBUF_HEADER Header; //!< \~english message header + PNO SndPno; //!< \~english process No.(claimant specific) + u_int16 TimerSeq; //!< \~english timer sequence No.(claimant specific) + u_int8 TimeType; //!< \~english timer type + u_int8 Dummy[3]; //!< \~english dummy data +} TimerStopReq; + +/** + * @struct GpsSetTimeReq + * \~english GPS RTC time set request + */ +typedef struct { + T_APIMSG_MSGBUF_HEADER Header; //!< \~english message header + PNO SndPno; //!< \~english process No.(claimant specific) + u_int8 Dummy1; //!< \~english dummy data + u_int8 Dummy2; //!< \~english dummy data + GpsSetData SetData; //!< \~english GPS setting data +} GpsSetTimeReq; + +/** + * @struct GpsSetTimeReq + * \~english time difference set request + */ +typedef struct { + T_APIMSG_MSGBUF_HEADER Header; //!< \~english message header + int8 DiffTime; //!< \~english time difference value + int8 Dummy1; //!< \~english dummy data + int16 Dummy2; //!< \~english dummy data +} SetDiffTimeReq; + + +/** + * @struct T_TIM_RCV_DATA + * \~english command notify information structure + */ +typedef struct { + PNO SndPno; //!< \~english command delivery PNO + u_int8 ucAlmanc_Flg; + //!< \~english almanac abnormal judgement notify complete flag + u_int8 ucInvalid_Flg; + //!< \~english time acquisition notify complete flag +} T_TIM_RCV_DATA; + +/** + * @struct TimerSramData + * \~english timer SRAM data structure + */ +typedef struct { + u_int32 navitime; //!< \~english Navi operation addition time + int8 _difftime; //!< \~english time difference value of current time + int8 timeUnit; //!< \~english specific time manager unit + int8 dummy[2]; //!< \~english dummy data + T_TIM_RCV_DATA timCmdData[TIM_NUM_SNDCMD]; + //!< \~english command receive information +} TimerSramData; + +/** + * @struct SysTimeData + * \~english system time data + */ +typedef struct { + u_int16 Yyear; //!< \~english current time(year:A.D.BCD ex. 0x1998) + u_int8 Mmonth; //!< \~english (month BCD 0x01 to 0x12) + u_int8 Dday; //!< \~english (day BCD 0x01 to 0x31) + u_int8 Hhour; //!< \~english (hour BCD 0x00 to 0x23) + u_int8 Mmin; //!< \~english (min BCD 0x00 to 0x59) + u_int8 Ssec; //!< \~english (sec BCD 0x00 to 0x59) + u_int8 Wweek; //!< \~english (week BIN 0x00 to 0x06) +} SysTimeData; + +/** + * @struct YearCntTbl + * \~english year convert table + */ +typedef struct TimeCnvTbl_tag { + uint32_t ulYear; //!< \~english year + uint32_t ulCount; //!< \~english count + uint32_t ulMonth[12]; //!< \~english month +} YearCntTbl; + +/** + * @struct DayCntTbl + * \~english day convert table + */ +typedef struct DayCnvTbl_tag { + YearCntTbl stTbl[CNV_YEAR_MAX]; //!< \~english year convert table +} DayCntTbl; + +/** + * @struct TG_TIM_ROLOVR_GPSWEEKCORDATA + * \~english GPS week correction data + */ +typedef struct { + u_int8 gpsweekcorcnt; //!< \~english GPS week rollover correct count + u_int8 permission; //!< \~english GPS week rollover correct permission + u_int8 dummy[2]; //!< \~english dummy data +} TG_TIM_ROLOVR_GPSWEEKCORDATA; + +/** + * @struct TIMECHGIND_MSG + * \~english time change information message structure + */ +typedef struct { + T_APIMSG_MSGBUF_HEADER Header; //!< \~english message header + RealTimeData RealTime; //!< \~english data body(current time data) +} TIMECHGIND_MSG; + +/** + * @struct T_TIM_CMDMSG + * \~english time available notification/almanac abnormality notification structure + */ +typedef struct { + T_APIMSG_MSGBUF_HEADER Header; //!< \~english message header +} T_TIM_CMDMSG; + +/** + * @struct T_TIM_RETTIMEMSG + * \~english time setting response message + */ +typedef struct { + T_APIMSG_MSGBUF_HEADER Header; //!< \~english message header + int8 cResult; //!< \~english process result + int8 dummy[2]; //!< \~english dummy data +} T_TIM_RETTIMEMSG; + +/** + * @struct TimerModDat + * \~english current time data module structure + */ +typedef struct { + u_int32 InitFlg; //!< \~english initialization complete flag + u_int8 CrtFlg; //!< \~english corrected/not corrected flag + u_int8 CrtHou; //!< \~english the last correction: hour + u_int8 CrtMin; //!< \~english min + u_int8 CrtSec; //!< \~english sec +} TimerModDat; + +/** @}*/ // end of positioning_base_library +/** @}*/ // end of vehicle_service +/** @}*/ // end of BaseSystem +#endif // POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_VEHICLE_SERVICE_SYS_TIMERAPI_H_ + |