17 #include <core/dependencies.h>
19 #ifdef POK_NEEDS_ARINC653_QUEUEING
22 #include <middleware/port.h>
23 #include <arinc653/types.h>
24 #include <arinc653/queueing.h>
26 void CREATE_QUEUING_PORT (
27 QUEUING_PORT_NAME_TYPE QUEUING_PORT_NAME,
28 MESSAGE_SIZE_TYPE MAX_MESSAGE_SIZE,
29 MESSAGE_RANGE_TYPE MAX_NB_MESSAGE,
30 PORT_DIRECTION_TYPE PORT_DIRECTION,
31 QUEUING_DISCIPLINE_TYPE QUEUING_DISCIPLINE,
32 QUEUING_PORT_ID_TYPE *QUEUING_PORT_ID,
33 RETURN_CODE_TYPE *return_code)
36 pok_port_direction_t core_direction;
37 pok_port_queueing_discipline_t core_discipline;
38 pok_port_id_t core_id;
40 switch (QUEUING_DISCIPLINE)
43 core_discipline = POK_PORT_QUEUEING_DISCIPLINE_PRIORITY;
47 core_discipline = POK_PORT_QUEUEING_DISCIPLINE_FIFO;
51 *return_code = INVALID_PARAM;
55 switch (PORT_DIRECTION)
58 core_direction = POK_PORT_DIRECTION_OUT;
62 core_direction = POK_PORT_DIRECTION_IN;
66 *return_code = INVALID_PARAM;
70 core_ret = pok_port_queueing_create (QUEUING_PORT_NAME, MAX_MESSAGE_SIZE * MAX_NB_MESSAGE, core_direction, core_discipline, &core_id);
72 *QUEUING_PORT_ID = core_id;
73 *return_code = core_ret;
76 void SEND_QUEUING_MESSAGE (
77 QUEUING_PORT_ID_TYPE QUEUING_PORT_ID,
78 MESSAGE_ADDR_TYPE MESSAGE_ADDR,
79 MESSAGE_SIZE_TYPE LENGTH,
80 SYSTEM_TIME_TYPE TIME_OUT,
81 RETURN_CODE_TYPE *return_code)
85 core_ret = pok_port_queueing_send (QUEUING_PORT_ID, MESSAGE_ADDR, LENGTH, TIME_OUT);
87 *return_code = core_ret;
90 void RECEIVE_QUEUING_MESSAGE (
91 QUEUING_PORT_ID_TYPE QUEUING_PORT_ID,
92 SYSTEM_TIME_TYPE TIME_OUT,
93 MESSAGE_ADDR_TYPE MESSAGE_ADDR,
94 MESSAGE_SIZE_TYPE *LENGTH,
95 RETURN_CODE_TYPE *return_code )
99 core_ret = pok_port_queueing_receive (QUEUING_PORT_ID, TIME_OUT, *LENGTH, MESSAGE_ADDR, (pok_port_size_t*)LENGTH);
101 *return_code = core_ret;
104 void GET_QUEUING_PORT_ID (
105 QUEUING_PORT_NAME_TYPE QUEUING_PORT_NAME,
106 QUEUING_PORT_ID_TYPE *QUEUING_PORT_ID,
107 RETURN_CODE_TYPE *return_code)
109 (void) QUEUING_PORT_NAME;
110 (void) QUEUING_PORT_ID;
111 *return_code = NOT_AVAILABLE;
114 void GET_QUEUING_PORT_STATUS (
115 QUEUING_PORT_ID_TYPE QUEUING_PORT_ID,
117 RETURN_CODE_TYPE *return_code)
119 (void) QUEUING_PORT_ID;
120 (void) QUEUING_PORT_STATUS;
121 *return_code = NOT_AVAILABLE;