POK
blackboard.c
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 #include <arinc653/types.h>
21 #include <arinc653/blackboard.h>
22 #include <middleware/blackboard.h>
23 
24 
25 void CREATE_BLACKBOARD (
26  /*in */ BLACKBOARD_NAME_TYPE BLACKBOARD_NAME,
27  /*in */ MESSAGE_SIZE_TYPE MAX_MESSAGE_SIZE,
28  /*out*/ BLACKBOARD_ID_TYPE *BLACKBOARD_ID,
29  /*out*/ RETURN_CODE_TYPE *RETURN_CODE )
30 {
31  pok_blackboard_id_t core_id;
32  pok_ret_t core_ret;
33 
34  core_ret = pok_blackboard_create (BLACKBOARD_NAME, MAX_MESSAGE_SIZE, &core_id);
35  *RETURN_CODE = core_ret;
36 }
37 
38 void DISPLAY_BLACKBOARD (
39  /*in */ BLACKBOARD_ID_TYPE BLACKBOARD_ID,
40  /*in */ MESSAGE_ADDR_TYPE MESSAGE_ADDR, /* by reference */
41  /*in */ MESSAGE_SIZE_TYPE LENGTH,
42  /*out*/ RETURN_CODE_TYPE *RETURN_CODE )
43 {
44  pok_ret_t core_ret;
45  core_ret = pok_blackboard_display (BLACKBOARD_ID, MESSAGE_ADDR, LENGTH);
46  *RETURN_CODE = core_ret;
47 }
48 
49 void READ_BLACKBOARD (
50  /*in */ BLACKBOARD_ID_TYPE BLACKBOARD_ID,
51  /*in */ SYSTEM_TIME_TYPE TIME_OUT,
52  /*out*/ MESSAGE_ADDR_TYPE MESSAGE_ADDR,
53  /*out*/ MESSAGE_SIZE_TYPE *LENGTH,
54  /*out*/ RETURN_CODE_TYPE *RETURN_CODE )
55 {
56  pok_ret_t core_ret;
57  core_ret = pok_blackboard_read (BLACKBOARD_ID, TIME_OUT, MESSAGE_ADDR, LENGTH);
58  *RETURN_CODE = core_ret;
59 }
60 
61 void CLEAR_BLACKBOARD (
62  /*in */ BLACKBOARD_ID_TYPE BLACKBOARD_ID,
63  /*out*/ RETURN_CODE_TYPE *RETURN_CODE )
64 {
65  (void) BLACKBOARD_ID;
66  *RETURN_CODE = NOT_AVAILABLE;
67 }
68 
69 void GET_BLACKBOARD_ID (
70  /*in */ BLACKBOARD_NAME_TYPE BLACKBOARD_NAME,
71  /*out*/ BLACKBOARD_ID_TYPE *BLACKBOARD_ID,
72  /*out*/ RETURN_CODE_TYPE *RETURN_CODE )
73 {
74  (void) BLACKBOARD_NAME;
75  (void) BLACKBOARD_ID;
76  *RETURN_CODE = NOT_AVAILABLE;
77 }
78 
79 void GET_BLACKBOARD_STATUS (
80  /*in */ BLACKBOARD_ID_TYPE BLACKBOARD_ID,
81  /*out*/ BLACKBOARD_STATUS_TYPE *BLACKBOARD_STATUS,
82  /*out*/ RETURN_CODE_TYPE *RETURN_CODE )
83 {
84  (void) BLACKBOARD_ID;
85  (void) BLACKBOARD_STATUS;
86  *RETURN_CODE = NOT_AVAILABLE;
87 }
88 #endif