FreeCalypso > hg > freecalypso-citrine
comparison g23m-aci/aci/ati_em.c @ 0:75a11d740a02
initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 09 Jun 2016 00:02:41 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:75a11d740a02 |
---|---|
1 /* | |
2 +----------------------------------------------------------------------------- | |
3 | Project : | |
4 | Modul : | |
5 +----------------------------------------------------------------------------- | |
6 | Copyright 2002 Texas Instruments Berlin, AG | |
7 | All rights reserved. | |
8 | | |
9 | This file is confidential and a trade secret of Texas | |
10 | Instruments Berlin, AG | |
11 | The receipt of or possession of this file does not convey | |
12 | any rights to reproduce or disclose its contents or to | |
13 | manufacture, use, or sell anything it may describe, in | |
14 | whole, or in part, without the specific written consent of | |
15 | Texas Instruments Berlin, AG. | |
16 +----------------------------------------------------------------------------- | |
17 | Purpose : This module provides the ati interface for the engineering mode. | |
18 +----------------------------------------------------------------------------- | |
19 */ | |
20 | |
21 #include "config.h" | |
22 #include "fixedconf.h" | |
23 #include "condat-features.h" | |
24 #include "aci_conf.h" | |
25 | |
26 #undef DUMMY_ATI_STRINGS | |
27 | |
28 #include "aci_all.h" | |
29 | |
30 #include "aci_cmh.h" | |
31 #include "ati_cmd.h" | |
32 #include "aci_io.h" | |
33 #include "aci_cmd.h" | |
34 #include "l4_tim.h" | |
35 #include "aci_em.h" | |
36 | |
37 #include "aci_mem.h" | |
38 #include "aci_prs.h" | |
39 #include "aci_lst.h" | |
40 | |
41 #include "ati_int.h" | |
42 | |
43 #ifdef FF_ATI_BAT | |
44 | |
45 #include "typedefs.h" | |
46 #include "gdd.h" | |
47 #include "bat.h" | |
48 | |
49 #include "ati_bat.h" | |
50 | |
51 #endif /*FF_ATI_BAT*/ | |
52 | |
53 /*==== EXPORT =====================================================*/ | |
54 /*==== VARIABLES ==================================================*/ | |
55 /*==== FUNCTIONS ==================================================*/ | |
56 /*==== CONSTANTS ==================================================*/ | |
57 #define EMET_L1 0x0001 | |
58 #define EMET_ALL 0x00ff | |
59 | |
60 /* | |
61 +------------------------------------------------------------------------------ | |
62 | Function : setatPercentEM | |
63 +------------------------------------------------------------------------------ | |
64 | Description : AT-cmd for the EM infrastructure data | |
65 | | |
66 | | |
67 | Parameters : char *cl | |
68 | UBYTE srcId | |
69 | | |
70 | Return : char * | |
71 +------------------------------------------------------------------------------ | |
72 */ | |
73 GLOBAL T_ATI_RSLT setatPercentEM (char *cl, UBYTE srcId) | |
74 { | |
75 T_ACI_RETURN ret = AT_FAIL; | |
76 T_EM_AT_MODE mode = (T_EM_AT_MODE)ACI_NumParmNotPresent; | |
77 T_EM_AT_TYPE type = (T_EM_AT_TYPE)ACI_NumParmNotPresent; | |
78 T_ATI_SRC_PARAMS *src_params = find_element (ati_src_list, srcId, search_ati_src_id); | |
79 | |
80 src_params->curAtCmd = AT_CMD_EM; | |
81 | |
82 cl = parse (cl, "dd", &mode, &type); | |
83 | |
84 if ( (mode NEQ SIN_REP) AND (mode NEQ PCO_REP) ) | |
85 { | |
86 cmdCmeError (CME_ERR_OpNotSupp); | |
87 return ATI_FAIL; | |
88 } | |
89 | |
90 if ( (mode EQ SIN_REP) AND ((type EQ ACI_NumParmNotPresent) OR ((type < EM_AT_SC) AND (type > EM_AT_PDP))) ) | |
91 { | |
92 cmdCmeError (CME_ERR_OpNotSupp); | |
93 return ATI_FAIL; | |
94 } | |
95 | |
96 if ( (mode EQ PCO_REP) AND ((type EQ ACI_NumParmNotPresent) OR (type > EM_AT_PCO_HIGHEST-1)) ) | |
97 { | |
98 cmdCmeError (CME_ERR_OpNotSupp); | |
99 return ATI_FAIL; | |
100 } | |
101 | |
102 if (type EQ ACI_NumParmNotPresent) | |
103 { | |
104 type = EM_AT_SC; | |
105 } | |
106 | |
107 srcId_cb = srcId; | |
108 | |
109 #ifdef FF_ATI_BAT | |
110 { | |
111 T_BAT_cmd_send cmd; | |
112 T_BAT_cmd_set_percent_em my_bat_set_percent_em; | |
113 | |
114 TRACE_FUNCTION("setatPercentEM() calls bat_send() <=== as APPLICATION"); | |
115 | |
116 memset(&my_bat_set_percent_em, 0, sizeof(my_bat_set_percent_em)); | |
117 cmd.ctrl_params = BAT_CMD_SET_PERCENT_EM; | |
118 cmd.params.ptr_set_percent_em = &my_bat_set_percent_em; | |
119 | |
120 my_bat_set_percent_em.mode = mode; | |
121 my_bat_set_percent_em.sin_type = type; | |
122 my_bat_set_percent_em.pco_type = type; | |
123 | |
124 bat_send(ati_bat_get_client(srcId), &cmd); | |
125 | |
126 return ATI_EXCT; /* executing, because response is passed by callback function */ | |
127 } | |
128 | |
129 #else /* OLD FUNCTION BODY */ | |
130 | |
131 TRACE_FUNCTION("setatPercentEM()"); | |
132 | |
133 ret = sAT_PercentEM((T_ACI_CMD_SRC)srcId, mode, type); | |
134 | |
135 switch(ret) | |
136 { | |
137 case AT_CMPL: | |
138 break; | |
139 | |
140 case AT_EXCT: | |
141 src_params->curAtCmd = AT_CMD_EM; | |
142 break; | |
143 | |
144 case AT_FAIL: | |
145 cmdCmeError(CME_ERR_Unknown); | |
146 break; | |
147 | |
148 default: | |
149 cmdCmeError(CME_ERR_Unknown); | |
150 break; | |
151 } /* switch */ | |
152 return (map_aci_2_ati_rslt(ret)); | |
153 | |
154 #endif /* no FF_ATI_BAT*/ | |
155 } | |
156 | |
157 /* | |
158 +------------------------------------------------------------------------------ | |
159 | Function : setatPercentEMET | |
160 +------------------------------------------------------------------------------ | |
161 | Description : AT-cmd for the EM event traces | |
162 | | |
163 | | |
164 | Parameters : char *cl | |
165 | UBYTE srcId | |
166 | | |
167 | Return : char * | |
168 +------------------------------------------------------------------------------ | |
169 */ | |
170 GLOBAL T_ATI_RSLT setatPercentEMET (char *cl, UBYTE srcId) | |
171 { | |
172 T_ACI_RETURN ret = AT_EXCT; | |
173 SHORT type = ACI_NumParmNotPresent; | |
174 T_ATI_SRC_PARAMS *src_params = find_element (ati_src_list, srcId, search_ati_src_id); | |
175 | |
176 | |
177 TRACE_FUNCTION("setatPercentEMET()"); | |
178 | |
179 cl = parse (cl, "d", &type); | |
180 | |
181 /* if type is not in range then error*/ | |
182 if ((type < EMET_L1) OR (type > EMET_ALL)) | |
183 { | |
184 cmdCmeError (CME_ERR_OpNotSupp); | |
185 return ATI_FAIL; | |
186 } | |
187 | |
188 srcId_cb = srcId; | |
189 | |
190 ret = sAT_PercentEMET((T_ACI_CMD_SRC)srcId, (UBYTE)type); | |
191 | |
192 switch(ret) | |
193 { | |
194 case AT_CMPL: | |
195 break; | |
196 | |
197 case AT_EXCT: | |
198 src_params->curAtCmd = AT_CMD_EMET; | |
199 break; | |
200 | |
201 case AT_FAIL: | |
202 cmdCmeError(CME_ERR_Unknown); | |
203 break; | |
204 | |
205 default: | |
206 cmdCmeError(CME_ERR_Unknown); | |
207 break; | |
208 } /* switch */ | |
209 return (map_aci_2_ati_rslt(ret)); | |
210 } /* setatPercentEMET */ | |
211 | |
212 /* | |
213 +------------------------------------------------------------------------------ | |
214 | Function : setatPercentEMETS | |
215 +------------------------------------------------------------------------------ | |
216 | Description : AT-cmd for the EM event traces | |
217 | | |
218 | | |
219 | Parameters : char *cl | |
220 | UBYTE srcId | |
221 | | |
222 | Return : char * | |
223 +------------------------------------------------------------------------------ | |
224 */ | |
225 GLOBAL T_ATI_RSLT setatPercentEMETS (char *cl, UBYTE srcId) | |
226 { | |
227 T_ACI_RETURN ret = AT_EXCT; | |
228 SHORT subclass = ACI_NumParmNotPresent; | |
229 ULONG bitm_h = (ULONG)ACI_NumParmNotPresent; | |
230 ULONG bitm_l = (ULONG)ACI_NumParmNotPresent; | |
231 T_ATI_SRC_PARAMS *src_params = find_element (ati_src_list, srcId, search_ati_src_id); | |
232 | |
233 TRACE_FUNCTION("setatPercentEMETS()"); | |
234 | |
235 cl = parse (cl, "dyy", &subclass, &bitm_h, &bitm_l); | |
236 | |
237 if ( (subclass < EM_L1) OR (subclass > EM_SIM) ) | |
238 { | |
239 cmdCmeError (CME_ERR_OpNotSupp); | |
240 return ATI_FAIL; | |
241 } | |
242 | |
243 srcId_cb = srcId; | |
244 | |
245 ret = sAT_PercentEMETS((T_ACI_CMD_SRC)srcId, (UBYTE)subclass, bitm_h, bitm_l); | |
246 | |
247 switch(ret) | |
248 { | |
249 case AT_CMPL: | |
250 break; | |
251 | |
252 case AT_EXCT: | |
253 src_params->curAtCmd = AT_CMD_EMETS; | |
254 break; | |
255 | |
256 case AT_FAIL: | |
257 cmdCmeError(CME_ERR_Unknown); | |
258 break; | |
259 | |
260 default: | |
261 cmdCmeError(CME_ERR_Unknown); | |
262 break; | |
263 } /* switch */ | |
264 return (map_aci_2_ati_rslt(ret)); | |
265 } /* setatPercentEMETS */ | |
266 | |
267 | |
268 | |
269 /*+++++++++++++++++++++++++++++++++++++++++ E O F +++++++++++++++++++++++++++++++++++++++++*/ | |
270 |