File: /home/oboss/Users/gec/sources/PUS_Services/Large_Data_Transfer/large_data_transfer-sender.ads
1 --% Compilation Unit: Large_Data_Transfer.Sender
2 --
3 --% Category: Generic 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-sender.ads,v $
13 -- Revision 1.2 2003/10/09 11:05:33 jhl
14 -- Added Service 13 And 19
15 --
16 -- Revision 1.1.2.2 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:49 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 Large_Data_Transfer.Sender_State;
53
54 -- With's for task prioritizing
55 with Task_Priority_Control;
56
57 generic
58
59 --% Generic Parameter Constraints:
60 --> None
61
62 -- TC Handler Parameters:
63
64 -- Priority of protected object implementing buffering of calls to
65 --+ Handle_TC_Packet
66 TC_Handler_Buffer_Priority
67 : in Task_Priority_Control.
68 Passive_Task_Priority;
69
70 -- Maximum number of entries in buffer of calls to Handle_TC_Packet.
71 -- Should be defined to cater for bursts in arrival of TC packets for
72 --+ execution.
73 TC_Handler_Buffer_Size : in Positive;
74
75 -- Priority and stack size of sporadic task performing TC packet execution
76 --+ as a response to calls to Handle_TC_Packet
77 TC_Handler_Interpreter_Priority
78 : in Task_Priority_Control.
79 Active_Task_Priority;
80
81 TC_Handler_Interpreter_Stack_Size : in Natural;
82
83 -- SDU Sender Parameters:
84
85 -- Priority of protected object implementing buffering of calls to the SDU
86 --+ sender
87 SDU_Sender_Buffer_Priority
88 : in Task_Priority_Control.
89 Passive_Task_Priority;
90
91 -- Maximum number of entries in buffer of calls to the SDU sender.
92 -- Should be defined to cater for bursts in arrival of TM packets
93 SDU_Sender_Buffer_Size : in Positive;
94
95 -- Priority and stack size of sporadic task performing SDU sending as a
96 --+ response to calls to Deposit_TM_Packet
97 SDU_Sender_Interpreter_Priority
98 : in Task_Priority_Control.
99 Active_Task_Priority;
100
101 SDU_Sender_Interpreter_Stack_Size : in Natural;
102
103 -- Priority of proteceted object encapsulating actual state changes, making
104 --+ them atomic.
105 Protected_State_Priority
106 : in Task_Priority_Control.
107 Passive_Task_Priority;
108
109 -- Max queue length of parts to resend for sending sub-service
110 --
111 -- Default value is as the maximum needed queue length for any possible SDU
112 -- To disable the ability to resend parts set this to ZERO
113 Max_Resend_Queue_Length : in Large_Data_Transfer.Optional_Part_Range :=
114 Large_Data_Transfer.Optional_Part_Range'Last;
115
116 -- Timeout interval for downlink reception acknowledgement TC from receiver.
117 --+
118 Timeout_Interval_In_Milliseconds : in Positive;
119
120 -- Timeout handler for sending sub-service
121 --
122 -- This subprogram can be overridden with an application process
123 -- specific handler.
124
125 with procedure Sender_Timeout_Handler
126 (Timeout : in Sender_Timeout) is
127 Large_Data_Transfer.Default_Sender_Timeout_Handler;
128
129 -- Priority of proteceted object encapsulating the timout control
130 Protected_Timer_Control_Priority
131 : in Task_Priority_Control.Passive_Task_Priority;
132
133 -- Priority of the actual timer task for timeout control
134 Active_Timer_Priority : in Task_Priority_Control.Active_Task_Priority;
135
136 package Large_Data_Transfer.Sender is
137
138 --% Library Package:
139 -- The main package for the instantiation of the Large Data Transfer
140 --+ sending sub-service.
141 --
142 -- Disassembles and sends a SDU TM PUS Packet as SDU Parts according to
143 --+ the sending protocol defined for the Large Data Transfer, as
144 --+ understood from the ECSS-E-70-41A Packet Utilization Standard
145 --
146 --% Active Tasks:
147 --> The_Large_Data_Transfer_Sender_TC_Handler - Handles TC PUS Packets
148 --> The_Large_Data_Transfer_Sender_SDU_Sender - Handles sending TM PUS
149 --+ Packets as SDU Parts
150 --> The_Sender_State - Contains an active task for triggering timeouts
151 --% Passive Tasks:
152 --> The_Sender_State - Contains a protected object maintaining the state
153 --+ of the sending sub-service.
154 --> The_Sender_State - Contains a protected object controlling the timeout
155 --+ functionality
156
157 -- Exception indicating that an SDU received for sending (downlink) has
158 --+ exceeded the allowed maximum size of an SDU.
159 -- This will never happen if the write streams have been configured to be
160 --+ the correct size for a max SDU.
161 SDU_Byte_Size_Exceeded : exception;
162
163 -- Exception indicating that an SDU received for sending (downlink) has a
164 --+ length too small to fill a single SDU part (SDU part length given by
165 --+ Part_Byte_Length in Large_Data_Transfer.
166 -- This will never happen if the Large Data Transfer sender is called
167 -- through the Large Data Transder service interface.
168 SDU_Byte_Size_Too_Short : exception;
169
170
171
172 --% Subprogram:
173 -- Initialization of generic package instantiation.
174 --% Parameter Constraints:
175 --> None
176 --% Exceptions Raised:
177 --> None
178
179 procedure Initialize;
180
181 --% Subprogram:
182 -- Main handler for PUS Packet delivered to the Large Data Transfer
183 --+ sending sub-service from the Large Data Transfer service (CDH PUS
184 --+ Packet distributer)
185 --
186 -- This subprogram shall override the default subprogram in the
187 --+ instantiation of the Large_Data_Transfer.Service if the sending
188 --+ sub-service is to be used.
189 --
190 --% Parameter Constraints:
191 --> TC_Packet - Must be a TC Packet with service type and service sub-type
192 --+ for the Large Data Transfer sending sub-service
193 --% Exceptions Raised:
194 --> None
195
196 procedure Handle_TC_Packet
197 (TC_Packet : in PUS.PUS_Packet);
198
199 --% Subprogram:
200 -- Deposits function for TM PUS Packets that shall be sent as SDU parts
201 --+ by the Large Data Transfer sending sub-service. A TM deposited WILL
202 --+ be send as an SDU, i.e. it must have a length which is long enough
203 --+ for it to be disassembled in parts.
204 --
205 -- This subprogram shall override the default subprogram in the
206 --+ instantiation of the Large_Data_Transfer.Service if the sending
207 --+ sub-service is to be used.
208 --
209 --% Parameter Constraints:
210 --> PUS_Packet - Must be a TM Packet with a size that qualifies for
211 --+ sending it as an SDU.
212 --% Exceptions Raised:
213 -- Sdu_Byte_Size_Exceeded - Length of SDU generated from the TM is too
214 --+ long.
215 -- Sdu_Byte_Size_Too_Short - Length of SDU generated from the TM is too
216 --+ short.
217
218 function Deposit_TM_Packet
219 (TM_Packet : in PUS.PUS_Packet)
220 return Boolean;
221
222 private
223
224 -- Package instantiations with types and functionality, for use in private
225 --+ generic children
226
227 --% Library Package:
228 -- Instantiation of the sender state
229
230 package The_Sender_State is new Large_Data_Transfer.Sender_State
231 (Protected_State_Priority =>
232 Protected_State_Priority,
233 Max_Resend_Queue_Length =>
234 Max_Resend_Queue_Length,
235 Timeout_Interval_In_Milliseconds =>
236 Timeout_Interval_In_Milliseconds,
237 Sender_Timeout_Handler =>
238 Sender_Timeout_Handler,
239 Protected_Timer_Control_Priority =>
240 Protected_Timer_Control_Priority,
241 Active_Timer_Priority =>
242 Active_Timer_Priority);
243
244 end Large_Data_Transfer.sender;
245
246 --~-----------------------------------------------------------------------------
247