POK
blackboard.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_BLACKBOARD
19 
20 /*-------------------------------------------------------------------*/
21 /* */
22 /* BLACKBOARD constant and type definitions and management services */
23 /* */
24 /*-------------------------------------------------------------------*/
25 
26 #ifndef APEX_BLACKBOARD
27 #define APEX_BLACKBOARD
28 
29 #ifndef POK_NEEDS_ARINC653_PROCESS
30 #define POK_NEEDS_ARINC653_PROCESS
31 #endif
32 
33 #include <arinc653/types.h>
34 #include <arinc653/process.h>
35 
36 #define MAX_NUMBER_OF_BLACKBOARDS SYSTEM_LIMIT_NUMBER_OF_BLACKBOARDS
37 
38 typedef NAME_TYPE BLACKBOARD_NAME_TYPE;
39 
40 typedef APEX_INTEGER BLACKBOARD_ID_TYPE;
41 
42 typedef enum { EMPTY = 0, OCCUPIED = 1 } EMPTY_INDICATOR_TYPE;
43 
44 typedef struct {
45  EMPTY_INDICATOR_TYPE EMPTY_INDICATOR;
46  MESSAGE_SIZE_TYPE MAX_MESSAGE_SIZE;
47  WAITING_RANGE_TYPE WAITING_PROCESSES;
49 
50 extern void CREATE_BLACKBOARD (
51  /*in */ BLACKBOARD_NAME_TYPE BLACKBOARD_NAME,
52  /*in */ MESSAGE_SIZE_TYPE MAX_MESSAGE_SIZE,
53  /*out*/ BLACKBOARD_ID_TYPE *BLACKBOARD_ID,
54  /*out*/ RETURN_CODE_TYPE *RETURN_CODE );
55 
56 extern void DISPLAY_BLACKBOARD (
57  /*in */ BLACKBOARD_ID_TYPE BLACKBOARD_ID,
58  /*in */ MESSAGE_ADDR_TYPE MESSAGE_ADDR, /* by reference */
59  /*in */ MESSAGE_SIZE_TYPE LENGTH,
60  /*out*/ RETURN_CODE_TYPE *RETURN_CODE );
61 
62 extern void READ_BLACKBOARD (
63  /*in */ BLACKBOARD_ID_TYPE BLACKBOARD_ID,
64  /*in */ SYSTEM_TIME_TYPE TIME_OUT,
65  /*out*/ MESSAGE_ADDR_TYPE MESSAGE_ADDR,
66  /*out*/ MESSAGE_SIZE_TYPE *LENGTH,
67  /*out*/ RETURN_CODE_TYPE *RETURN_CODE );
68 
69 extern void CLEAR_BLACKBOARD (
70  /*in */ BLACKBOARD_ID_TYPE BLACKBOARD_ID,
71  /*out*/ RETURN_CODE_TYPE *RETURN_CODE );
72 
73 extern void GET_BLACKBOARD_ID (
74  /*in */ BLACKBOARD_NAME_TYPE BLACKBOARD_NAME,
75  /*out*/ BLACKBOARD_ID_TYPE *BLACKBOARD_ID,
76  /*out*/ RETURN_CODE_TYPE *RETURN_CODE );
77 
78 extern void GET_BLACKBOARD_STATUS (
79  /*in */ BLACKBOARD_ID_TYPE BLACKBOARD_ID,
80  /*out*/ BLACKBOARD_STATUS_TYPE *BLACKBOARD_STATUS,
81  /*out*/ RETURN_CODE_TYPE *RETURN_CODE );
82 
83 #endif
84 
85 #endif