POK
apex-sampling_ports.ads
1 -- ---------------------------------------------------------------------------
2 -- --
3 -- SAMPLING PORT constant and type definitions and management services --
4 -- --
5 -- ---------------------------------------------------------------------------
6 package APEX.Sampling_Ports is
7  Max_Number_Of_Sampling_Ports : constant :=
8  System_Limit_Number_Of_Sampling_Ports;
9  subtype Sampling_Port_Name_Type is Name_Type;
10  type Sampling_Port_Id_Type is private;
11  Null_Sampling_Port_Id : constant Sampling_Port_Id_Type;
12  type Validity_Type is (Invalid, Valid);
13  type Sampling_Port_Status_Type is record
14  Refresh_Period : System_Time_Type;
15  Max_Message_Size : Message_Size_Type;
16  Port_Direction : Port_Direction_Type;
17  Last_Msg_Validity : Validity_Type;
18  end record;
19  procedure Create_Sampling_Port
20  (Sampling_Port_Name : in Sampling_Port_Name_Type;
21  Max_Message_Size : in Message_Size_Type;
22  Port_Direction : in Port_Direction_Type;
23  Refresh_Period : in System_Time_Type;
24  Sampling_Port_Id : out Sampling_Port_Id_Type;
25  Return_Code : out Return_Code_Type);
26  procedure Write_Sampling_Message
27  (Sampling_Port_Id : in Sampling_Port_Id_Type;
28  Message_Addr : in Message_Addr_Type;
29  Length : in Message_Size_Type;
30  Return_Code : out Return_Code_Type);
31  procedure Read_Sampling_Message
32  (Sampling_Port_Id : in Sampling_Port_Id_Type;
33  Message_Addr : in Message_Addr_Type;
34  -- The message address is passed IN, although the respective message is
35  -- passed OUT
36  Length : out Message_Size_Type;
37  Validity : out Validity_Type;
38  Return_Code : out Return_Code_Type);
39  procedure Get_Sampling_Port_Id
40  (Sampling_Port_Name : in Sampling_Port_Name_Type;
41  Sampling_Port_Id : out Sampling_Port_Id_Type;
42  Return_Code : out Return_Code_Type);
43  procedure Get_Sampling_Port_Status
44  (Sampling_Port_Id : in Sampling_Port_Id_Type;
45  Sampling_Port_Status : out Sampling_Port_Status_Type;
46  Return_Code : out Return_Code_Type);
47 private
48  type Sampling_Port_Id_Type is new APEX_Integer;
49  Null_Sampling_Port_Id : constant Sampling_Port_Id_Type := 0;
50  pragma Convention (C, Validity_Type);
51  pragma Convention (C, Sampling_Port_Status_Type);
52 
53  -- POK BINDINGS
54  pragma Import (C, Create_Sampling_Port, "CREATE_SAMPLING_PORT");
55  pragma Import (C, Write_Sampling_Message, "WRITE_SAMPLING_MESSAGE");
56  pragma Import (C, Read_Sampling_Message, "READ_SAMPLING_MESSAGE");
57  pragma Import (C, Get_Sampling_Port_Id, "GET_SAMPLING_PORT_ID");
58  pragma Import (C, Get_Sampling_Port_Status, "GET_SAMPLING_PORT_STATUS");
59  -- END OF POK BINDINGS
60 end APEX.Sampling_Ports;