comparison g23m/condat/ms/src/aci/aci_bat_csc.c @ 0:509db1a7b7b8

initial import: leo2moko-r1
author Space Falcon <falcon@ivan.Harhan.ORG>
date Mon, 01 Jun 2015 03:24:05 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:509db1a7b7b8
1 /*
2 +-----------------------------------------------------------------------------
3 | Project : GSM-F&D (8411)
4 | Modul : ACI_BAT
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 BAT wrapper modul is ...
18 |
19 +-----------------------------------------------------------------------------
20 */
21
22 #include "aci_all.h" /* includes prim.h, which includes p_bat.h */
23 #include "aci_cmh.h" /* prototypes of sAT_,qAT_,tAT_ */
24 #include "aci_cmd.h"
25 #include "aci_lst.h"
26 #include "ati_int.h"
27 #include "aci_bat_cmh.h" /* prototypes of sBAT_,qBAT_,tBAT_ */
28 #include "aci_bat.h"
29
30
31 /*
32 +--------------------------------------------------------------------+
33 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
34 | STATE : code ROUTINE : sBAT_PercentBAND |
35 +--------------------------------------------------------------------+
36
37 PURPOSE :
38 */
39 GLOBAL T_ACI_BAT_RSLT sBAT_PercentBAND(T_ACI_DTI_PRC_PSI *src_infos_psi,
40 T_BAT_cmd_send *cmd)
41 {
42 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
43 T_BAT_cmd_set_percent_band *band = cmd->params.ptr_set_percent_band;
44 U8 bandType;
45
46 TRACE_FUNCTION ("sBAT_PercentBAND()");
47
48 #if 0
49 if (band->band NEQ BAT_P_BAND_BAND_NOT_PRESENT)
50 {
51 ret = sAT_PercentBAND(src_infos_psi->srcId, band->mode, (U8)band->band);
52 }
53 #else
54 switch (band->band)
55 {
56 case BAT_P_BAND_BAND_900:
57 bandType = 1;
58 break;
59 case BAT_P_BAND_BAND_1800:
60 bandType = 2;
61 break;
62 case BAT_P_BAND_BAND_1900:
63 bandType = 4;
64 break;
65 case BAT_P_BAND_BAND_E_GSM:
66 bandType = 8;
67 break;
68 case BAT_P_BAND_BAND_850:
69 bandType = 16;
70 break;
71 default:
72 return ret;
73 }
74 ret = sAT_PercentBAND(src_infos_psi->srcId, band->mode, bandType);
75 #endif
76
77 return ret;
78 }
79
80 /*
81 +--------------------------------------------------------------------+
82 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
83 | STATE : code ROUTINE : tBAT_PercentBAND |
84 +--------------------------------------------------------------------+
85
86 PURPOSE :
87 */
88 GLOBAL T_ACI_BAT_RSLT tBAT_PercentBAND(T_ACI_DTI_PRC_PSI *src_infos_psi,
89 T_BAT_cmd_send *cmd)
90 {
91 TRACE_FUNCTION ("tBAT_PercentBAND()");
92 return (ACI_BAT_FAIL);
93 }
94
95 /*
96 +--------------------------------------------------------------------+
97 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
98 | STATE : code ROUTINE : qBAT_PercentBAND |
99 +--------------------------------------------------------------------+
100
101 PURPOSE :
102 */
103 GLOBAL T_ACI_BAT_RSLT qBAT_PercentBAND(T_ACI_DTI_PRC_PSI *src_infos_psi,
104 T_BAT_cmd_send *cmd)
105 {
106 T_ACI_BAT_RSLT ret;
107 T_BAT_cmd_response resp;
108 T_BAT_res_que_percent_band band;
109
110 TRACE_FUNCTION ("qBAT_PercentBAND()");
111
112 resp.ctrl_response = BAT_RES_QUE_PERCENT_BAND;
113 resp.response.ptr_que_percent_band = &band;
114
115 ret = qAT_PercentBAND(src_infos_psi->srcId,(T_ACI_BAND_MODE*)&band.mode, (U8*)&band.band);
116
117 aci_bat_send(src_infos_psi, &resp);
118 return (ret);
119 }
120
121 /*
122 +--------------------------------------------------------------------+
123 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
124 | STATE : code ROUTINE : qBAT_PercentCPI |
125 +--------------------------------------------------------------------+
126
127 PURPOSE :
128 */
129 GLOBAL T_ACI_BAT_RSLT qBAT_PercentCPI(T_ACI_DTI_PRC_PSI *src_infos_psi,
130 T_BAT_cmd_send *cmd)
131 {
132 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
133 T_BAT_cmd_response resp;
134 //T_BAT_res_que_percent_cpi cpi;
135
136 TRACE_FUNCTION ("qBAT_PercentCPI()");
137
138 //resp.ctrl_response = BAT_RES_QUE_PERCENT_CPI;
139 /* hmm, do not know which ACI function to call ! */
140 aci_bat_send(src_infos_psi, &resp);
141 return (ret);
142 }
143
144 /*
145 +--------------------------------------------------------------------+
146 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
147 | STATE : code ROUTINE : qBAT_PercentCNAP |
148 +--------------------------------------------------------------------+
149
150 PURPOSE :
151 */
152 GLOBAL T_ACI_BAT_RSLT qBAT_PercentCNAP(T_ACI_DTI_PRC_PSI *src_infos_psi,
153 T_BAT_cmd_send *cmd)
154 {
155 T_ACI_BAT_RSLT ret;
156 T_BAT_cmd_response resp;
157 T_BAT_res_que_percent_cnap cnap;
158
159 TRACE_FUNCTION ("qBAT_PercentCNAP()");
160
161 resp.ctrl_response = BAT_RES_QUE_PERCENT_CNAP;
162 resp.response.ptr_que_percent_cnap = &cnap;
163
164 ret = qAT_PercentCNAP(src_infos_psi->srcId);
165 aci_bat_send(src_infos_psi, &resp);
166 return (ret);
167 }
168
169 /*
170 +--------------------------------------------------------------------+
171 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
172 | STATE : code ROUTINE : sBAT_PercentALS |
173 +--------------------------------------------------------------------+
174
175 PURPOSE :
176 */
177 GLOBAL T_ACI_BAT_RSLT sBAT_PercentALS(T_ACI_DTI_PRC_PSI *src_infos_psi,
178 T_BAT_cmd_send *cmd)
179 {
180 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
181 T_ACI_ALS_MOD ALSmode;
182
183 TRACE_FUNCTION ("sBAT_PercentALS()");
184
185 #ifndef _SIMULATION_
186 /* mapping for SAP BAT %ALS values according to 8415.052.doc */
187 switch( cmd->params.ptr_set_percent_als->mode )
188 {
189 case BAT_P_ALS_MOD_SPEECH:
190 ALSmode = ALS_MOD_SPEECH;
191 break;
192
193 case BAT_P_ALS_MOD_AUX_SPEECH:
194 ALSmode = ALS_MOD_AUX_SPEECH;
195 break;
196
197 default:
198 cmdCmeError(CME_ERR_OpNotSupp);
199 return (ACI_BAT_FAIL);
200 }
201 #else /* if SIMULATION */
202 ALSmode = cmd->params.ptr_set_percent_als->mode;
203 #endif /* SIMULATION */
204 ret = sAT_PercentALS( src_infos_psi->srcId, ALSmode);
205 return (ret);
206 }
207
208 /*
209 +--------------------------------------------------------------------+
210 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
211 | STATE : code ROUTINE : tBAT_PercentALS |
212 +--------------------------------------------------------------------+
213
214 PURPOSE :
215 */
216 GLOBAL T_ACI_BAT_RSLT tBAT_PercentALS (T_ACI_DTI_PRC_PSI *src_infos_psi,
217 T_BAT_cmd_send *cmd)
218 {
219 TRACE_FUNCTION ("tBAT_PercentALS()");
220 return (ACI_BAT_FAIL);
221 }
222
223 /*
224 +--------------------------------------------------------------------+
225 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
226 | STATE : code ROUTINE : qBAT_PercentALS |
227 +--------------------------------------------------------------------+
228
229 PURPOSE :
230 */
231 GLOBAL T_ACI_BAT_RSLT qBAT_PercentALS(T_ACI_DTI_PRC_PSI *src_infos_psi,
232 T_BAT_cmd_send *cmd)
233 {
234 T_ACI_BAT_RSLT ret;
235 T_BAT_cmd_response resp;
236 T_BAT_res_que_percent_als als;
237 T_ACI_ALS_MOD als_aci_mode;
238
239 TRACE_FUNCTION ("qBAT_PercentALS()");
240
241 resp.ctrl_response = BAT_RES_QUE_PERCENT_ALS;
242 resp.response.ptr_que_percent_als = &als;
243
244 ret = qAT_PercentALS( src_infos_psi->srcId,&als_aci_mode);
245 switch(als_aci_mode)
246 {
247 case ALS_MOD_SPEECH:
248 als.mode = BAT_P_ALS_MOD_SPEECH;
249 break;
250
251 case ALS_MOD_AUX_SPEECH:
252 als.mode = BAT_P_ALS_MOD_AUX_SPEECH;
253 break;
254
255 default:
256 cmdCmeError(CME_ERR_OpNotSupp);
257 return (ACI_BAT_FAIL);
258 }
259 aci_bat_send(src_infos_psi, &resp);
260 return (ret);
261 }
262
263 /*
264 +--------------------------------------------------------------------+
265 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
266 | STATE : code ROUTINE : sBAT_PercentPPP |
267 +--------------------------------------------------------------------+
268
269 PURPOSE :
270 */
271 #if defined(FF_WAP) || defined(FF_TCP_IP) || defined(FF_SAT_E)
272
273 GLOBAL T_ACI_BAT_RSLT sBAT_PercentPPP(T_ACI_DTI_PRC_PSI *src_infos_psi,
274 T_BAT_cmd_send *cmd)
275 {
276 T_ACI_BAT_RSLT ret;
277
278 TRACE_FUNCTION ("sBAT_PercentPPP()");
279
280 ret = sAT_PercentPPP(src_infos_psi->srcId,
281 cmd->params.ptr_set_percent_ppp->authprot,
282 cmd->params.ptr_set_percent_ppp->user,
283 cmd->params.ptr_set_percent_ppp->password,
284 cmd->params.ptr_set_percent_ppp->conn_type);
285
286 return (ret);
287 }
288
289 /*
290 +--------------------------------------------------------------------+
291 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
292 | STATE : code ROUTINE : qBAT_PercentPPP |
293 +--------------------------------------------------------------------+
294
295 PURPOSE :
296 */
297
298 GLOBAL T_ACI_BAT_RSLT qBAT_PercentPPP(T_ACI_DTI_PRC_PSI *src_infos_psi,
299 T_BAT_cmd_send *cmd)
300 {
301 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
302 T_BAT_cmd_response resp;
303 T_BAT_res_que_percent_ppp ppp;
304
305 TRACE_FUNCTION ("qBAT_PercentPPP()");
306
307 resp.ctrl_response = BAT_RES_QUE_PERCENT_PPP;
308 resp.response.ptr_que_percent_ppp = &ppp;
309
310 qAT_PercentPPP(src_infos_psi->srcId, (ULONG*)&ppp.ipaddr, (ULONG*)&ppp.dns1,(ULONG*)&ppp.dns2);
311 aci_bat_send(src_infos_psi, &resp);
312 return (ret);
313 }
314 #endif /* defined(FF_WAP) || defined(FF_TCP_IP) || defined(FF_SAT_E) */
315