File: /home/oboss/Users/gec/sources/Basic_Services/External_PUS/iso_checksum.ads

1     --% Compilation Unit:	ISO_Checksum
2     --
3     --% Category: Package Declaration
4     --
5     --% Release:  $Name:  $
6     --
7     --% Version:  $Revision: 2.0 $
8     --
9     --% Author:   $Author: gec $
10     --
11     --% Revision Log:
12     --    $Log: iso_checksum.ads,v $
13     --    Revision 2.0  2003/04/04 08:50:01  gec
14     --    Initial release of source files serving as baseline for OBOSS-III project.
15     --
16     --    Revision 1.1.1.1  2003/04/04 08:13:01  gec
17     --    Imported using TkCVS
18     --
19     --
20     --
21     --% Project: OBOSS
22     --
23     --% Copyright (C) 2003 by Terma A/S
24     --  Proprietary and intellectual rights of Terma A/S, Denmark,
25     --  are involved in the subject-matter of this material and
26     --  all manufacturing, reproduction, use, disclosure, and
27     --  sales rights pertaining to such subject-matter are
28     --  expressly reserved. This material is submitted for a
29     --  specific purpose as agreed, and the recipient by
30     --  accepting this material agrees that this material will
31     --  not be used, copied, or reproduced in whole or in part
32     --  nor its contents revealed in any manner or to any person,
33     --  except to meet the purpose for which it was submitted and
34     --  subject to the terms of the agreement.
35     --
36     --% Target Dependencies:
37     --    None
38     --% Compiler Dependencies:
39     --    None
40     
41     --~-----------------------------------------------------------------------------
42     
43     with Basic_Types;
44     package ISO_Checksum is
45     
46        --% Library Package:
47        --    Support for calculation and check of ISO 16-bit checksum on byte
48        --+    arrays
49        --% Active Tasks:
50        -->   None
51        --% Passive Tasks:
52        -->   None
53     
54        Checksum_Byte_Size : constant := 2;
55        subtype Checksum_Type is Basic_Types.Byte_Array (1 .. Checksum_Byte_Size);
56     
57     
58        --% Subprogram:
59        --    Calculate the 16-bit ISO checksum of a byte array
60        --% Parameter Constraints:
61        -->   None
62        --% Exceptions Raised:
63        -->   None
64     
65        function Calculate_Checksum
66              (Data : in     Basic_Types.Byte_Array)
67              return Checksum_Type;
68     
69     
70        --% Subprogram:
71        --    Check the 16-bit ISO checksum present in the last two bytes of a byte
72        --+    array
73        --% Parameter Constraints:
74        -->   None
75        --% Exceptions Raised:
76        -->   None
77     
78        function Checksum_Ok
79              (Data :        Basic_Types.Byte_Array)
80              return Boolean;
81     
82     end ISO_Checksum;
83     
84     --~-----------------------------------------------------------------------------
85