File: /home/oboss/Users/gec/sources/Basic_Services/Internal_PUS/pus_data_types.ads

1     --% Compilation Unit: PUS_Data_Types
2     --
3     --% Category: Package Declaration
4     --
5     --% Release:  $Name:  $
6     --
7     --% Version:  $Revision: 2.3 $
8     --
9     --% Author:   $Author: gec $
10     --
11     --% Revision Log:
12     --    $Log: pus_data_types.ads,v $
13     --    Revision 2.3  2003/11/13 14:57:33  gec
14     --    Merged ECSS Migration branch to main trunk.
15     --
16     --    Revision 2.2.4.2  2003/10/29 15:38:08  gec
17     --    Added support for management of telemetry packet subcounters.
18     --
19     --    Revision 2.2.4.1  2003/10/29 07:17:39  gec
20     --    Packet headers and data field headers updated to be compliant to ECSS
21     --+    Telemetry & Telecommand Packet Utilization standard.
22     --
23     --    Revision 2.2  2003/10/21 08:44:43  gec
24     --    Merged STADY_Recommendations branch onto trunk.
25     --    Contains numerous updates resulting from STADY fault descriptions.
26     --
27     --    Revision 2.0.2.1  2003/10/20 12:34:06  gec
28     --    Redefined telecommand and telemetry sequence counter type to a modular
29     --+    integer.
30     --    Eliminated dubious use of exceptions when incrementing source sequence
31     --+    counters in Packet_Counters_Manager.
32     --
33     --    Response to STADY fault description Fault 92 & 93.
34     --
35     --    Revision 2.1  2003/10/09 11:05:17  jhl
36     --    Added Service 13 And 19
37     --
38     --    Revision 2.0.4.1  2003/10/01 11:54:22  jhl
39     --    Initial version of service 13 Event Action, and 19 Large Data Transfer.
40     --
41     --    Revision 2.0  2003/04/04 08:50:02  gec
42     --    Initial release of source files serving as baseline for OBOSS-III
43     --+    project.
44     --
45     --    Revision 1.1.1.1  2003/04/04 08:13:02  gec
46     --    Imported using TkCVS
47     --
48     --
49     --
50     --% Project: OBOSS
51     --
52     --% Copyright (C) 2003 by Terma A/S
53     --  Proprietary and intellectual rights of Terma A/S, Denmark,
54     --  are involved in the subject-matter of this material and
55     --  all manufacturing, reproduction, use, disclosure, and
56     --  sales rights pertaining to such subject-matter are
57     --  expressly reserved. This material is submitted for a
58     --  specific purpose as agreed, and the recipient by
59     --  accepting this material agrees that this material will
60     --  not be used, copied, or reproduced in whole or in part
61     --  nor its contents revealed in any manner or to any person,
62     --  except to meet the purpose for which it was submitted and
63     --  subject to the terms of the agreement.
64     --
65     --% Target Dependencies:
66     --    None
67     --% Compiler Dependencies:
68     --    None
69     
70     --~-----------------------------------------------------------------------------
71     
72     with Basic_Types;
73     with Mission_Parameters;
74     with Source_Data_Stream;
75     with PUS;
76     package PUS_Data_Types is
77     
78        --% Library Package:
79        --    Definition of internal PUS packet data types and operations
80        --% Active Tasks:
81        -->   None
82        --% Passive Tasks:
83        -->   None
84     
85        type Packet_Type is
86              (TM_Packet_Type,
87               TC_Packet_Type);
88     
89        Sequence_Count_Size : constant := 14;
90        type Sequence_Count is mod 2**Sequence_Count_Size - 1;
91     
92        -- Definition of packet subcounters
93        Packet_Subcount_Size : constant := 8;
94        type Packet_Subcount is mod 2**Packet_Subcount_Size - 1;
95     
96        type Ack_Stages is
97              (Completion,
98               Progress_Of_Execution,
99               Start_Of_Execution,
100               Acceptance);
101     
102        type Ack_Type is array (Ack_Stages) of Boolean;
103        pragma Pack (Ack_Type);
104     
105        type Service_Type is
106              (Telecommand_Verification,
107               Device_Level_Commanding,
108               HK_And_Diagnostic_Reporting,
109               Event_Reporting,
110               Memory_Management,
111               Function_Management,
112               Onboard_Scheduling,
113               Onboard_Monitoring,
114               Large_Data_Transfer,
115               Onboard_Storage_And_Retrieval,
116               Onboard_Traffic_Management,
117               Event_Action,
118               Science_Data);
119        -- Only service types supported by OBOSS are included
120     
121        type Service_Subtype is range 0 .. 255;
122     
123        type Service_Name is
124           record
125              Service_Type_Val    : Service_Type;
126              Service_Subtype_Val : Service_Subtype;
127           end record;
128     
129        subtype On_Board_Time     is Basic_Types.On_Board_Time;
130        subtype On_Board_Duration is Basic_Types.Relative_On_Board_Time;
131     
132        type SDU_Unit_Type is
133              (Standard_Packet,
134               Extended_Packet);                   -- Extended packet type is NOT
135                                            --+    supported in OBOSS.
136     
137        --% Subprogram:
138        --    T1 < T2 iff T1 designates an earlier time than T2
139        --% Parameter Constraints:
140        -->   None
141        --% Exceptions Raised:
142        -->   None
143     
144        function "<"
145              (T1, T2 : in     On_Board_Time)
146              return Boolean renames Basic_Types."<";
147     
148        --% Subprogram:
149        --    T1 <= T2 iff T1 equals T2 or designates an earlier time than T2
150        --% Parameter Constraints:
151        -->   None
152        --% Exceptions Raised:
153        -->   None
154     
155        function "<="
156              (T1, T2 : in     On_Board_Time)
157              return Boolean;
158     
159        --% Subprogram:
160        --    Computes the time span from T2 to T1
161        --% Parameter Constraints:
162        -->   None
163        --% Exceptions Raised:
164        -->   Basic_Types.Incompatible_Time_Representations - raised if the P-fields
165        --+    differ
166        -->   Basic_Types.Time_Span_Too_Large - Overflow in calculation
167     
168        function "-"
169              (T1, T2 : in     On_Board_Time)
170              return On_Board_Duration renames Basic_Types."-";
171     
172     
173        --% Subprogram:
174        --    Adds the time span Rt to the time T
175        --% Parameter Constraints:
176        -->   None
177        --% Exceptions Raised:
178        -->   Basic_Types.Incompatible_Time_Representations - raised if the P-fields
179        --+    differ
180        -->   Basic_Types.Time_Span_Too_Large - Overflow in calculation
181     
182        function "+"
183              (T  : in     On_Board_Time;
184               Rt : in     On_Board_Duration)
185              return On_Board_Time renames Basic_Types."+";
186     
187        type Optional_Packet_Store_ID(Status : Boolean := False) is
188           record
189              case Status is
190                 when True =>
191                    Store_ID : Mission_Parameters.Packet_Store_ID;
192                 when False =>
193                    null;
194              end case;
195           end record;
196     
197        type PUS_Packet_Impl(Pck_Type : Packet_Type := Packet_Type'First) is
198           record
199              Sender_APID   : Mission_Parameters.APID;
200              Receiver_APID : Mission_Parameters.APID;
201              Service       : Service_Name;
202              Source_Data   : Source_Data_Stream.Write_Stream;
203              case Pck_Type is
204                 when TC_Packet_Type =>
205                    Sequence_Counter : Sequence_Count;
206                    Ack              : Ack_Type;
207                 when TM_Packet_Type =>
208                    Opt_Storage_ID          : Optional_Packet_Store_ID;
209                    Source_Sequence_Counter : Sequence_Count;
210                    Packet_Subcounter       : Packet_Subcount;
211                    Packet_Time             : On_Board_Time;
212              end case;
213           end record;
214     
215     
216        type Source_Data_Allocation_Size is new Source_Data_Stream.Allocation_Size;
217     
218        subtype Time_Rep_Spec is Basic_Types.Time_Rep_Spec;
219     
220        -- Packet type exceptions
221     
222        Wrong_Packet_Kind : exception;
223     
224     end PUS_Data_Types;
225     
226     --~-----------------------------------------------------------------------------
227