POK
event.h
1 /*
2  * POK header
3  *
4  * The following file is a part of the POK project. Any modification should
5  * made according to the POK licence. You CANNOT use this file or a part of
6  * this file is this part of a file for your own project
7  *
8  * For more information on the POK licence, please see our LICENCE FILE
9  *
10  * Please follow the coding guidelines described in doc/CODING_GUIDELINES
11  *
12  * Copyright (c) 2007-2009 POK team
13  *
14  * Created by julien on Thu Jan 15 23:34:13 2009
15  */
16 
17 
18 #ifdef POK_NEEDS_ARINC653_EVENT
19 
20 #ifndef APEX_EVENT
21 #define APEX_EVENT
22 
23 
24 #ifndef POK_NEEDS_ARINC653_PROCESS
25 #define POK_NEEDS_ARINC653_PROCESS 1
26 #endif
27 
28 #include <arinc653/process.h>
29 
30 /*----------------------------------------------------------------------*/
31 /* */
32 /* EVENT constant definitions */
33 /* */
34 /*----------------------------------------------------------------------*/
35 /* implementation dependent */
36 /* these values are given as example */
37 /*------------------------------*/
38 /* max nb of events */
39 /*------------------------------*/
40 #define MAX_NUMBER_OF_EVENTS 63
41 /*----------------------------------------------------------------------*/
42 /* */
43 /* EVENT type definitions */
44 /* */
45 /*----------------------------------------------------------------------*/
46 /*------------------------------*/
47 /* event ident type */
48 /*------------------------------*/
49 typedef APEX_INTEGER EVENT_ID_TYPE;
50 /*------------------------------*/
51 /* event state type */
52 /*------------------------------*/
53 enum EVENT_STATE_VALUE_TYPE { UP, DOWN };
54 
55 typedef enum EVENT_STATE_VALUE_TYPE EVENT_STATE_TYPE;
56 
57 /*------------------------------*/
58 /* event name type */
59 /*------------------------------*/
60 typedef NAME_TYPE EVENT_NAME_TYPE;
61 /*------------------------------*/
62 /* event status type */
63 /*------------------------------*/
64 typedef struct {
65  EVENT_STATE_TYPE EVENT_STATE;
66  WAITING_RANGE_TYPE WAITING_PROCESSES;
68 
69 /*----------------------------------------------------------------------*/
70 /* */
71 /* event management services */
72 /* */
73 /*----------------------------------------------------------------------*/
74 /*----------------------------------------------------------------------*/
75 extern void CREATE_EVENT (
76  /*IN */ EVENT_NAME_TYPE EVENT_NAME,
77  /*OUT*/ EVENT_ID_TYPE *EVENT_ID,
78  /*OUT*/ RETURN_CODE_TYPE *RETURN_CODE );
79 /*----------------------------------------------------------------------*/
80 extern void SET_EVENT (
81  /*IN */ EVENT_ID_TYPE EVENT_ID,
82  /*OUT*/ RETURN_CODE_TYPE *RETURN_CODE );
83 /*----------------------------------------------------------------------*/
84 extern void RESET_EVENT (
85  /*IN */ EVENT_ID_TYPE EVENT_ID,
86  /*OUT*/ RETURN_CODE_TYPE *RETURN_CODE );
87 /*----------------------------------------------------------------------*/
88 extern void WAIT_EVENT (
89  /*IN */ EVENT_ID_TYPE EVENT_ID,
90  /*IN */ SYSTEM_TIME_TYPE TIME_OUT,
91  /*OUT*/ RETURN_CODE_TYPE *RETURN_CODE );
92 /*----------------------------------------------------------------------*/
93 extern void GET_EVENT_ID (
94  /*IN */ EVENT_NAME_TYPE EVENT_NAME,
95  /*OUT*/ EVENT_ID_TYPE *EVENT_ID,
96  /*OUT*/ RETURN_CODE_TYPE *RETURN_CODE );
97 /*----------------------------------------------------------------------*/
98 extern void GET_EVENT_STATUS (
99  /*IN */ EVENT_ID_TYPE EVENT_ID,
100  /*OUT*/ EVENT_STATUS_TYPE *EVENT_STATUS ,
101  /*OUT*/ RETURN_CODE_TYPE *RETURN_CODE );
102 /*----------------------------------------------------------------------*/
103 #endif
104 #endif