2
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /*
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 +-----------------------------------------------------------------------------
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 | Project :
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 | Modul : csn1_choice_2.c
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 +-----------------------------------------------------------------------------
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 | Copyright 2002 Texas Instruments Berlin, AG
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 | All rights reserved.
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 |
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 | This file is confidential and a trade secret of Texas
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 | Instruments Berlin, AG
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 | The receipt of or possession of this file does not convey
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 | any rights to reproduce or disclose its contents or to
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 | manufacture, use, or sell anything it may describe, in
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 | whole, or in part, without the specific written consent of
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 | Texas Instruments Berlin, AG.
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 +-----------------------------------------------------------------------------
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 | Purpose : Definition of encoding and decoding functions for CSN1_S1 elements
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 +-----------------------------------------------------------------------------
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 */
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 /*
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 * standard definitions like GLOBAL, UCHAR, ERROR etc.
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 */
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 #include "typedefs.h"
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 #include "header.h"
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 /*
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 * Prototypes of ccd (USE_DRIVER EQ undef) for prototypes only
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 * look at ccdapi.h
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 */
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 #undef USE_DRIVER
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 #include "ccdapi.h"
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 /*
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 * Types and functions for bit access and manipulation
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 */
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 #include "ccd_globs.h"
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 #include "bitfun.h"
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 /*
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 * Prototypes of ccd internal functions
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 */
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 #include "ccd.h"
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 /*
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 * Declaration of coder/decoder tables
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 */
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 #include "ccdtable.h"
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 #include "ccddata.h"
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 extern SHORT cdc_csn1_choice_x_decode (const ULONG c_ref, const ULONG e_ref,
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 ULONG num, T_CCD_Globs *globs);
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 extern SHORT cdc_csn1_choice_x_encode (const ULONG c_ref, const ULONG e_ref,
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 ULONG num, T_CCD_Globs *globs);
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 #ifndef RUN_INT_RAM
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 /*
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 +--------------------------------------------------------------------+
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 | PROJECT : CCD (6144) MODULE : CDC_GSM |
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 | STATE : code ROUTINE : cdc_csn1_choice2_decode |
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 +--------------------------------------------------------------------+
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 PURPOSE : Decoding of the GSM Type CSN1 CHOICE1 element. This element
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 consists of 2 bits CHOICE index and a value part of an
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 union type. The item of the union type represents the
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 CHOICE alternatives.
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 */
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
68
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
69 SHORT cdc_csn1_choice2_decode (const ULONG c_ref, const ULONG e_ref,
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
70 T_CCD_Globs *globs)
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 {
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 #ifdef DEBUG_CCD
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73 #ifndef CCD_SYMBOLS
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 TRACE_CCD (globs, "cdc_csn1_choice2_decode()");
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
75 #else
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
76 TRACE_CCD (globs, "cdc_csn1_choice2_decode() %s",
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
77 ccddata_get_alias((USHORT) e_ref, 1));
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 #endif
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
79 #endif
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
80
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
81 return cdc_csn1_choice_x_decode (c_ref, e_ref, 2, globs);
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
82 }
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 #endif /* !RUN_INT_RAM */
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
85
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
86 #ifndef RUN_INT_RAM
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
87 /*
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
88 +--------------------------------------------------------------------+
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
89 | PROJECT : CCD (6144) MODULE : CDC_GSM |
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
90 | STATE : code ROUTINE : cdc_csn1_choice2_encode |
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
91 +--------------------------------------------------------------------+
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
92
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
93 PURPOSE : Encoding of the GSM Type CSN1 CHOICE1 element. This element
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
94 consists of 2 bits CHOICE index and a value part of an
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
95 union type. The item of the union type represents the
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
96 CHOICE alternatives.
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
97 */
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
98
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
99 SHORT cdc_csn1_choice2_encode (const ULONG c_ref, const ULONG e_ref,
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
100 T_CCD_Globs *globs)
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
101 {
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
102 #ifdef DEBUG_CCD
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
103 #ifndef CCD_SYMBOLS
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
104 TRACE_CCD (globs, "cdc_csn1_choice2_encode()");
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
105 #else
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
106 TRACE_CCD (globs, "cdc_csn1_choice2_encode() %s",
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
107 ccddata_get_alias((USHORT) e_ref, 1));
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
108 #endif
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
109 #endif
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
110
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
111 return cdc_csn1_choice_x_encode (c_ref, e_ref, 2, globs);
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
112 }
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
113 #endif /* !RUN_INT_RAM */
|