File: /home/oboss/Users/gec/sources/PUS_Services/Event_Action/event_action-service-tm_parser.ads
1 --% Compilation Unit: Event_Action.Service.TM_Parser
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: event_action-service-tm_parser.ads,v $
13 -- Revision 1.2 2003/10/09 11:05:24 jhl
14 -- Added Service 13 And 19
15 --
16 -- Revision 1.1.2.2 2003/10/06 12:17:15 jhl
17 -- Event Action Post Review first update
18 --
19 -- Revision 1.1.2.1 2003/10/01 11:54:34 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 Event_Reporting_Types;
54 with PUS_Parser;
55 private generic package Event_Action.Service.TM_Parser is
56
57 --% Library Package:
58 -- Parses and interprets a TM PUS Packet
59 --% Active Tasks:
60 --> None
61 --% Passive Tasks:
62 --> None
63
64 -- Exception indicating that the service subtype is not supported.
65 Unsupported_Service_Subtype : exception;
66
67 -- Exception indicating that the TM source data is inconsistent and can not
68 --+ be parsed.
69 Source_Data_Is_Inconsistent : exception;
70
71 -- Internal TM Source Data abstract data type and associated interpretation
72 --+ function.
73 type Internal_TM_Source_Data is abstract tagged null record;
74 function Interpret_TM
75 (TM : in PUS.PUS_Packet;
76 Parsed_TM_Data : in Internal_TM_Source_Data)
77 return Boolean is abstract;
78
79 -- Internal TM Source Data actual inherited types and associated
80 --+ interpretation functions.
81
82 type Internal_TM_Source_Data_Event_Report_ID is new Internal_TM_Source_Data
83 with record
84 RID : Event_Action.Report_ID;
85 end record;
86
87 function Interpret_TM
88 (TM : in PUS.PUS_Packet;
89 Parsed_TM_Data : in Internal_TM_Source_Data_Event_Report_ID)
90 return Boolean;
91
92 --% Subprogram:
93 -- Transforms telemetry source data contained in in Src_Data read stream
94 --+ into an internal representation of an event reporting telemetry
95 --+ representation (service type 5) of subtype specified by
96 --+ Service_Subtype
97 --% Parameter Constraints:
98 --> None
99 --% Exceptions Raised:
100 --> Source_Data_Is_Inconsistent - Indicates that contents of Src_Data
101 --+ cannot be interpreted as a service request of the subtype given by
102 --+ Service_Subtype
103 --> Unsupported_Service_Subtype - Indicates that the service subtype
104 --+ is not supported
105
106 function Parse_TM_Source_Data
107 (Service_Subtype : in PUS_Data_Types.Service_Subtype;
108 Src_Data : in Source_Data_Stream.Read_Stream)
109 return Internal_TM_Source_Data'Class;
110
111 --% Library Package:
112 -- Parser used to parse a TM PUS Packet
113
114 package The_Parser is new PUS_Parser
115 (Service_Type =>
116 PUS_Data_Types.Event_Reporting,
117 Internal_PUS_Source_Data =>
118 Internal_TM_Source_Data,
119 Parse_Source_Data =>
120 Parse_TM_Source_Data,
121 Unsupported_PUS_Packet_Status_Type =>
122 Event_Reporting_Types.Report_ID,
123 Unsupported_PUS_Packet_Status =>
124 Event_Reporting_Types.Unsupported_Telemetry_Packet);
125
126 subtype Internal_TM_Representation is
127 The_Parser.Internal_PUS_Representation;
128
129 subtype Internal_TM_Representation_Failed is
130 The_Parser.Internal_PUS_Representation_Failed;
131
132 subtype Internal_TM_Representation_Passed is
133 The_Parser.Internal_PUS_Representation_Passed;
134
135 --% Subprogram:
136 -- Main parsing function.
137 --% Parameter Constraints:
138 --> PUS Packet must be a telemetry packet
139 --% Exceptions Raised:
140 --> None
141
142 function Parse_TM
143 (TM : in PUS.PUS_Packet)
144 return Internal_TM_Representation'Class;
145
146 -- The Event_Reporting_Service_Subtype is introduced to specify which event report
147 --+ service subtypes the event action service will detect / react on
148
149 type Event_Reporting_Service_Subtype is
150 (Any_Event_Report);
151
152 end Event_Action.service.tm_Parser;
153
154 --~-----------------------------------------------------------------------------
155
156