File: /home/oboss/Users/gec/sources/PUS_Services/Large_Data_Transfer/large_data_transfer_parser.ads
1 --% Compilation Unit: Large_Data_Transfer_Parser
2 --
3 --% Category: Package Declaration
4 --
5 --% Release: $Name: $
6 --
7 --% Version: $Revision: 1.2 $
8 --
9 --% Author: $Author: jhl $
10 --
11 --% Revision Log:
12 -- $Log: large_data_transfer_parser.ads,v $
13 -- Revision 1.2 2003/10/09 11:05:36 jhl
14 -- Added Service 13 And 19
15 --
16 -- Revision 1.1.2.1 2003/10/03 09:47:56 jhl
17 -- Large Data Transfer post review first update
18 --
19 -- Revision 1.1.2.1 2003/10/01 11:54:39 jhl
20 -- Initial version of service 13 Event Action, and 19 Large Data Transfer.
21 --
22 -- Revision 2.0 2003/04/04 10:08:58 gec
23 -- Initial release serving as baseline for OBOSS-III project.
24 --
25 -- Revision 1.1.1.1 2003/04/04 07:19:20 gec
26 -- Imported using TkCVS
27 --
28 --
29 --
30 --% Project: OBOSS
31 --
32 --% Copyright (C) 2003 by Terma A/S
33 -- Proprietary and intellectual rights of Terma A/S, Denmark,
34 -- are involved in the subject-matter of this material and
35 -- all manufacturing, reproduction, use, disclosure, and
36 -- sales rights pertaining to such subject-matter are
37 -- expressly reserved. This material is submitted for a
38 -- specific purpose as agreed, and the recipient by
39 -- accepting this material agrees that this material will
40 -- not be used, copied, or reproduced in whole or in part
41 -- nor its contents revealed in any manner or to any person,
42 -- except to meet the purpose for which it was submitted and
43 -- subject to the terms of the agreement.
44 --
45 --% Target Dependencies:
46 -- None
47 --% Compiler Dependencies:
48 -- None
49
50 --~-----------------------------------------------------------------------------
51
52 with Source_Data_Stream;
53 with Large_Data_Transfer_Types;
54 with External_Large_Data_Transfer_Types;
55 with External_PUS_Data_Types;
56 with PUS_Data_Types;
57
58 generic
59
60 -- List range type for parsing lists of sequence numbers
61 type List_Range is range <>;
62
63 -- List array type for parsing lists of sequence numbers
64 type List is array (List_Range) of
65 Large_Data_Transfer_Types.Sequence_Number;
66
67 package Large_Data_Transfer_Parser is
68
69 --% Library Package:
70 -- Implements common parser routines for parsing
71 --% Active Tasks:
72 --> None
73 --% Passive Tasks:
74 --> None
75
76 --> The parsed length of the list, from the source data is out of range.
77 List_Length_Value_Out_Of_Range : exception;
78
79 --> A parsed list elements value is out of range
80 Parameter_Value_Out_Of_Range : exception;
81
82 -- Exception indicating that the source data is inconsistent and can not be
83 --+ parsed.
84 Source_Data_Is_Inconsistent : exception;
85
86 -- Exception indicating that the service subtype is usupported / unknown
87 Unsupported_Service_Subtype : exception;
88
89 --% Subprogram:
90 -- Checks if a source data read stream contains bits.
91 -- If the read strean is NOT allocated it is regarded as empty.
92 --% Parameter Constraints:
93 --> None
94 --% Exceptions Raised:
95 --> None
96
97 function Read_Stream_Is_Empty
98 (Read_Stream : in Source_Data_Stream.Read_Stream)
99 return Boolean;
100
101 --% Subprogram:
102 -- Checks that a source data read stream contains at most 7
103 --+ padding 0-bits in the end.
104 -- If the read stream is NOT allocated it is regarded as empty.
105 --% Parameter Constraints:
106 --> None
107 --% Exceptions Raised:
108 --> None
109
110 function Less_Than_One_Padding_Byte_Left
111 (Read_Stream : in Source_Data_Stream.Read_Stream)
112 return Boolean;
113
114 --% Subprogram:
115 -- parsing procedure for parsing a single sequence number from a
116 --+ source data read stream containing nothing else but a sequence
117 --+ number The sequence number shall have the form:
118 --+ <Element_Type>
119 -- where:
120 -- <Element_Type> is of type
121 --+ External_Large_Data_Transfer_Type.Sequence_Number
122 --
123 -- Used e.g. in parsing sequence number in an acknowledgement TC.
124 --% Parameter Constraints:
125 --> None
126 --% Exceptions Raised:
127 --> Parameter_Value_Out_Of_Range - A parsed parameter value is out of
128 --+ range
129 --> Source_Data_Is_Inconsistent - The source data is generally
130 --+ inconsistent.
131
132 procedure Parse_Sequence_Number
133 (Src_Data : in out Source_Data_Stream.Read_Stream;
134 Parsed_Sequence_Number
135 : out Large_Data_Transfer_Types.
136 Sequence_Number);
137
138 --% Subprogram:
139 -- Generic parsing procedure for parsing of lists in source data. The
140 --+ source data list shall have the form: <N> [ <Element_Type>], where -
141 -- <N> is of type External_Large_Data_Transfer.List_Length
142 -- <Element_Type> is of type
143 --+ External_Large_Data_Transfer_Type.Sequence_Number
144 --% Parameter Constraints:
145 --> None
146 --% Exceptions Raised:
147 --> List_Length_Value_Out_Of_Range - The parsed length of the list, from
148 --+ the source data is out of range.
149 --> Parameter_Value_Out_Of_Range - A parsed list element value is out of
150 --+ range
151 --> Source_Data_Is_Inconsistent - The source data is generally
152 --+ inconsistent.
153
154 procedure Parse_List
155 (Src_Data : in out Source_Data_Stream.Read_Stream;
156 Parsed_List_Count : out List_Range;
157 Parsed_List : out List);
158
159 --% Subprogram:
160 -- Parses the service subtype
161 --% Parameter Constraints:
162 --> None
163 --% Exceptions Raised:
164 --> Unsupported_Service_Subtype - The service subtype is unsupported /
165 --+ unknown;
166
167 function Parse_Service_Subtype
168 (Service_Subtype : in PUS_Data_Types.Service_Subtype)
169 return Large_Data_Transfer_Types.Large_Data_Transfer_Service_Subtype;
170
171 --% Subprogram:
172 -- Unparses the service subtype
173 --% Parameter Constraints:
174 --> None
175 --% Exceptions Raised:
176 --> None
177
178 function Unparse_Service_Subtype
179 (Service_Subtype : in Large_Data_Transfer_Types.Large_Data_Transfer_Service_Subtype)
180 return External_PUS_Data_Types.External_Service_Subtype;
181
182 end Large_Data_Transfer_Parser;
183
184 --~-----------------------------------------------------------------------------
185
186
187