comparison src/gpf3/ccd/gsm1_asn.c @ 2:c41a534f33c6

src/gpf3: preened GPF goo from TCS3.2
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 25 Sep 2016 23:52:50 +0000
parents
children
comparison
equal deleted inserted replaced
1:864b8cc0cf63 2:c41a534f33c6
1 /*
2 +-----------------------------------------------------------------------------
3 | Project :
4 | Modul : gsm1_asn.c
5 +-----------------------------------------------------------------------------
6 | Copyright 2002 Texas Instruments Berlin, AG
7 | All rights reserved.
8 |
9 | This file is confidential and a trade secret of Texas
10 | Instruments Berlin, AG
11 | The receipt of or possession of this file does not convey
12 | any rights to reproduce or disclose its contents or to
13 | manufacture, use, or sell anything it may describe, in
14 | whole, or in part, without the specific written consent of
15 | Texas Instruments Berlin, AG.
16 +-----------------------------------------------------------------------------
17 | Purpose : Definition of encoding and decoding functions for GSM1_ASN elements
18 +-----------------------------------------------------------------------------
19 */
20
21
22 /*
23 * standard definitions like GLOBAL, UCHAR, ERROR etc.
24 */
25 #include "typedefs.h"
26 #include "header.h"
27
28 /*
29 * Prototypes of ccd (USE_DRIVER EQ undef) for prototypes only
30 * look at ccdapi.h
31 */
32 #undef USE_DRIVER
33 #include "ccdapi.h"
34
35 /*
36 * Types and functions for bit access and manipulation
37 */
38 #include "ccd_globs.h"
39 #include "bitfun.h"
40
41 /*
42 * Prototypes of ccd internal functions
43 */
44 #include "ccd.h"
45
46 /*
47 * Declaration of coder/decoder tables
48 */
49 #include "ccdtable.h"
50 #include "ccddata.h"
51
52
53 #ifndef RUN_INT_RAM
54 /*
55 +--------------------------------------------------------------------+
56 | PROJECT : CCD (6144) MODULE : CDC_GSM |
57 | STATE : code ROUTINE : cdc_gsm1asn_decode |
58 +--------------------------------------------------------------------+
59
60 PURPOSE : Decoding of the GSM Type ASN1 element. This element
61 consists of a 8 bit T component a
62 8 Bit L component and a V component wich
63 length depends on the value of the L component. The value
64 of L may be coded fix as 0x80. In this case a end of
65 content tag must follow the V component to identify the
66 end of this element (implicit length)
67
68 */
69
70 SHORT cdc_gsm1asn_decode (const ULONG c_ref, const ULONG e_ref, T_CCD_Globs *globs)
71 {
72 T_TLV_SORT tlv_inf;
73
74 tlv_inf.gotTag = TRUE;
75 tlv_inf.gotLen = TRUE;
76
77 #ifdef DEBUG_CCD
78 #ifndef CCD_SYMBOLS
79 TRACE_CCD (globs, "cdc_gsm1asn_decode()");
80 #else
81 TRACE_CCD (globs, "cdc_gsm1asn_decode() %s", ccddata_get_alias((USHORT) e_ref, 1));
82 #endif
83 #endif
84
85 return cdc_tlv_decode (c_ref, e_ref, &tlv_inf, globs);
86 }
87 #endif /* !RUN_INT_RAM */
88
89 #ifndef RUN_INT_RAM
90 /*
91 +--------------------------------------------------------------------+
92 | PROJECT : CCD (6144) MODULE : CDC_GSM |
93 | STATE : code ROUTINE : cdc_gsm1asn_encode |
94 +--------------------------------------------------------------------+
95
96 PURPOSE : Encoding of the GSM Type ASN1 element. This element
97 consists of a 8 bit T component a
98 8 Bit L component and a V component wich
99 length depends on the value of the L component. The value
100 of L may be coded fix as 0x80. In this case a end of
101 content tag must follow the V component to identify the
102 end of this element (implicit length)
103
104 */
105
106 SHORT cdc_gsm1asn_encode (const ULONG c_ref, const ULONG e_ref, T_CCD_Globs *globs)
107 {
108 #ifdef DEBUG_CCD
109 #ifndef CCD_SYMBOLS
110 TRACE_CCD (globs, "cdc_gsm1asn_encode()");
111 #else
112 TRACE_CCD (globs, "cdc_gsm1asn_encode() %s", ccddata_get_alias((USHORT) e_ref, 1));
113 #endif
114 #endif
115
116 cdc_tlv_encode (e_ref, 8, 8, globs);
117
118 return 1;
119 }
120 #endif /* !RUN_INT_RAM */