File: /home/oboss/Users/gec/sources/Basic_Services/Mission_Parameters/mission_parameters.ads
1 --% Compilation Unit: Mission_Parameters
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: mission_parameters.ads,v $
13 -- Revision 2.3 2004/02/13 16:16:27 gec
14 -- Merged results of Demonstrator development on to main OBOSS trunk.
15 --
16 -- Revision 2.2.2.4 2004/02/05 14:24:44 gec
17 -- Updated TC & TM packet max size in accordance with demonstrator specification.
18 --
19 -- Revision 2.2.2.3 2003/12/12 12:11:26 gec
20 -- Updated Data Handling System application process according to 'OBOSS-III Demonstrator Test Case Specification'.
21 --
22 -- Revision 2.2.2.2 2003/12/08 10:23:29 gec
23 -- Updated overall framework in accordance with OBOSS-III Demonstrator Test
24 --+ Case Specification.
25 --
26 -- Revision 2.2.2.1 2003/12/05 10:17:20 gec
27 -- Updated external format for packet fields according to 'Demonstrator Test
28 --+ Case Specification'.
29 --
30 -- Revision 2.2 2003/11/13 14:57:33 gec
31 -- Merged ECSS Migration branch to main trunk.
32 --
33 -- Revision 2.1.4.2 2003/11/10 10:02:45 gec
34 -- Added definition of smallest adressable unit.
35 --
36 -- Revision 2.1.4.1 2003/10/29 07:17:39 gec
37 -- Packet headers and data field headers updated to be compliant to ECSS
38 --+ Telemetry & Telecommand Packet Utilization standard.
39 --
40 -- Revision 2.1 2003/10/21 08:44:43 gec
41 -- Merged STADY_Recommendations branch onto trunk.
42 -- Contains numerous updates resulting from STADY fault descriptions.
43 --
44 -- Revision 2.0.2.1 2003/10/20 13:14:05 gec
45 -- Replaced use of magic numbers for application process identifiers by
46 --+ named numbers and references to these.
47 --
48 -- Response to STADY fault description Fault 95.
49 --
50 -- Revision 2.0 2003/04/04 08:50:10 gec
51 -- Initial release of source files serving as baseline for OBOSS-III
52 --+ project.
53 --
54 -- Revision 1.1.1.1 2003/04/04 08:13:03 gec
55 -- Imported using TkCVS
56 --
57 --
58 --
59 --% Project: OBOSS
60 --
61 --% Copyright (C) 2003 by Terma A/S
62 -- Proprietary and intellectual rights of Terma A/S, Denmark,
63 -- are involved in the subject-matter of this material and
64 -- all manufacturing, reproduction, use, disclosure, and
65 -- sales rights pertaining to such subject-matter are
66 -- expressly reserved. This material is submitted for a
67 -- specific purpose as agreed, and the recipient by
68 -- accepting this material agrees that this material will
69 -- not be used, copied, or reproduced in whole or in part
70 -- nor its contents revealed in any manner or to any person,
71 -- except to meet the purpose for which it was submitted and
72 -- subject to the terms of the agreement.
73 --
74 --% Target Dependencies:
75 -- None
76 --% Compiler Dependencies:
77 -- None
78
79 --~-----------------------------------------------------------------------------
80
81 with Basic_Types;
82 with Source_Data_Stream;
83 with Parameter_Representation;
84 with System;
85 package Mission_Parameters is
86
87 --% Library Package:
88 -- Definition of a subset of the system level parameters from Appendix B
89 --+ of the PUS standard, and definition of types and operations related
90 --+ to application process identifiers and packet store identifiers.
91 --% Active Tasks:
92 --> None
93 --% Passive Tasks:
94 --> None
95
96 -- Full CUC format used
97 Canonical_Time_Rep_Spec : constant Basic_Types.Time_Rep_Spec := (3, 3);
98
99 Max_Monitoring_Reporting_Delay : constant := 10;
100 Diag_Min_Interv : constant := 1.0;
101 Num_Source_Bits : constant := 6;
102 Num_Sub_Schedules : constant := 3;
103 Tcpkt_Max_Length : constant := 16#400#;
104 Tmpkt_Max_Length : constant := 16#400#;
105
106 -- Definition of <SMALLEST_ADDRESSABLE_UNIT> as defined in Appendix B of
107 --+ ECSS-E-70-41A.
108 -- Expressed as a bit size being a multiplum of Storage_Unit
109 Smallest_Addressable_Unit : constant := 1 * System.Storage_Unit;
110
111 -- Possible chekcum types used in Packet Error Control Field
112 type Checksum_Type is
113 (ISO_16,
114 CRC);
115
116 -- Indicates the mission wide error control field type for telecommands.
117 -- Definition of <TC_CHECKSUM_TYPE> as defined in Appendix B of
118 --+ ECSS-E-70-41A.
119 TC_Checksum_Type : constant Checksum_Type := ISO_16;
120
121 -- TC_Packet_Error_Control_Field_Byte_Size may be 0 or 2.
122 TC_Packet_Error_Control_Field_Byte_Size : constant := 2;
123
124 -- Indicates the mission wide error control field type for telemetry.
125 -- Definition of <TM_CHECKSUM_TYPE> as defined in Appendix B of
126 --+ ECSS-E-70-41A.
127 TM_Checksum_Type : constant Checksum_Type := ISO_16;
128
129 -- TM_Packet_Error_Control_Field_Byte_Size may be 0 or 2.
130 TM_Packet_Error_Control_Field_Byte_Size : constant := 2;
131
132 -- Definition of application process IDs
133 Time_Packet_APID : constant := 0; -- Reserved for time
134 --+ packets
135 Ground_APID : constant := 1; -- Ground application
136 --+ process
137 Data_Handling_System_APID : constant := 2; -- Data Handling System
138 --+ application process
139 Packet_Router_APID : constant := 3; -- Packet Router application
140 --+ process
141 Onboard_Storage_APID : constant := 4; -- Onboard Storage
142 --+ application process
143 Power_Conditioning_System_APID : constant := 8; -- Power Conditioning System
144 --+ application process
145 Payload_APID : constant := 12; -- Payload application
146 --+ process
147 Idle_APID : constant := 2#111_1111_1111#; -- Reserved
148 --+ application process ID for idle
149 --+ frames
150 type APID is
151 (Time_Packet,
152 Ground,
153 Data_Handling_System,
154 Packet_Router,
155 Onboard_Storage,
156 Power_Conditioning_System,
157 Payload,
158 Idle);
159
160 for APID use (Time_Packet => Time_Packet_APID,
161 Ground => Ground_APID,
162 Data_Handling_System => Data_Handling_System_APID,
163 Packet_Router => Packet_Router_APID,
164 Onboard_Storage => Onboard_Storage_APID,
165 Power_Conditioning_System => Power_Conditioning_System_APID,
166 Payload => Payload_APID,
167 Idle => Idle_APID);
168
169 subtype External_APID is Parameter_Representation.Enumerated_16;
170
171 -- Definition of source ID and destination ID
172 type Source_ID is new APID range Ground .. Data_Handling_System;
173 subtype External_Source_ID is Parameter_Representation.Enumerated_12;
174
175 type Destination_ID is new APID range Ground .. Data_Handling_System;
176 subtype External_Destination_ID is Parameter_Representation.Enumerated_12;
177
178 -- External representation of Parameter IDs in PUS packets.
179 type External_Parameter_ID is new Parameter_Representation.Enumerated_8;
180
181
182 -- Internal representation of parameter IDs.
183 type Parameter_ID is new Natural;
184
185 -- Supported stores
186 type Packet_Store_ID is
187 (Low_Priority_Store,
188 High_Priority_Store);
189
190 -- The store identifiers must be given in an order where store identifiers
191 --+ associated with one application process constitute a consecutive
192 --+ range.
193
194 Packet_Store_ID_Length : constant := 25;
195 subtype External_Packet_Store_ID is
196 Parameter_Representation.Character_String
197 (1 .. Packet_Store_ID_Length);
198
199 subtype Onboard_Storage_Packet_Store_ID is
200 Packet_Store_ID range Low_Priority_Store .. High_Priority_Store;
201
202
203 --% Subprogram:
204 -- Reads an application process identifier from a stream
205 --% Parameter Constraints:
206 --> None
207 --% Exceptions Raised:
208 --> Mission_Parameters.Invalid_Data_APID - When a valid application
209 --+ process identifier cannot be read from the source data stream.
210 --> Source_Data_Stream.Read_Stream_Exhausted - When source data stream
211 --+ does not hold a sufficient number of bits for the required type.
212
213 procedure Get
214 (Src_Data : in out Source_Data_Stream.Read_Stream;
215 Application_ID : out APID);
216
217
218 --% Subprogram:
219 -- Writes an application process identifier to a stream
220 --% Parameter Constraints:
221 --> None
222 --% Exceptions Raised:
223 --> Mission_Parameters.Invalid_Data_APID - When an invalid application
224 --+ process identifier is attempted written to the source data stream.
225 --> Source_Data_Stream.Write_Stream_Exhausted - When source data stream
226 --+ does not have enough space for the value to be written.
227
228 procedure Put
229 (Src_Data : in out Source_Data_Stream.Write_Stream;
230 Application_ID : in APID);
231
232
233 --% Subprogram:
234 -- Reads an packet store identifier from a stream
235 --% Parameter Constraints:
236 --> None
237 --% Exceptions Raised:
238 --> Mission_Parameters.Invalid_Packet_Store_ID - When a valid packet
239 --+ store identifier cannot be read from the source data stream.
240 --> Source_Data_Stream.Read_Stream_Exhausted - When source data stream
241 --+ does not hold a sufficient number of bits for the required type.
242
243 procedure Get
244 (Src_Data : in out Source_Data_Stream.Read_Stream;
245 Store_ID : out Packet_Store_ID);
246
247
248 --% Subprogram:
249 -- Writes an packet store identifier to a stream
250 --% Parameter Constraints:
251 --> None
252 --% Exceptions Raised:
253 --> Mission_Parameters.Invalid_Packet_Store_ID - When an invalid packet
254 --+ store identifier is attempted written to the source data stream.
255 --> Source_Data_Stream.Write_Stream_Exhausted - When source data stream
256 --+ does not have enough space for the value to be written.
257
258 procedure Put
259 (Src_Data : in out Source_Data_Stream.Write_Stream;
260 Store_ID : in Packet_Store_ID);
261
262
263 -- Exception indicating that a Get operation has read a bit-pattern from a
264 --+ source data stream that is not an APID
265 Invalid_Data_APID : exception;
266
267 -- Exception indicating that a Get operation has read a bit-pattern from a
268 --+ source data stream that is not a Packet_Store_ID
269 Invalid_Packet_Store_ID : exception;
270
271 end Mission_Parameters;
272
273 --~-----------------------------------------------------------------------------
274