------------------------------------------------------------------ -- -- NAME: BINARY_ENCODER_CONVERSION -- DISCREPANCY REPORTS: -- ------------------------------------------------------------------ -- file : BIN_ENCODER_CONV.ADA -- level : 0a with BINARY_ENCODER_TYPES; with CGM_BYTE_TYPES; package BINARY_ENCODER_CONVERSION is -- This package contains procedures required to encode the -- command header information (element class, element id, -- parameter list length) into an array of bytes. ------------------------------------------------------------------ procedure CONVERT_HEADER (HEADER : in BINARY_ENCODER_TYPES.HEADER_TYPE; RESULT : out CGM_BYTE_TYPES.BYTE_ARRAY); -- This routine creates word 1 of short & long-form command -- headers and returns it in an array of bytes. The command -- header word is created by combining the individual -- components of the HEADER into bytes through bit -- manipulations. See the BINARY_ENCODER_TYPES package for -- the complete form of command_headers. -------------------------------------------------------------------- procedure CONVERT_SIXTEEN_UNIT (INFORMATION : in BINARY_ENCODER_TYPES.SIXTEEN_BIT_TYPE; RESULT : out CGM_BYTE_TYPES.BYTE_ARRAY); -- This routine creates word 2 of long-form command headers. -- Word 2 contains a single bit partition flag followed by -- a parameter list length in the next 15 bits (value 0..32767). -- This routine only gets called when the parameter list length -- exceeds 30 octets (bytes). The 16 bits of information are -- returned in a byte array. -------------------------------------------------------------------- end BINARY_ENCODER_CONVERSION;