FreeCalypso > hg > freecalypso-sw
annotate gsm-fw/ccd/cdc_com.c @ 871:a5c8f48003cd
rvinterf: client programs can now selectively stop receiving packets of a
particular RVTMUX type
author | Space Falcon <falcon@ivan.Harhan.ORG> |
---|---|
date | Fri, 29 May 2015 06:29:38 +0000 |
parents | 970d6199f2c5 |
children |
rev | line source |
---|---|
648
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2 +----------------------------------------------------------------------------- |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3 | Project : |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
4 | Modul : cdc_com.c |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
5 +----------------------------------------------------------------------------- |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
6 | Copyright 2002 Texas Instruments Berlin, AG |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
7 | All rights reserved. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
8 | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
9 | This file is confidential and a trade secret of Texas |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
10 | Instruments Berlin, AG |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
11 | The receipt of or possession of this file does not convey |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
12 | any rights to reproduce or disclose its contents or to |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
13 | manufacture, use, or sell anything it may describe, in |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
14 | whole, or in part, without the specific written consent of |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
15 | Texas Instruments Berlin, AG. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
16 +----------------------------------------------------------------------------- |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
17 | Purpose : Condat Conder Decoder |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
18 | Definitions of common functions for encoding and decoding of |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
19 | GSM, GPRS or UMTS air interface messages |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
20 +----------------------------------------------------------------------------- |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
21 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
22 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
23 #ifdef _MSDOS |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
24 #include <dos.h> |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
25 #include <conio.h> |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
26 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
27 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
28 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
29 * standard definitions like UCHAR, ERROR etc. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
30 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
31 #include "typedefs.h" |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
32 #include "header.h" |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
33 #include <string.h> |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
34 #include <stdlib.h> |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
35 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
36 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
37 * Prototypes of ccd (USE_DRIVER EQ undef) for prototypes only |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
38 * look at ccdapi.h |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
39 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
40 #undef USE_DRIVER |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
41 #include "ccdapi.h" |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
42 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
43 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
44 * Types and functions for bit access and manipulation |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
45 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
46 #include "ccd_globs.h" |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
47 #include "bitfun.h" |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
48 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
49 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
50 * Declaration of coder/decoder-tables |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
51 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
52 #include "ccdtable.h" |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
53 #include "ccddata.h" |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
54 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
55 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
56 * Prototypes and constants in the common part of ccd |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
57 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
58 #include "ccd.h" |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
59 #include "ccd_codingtypes.h" |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
60 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
61 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
62 * Need memory allocation functions for dynamic arrays (pointers) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
63 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
64 #ifdef DYNAMIC_ARRAYS |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
65 #include "vsi.h" |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
66 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
67 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
68 #ifndef RUN_FLASH |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
69 const UBYTE padding_bits[8] = {0, 0, 1, 0, 1, 0, 1, 1}; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
70 const UBYTE padding_bits_prev[8] = {1, 0, 0, 1, 0, 1, 0, 1}; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
71 #endif /* !RUN_FLASH */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
72 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
73 #ifndef RUN_FLASH |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
74 /* Attention for RUN_...: static data (used in cdc_skipElem) */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
75 static UBYTE dummy[256]; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
76 #endif /* !RUN_FLASH */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
77 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
78 typedef struct unknownTag |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
79 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
80 U8 errCode; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
81 U8 tag; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
82 U16 bitpos; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
83 struct unknownTag *next; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
84 }T_UNKNOWN_TAG; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
85 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
86 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
87 #ifndef RUN_FLASH |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
88 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
89 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
90 | PROJECT : CCD (6144) MODULE : CDC_COM | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
91 | STATE : code ROUTINE : cdc_init_ctx_table | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
92 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
93 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
94 PURPOSE : init the iei_ctx table. This must be done before decoding |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
95 a message. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
96 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
97 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
98 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
99 static void cdc_init_ctx_table (T_CCD_Globs *globs) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
100 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
101 int i; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
102 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
103 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
104 TRACE_CCD (globs, "CONTEXT table init"); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
105 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
106 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
107 for (i=0; i<MAX_RECURSIONS_PER_MSG; i++) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
108 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
109 globs->iei_ctx[i].valid = FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
110 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
111 globs->numEOCPending = 0; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
112 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
113 #endif /* !RUN_FLASH */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
114 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
115 #ifndef RUN_INT_RAM |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
116 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
117 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
118 | PROJECT : CCD (6144) MODULE : CCD | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
119 | STATE : code ROUTINE : cdc_BCD_decode | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
120 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
121 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
122 PURPOSE : Decoding of an bitstream containing a BCD string |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
123 with k digits. If the first digit in the bitstream |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
124 is DIGIT_2, the digits are ordered |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
125 in the Bitstream as follow: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
126 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
127 MSBit LSBit |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
128 8 7 6 5 4 3 2 1 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
129 DIGIT_2 DIGIT_1 Octett n |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
130 DIGIT_4 DIGIT_3 Octett n+1 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
131 : : : : : : : : |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
132 DIGIT_Z DIGIT_X Octett n+m |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
133 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
134 if the number of the digits is odd, the last |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
135 Octett contains the bit pattern 1111 in the |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
136 most significant nibble. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
137 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
138 : : : : : : : : |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
139 1 1 1 1 DIGIT_X Octett n+m |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
140 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
141 NOTE: If the first digit in the bitstream is DIGIT_1, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
142 the digits are ordered in a different way: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
143 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
144 MSBit LSBit |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
145 8 7 6 5 4 3 2 1 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
146 DIGIT_1 XXXXXXX Octett n |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
147 DIGIT_3 DIGIT_2 Octett n+1 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
148 DIGIT_5 DIGIT_4 Octett n+2 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
149 : : : : : : : : |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
150 DIGIT_Z DIGIT_X Octett n+m |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
151 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
152 In this case, if the number of the digits |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
153 is even, the last octett contains the bit |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
154 pattern 1111 in the most significant nibble. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
155 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
156 : : : : : : : : |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
157 1 1 1 1 DIGIT_X Octett n+m |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
158 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
159 The amount of digits may be constant or variable. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
160 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
161 NOTE: A special case (type BCD_NOFILL) is the encoding and |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
162 decoding of a BCD string starting with DIGIT_2 but |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
163 without setting/checking the most significant nibble |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
164 of Octet n+m. This nibble belongs to the next IE |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
165 (usual coded by type BCD_MNC). |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
166 Type BCD_NOFILL is coded by startDigit EQ 2. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
167 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
168 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
169 void cdc_BCD_decode (const ULONG e_ref, UBYTE startDigit, T_CCD_Globs *globs) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
170 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
171 BOOL is_variable; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
172 UBYTE *digits; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
173 UBYTE *addr_c_xxx; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
174 ULONG i, max_rep, nibbles_to_read, repeat; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
175 ULONG cix_ref, num_prolog_steps, prolog_step_ref; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
176 int k; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
177 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
178 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
179 #ifndef CCD_SYMBOLS |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
180 TRACE_CCD (globs, "cdc_BCD_decode()"); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
181 #else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
182 TRACE_CCD (globs, "cdc_BCD_decode() %s", ccddata_get_alias((USHORT) e_ref, 1)); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
183 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
184 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
185 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
186 cix_ref = melem[e_ref].calcIdxRef; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
187 num_prolog_steps = calcidx[cix_ref].numPrologSteps; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
188 prolog_step_ref = calcidx[cix_ref].prologStepRef; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
189 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
190 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
191 * if this element is conditional, check the condition |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
192 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
193 if (calcidx[cix_ref].numCondCalcs NEQ 0 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
194 AND ! ccd_conditionOK (e_ref, globs)) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
195 return; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
196 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
197 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
198 * if this element have a defined Prolog |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
199 * we have to process it before decoding the bitstream |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
200 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
201 if (num_prolog_steps) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
202 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
203 ccd_performOperations (num_prolog_steps, prolog_step_ref, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
204 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
205 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
206 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
207 * if this element is repeatable, and the number of |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
208 * repeats depends on another element, calculate the repeater |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
209 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
210 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
211 if (melem[e_ref].repType NEQ ' ') |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
212 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
213 is_variable = ccd_calculateRep (e_ref, &repeat, &max_rep, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
214 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
215 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
216 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
217 repeat = 1; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
218 is_variable = FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
219 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
220 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
221 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
222 * setup the offset into the C-structure for this element |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
223 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
224 globs->pstructOffs = melem[e_ref].structOffs; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
225 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
226 if (melem[e_ref].optional) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
227 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
228 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
229 * for optional elements set the valid-flag |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
230 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
231 globs->pstruct[globs->pstructOffs++] = (UBYTE) TRUE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
232 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
233 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
234 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
235 if (is_variable) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
236 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
237 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
238 * for variable sized elements store the min-value |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
239 * as counter into the C-Structure (c_xxx). |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
240 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
241 addr_c_xxx = (UBYTE *) (globs->pstruct + globs->pstructOffs++); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
242 if (max_rep > 255) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
243 globs->pstructOffs++; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
244 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
245 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
246 addr_c_xxx = NULL; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
247 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
248 digits = (UBYTE *) (globs->pstruct + globs->pstructOffs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
249 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
250 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
251 if (startDigit EQ 1) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
252 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
253 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
254 * read the BCD digits out of the bitstream. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
255 * The read order is 1,X,3,2,5,4 ... |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
256 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
257 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
258 * if the first digit is digit_1 read it and skip |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
259 * the next 4 bits, because they do not belong to |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
260 * the BCD stream. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
261 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
262 digits[0] = bf_decodeByteNumber (4, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
263 bf_incBitpos (4, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
264 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
265 * make a correction on the repeatvalue |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
266 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
267 if (melem[e_ref].repType NEQ ' ') |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
268 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
269 is_variable = ccd_calculateRep (e_ref, &repeat, &max_rep, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
270 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
271 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
272 k = 2; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
273 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
274 for (i=0; i<repeat; i++) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
275 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
276 digits[k] = bf_decodeByteNumber (4, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
277 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
278 TRACE_CCD (globs, "BCD digit (%X) read", (USHORT) digits[k]); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
279 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
280 k = ((k&1) EQ 0) ? (k-1) : (k+3); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
281 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
282 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
283 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
284 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
285 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
286 * read the BCD digits out of the bitstream. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
287 * The read order is 2,1,4,3,6,5 ... |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
288 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
289 k = 1; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
290 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
291 nibbles_to_read = repeat; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
292 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
293 if (repeat & 1) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
294 nibbles_to_read++; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
295 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
296 for (i=0; i<nibbles_to_read; i++) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
297 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
298 digits[k] = bf_decodeByteNumber (4, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
299 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
300 TRACE_CCD (globs, "BCD digit (%X) read", (USHORT) digits[k]); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
301 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
302 k = ((k&1) EQ 1) ? (k-1) : (k+3); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
303 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
304 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
305 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
306 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
307 * check the 1111 pattern and the even odd criteria |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
308 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
309 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
310 if (startDigit EQ 1) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
311 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
312 if ((repeat & 1) EQ 0) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
313 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
314 /* even number of digits */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
315 if (digits[repeat] NEQ 0xf) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
316 repeat++; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
317 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
318 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
319 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
320 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
321 if ((repeat & 1) EQ 1) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
322 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
323 /* odd number of digits */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
324 if (digits[repeat] NEQ 0xf AND startDigit EQ 0) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
325 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
326 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
327 * if there is no 1111 pattern generate an error |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
328 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
329 ccd_setError (globs, ERR_PATTERN_MISMATCH, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
330 CONTINUE, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
331 (USHORT) (globs->bitpos-8), (USHORT) -1); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
332 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
333 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
334 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
335 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
336 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
337 /* even number of digits - the last may be 0xf */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
338 if (digits[repeat-1] EQ 0xf) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
339 repeat--; /* 0x0f dosn't belong to the coded digit string */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
340 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
341 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
342 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
343 if (addr_c_xxx NEQ NULL) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
344 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
345 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
346 * store the number of digits into the |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
347 * c_xxx variable if there is one. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
348 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
349 if (max_rep > 65535) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
350 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
351 ULONG *addr_c_xxx_u32; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
352 addr_c_xxx_u32 = (ULONG *)addr_c_xxx; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
353 *addr_c_xxx_u32 = repeat; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
354 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
355 else if (max_rep > 255) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
356 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
357 USHORT *addr_c_xxx_u16; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
358 addr_c_xxx_u16 = (USHORT *)addr_c_xxx; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
359 *addr_c_xxx_u16 = (USHORT) repeat; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
360 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
361 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
362 *addr_c_xxx = (UBYTE) repeat; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
363 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
364 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
365 #endif /* !RUN_INT_RAM */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
366 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
367 #ifndef RUN_INT_RAM |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
368 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
369 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
370 | PROJECT : CCD (6144) MODULE : CCD | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
371 | STATE : code ROUTINE : cdc_BCD_encode | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
372 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
373 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
374 PURPOSE : encoding a Bytearray, that contain a BCD Number, into |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
375 bitstream. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
376 The digits coded in the following order |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
377 into the Bitstream: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
378 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
379 MSBit LSBit |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
380 7 8 6 5 4 3 2 1 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
381 DIGIT_2 DIGIT_1 Octett n |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
382 DIGIT_4 DIGIT_3 Octett n+1 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
383 : : : : : : : : |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
384 DIGIT_Z DIGIT_X Octett n+m |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
385 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
386 if the number of the digits are odd, the bit pattern 1111 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
387 will be coded in the most significant nibble of |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
388 the last Octett. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
389 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
390 : : : : : : : : |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
391 1 1 1 1 DIGIT_X Octett n+m |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
392 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
393 The amount of digits may be constant or variable. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
394 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
395 void cdc_BCD_encode (const ULONG e_ref, UBYTE startDigit, T_CCD_Globs *globs) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
396 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
397 ULONG repeat; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
398 int k; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
399 register UBYTE *digits; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
400 BOOL fullBitsNeeded=FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
401 ULONG cix_ref, num_prolog_steps, prolog_step_ref; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
402 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
403 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
404 #ifndef CCD_SYMBOLS |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
405 TRACE_CCD (globs, "cdc_BCD_encode()"); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
406 #else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
407 TRACE_CCD (globs, "cdc_BCD_encode() %s", ccddata_get_alias((USHORT) e_ref, 1)); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
408 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
409 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
410 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
411 cix_ref = melem[e_ref].calcIdxRef; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
412 num_prolog_steps = calcidx[cix_ref].numPrologSteps; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
413 prolog_step_ref = calcidx[cix_ref].prologStepRef; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
414 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
415 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
416 * if this element is conditional, check the condition |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
417 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
418 if (calcidx[cix_ref].numCondCalcs NEQ 0 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
419 AND ! ccd_conditionOK (e_ref, globs)) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
420 return; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
421 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
422 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
423 * if this element have a defined Prolog |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
424 * we have to process it before decoding the bitstream |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
425 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
426 if (num_prolog_steps) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
427 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
428 ccd_performOperations (num_prolog_steps, prolog_step_ref, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
429 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
430 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
431 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
432 * setup the offset into the C-structure for this element |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
433 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
434 globs->pstructOffs = melem[e_ref].structOffs; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
435 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
436 if (melem[e_ref].optional) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
437 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
438 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
439 * for optional elements check the valid-flag |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
440 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
441 if (globs->pstruct[globs->pstructOffs++] == FALSE) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
442 return; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
443 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
444 else if (globs->pstruct [melem[e_ref].structOffs] != TRUE) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
445 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
446 TRACE_CCD (globs, "Ambiguous value for valid flag!\n...assumed 1 for ccdID=%d", |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
447 e_ref); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
448 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
449 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
450 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
451 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
452 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
453 * if this element is repeatable, and the number of |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
454 * repeats depends on another element, calculate the repeater |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
455 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
456 if (melem[e_ref].repType EQ 'v' OR melem[e_ref].repType EQ 'i') |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
457 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
458 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
459 * for variable sized elements read the amount |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
460 * of repeats out of the C-Structure (c_xxx). |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
461 * If the number of repeats given by the C-Structure |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
462 * exceeds the allowed value (maxRepeat) CCD gives a warning! |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
463 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
464 if (melem[e_ref].maxRepeat > 255) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
465 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
466 ULONG count = (ULONG) (* (USHORT *)(globs->pstruct + globs->pstructOffs++)); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
467 repeat = MINIMUM (count, (ULONG) melem[e_ref].maxRepeat); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
468 if (repeat < count) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
469 ccd_recordFault (globs, ERR_MAX_REPEAT, CONTINUE, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
470 e_ref, globs->pstruct + globs->pstructOffs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
471 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
472 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
473 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
474 repeat = (ULONG)MINIMUM (globs->pstruct[globs->pstructOffs], |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
475 melem[e_ref].maxRepeat); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
476 if ( repeat < (ULONG) (globs->pstruct[globs->pstructOffs]) ) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
477 ccd_recordFault (globs, ERR_MAX_REPEAT, CONTINUE, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
478 (USHORT) e_ref, globs->pstruct + globs->pstructOffs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
479 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
480 globs->pstructOffs++; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
481 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
482 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
483 if (melem[e_ref].repType EQ 'c') |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
484 repeat = (ULONG) melem[e_ref].maxRepeat; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
485 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
486 repeat = 1; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
487 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
488 /* There seems to exist cases where address contains no digits. */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
489 if (repeat EQ 0) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
490 return; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
491 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
492 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
493 * setup the read pointer to the byte array that contain |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
494 * the BCD number. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
495 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
496 digits = (UBYTE *) (globs->pstruct + globs->pstructOffs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
497 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
498 if (startDigit EQ 1) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
499 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
500 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
501 * write the BCD digits into the bitstream. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
502 * The write order is 1,X,3,2,5,4 ... |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
503 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
504 if ((repeat & 1) EQ 0) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
505 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
506 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
507 * for even digits store the 1111 pattern at last digit |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
508 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
509 fullBitsNeeded = TRUE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
510 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
511 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
512 * if the first digit is digit_1 write it and skip |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
513 * the next 4 bits, because they does not belong to |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
514 * the BCD stream. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
515 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
516 bf_codeByteNumber (4, digits[0], globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
517 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
518 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
519 TRACE_CCD (globs, "BCD digit (%X) written", (USHORT) digits[0]); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
520 TRACE_CCD (globs, "skipping 4 bits"); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
521 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
522 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
523 bf_incBitpos (4, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
524 k = 2; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
525 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
526 while (--repeat>1) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
527 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
528 bf_codeByteNumber (4, digits[k], globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
529 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
530 TRACE_CCD (globs, "BCD digit (%X) written", (USHORT) digits[k]); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
531 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
532 k = ((k&1) EQ 0) ? (k-1) : (k+3); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
533 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
534 if (repeat) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
535 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
536 if (fullBitsNeeded) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
537 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
538 bf_codeByteNumber (4, 0xf, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
539 k = ((k&1) EQ 0) ? (k-1) : (k+3); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
540 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
541 bf_codeByteNumber (4, digits[k], globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
542 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
543 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
544 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
545 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
546 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
547 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
548 * store the BCD digits into the bitstream. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
549 * The write order is 2,1,4,3,6,5 ... |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
550 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
551 if (repeat & 1) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
552 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
553 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
554 * for odd digits store the 1111 pattern at last digit |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
555 * in case of type BCD_NOFILL use 0 instead |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
556 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
557 fullBitsNeeded = TRUE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
558 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
559 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
560 k = 1; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
561 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
562 while ( repeat-- > 1) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
563 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
564 bf_codeByteNumber (4, digits[k], globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
565 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
566 TRACE_CCD (globs, "BCD digit (%X) written", (USHORT) digits[k]); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
567 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
568 k = ((k&1) EQ 1) ? (k-1) : (k+3); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
569 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
570 if (fullBitsNeeded) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
571 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
572 bf_codeByteNumber (4, (UBYTE)((startDigit NEQ 2) ? 0xf : 0), globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
573 k = ((k&1) EQ 1) ? (k-1) : (k+3); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
574 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
575 bf_codeByteNumber (4, digits[k], globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
576 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
577 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
578 #endif /* !RUN_INT_RAM */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
579 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
580 #ifndef RUN_FLASH |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
581 /* Attention for RUN_...: static function */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
582 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
583 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
584 | PROJECT : CCD (6144) MODULE : CDC_COM | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
585 | STATE : code ROUTINE : cdc_init_table | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
586 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
587 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
588 PURPOSE : init the iei_table for each new msg that is to be decoded. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
589 The c_ref references a composition (msg). The function |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
590 initialises the table entrys only for the used iei for |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
591 this message. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
592 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
593 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
594 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
595 static void cdc_init_table (const ULONG c_ref, T_CCD_Globs *globs) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
596 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
597 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
598 ULONG look_up; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
599 ULONG num_elems; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
600 ULONG ie_table_idx; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
601 ULONG rlevel = globs->ccd_recurs_level; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
602 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
603 if (globs->iei_ctx[rlevel].valid AND rlevel < (ULONG) globs->last_level) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
604 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
605 int i; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
606 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
607 * this iei context has been initialized before, so |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
608 * no action for this. All deeper levels must be set |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
609 * to invalid; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
610 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
611 for (i=globs->last_level; i<MAX_RECURSIONS_PER_MSG; i++) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
612 globs->iei_ctx[i].valid = FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
613 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
614 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
615 TRACE_CCD (globs, "TAG table init for old level %d", rlevel); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
616 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
617 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
618 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
619 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
620 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
621 * this iei context has not been initialized before, so |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
622 * initialize the iei_table for this. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
623 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
624 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
625 TRACE_CCD (globs, "TAG table init for new level %d", rlevel); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
626 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
627 look_up = (ULONG) mcomp[c_ref].componentRef; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
628 num_elems = (ULONG) mcomp[c_ref].numOfComponents; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
629 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
630 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
631 * store the startposition of the corresponding melem table and |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
632 * the number of elements in the IEtable |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
633 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
634 globs->iei_ctx[rlevel].melemStart = (USHORT) look_up; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
635 globs->iei_ctx[rlevel].ieTableLen = (USHORT) num_elems; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
636 globs->iei_ctx[rlevel].EOCPending = FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
637 globs->iei_ctx[rlevel].countSkipped = 0; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
638 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
639 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
640 * for each element with an iei (ident) setup the |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
641 * the iei_table-entry. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
642 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
643 ie_table_idx = 0; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
644 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
645 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
646 * if the number of IE in this message is greater than |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
647 * the allocated IEItable, generate an error. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
648 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
649 if (num_elems > MAX_IE_PER_MSG) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
650 ccd_setError (globs, ERR_INTERNAL_ERROR, BREAK, (USHORT) -1); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
651 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
652 while (num_elems--) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
653 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
654 if (melem[look_up].ident NEQ 0xffff) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
655 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
656 globs->iei_ctx[rlevel].iei_table[ie_table_idx].ident = (UBYTE) melem[look_up].ident; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
657 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
658 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
659 * GSM1TV elements have only a 4 bit Tag (T). For this |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
660 * elements we have to shift the ident into the upper nibble |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
661 * and set the lower nibble to zero. For GSM2T elements and |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
662 * GSM1TV elements set the MSBit (Bit7). |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
663 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
664 if (melem[look_up].codingType EQ CCDTYPE_GSM1_TV) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
665 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
666 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
667 * shift into the upper nibble, clear the lower nibble |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
668 * and set the MSBit. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
669 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
670 globs->iei_ctx[rlevel].iei_table[ie_table_idx].ident <<= 4; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
671 globs->iei_ctx[rlevel].iei_table[ie_table_idx].ident |= 0x80; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
672 globs->iei_ctx[rlevel].iei_table[ie_table_idx].ident &= 0xf0; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
673 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
674 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
675 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
676 if (melem[look_up].codingType EQ CCDTYPE_GSM2_T) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
677 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
678 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
679 * Set the MSBit. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
680 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
681 globs->iei_ctx[rlevel].iei_table[ie_table_idx].ident |= 0x80; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
682 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
683 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
684 globs->iei_ctx[rlevel].iei_table[ie_table_idx].act_amount = 0; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
685 globs->iei_ctx[rlevel].iei_table[ie_table_idx].exhausted = FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
686 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
687 switch (melem[look_up].codingType) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
688 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
689 case CCDTYPE_GSM1_TV: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
690 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
691 case CCDTYPE_GSM2_T: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
692 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
693 case CCDTYPE_GSM3_TV: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
694 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
695 case CCDTYPE_GSM4_TLV: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
696 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
697 case CCDTYPE_GSM5_TV: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
698 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
699 case CCDTYPE_GSM5_TLV: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
700 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
701 case CCDTYPE_GSM1_ASN: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
702 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
703 case CCDTYPE_GSM6_TLV: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
704 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
705 globs->iei_ctx[rlevel].iei_table[ie_table_idx].valid = TRUE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
706 break; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
707 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
708 default: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
709 globs->iei_ctx[rlevel].iei_table[ie_table_idx].valid = FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
710 break; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
711 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
712 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
713 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
714 globs->iei_ctx[rlevel].iei_table[ie_table_idx].valid = FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
715 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
716 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
717 TRACE_CCD (globs, "iei_table[%d] v=%d ident=%x level=%d", |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
718 ie_table_idx, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
719 globs->iei_ctx[rlevel].iei_table[ie_table_idx].valid, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
720 globs->iei_ctx[rlevel].iei_table[ie_table_idx].ident, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
721 rlevel); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
722 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
723 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
724 look_up++; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
725 ie_table_idx++; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
726 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
727 globs->iei_ctx[rlevel].valid = TRUE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
728 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
729 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
730 #endif /* !RUN_FLASH */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
731 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
732 #ifndef RUN_FLASH |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
733 /* Attention for RUN_...: static function */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
734 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
735 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
736 | PROJECT : CCD (6144) MODULE : CDC_COM | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
737 | STATE : code ROUTINE : cdc_search_table | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
738 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
739 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
740 PURPOSE : search on the iei_table for the given TAG (T). |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
741 if the TAG can be found (and - in case of CCDTYPE_GSM1_ASN - |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
742 if the information element isn't exhausted), the table |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
743 index was returned as a difference between the found index |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
744 and the aktIndex, -127 otherwise. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
745 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
746 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
747 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
748 static int cdc_search_table |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
749 ( |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
750 int akt_index, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
751 ULONG t, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
752 BOOL limited, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
753 BOOL *nonTaggedFound, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
754 T_CCD_Globs *globs |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
755 ) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
756 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
757 int tab_idx; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
758 ULONG iei; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
759 int ret = -127; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
760 ULONG rec_level = globs->ccd_recurs_level; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
761 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
762 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
763 * search from the akt position to the end of the table. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
764 * This is faster, because in correct messages the found Tag |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
765 * is at a later position in the table. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
766 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
767 tab_idx = akt_index; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
768 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
769 *nonTaggedFound = FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
770 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
771 while (tab_idx < (int) globs->iei_ctx[rec_level].ieTableLen) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
772 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
773 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
774 TRACE_CCD (globs, "looking for Tag(%x) iei_table[%d] v=%d ident=%x level=%d", |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
775 t, tab_idx, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
776 globs->iei_ctx[rec_level].iei_table[tab_idx].valid, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
777 globs->iei_ctx[rec_level].iei_table[tab_idx].ident, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
778 rec_level); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
779 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
780 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
781 if (globs->iei_ctx[rec_level].iei_table[tab_idx].valid) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
782 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
783 if (limited) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
784 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
785 iei= (ULONG)(globs->iei_ctx[rec_level].iei_table[tab_idx].ident & 0x7f); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
786 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
787 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
788 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
789 iei= (ULONG)(globs->iei_ctx[rec_level].iei_table[tab_idx].ident); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
790 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
791 if ( iei EQ t ) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
792 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
793 if ( globs->iei_ctx[rec_level].iei_table[tab_idx].exhausted EQ FALSE ) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
794 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
795 return (tab_idx-akt_index); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
796 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
797 else if ( (globs->iei_ctx[rec_level].melemStart + akt_index) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
798 EQ (int) globs->iei_ctx[rec_level].melemLast) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
799 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
800 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
801 * allows multiple appearance of the repeated element is coded as |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
802 * TLV0 TLV1 TLV2 .... |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
803 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
804 return (tab_idx-akt_index); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
805 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
806 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
807 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
808 ret = (tab_idx-akt_index); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
809 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
810 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
811 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
812 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
813 *nonTaggedFound = TRUE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
814 tab_idx++; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
815 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
816 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
817 tab_idx = 0; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
818 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
819 while (tab_idx < akt_index) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
820 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
821 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
822 TRACE_CCD (globs, "looking for Tag(%x) iei_table[%d] v=%d ident=%x level=%d", |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
823 t, tab_idx, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
824 globs->iei_ctx[rec_level].iei_table[tab_idx].valid, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
825 globs->iei_ctx[rec_level].iei_table[tab_idx].ident, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
826 rec_level); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
827 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
828 if (limited) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
829 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
830 iei= (ULONG)(globs->iei_ctx[rec_level].iei_table[tab_idx].ident & 0x7f); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
831 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
832 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
833 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
834 iei= (ULONG) globs->iei_ctx[rec_level].iei_table[tab_idx].ident; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
835 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
836 if (globs->iei_ctx[rec_level].iei_table[tab_idx].valid |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
837 AND (iei EQ t) ) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
838 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
839 if ( globs->iei_ctx[rec_level].iei_table[tab_idx].exhausted EQ FALSE ) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
840 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
841 return (tab_idx-akt_index); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
842 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
843 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
844 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
845 ret = (tab_idx-akt_index); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
846 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
847 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
848 tab_idx++; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
849 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
850 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
851 if (ret != -127) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
852 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
853 globs->SequenceError = TRUE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
854 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
855 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
856 return ret; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
857 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
858 #endif /* !RUN_FLASH */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
859 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
860 #ifndef RUN_FLASH |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
861 /* Attention for RUN_...: static function */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
862 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
863 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
864 | PROJECT : CCD (6144) MODULE : CDC_COM | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
865 | STATE : code ROUTINE : cdc_decode_L | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
866 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
867 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
868 PURPOSE : Decode the length element of TLV and LV values |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
869 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
870 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
871 static ULONG cdc_decode_L (const ULONG e_ref, const ULONG len_l, T_CCD_Globs *globs) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
872 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
873 ULONG l; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
874 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
875 switch (melem[e_ref].codingType) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
876 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
877 case CCDTYPE_GSM1_ASN: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
878 l = (ULONG) bf_decodeByteNumber (8, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
879 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
880 TRACE_CCD (globs, "decoding 8 bits, l = (%x)", l); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
881 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
882 if (l EQ 0x80) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
883 l = 0xFFFF; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
884 else if (l EQ 0x81) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
885 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
886 l = (ULONG) bf_decodeByteNumber (8, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
887 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
888 TRACE_CCD (globs, "decoding 8 bits after 0x81, l = (%x)", l); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
889 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
890 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
891 else if (l EQ 0x82) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
892 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
893 l = bf_decodeShortNumber (16, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
894 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
895 TRACE_CCD (globs, "decoding 16 bits after 0x82, l = (%x)", l); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
896 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
897 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
898 break; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
899 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
900 case CCDTYPE_GSM5_TLV: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
901 l = (ULONG) bf_decodeByteNumber (8, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
902 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
903 if (l EQ 0x81) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
904 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
905 l = (ULONG) bf_decodeByteNumber (8, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
906 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
907 TRACE_CCD (globs, "decoding 8 bits after 0x81, l = (%x)", l); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
908 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
909 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
910 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
911 TRACE_CCD (globs, "decoding 8 bits, l = (%x)", l); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
912 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
913 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
914 break; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
915 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
916 case CCDTYPE_GSM6_TLV: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
917 l = bf_decodeShortNumber (16, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
918 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
919 TRACE_CCD (globs, "decoding 16 bits, l = (%x)", l); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
920 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
921 break; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
922 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
923 default: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
924 l = (ULONG) bf_decodeByteNumber (len_l, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
925 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
926 TRACE_CCD (globs, "decoding %d bits, l = (%x)", len_l, l); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
927 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
928 break; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
929 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
930 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
931 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
932 * Write the value of l at the end of UPN Stack. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
933 * this could be read by an IE of the coding type NO_CODE. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
934 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
935 globs->KeepReg[0] = l ; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
936 return l; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
937 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
938 #endif /* !RUN_FLASH */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
939 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
940 #ifndef RUN_FLASH |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
941 /* Attention for RUN_...: static function */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
942 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
943 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
944 | PROJECT : CCD (6144) MODULE : CDC_COM | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
945 | STATE : code ROUTINE : cdc_tagged_LV_decode| |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
946 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
947 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
948 PURPOSE : If the parameter lenL is set to a positive value, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
949 this function decodes the L-component. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
950 After this it decodes the element referenced |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
951 by eRef out of the bitstream into the C-Structure |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
952 (globs->pstruct) at position globs->pstructOffs. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
953 If a repeat value is defined for this element, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
954 this function decodes only one appeareance |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
955 of the element because it is a tagged |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
956 element. In this case the decoded element is stored in |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
957 an array wich is indexed by eIndex; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
958 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
959 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
960 static BOOL cdc_tagged_LV_decode (const ULONG e_ref, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
961 ULONG e_index, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
962 const ULONG len_l, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
963 T_CCD_Globs *globs) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
964 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
965 ULONG amount, l; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
966 USHORT act_maxBP, tmp_maxBP; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
967 BOOL endOfComposition = FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
968 BOOL asn1=FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
969 U32 offset=0; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
970 #ifdef DYNAMIC_ARRAYS |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
971 U8 *old_pstruct = NULL; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
972 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
973 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
974 if (melem[e_ref].codingType EQ CCDTYPE_GSM1_ASN) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
975 asn1 = TRUE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
976 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
977 if (melem[e_ref].elemType NEQ 'S') |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
978 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
979 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
980 * set the offset into the C-structure for this element. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
981 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
982 if (melem[e_ref].optional) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
983 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
984 globs->pstruct[globs->pstructOffs++] = (UBYTE) TRUE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
985 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
986 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
987 if (melem[e_ref].repType EQ 'i') |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
988 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
989 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
990 * The number of appearance of all repeatable IEs may |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
991 * differ in a message. So we have to store the number |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
992 * in a c_xxx counter into the C-Structure. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
993 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
994 if (melem[e_ref].maxRepeat > 65535) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
995 *(ULONG *) (globs->pstruct + globs->pstructOffs++) = e_index; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
996 else if (melem[e_ref].maxRepeat > 255) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
997 *(USHORT *) (globs->pstruct + globs->pstructOffs++) = (USHORT) e_index; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
998 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
999 globs->pstruct[globs->pstructOffs] = (UBYTE) e_index; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1000 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1001 globs->pstructOffs++; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1002 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1003 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1004 * Recalculate the struct offset for repeatable IEs. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1005 * New pointer types 'R' and 'F' are equivalent to 'V'. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1006 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1007 #ifdef DYNAMIC_ARRAYS |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1008 offset = (e_index-1) * ((melem[e_ref].elemType EQ 'V' |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1009 OR melem[e_ref].elemType EQ 'R' |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1010 OR melem[e_ref].elemType EQ 'F' |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1011 ) ? mvar[melem[e_ref].elemRef].cSize |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1012 : mcomp[melem[e_ref].elemRef].cSize |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1013 ); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1014 #else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1015 offset = (e_index-1) * ((melem[e_ref].elemType EQ 'V') |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1016 ? mvar[melem[e_ref].elemRef].cSize |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1017 : mcomp[melem[e_ref].elemRef].cSize |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1018 ); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1019 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1020 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1021 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1022 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1023 * If len_l > 0 read the l-Component out of the bistream. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1024 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1025 if (len_l) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1026 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1027 if( len_l <= (ULONG) (globs->maxBitpos - globs->bitpos) ) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1028 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1029 act_maxBP = globs->maxBitpos; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1030 l = cdc_decode_L (e_ref, len_l, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1031 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1032 if (l EQ 0xFFFF) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1033 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1034 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1035 * For ASN1-BER encoding we must look for the special |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1036 * length 0x80 because it indicates the indefinite |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1037 * length. This needs a special handling with later EOC tags. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1038 * |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1039 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1040 globs->iei_ctx[globs->ccd_recurs_level].EOCPending = TRUE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1041 globs->numEOCPending++; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1042 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1043 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1044 TRACE_CCD (globs, "implicit ASN1 length - EOC is pending"); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1045 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1046 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1047 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1048 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1049 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1050 * Calculate the max bitpos for this element |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1051 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1052 tmp_maxBP = (USHORT) (globs->bitpos + (l*8)); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1053 if (globs->buflen < tmp_maxBP) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1054 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1055 ccd_recordFault (globs, ERR_MSG_LEN, CONTINUE, (USHORT) e_ref, globs->pstruct + globs->pstructOffs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1056 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1057 else if (globs->maxBitpos < tmp_maxBP) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1058 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1059 ccd_recordFault (globs, ERR_ELEM_LEN, BREAK, (USHORT) e_ref, globs->pstruct + globs->pstructOffs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1060 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1061 globs->maxBitpos = (USHORT)MINIMUM (globs->buflen, tmp_maxBP); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1062 tmp_maxBP = globs->maxBitpos; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1063 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1064 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1065 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1066 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1067 ccd_recordFault (globs, ERR_ELEM_LEN, BREAK, (USHORT) e_ref, globs->pstruct + globs->pstructOffs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1068 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1069 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1070 #ifdef DYNAMIC_ARRAYS |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1071 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1072 * Check for pointer types; allocate memory if necessary. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1073 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1074 if ((melem[e_ref].elemType >= 'P' AND melem[e_ref].elemType <= 'R') OR |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1075 (melem[e_ref].elemType >= 'D' AND melem[e_ref].elemType <= 'F')) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1076 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1077 U32 cSize; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1078 U8 *addr; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1079 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1080 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1081 * Find size to allocate; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1082 * - Read from mcomp or mvar according to type |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1083 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1084 cSize = (ULONG)((melem[e_ref].elemType EQ 'V' OR |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1085 melem[e_ref].elemType EQ 'R') |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1086 ? mvar[melem[e_ref].elemRef].cSize |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1087 : mcomp[melem[e_ref].elemRef].cSize |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1088 ); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1089 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1090 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1091 * Allocate additional memory |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1092 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1093 addr = (U8 *)DP_ALLOC( cSize, globs->alloc_head, DP_NO_FRAME_GUESS); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1094 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1095 /* If no memory, log error and return immediately */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1096 if (addr EQ NULL) { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1097 ccd_setError (globs, ERR_NO_MEM, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1098 BREAK, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1099 (USHORT) -1); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1100 return endOfComposition; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1101 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1102 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1103 memset (addr, 0, (size_t)(cSize)); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1104 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1105 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1106 * Memory allocated; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1107 * 1. Save old "globs->pstruct" variables |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1108 * 2. Store pointer to freshly allocated memory area in structure |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1109 * 3. Initialize pstruct to point to the freshly allocated memory area. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1110 * 4. Initialize pstructOffs to 0 to start decoding at offset 0 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1111 * in the new memory area. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1112 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1113 old_pstruct = globs->pstruct; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1114 *(U8 **)(globs->pstruct + globs->pstructOffs) = addr; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1115 globs->pstruct = addr; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1116 globs->pstructOffs = 0; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1117 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1118 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1119 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1120 globs->pstructOffs += offset; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1121 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1122 #else /* DYNAMIC_ARRAYS */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1123 globs->pstructOffs += offset; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1124 #endif /* DYNAMIC_ARRAYS */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1125 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1126 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1127 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1128 * Decode the value. Keep caution with BER encoding of ASN1 integers. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1129 * All other types can be decoded by a generic function. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1130 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1131 if (asn1 AND melem[e_ref].elemType EQ 'V' |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1132 AND |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1133 melem[e_ref].repType EQ ' ' |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1134 AND |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1135 l NEQ 0xFFFF |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1136 ) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1137 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1138 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1139 #ifdef CCD_SYMBOLS |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1140 TRACE_CCD (globs, "BER decoding of ASN.1 integer %s", |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1141 ccddata_get_alias((USHORT) e_ref, 1)); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1142 #else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1143 TRACE_CCD (globs, "BER decoding of ASN.1 integer; e_ref = %d", melem[e_ref].elemRef); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1144 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1145 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1146 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1147 if (mvar[melem[e_ref].elemRef].cType EQ 'X') |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1148 bf_readBitChunk (l*8, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1149 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1150 bf_readBits (l*8, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1151 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1152 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1153 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1154 amount = 1; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1155 if (len_l) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1156 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1157 if (l > 0) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1158 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1159 cdc_decodeElemvalue (e_ref, &amount, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1160 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1161 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1162 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1163 amount = 0; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1164 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1165 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1166 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1167 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1168 if (melem[e_ref].codingType != CCDTYPE_GSM2_T) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1169 cdc_decodeElemvalue (e_ref, &amount, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1170 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1171 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1172 #ifdef DYNAMIC_ARRAYS |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1173 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1174 * Restore globs->pstruct for possible use below |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1175 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1176 if (old_pstruct NEQ NULL) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1177 globs->pstruct = old_pstruct; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1178 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1179 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1180 if (asn1 AND globs->numEOCPending AND !bf_endOfBitstream(globs)) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1181 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1182 UBYTE T = bf_decodeByteNumber (8, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1183 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1184 TRACE_CCD (globs, "looking for EOC decoding 8 bits T = (%x)", T); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1185 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1186 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1187 if (T EQ 0) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1188 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1189 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1190 TRACE_CCD (globs, "First EOC octet found"); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1191 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1192 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1193 if (globs->iei_ctx[globs->ccd_recurs_level].EOCPending) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1194 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1195 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1196 TRACE_CCD (globs, "End of ASN1 TLV"); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1197 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1198 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1199 * Skip the second EOC octet. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1200 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1201 bf_incBitpos (8, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1202 globs->iei_ctx[globs->ccd_recurs_level].EOCPending = FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1203 globs->numEOCPending--; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1204 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1205 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1206 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1207 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1208 * The read first EOC octet belongs to an ASN1 TLV of a |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1209 * higher recursion level. Let it be read and evalauted later |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1210 * again for that IE. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1211 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1212 bf_setBitpos (globs->bitpos-8, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1213 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1214 TRACE_CCD (globs, "End of higer level ASN1 TLV"); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1215 TRACE_CCD (globs, "Decrementing bitpos by 8 to %d", globs->bitpos); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1216 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1217 endOfComposition = TRUE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1218 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1219 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1220 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1221 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1222 if (globs->iei_ctx[globs->ccd_recurs_level].EOCPending) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1223 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1224 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1225 * EOC element is pending but not found. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1226 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1227 ccd_setError (globs, ERR_EOC_TAG_MISSING, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1228 BREAK, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1229 (USHORT) T, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1230 globs->bitpos-8, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1231 (USHORT) -1); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1232 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1233 bf_setBitpos (globs->bitpos-8, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1234 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1235 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1236 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1237 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1238 * normal TAG leave it in the bitstream |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1239 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1240 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1241 TRACE_CCD (globs, "Normal TAG - Decrementing bitpos by 8 to %d", globs->bitpos); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1242 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1243 bf_setBitpos (globs->bitpos-8, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1244 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1245 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1246 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1247 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1248 if (len_l) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1249 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1250 if (!asn1) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1251 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1252 if (globs->bitpos > tmp_maxBP) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1253 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1254 ccd_recordFault (globs, ERR_ELEM_LEN, CONTINUE, (USHORT) e_ref, globs->pstruct + globs->pstructOffs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1255 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1256 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1257 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1258 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1259 * set the bitpos to the end of the LV or TLV element |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1260 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1261 bf_setBitpos (tmp_maxBP, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1262 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1263 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1264 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1265 * set the maxBitpos to the next octet boundary if the |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1266 * last non-spare IE does not end at an octet boundary. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1267 * This is necessary for avoiding an early end of decoding. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1268 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1269 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1270 globs->maxBitpos = globs->buflen; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1271 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1272 globs->maxBitpos = act_maxBP; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1273 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1274 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1275 return endOfComposition; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1276 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1277 #endif /* !RUN_FLASH */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1278 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1279 #ifndef RUN_FLASH |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1280 /* Attention for RUN_...: static function */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1281 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1282 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1283 | PROJECT : CCD (6144) MODULE : CDC_COM | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1284 | STATE : code ROUTINE : cdc_normal_LV_decode| |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1285 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1286 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1287 PURPOSE : If the parameter lenL is set, this function |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1288 decodes the L-component. After this it decodes |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1289 the element referenced by eRef from the |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1290 bitstream into the C-Structure (globs->pstruct) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1291 at position globs->pstructOffs. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1292 If a repeat value is defined for this element |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1293 this function decodes the V-component multiple and stores |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1294 the values into an array. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1295 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1296 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1297 static BOOL cdc_normal_LV_decode (const ULONG e_ref, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1298 const ULONG len_l, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1299 T_CCD_Globs *globs) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1300 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1301 ULONG l, repeat, amount, max_rep; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1302 USHORT act_maxBP, tmp_maxBP; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1303 BOOL is_variable; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1304 BOOL endOfComposition = FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1305 BOOL asn1; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1306 BOOL length_in_bits; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1307 #ifdef DYNAMIC_ARRAYS |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1308 U8 *old_pstruct = NULL; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1309 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1310 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1311 switch (melem[e_ref].codingType) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1312 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1313 case CCDTYPE_GSM1_ASN: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1314 asn1 = TRUE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1315 length_in_bits = FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1316 break; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1317 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1318 case CCDTYPE_GSM7_LV: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1319 asn1 = FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1320 length_in_bits = TRUE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1321 break; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1322 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1323 default: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1324 asn1 = FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1325 length_in_bits = FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1326 break; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1327 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1328 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1329 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1330 * if this element is repeatable, and the number of |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1331 * repeats depends on another element, calculate the repeater |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1332 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1333 if (melem[e_ref].repType NEQ ' ') |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1334 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1335 is_variable = ccd_calculateRep (e_ref, &repeat, &max_rep, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1336 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1337 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1338 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1339 repeat = 1; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1340 is_variable = FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1341 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1342 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1343 if (melem[e_ref].elemType NEQ 'S') |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1344 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1345 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1346 * Element is not a SPARE. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1347 * Setup the offset into the C-structure for this element |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1348 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1349 if (melem[e_ref].optional) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1350 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1351 globs->pstruct[globs->pstructOffs++] = (UBYTE) TRUE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1352 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1353 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1354 if (is_variable) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1355 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1356 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1357 * for variable sized elements store the min-value |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1358 * as counter into the C-Structure (c_xxx). |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1359 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1360 if (max_rep > 65535) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1361 *(ULONG *) (globs->pstruct + globs->pstructOffs++) = repeat; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1362 else if (max_rep > 255) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1363 *(USHORT *) (globs->pstruct + globs->pstructOffs++) = (USHORT) repeat; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1364 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1365 globs->pstruct[globs->pstructOffs] = (UBYTE) repeat; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1366 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1367 globs->pstructOffs++; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1368 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1369 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1370 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1371 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1372 * if len_l > 0 read the l-Component out of the bistream. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1373 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1374 if (len_l) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1375 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1376 if( len_l <= (ULONG)(globs->maxBitpos - globs->bitpos) ) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1377 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1378 act_maxBP = globs->maxBitpos; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1379 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1380 l = cdc_decode_L (e_ref, len_l, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1381 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1382 if (l EQ 0xFFFF) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1383 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1384 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1385 * for ASN1 element coding we must look for the special |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1386 * length 0x80 because it indicates the indefinite |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1387 * length. This needs a special handling with later EOC tags. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1388 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1389 globs->iei_ctx[globs->ccd_recurs_level].EOCPending = TRUE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1390 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1391 globs->numEOCPending++; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1392 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1393 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1394 TRACE_CCD (globs, "implicit ASN1 length - EOC is pending"); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1395 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1396 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1397 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1398 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1399 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1400 * calculate the max bitpos for this element |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1401 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1402 if (!length_in_bits) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1403 l *= 8; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1404 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1405 tmp_maxBP = (USHORT) (globs->bitpos + l); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1406 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1407 if (globs->buflen < tmp_maxBP) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1408 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1409 ccd_recordFault (globs, ERR_MSG_LEN, CONTINUE, (USHORT) e_ref, globs->pstruct + globs->pstructOffs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1410 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1411 else if (globs->maxBitpos < tmp_maxBP) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1412 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1413 ccd_recordFault (globs, ERR_ELEM_LEN, BREAK, (USHORT) e_ref, globs->pstruct + globs->pstructOffs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1414 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1415 globs->maxBitpos = (USHORT)MINIMUM (globs->buflen, tmp_maxBP); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1416 tmp_maxBP = globs->maxBitpos; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1417 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1418 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1419 * for bitfields which appear in TLV or LV elements |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1420 * we must calculate the length (repeat) from the l values |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1421 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1422 if (melem[e_ref].repType EQ 'b') |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1423 repeat = l; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1424 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1425 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1426 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1427 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1428 ccd_recordFault (globs, ERR_ELEM_LEN, BREAK, (USHORT) e_ref, globs->pstruct + globs->pstructOffs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1429 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1430 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1431 #ifdef DYNAMIC_ARRAYS |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1432 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1433 * MVJ: Dynamic array addition. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1434 * Check for pointer types; allocate memory if necessary. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1435 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1436 if ((melem[e_ref].elemType >= 'P' AND melem[e_ref].elemType <= 'R') OR |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1437 (melem[e_ref].elemType >= 'D' AND melem[e_ref].elemType <= 'F')) { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1438 ULONG cSize, rep; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1439 U8 *addr; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1440 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1441 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1442 * Find size to allocate; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1443 * - Read from mcomp or mvar according to type |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1444 * - Unbounded (0-terminated) ASN1-types are allocated with MAX repeat |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1445 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1446 if (globs->iei_ctx[globs->ccd_recurs_level].EOCPending) { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1447 rep = (ULONG) melem[e_ref].maxRepeat; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1448 } else { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1449 rep = repeat; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1450 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1451 cSize = (ULONG)((melem[e_ref].elemType EQ 'V' OR |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1452 melem[e_ref].elemType EQ 'R') |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1453 ? mvar[melem[e_ref].elemRef].cSize |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1454 : mcomp[melem[e_ref].elemRef].cSize |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1455 ) * rep; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1456 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1457 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1458 * Allocate additional memory |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1459 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1460 addr = (U8 *)DP_ALLOC( cSize, globs->alloc_head, DP_NO_FRAME_GUESS); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1461 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1462 /* If no memory, log error and return immediately */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1463 if (addr EQ NULL) { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1464 ccd_setError (globs, ERR_NO_MEM, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1465 BREAK, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1466 (USHORT) -1); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1467 return endOfComposition; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1468 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1469 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1470 memset (addr, 0, (size_t)cSize); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1471 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1472 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1473 * Memory allocated; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1474 * 1. Save old "globs->pstruct" variables |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1475 * 2. Store pointer to freshly allocated memory area in structure |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1476 * 3. Initialize pstruct to point to the freshly allocated memory area. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1477 * 4. Initialize pstructOffs to 0 to start decoding at offset 0 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1478 * in the new memory area. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1479 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1480 old_pstruct = globs->pstruct; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1481 *(U8 **)(globs->pstruct + globs->pstructOffs) = addr; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1482 globs->pstruct = addr; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1483 globs->pstructOffs = 0; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1484 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1485 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1486 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1487 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1488 * Decode the value. Keep caution with BER encoding of ASN1 integers. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1489 * All other types can be decoded by a generic function. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1490 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1491 if (asn1 AND melem[e_ref].elemType EQ 'V' |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1492 AND |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1493 melem[e_ref].repType EQ ' ' |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1494 AND |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1495 l NEQ 0xFFFF |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1496 ) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1497 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1498 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1499 #ifdef CCD_SYMBOLS |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1500 TRACE_CCD (globs, "BER decoding of ASN.1 integer %s", |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1501 ccddata_get_alias((USHORT) e_ref, 1)); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1502 #else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1503 TRACE_CCD (globs, "BER decoding of ASN.1 integer; e_ref = %d", melem[e_ref].elemRef); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1504 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1505 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1506 amount = l; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1507 if (mvar[melem[e_ref].elemRef].cType EQ 'X') |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1508 bf_readBitChunk (l, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1509 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1510 bf_readBits (l, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1511 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1512 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1513 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1514 amount = repeat; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1515 if (len_l) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1516 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1517 if (l > 0) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1518 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1519 cdc_decodeElemvalue (e_ref, &amount, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1520 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1521 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1522 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1523 amount = 0; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1524 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1525 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1526 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1527 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1528 if (melem[e_ref].codingType != CCDTYPE_GSM2_T) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1529 cdc_decodeElemvalue (e_ref, &amount, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1530 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1531 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1532 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1533 #ifdef DYNAMIC_ARRAYS |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1534 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1535 * Restore globs->pstruct for possible use below |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1536 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1537 if (old_pstruct NEQ NULL) { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1538 globs->pstruct = old_pstruct; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1539 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1540 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1541 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1542 if (amount NEQ repeat AND is_variable) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1543 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1544 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1545 * If the number of decoded elements is not equal to the given |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1546 * repeat value, because the bitstream or the IE ended, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1547 * store the new c_xxx value. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1548 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1549 globs->pstructOffs = melem[e_ref].structOffs; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1550 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1551 if (melem[e_ref].optional) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1552 globs->pstructOffs++; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1553 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1554 globs->pstruct[globs->pstructOffs] = (UBYTE) amount; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1555 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1556 if (melem[e_ref].repType NEQ 'i') |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1557 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1558 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1559 * if this element is not of the repeat style 'interval' |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1560 * ([X..Y] where X and Y are constants) we have to generate |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1561 * an ccd error because some outstanding repeats are missing. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1562 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1563 ccd_setError (globs, ERR_MAND_ELEM_MISS, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1564 CONTINUE, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1565 (USHORT) -1); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1566 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1567 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1568 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1569 if (asn1 AND globs->numEOCPending AND !bf_endOfBitstream(globs)) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1570 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1571 UBYTE T = bf_decodeByteNumber (8, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1572 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1573 TRACE_CCD (globs, "looking for EOC decoding 8 bits T = (%x)", T); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1574 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1575 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1576 if (T EQ 0) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1577 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1578 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1579 TRACE_CCD (globs, "First EOC octet found"); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1580 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1581 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1582 if (globs->iei_ctx[globs->ccd_recurs_level].EOCPending) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1583 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1584 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1585 TRACE_CCD (globs, "End of ASN1 TLV"); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1586 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1587 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1588 * Skip the second EOC octet. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1589 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1590 bf_incBitpos (8, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1591 globs->iei_ctx[globs->ccd_recurs_level].EOCPending = FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1592 globs->numEOCPending--; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1593 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1594 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1595 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1596 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1597 * The read first EOC octet belongs to an ASN1 TLV of a |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1598 * higher recursion level. Let it be read and evalauted later |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1599 * again for that IE. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1600 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1601 bf_setBitpos (globs->bitpos-8, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1602 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1603 TRACE_CCD (globs, "End of higer level ASN1 TLV"); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1604 TRACE_CCD (globs, "Decrementing bitpos by 8 to %d", globs->bitpos); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1605 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1606 endOfComposition = TRUE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1607 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1608 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1609 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1610 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1611 if (globs->iei_ctx[globs->ccd_recurs_level].EOCPending) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1612 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1613 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1614 * EOC element is pending but not found. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1615 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1616 ccd_setError (globs, ERR_EOC_TAG_MISSING, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1617 BREAK, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1618 (USHORT) T, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1619 globs->bitpos-8, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1620 (USHORT) -1); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1621 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1622 bf_setBitpos (globs->bitpos-8, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1623 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1624 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1625 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1626 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1627 * normal TAG leave it in the bitstream |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1628 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1629 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1630 TRACE_CCD (globs, "Normal TAG - Decrementing bitpos by 8 to %d", globs->bitpos); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1631 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1632 bf_setBitpos (globs->bitpos-8, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1633 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1634 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1635 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1636 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1637 if (len_l) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1638 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1639 if (!asn1) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1640 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1641 if (globs->bitpos > tmp_maxBP) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1642 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1643 ccd_recordFault (globs, ERR_ELEM_LEN, CONTINUE, (USHORT) e_ref, globs->pstruct + globs->pstructOffs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1644 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1645 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1646 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1647 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1648 * set the bitpos to the end of the LV or TLV element |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1649 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1650 bf_setBitpos (tmp_maxBP, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1651 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1652 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1653 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1654 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1655 * set the maxBitpos to the next octet boundary if the |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1656 * last non-spare IE does not end at an octet boundary. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1657 * This is necessary for avoiding an early end of decoding. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1658 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1659 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1660 globs->maxBitpos = globs->buflen; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1661 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1662 globs->maxBitpos = act_maxBP; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1663 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1664 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1665 return endOfComposition; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1666 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1667 #endif /* !RUN_FLASH */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1668 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1669 #ifndef RUN_FLASH |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1670 /* Attention for RUN_...: static function */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1671 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1672 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1673 | PROJECT : CCD (6144) MODULE : CDC_COM | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1674 | STATE : code ROUTINE : cdc_skipElem | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1675 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1676 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1677 PURPOSE : Skip an element referenced by eRef. This function |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1678 perform a decoding of this element, but not into |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1679 the target C-Structure. A dummy C-Structure is used |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1680 instead. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1681 The complete decoding is necesary, because there is |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1682 no information about the length of this element. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1683 B.t.w. for mandatory elements with fixed length, we can |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1684 calculate the length, for optional elements or for |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1685 variable sized arrays or bitbuffers it is impossible |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1686 without decoding the entire element. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1687 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1688 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1689 static void cdc_skipElem (const ULONG e_ref, const ULONG len_l, T_CCD_Globs *globs) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1690 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1691 UBYTE *ActStructAddr; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1692 U32 ActStructOffs; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1693 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1694 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1695 TRACE_CCD (globs, "skipping element %d", |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1696 melem[e_ref].elemRef); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1697 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1698 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1699 ActStructAddr = globs->pstruct; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1700 ActStructOffs = globs->pstructOffs; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1701 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1702 globs->pstruct = dummy; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1703 globs->pstructOffs = 0; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1704 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1705 cdc_tagged_LV_decode (e_ref, 1, len_l, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1706 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1707 globs->pstruct = ActStructAddr; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1708 globs->pstructOffs = ActStructOffs; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1709 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1710 #endif /* !RUN_FLASH */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1711 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1712 #ifndef RUN_FLASH |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1713 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1714 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1715 | PROJECT : CCD (6144) MODULE : CDC_COM | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1716 | STATE : code ROUTINE : cdc_tlv_decode | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1717 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1718 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1719 PURPOSE : Decoding of the T-components of T TV and TLV typed |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1720 information elements. The len determines the |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1721 length of the T component. This function returns the |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1722 index (reference) of the rigth element. If the |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1723 iei is not known in this composition (msg or submsg) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1724 an error handling is done and NO_REF is returned. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1725 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1726 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1727 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1728 SHORT cdc_tlv_decode (const ULONG c_ref, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1729 const ULONG e_ref, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1730 const T_TLV_SORT *tlv_inf, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1731 T_CCD_Globs *globs) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1732 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1733 ULONG repeat, max_rep; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1734 ULONG ie_amount, l, len_l, len_t, t; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1735 BOOL is_variable, nonTagged, limitSearch=FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1736 UBYTE CR=FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1737 SHORT IdxOffset = 0; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1738 int ieTableIdx; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1739 BOOL asn1, non_std_tag; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1740 SHORT ret; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1741 ULONG cix_ref, num_prolog_steps, prolog_step_ref; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1742 /* .../src/linux/include/asm/current.h defines a macro 'current' */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1743 T_UNKNOWN_TAG *first, *currentTag; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1744 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1745 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1746 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1747 * Set the flag for the type of extension which is to expect |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1748 * at the end of the message. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1749 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1750 globs->SeekTLVExt = TRUE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1751 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1752 /* Set ref number for calcidx table. */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1753 cix_ref = melem[e_ref].calcIdxRef; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1754 num_prolog_steps = calcidx[cix_ref].numPrologSteps; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1755 prolog_step_ref = calcidx[cix_ref].prologStepRef; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1756 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1757 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1758 * if this element is conditional, check the condition |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1759 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1760 if (calcidx[cix_ref].numCondCalcs NEQ 0 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1761 AND ! ccd_conditionOK (e_ref, globs)) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1762 return 1; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1763 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1764 len_t = 8; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1765 switch (melem[e_ref].codingType) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1766 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1767 case CCDTYPE_GSM1_ASN: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1768 asn1 = TRUE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1769 non_std_tag = FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1770 len_l = 8; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1771 break; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1772 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1773 case CCDTYPE_GSM5_TV: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1774 case CCDTYPE_GSM5_TLV: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1775 non_std_tag = TRUE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1776 asn1 = FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1777 len_l = 8; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1778 break; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1779 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1780 case CCDTYPE_GSM6_TLV: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1781 non_std_tag = FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1782 asn1 = FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1783 len_l = 16; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1784 break; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1785 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1786 case CCDTYPE_GSM7_LV: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1787 non_std_tag = FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1788 asn1 = FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1789 len_l = 7; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1790 break; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1791 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1792 default: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1793 asn1 = FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1794 non_std_tag = FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1795 len_l = 8; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1796 break; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1797 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1798 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1799 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1800 * if this element have a defined Prolog |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1801 * we have to process it before decoding the bitstream |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1802 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1803 if (num_prolog_steps) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1804 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1805 ccd_performOperations (num_prolog_steps, prolog_step_ref, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1806 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1807 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1808 if (tlv_inf->gotTag) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1809 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1810 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1811 * tagged element |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1812 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1813 len_t = 8; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1814 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1815 * initialize the iei_table for each new message |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1816 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1817 if (globs->ccd_recurs_level NEQ globs->last_level) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1818 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1819 cdc_init_table (c_ref, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1820 globs->TagPending = FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1821 globs->SequenceError = FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1822 globs->last_level = globs->ccd_recurs_level; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1823 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1824 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1825 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1826 * calculate the index into the ieTable for this element |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1827 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1828 ieTableIdx = (int)(e_ref - globs->iei_ctx[globs->ccd_recurs_level].melemStart); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1829 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1830 if (globs->TagPending) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1831 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1832 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1833 * if we previously read a t value and does not processed it |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1834 * get this pending tag. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1835 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1836 t = (ULONG) globs->PendingTag; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1837 globs->TagPending = FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1838 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1839 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1840 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1841 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1842 * read the information element identifier out of the bitstream. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1843 * If the first bit (MSBit) of the t-component is set, it is |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1844 * a Tag of a TYPE1 or TYPE2 element. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1845 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1846 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1847 t = (ULONG) bf_decodeByteNumber (8, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1848 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1849 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1850 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1851 if (!asn1 AND !non_std_tag AND (t & 0x80) EQ 0x80 AND (t & 0xA0) NEQ 0xA0) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1852 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1853 ULONG Tag4 = t & 0xf0; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1854 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1855 * MSBit is set. We have to check if the Tag value can |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1856 * be found as a 4 bit or 8 bit value in the IEI-table. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1857 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1858 if (cdc_search_table (ieTableIdx, Tag4, limitSearch, &nonTagged, globs) NEQ -127) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1859 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1860 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1861 * Tag found as a 4 bit value. Decrement the readpointer |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1862 * of the bitstream by 4, because we have read out 4 bits |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1863 * to much. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1864 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1865 bf_setBitpos (globs->bitpos-4, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1866 t = Tag4; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1867 len_t =4; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1868 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1869 TRACE_CCD (globs, "4 bit Tag decrementing bitpos by 4 to %d", globs->bitpos); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1870 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1871 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1872 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1873 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1874 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1875 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1876 TRACE_CCD (globs, "reading t = 0x%X", t); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1877 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1878 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1879 if (melem[e_ref].codingType EQ CCDTYPE_GSM5_TLV) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1880 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1881 limitSearch = TRUE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1882 CR = (UBYTE) (((t & 0x80) EQ 0x80) ? TRUE : FALSE); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1883 t &= 0x7f; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1884 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1885 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1886 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1887 if (asn1 AND t EQ 0x00) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1888 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1889 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1890 * This is for ASN1 element coding the special |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1891 * End Of Component Tag (EOC). The following length must be zero. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1892 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1893 bf_setBitpos (globs->bitpos-8, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1894 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1895 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1896 TRACE_CCD (globs, "ASN1 End of Component found belongs to higher TLV"); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1897 TRACE_CCD (globs, "leaving this level and decrementing bitpos by 8 to %d", globs->bitpos); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1898 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1899 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1900 return END_OF_COMPOSITION; /* skip the remaining elements in this level */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1901 } /* asn1 and EOC */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1902 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1903 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1904 if ((IdxOffset = (SHORT) cdc_search_table (ieTableIdx, t, limitSearch, &nonTagged, globs)) == -127) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1905 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1906 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1907 * t (iei) not defined in this composition (msg or submsg) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1908 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1909 if (asn1) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1910 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1911 if (melem[mcomp[c_ref].componentRef + mcomp[c_ref].numOfComponents -1].codingType == CCDTYPE_GSM5_V) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1912 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1913 /* Restore the old bitposition (before the 'TAG') and return |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1914 * IdxOffset to jump to last element of the composition. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1915 * The coding type of this elements is CCDTYPE_GSM5_V |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1916 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1917 bf_setBitpos (globs->bitpos-8, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1918 IdxOffset = (SHORT)(mcomp[c_ref].numOfComponents - ieTableIdx - 1); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1919 return (IdxOffset); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1920 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1921 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1922 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1923 * for recursive ASN.1 structs it is possible that the foreign |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1924 * tag belongs to a upper level composition of element. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1925 * |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1926 * |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1927 * Restore the old bitposition (before the TAG) and return |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1928 * END_OF_COMPOSITION to leave this composition level |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1929 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1930 bf_setBitpos (globs->bitpos-8, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1931 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1932 TRACE_CCD (globs, "Unknown Tag. It may belong to upper ASN.1 comp -> dec. bitpos by 8 to %d", globs->bitpos); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1933 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1934 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1935 return END_OF_COMPOSITION; /* skip the remaining elements in this level */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1936 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1937 else if (nonTagged) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1938 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1939 U16 actBitpos; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1940 actBitpos = globs->bitpos-8; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1941 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1942 if (melem[mcomp[c_ref].componentRef + mcomp[c_ref].numOfComponents -1].codingType == CCDTYPE_GSM5_V && |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1943 melem[e_ref].codingType EQ CCDTYPE_GSM5_TLV) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1944 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1945 #if defined (CCD_TEST) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1946 currentTag = (T_UNKNOWN_TAG *) malloc(sizeof(T_UNKNOWN_TAG)); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1947 #else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1948 currentTag = (T_UNKNOWN_TAG *) D_ALLOC(sizeof(T_UNKNOWN_TAG)); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1949 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1950 first = currentTag; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1951 currentTag->bitpos = globs->bitpos-8; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1952 currentTag->errCode = ERR_NO_MORE_ERROR; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1953 currentTag->next = NULL; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1954 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1955 /* unknown GSM Type TLV -> skip 'l' bytes */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1956 /* at least 8 bits must remain for following expeceted tagged element */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1957 while (globs->maxBitpos - 8 - globs->bitpos >= 8) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1958 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1959 currentTag->bitpos = globs->bitpos-8; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1960 currentTag->tag = (UBYTE) t; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1961 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1962 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1963 * Expecting a CCDTYPE_GSM5_TLV type we get an unknown tag with MSB set. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1964 * Store bitpos and t for the application (SAT) for the handling of |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1965 * comprehension required elements. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1966 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1967 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1968 if (CR) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1969 { // save (ERR_COMPREH_REQUIRED; globs->bitpos-len_t) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1970 currentTag->errCode = ERR_COMPREH_REQUIRED; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1971 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1972 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1973 { // save (ERR_IE_NOT_EXPECTED; globs->bitpos-len_t) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1974 currentTag->errCode = ERR_IE_NOT_EXPECTED; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1975 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1976 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1977 l = (ULONG) bf_decodeByteNumber (8, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1978 bf_incBitpos ((l << 3) , globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1979 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1980 t = (ULONG) bf_decodeByteNumber (8, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1981 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1982 limitSearch = TRUE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1983 CR = (UBYTE) (((t & 0x80) EQ 0x80) ? TRUE : FALSE); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1984 t &= 0x7f; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1985 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1986 if (cdc_search_table (ieTableIdx, t, limitSearch, &nonTagged, globs) != -127) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1987 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1988 bf_setBitpos (globs->bitpos-8, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1989 // set all ccd Errors |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1990 do |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1991 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1992 currentTag = first; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1993 ccd_setError (globs, currentTag->errCode, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1994 CONTINUE, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1995 (USHORT) currentTag->tag, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1996 currentTag->bitpos, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1997 (USHORT) -1); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1998 first = currentTag->next; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1999 #if defined (CCD_TEST) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2000 free(currentTag); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2001 #else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2002 D_FREE(currentTag); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2003 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2004 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2005 while (first != NULL ); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2006 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2007 return 0; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2008 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2009 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2010 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2011 #if defined (CCD_TEST) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2012 currentTag->next = (T_UNKNOWN_TAG *) malloc(sizeof(T_UNKNOWN_TAG)); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2013 #else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2014 currentTag->next = (T_UNKNOWN_TAG *) D_ALLOC(sizeof(T_UNKNOWN_TAG)); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2015 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2016 currentTag = currentTag->next; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2017 currentTag->next = NULL; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2018 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2019 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2020 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2021 do |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2022 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2023 currentTag = first; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2024 first = currentTag->next; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2025 #if defined (CCD_TEST) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2026 free(currentTag); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2027 #else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2028 D_FREE(currentTag); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2029 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2030 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2031 while (first != NULL ); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2032 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2033 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2034 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2035 * a non tagged element is possible in the message. If the tag |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2036 * can not be found, the tag may be the beginning of the non tagged |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2037 * element. E.g. rest octetts in sysinfo 4 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2038 * |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2039 * Restore the old bitposition (before the TAG) and return 1 to |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2040 * go to the next element. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2041 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2042 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2043 bf_setBitpos (actBitpos, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2044 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2045 TRACE_CCD (globs, "Unknown Tag but mand. IE possible -> dec. bitpos by 8 to %d", globs->bitpos); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2046 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2047 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2048 return 1; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2049 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2050 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2051 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2052 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2053 * Otherwise look if it is a type 1,2 or 4 Element |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2054 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2055 if ((t & 0x80) EQ 0x80) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2056 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2057 /* MSBit set -> GSM Type 1 or Type2 -> skip 1 byte */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2058 /* position already incremented by decoding the TAG value */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2059 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2060 /* Just another reason for getting IdxOffset equal to 0. */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2061 else if (globs->ccd_recurs_level >= MAX_RECURSIONS_PER_MSG) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2062 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2063 ccd_setError (globs, ERR_INTERNAL_ERROR, BREAK, (USHORT) -1); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2064 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2065 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2066 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2067 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2068 * Expecting a CCDTYPE_GSM5_TLV type we get an unknown tag with MSB set. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2069 * Store bitpos and t for the application (SAT) for the handling of |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2070 * comprehension required elements. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2071 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2072 if (CR) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2073 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2074 ccd_setError (globs, ERR_COMPREH_REQUIRED, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2075 CONTINUE, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2076 (USHORT) t, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2077 (USHORT) globs->bitpos-len_t, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2078 (USHORT) -1); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2079 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2080 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2081 * Expecting other types than CCDTYPE_GSM5_TLV we get an unknown tag with |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2082 * comprehension required bits (5, 6, 7 and 8 of IEI according to GSM0407) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2083 * are set to zero. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2084 * Store bitpos and t for the application for the handling of comprehension |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2085 * required elements. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2086 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2087 else if ((t & 0x70) EQ 0 AND |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2088 melem[e_ref].codingType NEQ CCDTYPE_GSM5_TLV) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2089 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2090 ccd_setError (globs, ERR_COMPREH_REQUIRED, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2091 CONTINUE, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2092 (USHORT) t, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2093 (USHORT) globs->bitpos-len_t, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2094 (USHORT) -1); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2095 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2096 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2097 * We get an unknown tag and any sort of comprehension required flag is set. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2098 * Store bitpos and t for the application |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2099 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2100 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2101 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2102 ccd_setError (globs, ERR_IE_NOT_EXPECTED, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2103 CONTINUE, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2104 (USHORT) t, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2105 (USHORT) globs->bitpos-len_t, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2106 (USHORT) -1); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2107 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2108 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2109 /* MSBit cleared -> GSM Type TLV -> skip 'l' bytes */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2110 if (globs->maxBitpos - globs->bitpos >= 8) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2111 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2112 l = (ULONG) bf_decodeByteNumber (8, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2113 bf_incBitpos ((l << 3) , globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2114 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2115 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2116 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2117 ccd_recordFault (globs, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2118 ERR_ELEM_LEN, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2119 BREAK, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2120 (USHORT) e_ref, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2121 globs->pstruct + globs->pstructOffs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2122 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2123 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2124 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2125 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2126 * return 0 -> that means try it again with this actual element |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2127 * referenced by e_ref |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2128 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2129 return 0; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2130 } /* tag not found */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2131 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2132 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2133 T_IEI_TABLE *iei_tbl = &globs->iei_ctx[globs->ccd_recurs_level].iei_table[ieTableIdx]; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2134 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2135 * element definition for this iei found |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2136 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2137 if (IdxOffset NEQ 0) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2138 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2139 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2140 * found index differs from the actual index |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2141 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2142 globs->TagPending = TRUE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2143 globs->PendingTag = (UBYTE) t; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2144 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2145 if (!asn1 AND IdxOffset < 0) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2146 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2147 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2148 * found an element in wrong sequence |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2149 * (for ASN1 elements the sequence order is not relevant) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2150 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2151 ccd_setError (globs, ERR_IE_SEQUENCE, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2152 (UBYTE) ((asn1) ? BREAK : CONTINUE), |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2153 (USHORT) t, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2154 (USHORT) globs->bitpos-len_t, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2155 (USHORT) -1); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2156 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2157 globs->SequenceError = TRUE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2158 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2159 if (globs->SequenceError) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2160 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2161 globs->RefBeforeError = (USHORT) e_ref; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2162 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2163 if (asn1) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2164 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2165 globs->iei_ctx[globs->ccd_recurs_level].countSkipped += IdxOffset; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2166 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2167 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2168 * skip to the found element |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2169 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2170 return (IdxOffset); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2171 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2172 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2173 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2174 globs->iei_ctx[globs->ccd_recurs_level].melemLast = (USHORT) e_ref; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2175 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2176 if (iei_tbl->act_amount == 0) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2177 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2178 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2179 * first apearance of this iei |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2180 * calculate the upper and lower boundaries and the |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2181 * facility of multiple appearance of this tagged element |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2182 * in the bitstream. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2183 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2184 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2185 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2186 * The element is repeatable. There are three kinds of |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2187 * repeat definitions valid for standard elements: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2188 * [5] - The element is repeated 5 times. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2189 * [0..5] - The element is repeated 0 to 5 times. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2190 * [a..5] - The element is repeated "the value of a" times. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2191 * |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2192 * For tagged elements the following processing is defined: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2193 * |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2194 * [5] - The t-Component is decoded |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2195 * (maybe the l-Component too (if defined one). |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2196 * After this the V-component of the element |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2197 * is decoded 5 times. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2198 * |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2199 * [0..5] - The t- and maybe the l-Component are decoded. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2200 * After this one V-Component is decoded and it |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2201 * is stored as an array entry into |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2202 * the target C-Structure. In this case the |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2203 * parameter ieIndex gives the index into |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2204 * this array, where the element has to |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2205 * be written into. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2206 * |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2207 * [a..5] - The t- and maybe the l-Component are decoded. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2208 * After this one V-Component is decoded |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2209 * "a" times and is stored into the C-Structure |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2210 * as an array. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2211 * |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2212 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2213 switch (melem[e_ref+IdxOffset].repType) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2214 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2215 case 'i': |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2216 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2217 * multiapearance of this element. The V-component is |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2218 * repeated once |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2219 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2220 is_variable = ccd_calculateRep (e_ref+IdxOffset, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2221 &repeat, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2222 &max_rep, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2223 globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2224 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2225 iei_tbl->max_amount = (UBYTE) max_rep; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2226 iei_tbl->multiple = TRUE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2227 break; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2228 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2229 case 'v': |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2230 case 'b': |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2231 default: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2232 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2233 * if this element is repeatable, and the number of |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2234 * repeats depends on another element, the valid amount |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2235 * of this element is 1 and the V-component will be |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2236 * repeated. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2237 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2238 iei_tbl->max_amount = 1; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2239 iei_tbl->multiple = FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2240 break; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2241 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2242 iei_tbl->act_amount = 1; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2243 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2244 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2245 if (iei_tbl->act_amount <= iei_tbl->max_amount) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2246 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2247 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2248 * process only the max_amount appearances of each element. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2249 * All additional IEs are ignored. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2250 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2251 ie_amount = (ULONG)(iei_tbl->act_amount)++; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2252 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2253 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2254 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2255 if (asn1) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2256 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2257 /* For ASN1 elements the sequence order is not relevant. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2258 * It is possible that the tag belongs to an upper level |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2259 * composition of elements. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2260 * Restore the old bitposition (before the TAG) and return |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2261 * END_OF_COMPOSITION to leave this composition level |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2262 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2263 bf_setBitpos (globs->bitpos-8, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2264 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2265 TRACE_CCD (globs, "Tag may belong to upper ASN.1 comp -> dec. bitpos by 8 to %d", globs->bitpos); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2266 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2267 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2268 return END_OF_COMPOSITION; /* skip the remaining elements in this level */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2269 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2270 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2271 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2272 ie_amount = 0; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2273 ccd_setError (globs, ERR_MAX_IE_EXCEED, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2274 CONTINUE, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2275 (USHORT) t, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2276 (USHORT) globs->bitpos-len_t, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2277 (USHORT) -1); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2278 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2279 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2280 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2281 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2282 * The t-component matches with the defined identifier for |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2283 * the actual element definition (e_ref). |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2284 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2285 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2286 if (globs->SequenceError) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2287 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2288 globs->SequenceError = FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2289 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2290 if (asn1) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2291 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2292 /* For ASN1 elements the sequence order is not relevant. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2293 * It is possible that the tag belongs to an upper level |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2294 * composition of elements. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2295 * Restore the old bitposition (before the TAG) and return |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2296 * END_OF_COMPOSITION to leave this composition level |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2297 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2298 bf_setBitpos (globs->bitpos-8, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2299 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2300 TRACE_CCD (globs, "Tag may belong to upper ASN.1 comp -> dec. bitpos by 8 to %d", globs->bitpos); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2301 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2302 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2303 return END_OF_COMPOSITION; /* skip the remaining elements in this level */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2304 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2305 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2306 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2307 /* found an element in wrong sequence */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2308 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2309 cdc_skipElem (e_ref, (tlv_inf->gotLen ? len_l:0), globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2310 return (SHORT)(globs->RefBeforeError - e_ref); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2311 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2312 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2313 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2314 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2315 * if this element is conditional, check the condition |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2316 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2317 if (calcidx[cix_ref].numCondCalcs NEQ 0 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2318 AND ! ccd_conditionOK (e_ref, globs)) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2319 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2320 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2321 * if the condition for this element is not valid |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2322 * but this element appears in the message, generate |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2323 * an error and skip the element |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2324 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2325 ccd_setError (globs, ERR_IE_NOT_EXPECTED, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2326 CONTINUE, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2327 (USHORT) t, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2328 (USHORT) globs->bitpos-len_t, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2329 (USHORT) -1); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2330 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2331 cdc_skipElem (e_ref, (tlv_inf->gotLen ? len_l:0), globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2332 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2333 return 0; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2334 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2335 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2336 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2337 * check for a valid index |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2338 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2339 if (ie_amount EQ 0) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2340 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2341 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2342 * The max number of repeats are reached |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2343 * In this case we must skip this element. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2344 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2345 cdc_skipElem (e_ref, (tlv_inf->gotLen ? len_l:0), globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2346 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2347 return 0; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2348 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2349 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2350 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2351 if (iei_tbl->multiple) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2352 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2353 if (melem[e_ref].elemType NEQ 'S') |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2354 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2355 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2356 * Element is not a SPARE |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2357 * Setup the offset into the C-structure for this element |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2358 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2359 globs->pstructOffs = melem[e_ref].structOffs; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2360 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2361 ret = cdc_tagged_LV_decode (e_ref, ie_amount, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2362 (tlv_inf->gotLen ? len_l:0), globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2363 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2364 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2365 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2366 if (melem[e_ref].elemType NEQ 'S') |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2367 { /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2368 * Element is not a SPARE |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2369 * Setup the offset into the C-structure for this element |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2370 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2371 globs->pstructOffs = melem[e_ref].structOffs; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2372 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2373 ret = cdc_normal_LV_decode (e_ref, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2374 (tlv_inf->gotLen ? len_l:0), globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2375 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2376 globs->SeekTLVExt = TRUE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2377 iei_tbl->exhausted = TRUE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2378 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2379 if (ret) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2380 return END_OF_COMPOSITION; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2381 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2382 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2383 * if more then one IE of this type are allowed, a ret of 0 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2384 * indicates the calling function (ccd_decodeComposition()) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2385 * to leave the pointer to the actual element definition on |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2386 * this element. If the value of ret is greater then 0 the |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2387 * calling function will increment the pointer by the value |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2388 * of ret. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2389 * cdc_T_decode() has found the expected element definition. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2390 * Go to the next definition or stay at this definition, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2391 * if the occurance of this element is more than one. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2392 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2393 if (iei_tbl->act_amount > iei_tbl->max_amount) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2394 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2395 iei_tbl->act_amount = 0; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2396 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2397 if (iei_tbl->max_amount > 1) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2398 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2399 return (0); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2400 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2401 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2402 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2403 if (globs->iei_ctx[globs->ccd_recurs_level].countSkipped) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2404 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2405 ret = (-1) * (globs->iei_ctx[globs->ccd_recurs_level].countSkipped); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2406 (globs->iei_ctx[globs->ccd_recurs_level].countSkipped) = 0; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2407 return (ret); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2408 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2409 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2410 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2411 return (1); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2412 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2413 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2414 } /* IdxOffset == 0 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2415 } /* tag found */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2416 } /* no asn1, no EOC */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2417 } /* got tag */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2418 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2419 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2420 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2421 * element has no t-component, process the l- and V-components |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2422 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2423 if (melem[e_ref].elemType NEQ 'S') |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2424 { /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2425 * Element is not a SPARE |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2426 * Setup the offset into the C-structure for this element |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2427 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2428 globs->pstructOffs = melem[e_ref].structOffs; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2429 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2430 ret = cdc_normal_LV_decode (e_ref, len_l, globs) ? END_OF_COMPOSITION : 1; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2431 globs->SeekTLVExt = TRUE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2432 return ret; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2433 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2434 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2435 #endif /* !RUN_FLASH */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2436 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2437 #ifndef RUN_FLASH |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2438 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2439 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2440 | PROJECT : CCD (6144) MODULE : CDC_COM | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2441 | STATE : code ROUTINE : cdc_tlv_encode | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2442 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2443 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2444 PURPOSE : if T_len > 0 this function encodes the T-Component of |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2445 this element. If L_len > 0 it encodes the number |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2446 of bytes uses for this element. After all the function |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2447 encodes the V-component referenced by eRef from the |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2448 C-Structure (globs->pstruct) at position globs->pstructOffs |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2449 into the bitstream. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2450 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2451 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2452 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2453 void cdc_tlv_encode (const ULONG e_ref, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2454 UBYTE lenT, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2455 UBYTE lenL, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2456 T_CCD_Globs *globs) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2457 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2458 ULONG posL=0, t_repeat, v_repeat, repeat; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2459 ULONG cSize, startOffset=0; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2460 BOOL multAppear; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2461 U8 *old_pstruct = NULL; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2462 ULONG i; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2463 ULONG cix_ref, num_prolog_steps, prolog_step_ref; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2464 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2465 cix_ref = melem[e_ref].calcIdxRef; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2466 num_prolog_steps = calcidx[cix_ref].numPrologSteps; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2467 prolog_step_ref = calcidx[cix_ref].prologStepRef; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2468 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2469 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2470 * If this element is conditional, check the condition. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2471 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2472 if (calcidx[cix_ref].numCondCalcs NEQ 0 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2473 AND ! ccd_conditionOK (e_ref, globs)) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2474 return; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2475 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2476 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2477 * If this element have a defined Prolog, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2478 * we have to process it before decoding the bit stream. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2479 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2480 if (num_prolog_steps) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2481 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2482 ccd_performOperations (num_prolog_steps, prolog_step_ref, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2483 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2484 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2485 if (melem[e_ref].elemType NEQ 'S') |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2486 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2487 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2488 * Element is not a SPARE. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2489 * Setup the offset into the C-structure for this element. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2490 * In case of pointer types, the pstructOffs must be |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2491 * the offset into the memory area pointed to. CCDGEN must |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2492 * ensure this holds true. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2493 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2494 globs->pstructOffs = melem[e_ref].structOffs; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2495 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2496 if ( ! cdc_isPresent(e_ref, globs) ) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2497 return; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2498 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2499 if (melem[e_ref].repType EQ 'v' OR melem[e_ref].repType EQ 'i') |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2500 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2501 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2502 * for variable sized elements read the amount |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2503 * of repeats out of the C-Structure (c_xxx). |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2504 * If the number of repeats given by the C-Structure |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2505 * exceeds the allowed value (maxRepeat) CCD gives a warning! |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2506 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2507 if (melem[e_ref].maxRepeat > 255) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2508 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2509 ULONG count = (ULONG) (* (USHORT *)(globs->pstruct + globs->pstructOffs++)); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2510 repeat = MINIMUM (count, (ULONG) melem[e_ref].maxRepeat); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2511 if (repeat < count) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2512 ccd_recordFault (globs, ERR_MAX_REPEAT, CONTINUE, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2513 (USHORT) e_ref, globs->pstruct + globs->pstructOffs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2514 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2515 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2516 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2517 repeat = (ULONG) MINIMUM (globs->pstruct[globs->pstructOffs], |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2518 melem[e_ref].maxRepeat); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2519 if ( repeat < (ULONG) (globs->pstruct[globs->pstructOffs]) ) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2520 ccd_recordFault (globs, ERR_MAX_REPEAT, CONTINUE, (USHORT) e_ref, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2521 globs->pstruct + globs->pstructOffs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2522 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2523 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2524 globs->pstructOffs++; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2525 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2526 multAppear = (melem[e_ref].repType EQ 'i'); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2527 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2528 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2529 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2530 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2531 * Field of constant length: repType EQ 'c' |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2532 * or bit-field allocated with |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2533 * given maximum length: repType EQ 'b' (often cType='X') |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2534 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2535 repeat = (ULONG)((melem[e_ref].repType EQ 'c' |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2536 OR melem[e_ref].repType EQ 'b') |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2537 ? melem[e_ref].maxRepeat |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2538 : 1 ); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2539 multAppear = FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2540 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2541 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2542 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2543 * Perform pointer dereference for pointer types. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2544 * Also, check optionality for these types. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2545 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2546 #ifdef DYNAMIC_ARRAYS |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2547 if ((melem[e_ref].elemType >= 'P' AND melem[e_ref].elemType <= 'R') OR |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2548 (melem[e_ref].elemType >= 'D' AND melem[e_ref].elemType <= 'F')) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2549 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2550 U8 *deref_pstruct; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2551 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2552 /* Get pointer value */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2553 deref_pstruct = *(U8 **)(globs->pstruct + globs->pstructOffs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2554 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2555 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2556 * Strictly speaking the 'D' to 'F' types should not need this |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2557 * check (should have returned after the optionality check above), |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2558 * but it will catch stray NULL pointers (or uninitialized |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2559 * valid flags) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2560 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2561 if (ccd_check_pointer(deref_pstruct) != ccdOK) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2562 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2563 ccd_recordFault (globs, ERR_INVALID_PTR, BREAK, (USHORT) e_ref, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2564 &globs->pstruct[globs->pstructOffs]); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2565 return; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2566 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2567 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2568 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2569 * Pointer not NULL; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2570 * 1. Save old globs->pstruct and assign pointer to globs->pstruct |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2571 * as new base. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2572 * 2. Set pstructOffs to 0 (zero) as the next offset will start |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2573 * in the new memory area. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2574 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2575 old_pstruct = globs->pstruct; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2576 globs->pstruct = deref_pstruct; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2577 globs->pstructOffs = 0; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2578 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2579 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2580 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2581 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2582 * 20010621 MVJ: Dynamic array addition. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2583 * Types 'R' and 'F' point to base types (just as type 'V') and |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2584 * read sizes from the same table. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2585 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2586 cSize = (ULONG)((melem[e_ref].elemType EQ 'V' |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2587 #ifdef DYNAMIC_ARRAYS |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2588 OR melem[e_ref].elemType EQ 'R' |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2589 OR melem[e_ref].elemType EQ 'F' |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2590 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2591 ) ? mvar[melem[e_ref].elemRef].cSize |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2592 : mcomp[melem[e_ref].elemRef].cSize |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2593 ); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2594 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2595 startOffset = globs->pstructOffs; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2596 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2597 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2598 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2599 repeat = (ULONG)((melem[e_ref].repType EQ 'c') |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2600 ? melem[e_ref].maxRepeat |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2601 : 1); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2602 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2603 multAppear = FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2604 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2605 cSize = 0; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2606 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2607 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2608 if (multAppear AND lenT) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2609 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2610 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2611 * multiple appearance of the repeated element is coded as |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2612 * TLV0 TLV1 TLV2 .... |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2613 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2614 t_repeat = repeat; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2615 v_repeat = 1; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2616 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2617 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2618 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2619 t_repeat = 1; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2620 v_repeat = repeat; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2621 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2622 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2623 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2624 * single appearance of the repeated element is coded as |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2625 * TLV0V1V2V3 .... |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2626 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2627 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2628 for (i=0; i < t_repeat; i++) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2629 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2630 if (lenT) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2631 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2632 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2633 * encode the T-component |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2634 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2635 bf_codeByteNumber (lenT, (UBYTE) melem[e_ref].ident, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2636 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2637 TRACE_CCD (globs, "encoding %d bits T-value (%x)", lenT, melem[e_ref].ident); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2638 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2639 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2640 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2641 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2642 * if lenL > 0 remember the position of the L-component, because |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2643 * we know it after encoding the entire element. for GSM5TLV elements |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2644 * it could be necessary to use 2 bytes for the length information. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2645 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2646 if (lenL) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2647 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2648 posL = (ULONG) globs->bitpos; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2649 bf_incBitpos (lenL, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2650 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2651 TRACE_CCD (globs, "skipping %d bits for L-value at byte %d.%d", lenL, globs->bytepos, globs->byteoffs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2652 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2653 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2654 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2655 if (cSize) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2656 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2657 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2658 * calculate the offset if it is not a spare |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2659 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2660 globs->pstructOffs = (ULONG)(startOffset + (i * cSize)); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2661 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2662 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2663 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2664 * Encode the value. Keep caution with BER encoding of ASN1 integers. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2665 * All other types can be encoded by a generic function. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2666 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2667 if (melem[e_ref].codingType EQ CCDTYPE_GSM1_ASN |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2668 AND |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2669 melem[e_ref].elemType EQ 'V' |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2670 AND melem[e_ref].repType EQ ' ' |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2671 ) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2672 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2673 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2674 #ifdef CCD_SYMBOLS |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2675 TRACE_CCD (globs, "BER encoding of ASN.1 integer %s", |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2676 ccddata_get_alias((USHORT) e_ref, 1)); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2677 #else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2678 TRACE_CCD (globs, "BER encoding of ASN.1 integer; e_ref= %d", melem[e_ref].elemRef); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2679 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2680 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2681 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2682 switch (mvar[melem[e_ref].elemRef].cType) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2683 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2684 case 'B': bf_writeBits (8, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2685 break; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2686 case 'S': |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2687 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2688 if (*(U16 *) (globs->pstruct+globs->pstructOffs) <= (U16)0xFF) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2689 bf_writeBits (8, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2690 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2691 bf_writeBits (16, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2692 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2693 break; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2694 case 'L': |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2695 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2696 U32 tmpVal= *(U32 *) (globs->pstruct+globs->pstructOffs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2697 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2698 if ( tmpVal <= (U32)0xFF) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2699 bf_writeBits (8, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2700 else if ( tmpVal <= (U32)0xFFFF) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2701 bf_writeBits (16, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2702 else if ( tmpVal <= (U32)0xFFFFFF) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2703 bf_writeBits (24, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2704 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2705 bf_writeBits (32, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2706 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2707 break; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2708 case 'X': |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2709 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2710 U16 ValLen= *(U16 *) (globs->pstruct+globs->pstructOffs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2711 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2712 if ( mvar[melem[e_ref].elemRef].bSize >= ValLen) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2713 bf_writeBitChunk (ValLen, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2714 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2715 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2716 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2717 TRACE_CCD (globs, "value length (%d) exceeds defined bSize!", ValLen); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2718 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2719 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2720 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2721 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2722 break; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2723 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2724 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2725 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2726 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2727 cdc_encodeElemvalue (e_ref, v_repeat, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2728 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2729 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2730 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2731 * calculate the bitlen if it is an TLV element and write the |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2732 * L-value. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2733 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2734 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2735 if (lenL) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2736 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2737 switch (melem[e_ref].codingType) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2738 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2739 case CCDTYPE_GSM5_TLV: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2740 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2741 USHORT L = (((USHORT)((globs->bitpos - posL)-lenL)+7) >> 3); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2742 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2743 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2744 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2745 TRACE_CCD (globs, "recoding the 8 bit L-value (%d)", L); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2746 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2747 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2748 if (L > 127) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2749 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2750 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2751 * if the length is > 127 we code the first byte to |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2752 * 0x81, shift the whole stuff rightwise by 8 and |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2753 * encode the length in the next byte (16 bits for L) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2754 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2755 bf_rShift8Bit ((USHORT) (posL+8), (USHORT) (L<<3), globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2756 bf_incBitpos (8, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2757 bf_recodeByteNumber ((USHORT) posL, lenL, (UBYTE) 0x81, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2758 bf_recodeByteNumber ((USHORT) (posL+8), lenL, (UBYTE) L, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2759 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2760 * set the bitpos to a 8 bit aligned position |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2761 * corresponding the L value |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2762 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2763 bf_setBitpos (posL+(L*8)+16, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2764 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2765 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2766 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2767 bf_recodeByteNumber ((USHORT) posL, lenL, (UBYTE) L, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2768 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2769 * set the bitpos to a 8 bit aligned position |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2770 * corresponding the L value |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2771 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2772 bf_setBitpos (posL+(L*8)+8, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2773 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2774 break; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2775 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2776 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2777 case CCDTYPE_GSM6_TLV: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2778 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2779 USHORT L = ((USHORT)(((globs->bitpos - posL)-lenL)+7) >> 3); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2780 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2781 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2782 TRACE_CCD (globs, "recoding the 16 bit L-value (%d)", L); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2783 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2784 bf_recodeShortNumber ((USHORT)posL, lenL, L, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2785 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2786 * set the bitpos to a 8 bit aligned position |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2787 * corresponding the L value |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2788 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2789 bf_setBitpos (posL+(L*8)+16, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2790 break; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2791 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2792 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2793 case CCDTYPE_GSM7_LV: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2794 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2795 USHORT L = (USHORT) ((globs->bitpos - posL)-lenL); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2796 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2797 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2798 TRACE_CCD (globs, "recoding the 7 bit L-value (bitlength) (%d)", L); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2799 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2800 bf_recodeShortNumber ((USHORT)posL, lenL, L, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2801 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2802 bf_setBitpos (posL+L+7, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2803 break; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2804 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2805 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2806 default: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2807 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2808 USHORT L = ((USHORT)(((globs->bitpos - posL)-lenL)+7) >> 3); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2809 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2810 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2811 TRACE_CCD (globs, "recoding the 8 bit L-value (%d)", L); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2812 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2813 bf_recodeByteNumber ((USHORT)posL, lenL, (UBYTE) L, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2814 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2815 * Set the bitpos to a 8 bit aligned position |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2816 * corresponding the L value |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2817 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2818 bf_setBitpos (posL+(L*8)+8, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2819 break; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2820 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2821 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2822 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2823 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2824 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2825 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2826 * Restore globs->pstruct if overwritten by pointer dereference. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2827 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2828 if (old_pstruct) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2829 globs->pstruct = old_pstruct; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2830 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2831 #endif /* !RUN_FLASH */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2832 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2833 #ifndef RUN_FLASH |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2834 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2835 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2836 | PROJECT : CCD (6144) MODULE : CDC_COM | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2837 | STATE : code ROUTINE : cdc_GSM_start | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2838 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2839 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2840 PURPOSE : Initialize the GSM specific codec part for each msg. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2841 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2842 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2843 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2844 void cdc_GSM_start (T_CCD_Globs *globs) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2845 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2846 globs->Swap1V_inProgress = FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2847 globs->last_level = 255; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2848 cdc_init_ctx_table (globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2849 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2850 #endif /* !RUN_FLASH */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2851 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2852 #ifndef RUN_INT_RAM |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2853 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2854 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2855 | PROJECT : CCD (6144) MODULE : CDC_COM | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2856 | STATE : code ROUTINE : cdc_isPresent | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2857 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2858 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2859 PURPOSE : For optional elements check the valid-flag in the C-struct. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2860 Spare elements in PER do not have a corresponding valid flag. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2861 In case of Dynamic Arrays: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2862 Postpone optional check for non-code transparent pointer |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2863 types ('P', 'Q', 'R'). |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2864 For these types, the optional flag is the pointer itself. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2865 These types cannot be checked yet, as the pointer may be |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2866 preceeded by a counter octet, a union tag id octet etc. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2867 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2868 U16 cdc_isPresent (const ULONG e_ref, T_CCD_Globs *globs) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2869 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2870 if (melem[e_ref].optional) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2871 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2872 #ifdef DYNAMIC_ARRAYS |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2873 if (melem[e_ref].elemType < 'P' OR melem[e_ref].elemType > 'R') |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2874 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2875 if(globs->pstruct[globs->pstructOffs++] == FALSE) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2876 return FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2877 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2878 else if (globs->pstruct [melem[e_ref].structOffs] != TRUE) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2879 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2880 TRACE_CCD (globs, "Ambiguous value for valid flag!\n...assumed 1 for ccdID=%d", |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2881 e_ref); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2882 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2883 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2884 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2885 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2886 { /*If elemType is P, Q or R - check the pointer value*/ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2887 if(*(void**) &globs->pstruct[globs->pstructOffs] == NULL) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2888 return FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2889 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2890 #else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2891 if (globs->pstruct[globs->pstructOffs++] == FALSE) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2892 return FALSE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2893 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2894 else if (globs->pstruct [melem[e_ref].structOffs] != TRUE) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2895 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2896 TRACE_CCD (globs, "Ambiguous value for valid flag!\n...assumed 1 for ccdID=%d", |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2897 e_ref); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2898 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2899 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2900 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2901 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2902 return TRUE; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2903 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2904 #endif /* !RUN_INT_RAM */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2905 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2906 #ifndef RUN_FLASH |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2907 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2908 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2909 | PROJECT : CCD (6144) MODULE : CDC_COM | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2910 | STATE : code ROUTINE : is_pointer_type | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2911 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2912 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2913 PURPOSE : Return TRUE for pointer elements. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2914 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2915 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2916 BOOL is_pointer_type (const ULONG e_ref) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2917 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2918 return ((melem[e_ref].elemType >= 'P' AND melem[e_ref].elemType <= 'R') OR |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2919 (melem[e_ref].elemType >= 'D' AND melem[e_ref].elemType <= 'F')); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2920 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2921 #endif /* !RUN_FLASH */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2922 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2923 #ifndef RUN_FLASH |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2924 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2925 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2926 | PROJECT : CCD (6144) MODULE : CDC_COM | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2927 | STATE : code ROUTINE : is_variable_type | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2928 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2929 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2930 PURPOSE : Return TRUE for elements with variable character. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2931 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2932 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2933 BOOL is_variable_type (const ULONG e_ref) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2934 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2935 return ((melem[e_ref].elemType == 'F') || ( melem[e_ref].elemType == 'R') || |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2936 (melem[e_ref].elemType == 'V')); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2937 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2938 #endif /* !RUN_FLASH */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2939 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2940 #ifndef RUN_INT_RAM |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2941 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2942 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2943 | PROJECT : CCD (6144) MODULE : CDC_COM | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2944 | STATE : code ROUTINE : PER_CommonBegin | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2945 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2946 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2947 PURPOSE : Common settings done by most of the encoding or decoding |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2948 functions for UNALIGNED PER (UMTS). |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2949 It handles position of pointer to the C-structure, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2950 valid flag for optional elements and length determinant |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2951 for array of elements. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2952 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2953 SHORT PER_CommonBegin (const ULONG e_ref, ULONG *max_rep, T_CCD_Globs *globs) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2954 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2955 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2956 * Set the offset in the C-structure on the value for this element |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2957 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2958 globs->pstructOffs = melem[e_ref].structOffs; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2959 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2960 /* For optional elements we have already set the valid flag in the |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2961 * C-structure while processing ASN1_SEQ. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2962 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2963 if ( ! cdc_isPresent(e_ref, globs) ) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2964 return (SHORT)ccdError; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2965 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2966 switch (melem[e_ref].repType) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2967 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2968 case ' ': |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2969 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2970 * Element is not an array. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2971 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2972 *max_rep = 1; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2973 break; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2974 case 'c': |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2975 case 'C': |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2976 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2977 * Read the size for an array of fixed length. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2978 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2979 *max_rep = (ULONG) melem[e_ref].maxRepeat; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2980 break; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2981 case 'j': |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2982 case 'J': |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2983 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2984 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2985 * Read the size for an array of variable length. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2986 * Read the value of the last encoded element. It is the length |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2987 * indicator. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2988 * Hint 1: globs->pstruct[melem[e_ref-1].structOffs is 0, since |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2989 * fields of variable length are projected on a COMP made of an |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2990 * ASN1_INTEGER for the lenght indicator and the field elements |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2991 * (sequences, integers, octets or bits). |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2992 * Hint 2: The current version of UMTS does not use length |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2993 * indicators larger than 64K. Hence the use of USHORT for repeat. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2994 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2995 switch (mvar[melem[e_ref-1].elemRef].cType) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2996 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2997 case 'B': *max_rep = (ULONG) globs->pstruct[melem[e_ref-1].structOffs]; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2998 break; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2999 case 'S': *max_rep = (ULONG) *(USHORT *) (globs->pstruct+melem[e_ref-1].structOffs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3000 break; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3001 default: *max_rep = 0; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3002 break; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3003 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3004 break; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3005 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3006 default: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3007 ccd_recordFault (globs, ERR_DEFECT_CCDDATA, BREAK, (USHORT) e_ref, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3008 globs->pstruct + globs->pstructOffs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3009 break; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3010 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3011 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3012 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3013 * There is nothing to be encoded. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3014 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3015 if (*max_rep EQ 0) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3016 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3017 return (SHORT)ccdError; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3018 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3019 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3020 * Check the validity of the lenght information. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3021 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3022 else if (melem[e_ref].maxRepeat AND *max_rep > melem[e_ref].maxRepeat) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3023 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3024 ccd_recordFault (globs, ERR_MAX_REPEAT, CONTINUE, (USHORT) e_ref, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3025 globs->pstruct + globs->pstructOffs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3026 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3027 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3028 return (SHORT)ccdOK; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3029 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3030 #endif /* !RUN_INT_RAM */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3031 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3032 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3033 #ifdef DYNAMIC_ARRAYS |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3034 #ifndef RUN_INT_RAM |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3035 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3036 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3037 | PROJECT : CCD (6144) MODULE : CDC_COM | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3038 | STATE : code ROUTINE : PER_allocmem | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3039 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3040 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3041 PURPOSE : Allocate memory for pointer types (dynamic array addition) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3042 Returns address of freshly allocated memory |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3043 or ccdError in case no memory is available. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3044 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3045 U8 *PER_allocmem(const ULONG e_ref, ULONG repeat, T_CCD_Globs *globs) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3046 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3047 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3048 * Check for pointer types; allocate memory if necessary. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3049 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3050 if ( is_pointer_type(e_ref) ) { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3051 ULONG cSize; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3052 U8 *addr; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3053 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3054 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3055 * Find size to allocate. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3056 * Read from mcomp or mvar according to type. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3057 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3058 cSize = (ULONG)((melem[e_ref].elemType EQ 'V' OR |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3059 melem[e_ref].elemType EQ 'R' |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3060 OR melem[e_ref].elemType EQ 'F') |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3061 ? mvar[melem[e_ref].elemRef].cSize |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3062 : mcomp[melem[e_ref].elemRef].cSize |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3063 ); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3064 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3065 #ifdef DEBUG_CCD |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3066 TRACE_CCD (globs, "PER_allocmem(): alloc%5d x%5d bytes (type '%c'); " |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3067 "elem%5d ('%s')", |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3068 repeat, cSize, melem[e_ref].elemType, e_ref, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3069 #ifdef CCD_SYMBOLS |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3070 mcomp[melem[e_ref].elemRef].name |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3071 #else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3072 "" |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3073 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3074 ); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3075 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3076 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3077 * Allocate additional memory - append to existing mem chain |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3078 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3079 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3080 cSize *= repeat; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3081 addr = (U8 *)DP_ALLOC( cSize, globs->alloc_head, DP_NO_FRAME_GUESS); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3082 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3083 /* If no memory, log error and return immediately */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3084 if (addr EQ NULL) { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3085 ccd_setError (globs, ERR_NO_MEM, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3086 BREAK, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3087 (USHORT) -1); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3088 return (U8 *)ccdError; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3089 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3090 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3091 memset (addr, 0, (size_t)cSize); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3092 return addr; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3093 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3094 return (U8 *)ccdError; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3095 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3096 #endif /* !RUN_INT_RAM */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3097 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3098 #ifndef RUN_INT_RAM |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3099 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3100 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3101 | PROJECT : CCD (6144) MODULE : CDC_COM | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3102 | STATE : code ROUTINE : PER_allocmem_and_update| |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3103 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3104 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3105 PURPOSE : Allocate memory for pointer types (dynamic array addition) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3106 Updates global variables after allocation |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3107 (globs->pstruct and globs->pstructOffs). |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3108 Assumes that these global variables are saved by the |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3109 calling function. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3110 Returns ccdOK or ccdError in case no memory is available. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3111 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3112 USHORT PER_allocmem_and_update(const ULONG e_ref, ULONG repeat, T_CCD_Globs *globs) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3113 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3114 U8 *addr; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3115 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3116 /* Allocate memory */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3117 addr = PER_allocmem(e_ref, repeat, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3118 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3119 /* No memory ? */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3120 if ( addr != (U8 *)ccdError ) { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3121 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3122 * Memory allocated; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3123 * 1. Store pointer to freshly allocated memory area in structure |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3124 * 2. Initialize pstruct to point to the freshly allocated memory area. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3125 * 3. Initialize pstructOffs to 0 to start decoding at offset 0 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3126 * in the new memory area. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3127 * Assumes that globs->pstruct is saved in the calling function. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3128 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3129 *(U8 **)(globs->pstruct + globs->pstructOffs) = addr; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3130 globs->pstruct = addr; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3131 globs->pstructOffs = 0; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3132 return ccdOK; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3133 } else { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3134 /* No memory - Return error */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3135 return ccdError; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3136 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3137 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3138 #endif /* !RUN_INT_RAM */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3139 #endif |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3140 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3141 #ifndef RUN_INT_RAM |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3142 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3143 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3144 | PROJECT : CCD (6144) MODULE : CDC_COM | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3145 | STATE : code ROUTINE : Read_NormallySmallNonNegativeWholeNr| |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3146 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3147 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3148 PURPOSE : Read a normally small non-negative whole number as defined |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3149 by ASN.1 PER. Function is used to read elements such as: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3150 a) bit-map field of SEQUENCE extensions, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3151 b) index of CHOICE extension or |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3152 c) extension value of extensible INTEGER or ENUMERATED. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3153 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3154 U32 Read_NormallySmallNonNegativeWholeNr (T_CCD_Globs *globs) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3155 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3156 U32 value_length=0; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3157 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3158 /* Read the first bit. If set to 0 it means the value is encoded |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3159 * in the following five bits. Else read a normally small ...nr. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3160 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3161 if (bf_readBit (globs) EQ 0) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3162 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3163 return ((U32) bf_getBits (6, globs)); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3164 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3165 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3166 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3167 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3168 * Do not handle the theoretical case that value length |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3169 * needs more than 63 bits. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3170 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3171 bf_incBitpos (1, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3172 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3173 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3174 * Read the value length first. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3175 * Then use the length to read the value. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3176 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3177 value_length = (U32) bf_getBits (6, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3178 return ((U32) bf_getBits (value_length, globs)); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3179 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3180 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3181 #endif /* !RUN_INT_RAM */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3182 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3183 #ifndef RUN_INT_RAM |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3184 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3185 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3186 | PROJECT : CCD (6144) MODULE : CDC_COM | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3187 | STATE : code ROUTINE : Write_NormallySmallNonNegativeWholeNr| |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3188 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3189 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3190 PURPOSE : Write a normally small non-negative whole number as defined |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3191 by ASN.1 PER. Function is used to encode elements such as: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3192 a) bit-map field of SEQUENCE extensions, |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3193 b) index of CHOICE extension or |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3194 c) extension value of extensible INTEGER or ENUMERATED. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3195 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3196 void Write_NormallySmallNonNegativeWholeNr (U32 Value, T_CCD_Globs *globs) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3197 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3198 /* For small numbers write 0 in the first bit. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3199 * Then encode that number in the succeeding five bits. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3200 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3201 if (Value < 64) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3202 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3203 bf_writeBit (0, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3204 bf_writeVal (Value, 6, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3205 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3206 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3207 * Encode the number under the assumption that its length is |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3208 * given by less than 63 bits. Hence encode also the length as a |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3209 * normally small... |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3210 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3211 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3212 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3213 /* Set flag bits: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3214 * 1 means "length determinant encoded before the value itself" |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3215 * 0 means "length determinant encoded only in five bits" |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3216 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3217 bf_writeVal (2, 2, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3218 bf_writeVal (bitSize[Value], 5, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3219 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3220 /* Encode the number itself */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3221 bf_writeVal (Value, bitSize[Value], globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3222 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3223 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3224 return; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3225 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3226 #endif /* !RUN_INT_RAM */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3227 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3228 #ifndef RUN_INT_RAM |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3229 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3230 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3231 | PROJECT : CCD (6144) MODULE : CDC_COM | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3232 | STATE : code ROUTINE : Read_OpenTpye_Length | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3233 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3234 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3235 PURPOSE : Read length of an ASN.1 open type. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3236 Open types are normally found in encoding of |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3237 parametrized information objects and extension types. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3238 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3239 U32 Read_OpenTpye_Length (T_CCD_Globs *globs) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3240 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3241 U32 Value; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3242 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3243 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3244 * Flag bit is 0 for "Value < 128" which means |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3245 * "encoding fits in the current octet" |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3246 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3247 if (bf_readBit (globs) EQ 0) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3248 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3249 Value = bf_getBits (7, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3250 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3251 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3252 * Flag bits are 10 for 128 "< Value < 16K". |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3253 * 1 means "encoding does not fit in the current octet". |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3254 * 0 means "encoding needs only one further octet". |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3255 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3256 else if (bf_readBit (globs) EQ 0) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3257 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3258 Value = bf_getBits (14, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3259 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3260 /* Currently no support for bigger values is required. */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3261 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3262 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3263 /* force error detection */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3264 Value = 0; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3265 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3266 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3267 return Value; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3268 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3269 #endif /* !RUN_INT_RAM */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3270 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3271 #ifndef RUN_INT_RAM |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3272 /* |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3273 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3274 | PROJECT : CCD (6144) MODULE : CDC_COM | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3275 | STATE : code ROUTINE : Write_OpenTpye_Length | |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3276 +--------------------------------------------------------------------+ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3277 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3278 PURPOSE : Write length of an ASN.1 open type. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3279 Open types are normally found in encoding of |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3280 parametrized information objects and extension types. |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3281 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3282 void Write_OpenTpye_Length (U32 Value, T_CCD_Globs *globs) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3283 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3284 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3285 if (Value < 128) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3286 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3287 bf_writeVal (Value, 8, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3288 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3289 else if (Value < 0x8000) |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3290 { |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3291 /* Set flag bits: |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3292 * 1 means "encoding does not fit in the current octet" |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3293 * 0 means "encoding needs only one further octet" |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3294 */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3295 bf_writeVal (2, 2, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3296 bf_writeVal (Value, 14, globs); |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3297 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3298 /* Currently no support for bigger values is required. */ |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3299 else |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3300 {} |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3301 |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3302 return; |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3303 } |
970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3304 #endif /* !RUN_INT_RAM */ |