POK
sampling.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_SAMPLING
19 
20 #include <arinc653/types.h>
21 
22 /*--------------------------------------------------------------------*/
23 /* */
24 /* SAMPLING PORT constant and type definitions and management services*/
25 /* */
26 /*--------------------------------------------------------------------*/
27 
28 #ifndef APEX_SAMPLING
29 #define APEX_SAMPLING
30 
31 #define MAX_NUMBER_OF_SAMPLING_PORTS SYSTEM_LIMIT_NUMBER_OF_SAMPLING_PORTS
32 
33 typedef NAME_TYPE SAMPLING_PORT_NAME_TYPE;
34 
35 typedef APEX_INTEGER SAMPLING_PORT_ID_TYPE;
36 
37 typedef enum { INVALID = 0, VALID = 1 } VALIDITY_TYPE;
38 
39 typedef struct
40 {
41  SYSTEM_TIME_TYPE REFRESH_PERIOD;
42  MESSAGE_SIZE_TYPE MAX_MESSAGE_SIZE;
43  PORT_DIRECTION_TYPE PORT_DIRECTION;
44  VALIDITY_TYPE LAST_MSG_VALIDITY;
46 
47 extern void CREATE_SAMPLING_PORT (
48  /*in */ SAMPLING_PORT_NAME_TYPE SAMPLING_PORT_NAME,
49  /*in */ MESSAGE_SIZE_TYPE MAX_MESSAGE_SIZE,
50  /*in */ PORT_DIRECTION_TYPE PORT_DIRECTION,
51  /*in */ SYSTEM_TIME_TYPE REFRESH_PERIOD,
52  /*out*/ SAMPLING_PORT_ID_TYPE *SAMPLING_PORT_ID,
53  /*out*/ RETURN_CODE_TYPE *RETURN_CODE );
54 
55 extern void WRITE_SAMPLING_MESSAGE (
56  /*in */ SAMPLING_PORT_ID_TYPE SAMPLING_PORT_ID,
57  /*in */ MESSAGE_ADDR_TYPE MESSAGE_ADDR, /* by reference */
58  /*in */ MESSAGE_SIZE_TYPE LENGTH,
59  /*out*/ RETURN_CODE_TYPE *RETURN_CODE );
60 
61 extern void READ_SAMPLING_MESSAGE (
62  /*in */ SAMPLING_PORT_ID_TYPE SAMPLING_PORT_ID,
63  /*out*/ MESSAGE_ADDR_TYPE MESSAGE_ADDR,
64  /*out*/ MESSAGE_SIZE_TYPE *LENGTH,
65  /*out*/ VALIDITY_TYPE *VALIDITY,
66  /*out*/ RETURN_CODE_TYPE *RETURN_CODE );
67 
68 extern void GET_SAMPLING_PORT_ID (
69  /*in */ SAMPLING_PORT_NAME_TYPE SAMPLING_PORT_NAME,
70  /*out*/ SAMPLING_PORT_ID_TYPE *SAMPLING_PORT_ID,
71  /*out*/ RETURN_CODE_TYPE *RETURN_CODE );
72 
73 extern void GET_SAMPLING_PORT_STATUS (
74  /*in */ SAMPLING_PORT_ID_TYPE SAMPLING_PORT_ID,
75  /*out*/ SAMPLING_PORT_STATUS_TYPE *SAMPLING_PORT_STATUS,
76  /*out*/ RETURN_CODE_TYPE *RETURN_CODE );
77 
78 #endif
79 
80 #endif