2 * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 /*******************************************************************************
20 *******************************************************************************/
22 /****************************************************************************
23 * File name : _pbEvent_Internal.h
25 * Subsystem name : _CWORD64_API Events Feature
26 * Title : Internal definition file for event function
27 ****************************************************************************/
28 #ifndef POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE__PBEVENT_INTERNAL_H_
29 #define POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE__PBEVENT_INTERNAL_H_
31 #include <other_service/ev_lib.h>
35 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
36 #define MAX_PB_EVENTS 16
37 #define MAX_EVENT_NAME_LEN 32
38 #define MIN_EVENT_VAL 0x80000000 /* Minimum event value(-2147483648) */
39 #define MAX_EVENT_VAL 0x7FFFFFFF /* Maximum event value( 2147483647) */
40 #define EVENT_BIT_ZERO 0x00000000 /* Event value All Bit Zero Definition */
41 #define MAX_PB_EVENT_WAIT_THREADS 1 /* Values other than 1 are not designed while the EV library is being used. */
42 #define EVSET_ABSOLUTE 1 /* Absolute setting */
43 #define EVSET_RELATE 2 /* Relative value setting */
44 #define EVSET_AND 3 /* AND value setting */
45 #define EVSET_OR 4 /* OR setting */
46 #define EVWAIT_VAL 1 /* Waiting mode for an event by specifying a range */
47 #define EVWAIT_ALLCLR 2 /* Mode to wait for an event when the specified bit is cleared */
48 #define EVWAIT_ANYSET 3 /* Mode to wait for an event with a specified set of bits */
50 #define _CWORD64_EVENT_MAXOPEN_IN_PROCESS 0x7FFFFFFF /* Maximum number of open events in the same process */
51 #define _CWORD64_EVENT_MAXOPEN_IN_SYSTEM 0x7FFFFFFF /* Maximum number of the same event open in the system */
53 #define MAX_EVENT_PROC_NUM (32) /* EVENT Max Processes Used */
57 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
58 /*****************************************************************************
59 * TAG : WAITING_CONDITION
60 * ABSTRACT : Event Status Settings
61 ******************************************************************************/
63 u_int8 uc_use_flag; /* Table Usage Flags(TRUE:Use FALSE:Not used) */
64 u_int8 uc_waiting; /* Event Waiting Flag */
65 /* TRUE Waiting for event */
66 /* FALSE Release Event Wait */
67 u_int16 us_mode; /* Waiting mode */
68 /* EVWAIT_VAL Wait for Value Range */
69 /* EVWAIT_ALLCLR Wait for specified bit to be cleared */
70 /* EVWAIT_ANYSET Waiting for setting the specified bit */
71 u_int32 ul_mask; /* Mask value when waiting for specified bit */
72 int32 l_min_val; /* Minimum value of condition when waiting for value range */
73 int32 l_max_val; /* Maximum value of condition when waiting for value range */
74 int32 l_last_val; /* Events at WaitEvent Return */
75 EV_ID flag_id[MAX_EVENT_PROC_NUM]; /* Event flags(CLS event library) */
76 } WAITING_CONDITION; /* Total 28 Bytes. */
78 /*****************************************************************************
79 * TAG : WAITING_CONDITION
80 * ABSTRACT : Event information storage area
81 ******************************************************************************/
83 TCHAR event_name[MAX_EVENT_NAME_LEN]; /* Maximum number of characters + NULL area */
85 WAITING_CONDITION st_condition[MAX_PB_EVENT_WAIT_THREADS];
88 u_int8 uc_manual_reset;
90 char name_of_mutex[NAME_MAX];
91 /* TODO: Members for the following EV library use:Structurely strange, but borrowed shared space.Correction is required. */
95 /*****************************************************************************
96 * TAG : PB_EVENT_OPEN_HANDLE
97 * ABSTRACT : Generated event management information
98 ******************************************************************************/
101 PB_EVENT* p_sys_event;
104 } PB_EVENT_OPEN_HANDLE;
106 /*****************************************************************************
107 * TAG : PB_EVENT_INSTANCE
108 * ABSTRACT : Event management table
109 ******************************************************************************/
111 PB_EVENT_OPEN_HANDLE* p_handle_table[MAX_PB_EVENTS];
112 HANDLE h_shared_memory;
113 SemID id_event_table_sem;
114 PB_EVENT* p_event_table;
118 Prototype declaration
119 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
128 #endif // POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE__PBEVENT_INTERNAL_H_