FreeCalypso > hg > freecalypso-citrine
comparison g23m-aci/aci/ati_em_ret.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 data preparation for the at-cmd output. | |
18 +----------------------------------------------------------------------------- | |
19 */ | |
20 | |
21 #ifndef ATI_EM_RET_C | |
22 #define ATI_EM_RET_C | |
23 #endif | |
24 | |
25 #include "config.h" | |
26 #include "fixedconf.h" | |
27 #include "condat-features.h" | |
28 #include "aci_conf.h" | |
29 | |
30 #include "aci_all.h" | |
31 /*===== INCLUDES ===================================================*/ | |
32 #include "aci_cmh.h" | |
33 #include "ati_cmd.h" | |
34 #include "aci_mem.h" | |
35 #include "aci_io.h" | |
36 #include "aci_cmd.h" | |
37 #include "ati_cmd.h" | |
38 | |
39 #include "aci.h" | |
40 #include "psa.h" | |
41 | |
42 #ifdef GPRS | |
43 #include "gprs.h" | |
44 #endif | |
45 | |
46 #if (defined(FAX_AND_DATA) || defined(UART) || defined(GPRS)) | |
47 #include "dti.h" | |
48 #include "dti_conn_mng.h" | |
49 #endif | |
50 | |
51 #include "cmh.h" | |
52 #include "cmh_snd.h" | |
53 #include "aci_em.h" | |
54 #include "cmh_em.h" | |
55 #ifdef GPRS | |
56 #include "gaci.h" | |
57 #include "gaci_cmh.h" | |
58 #include "cmh_sm.h" | |
59 #endif | |
60 | |
61 #include "aci_lst.h" | |
62 #include "ati_int.h" | |
63 | |
64 /*==== CONSTANTS ==================================================*/ | |
65 | |
66 /*==== TYPES ======================================================*/ | |
67 | |
68 /*==== EXPORT =====================================================*/ | |
69 EXTERN void em_aci_sem (UBYTE entity, UBYTE *buffer, UBYTE buf_index_tmp); | |
70 | |
71 EXTERN SHORT em_relcs; | |
72 | |
73 #if !defined (WIN32) | |
74 EXTERN CHAR* l1_version(void); | |
75 EXTERN CHAR* dl_version(void); | |
76 EXTERN CHAR* rr_version(void); | |
77 EXTERN CHAR* mm_version(void); | |
78 EXTERN CHAR* cc_version(void); | |
79 EXTERN CHAR* ss_version(void); | |
80 EXTERN CHAR* sim_version(void); | |
81 EXTERN CHAR* sms_version(void); | |
82 //EXTERN CHAR* aci_version(void); | |
83 #endif | |
84 | |
85 /*==== VARIABLES ==================================================*/ | |
86 | |
87 /*==== FUNCTIONS ==================================================*/ | |
88 | |
89 /* | |
90 +--------------------------------------------------------------------+ | |
91 | PROJECT : GSM-F&D (8411) MODULE : ACI_RET | | |
92 | STATE : code ROUTINE : rCI_OK | | |
93 +--------------------------------------------------------------------+ | |
94 | |
95 PURPOSE : handles AT_OK call back | |
96 | |
97 */ | |
98 | |
99 GLOBAL void rCI_PercentEM ( T_EM_VAL * val_tmp ) | |
100 { | |
101 char *me="%EM: "; | |
102 char *ver="%VER: "; | |
103 | |
104 int i=0, j=0; | |
105 UBYTE srcId = srcId_cb; | |
106 #ifdef GPRS | |
107 T_PDP_CONTEXT_INTERNAL *p_pdp_context_node = NULL; | |
108 UBYTE c_state,cid; | |
109 #endif | |
110 | |
111 TRACE_FUNCTION("rCI_PercentEM ()"); | |
112 | |
113 switch(val_tmp->em_utype) | |
114 { | |
115 case EM_SUBCLASS_SC: | |
116 sprintf(g_sa, "%s%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", | |
117 me, | |
118 val_tmp->em_u.em_sc_val.arfcn, val_tmp->em_u.em_sc_val.c1, | |
119 val_tmp->em_u.em_sc_val.c2, val_tmp->em_u.em_sc_val.rxlev, | |
120 val_tmp->em_u.em_sc_val.bsic, val_tmp->em_u.em_sc_val.cell_id, | |
121 val_tmp->em_u.em_sc_val.dsc, | |
122 val_tmp->em_u.em_sc_val.txlev, val_tmp->em_u.em_sc_val.tn, | |
123 val_tmp->em_u.em_sc_val.rlt, val_tmp->em_u.em_sc_val.tav, | |
124 val_tmp->em_u.em_sc_val.rxlev_f, val_tmp->em_u.em_sc_val.rxlev_s, | |
125 val_tmp->em_u.em_sc_val.rxqual_f, val_tmp->em_u.em_sc_val.rxqual_s, | |
126 val_tmp->em_u.em_sc_val.lac, val_tmp->em_u.em_sc_val.cba, | |
127 val_tmp->em_u.em_sc_val.cbq, val_tmp->em_u.em_sc_val.cell_type_ind, | |
128 val_tmp->em_u.em_sc_val.vocoder); | |
129 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
130 break; | |
131 #ifdef GPRS | |
132 case EM_SUBCLASS_SC_GPRS: | |
133 sprintf(g_sa, "%s%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", | |
134 me, | |
135 val_tmp->em_u.em_sc_gprs_val.tn, val_tmp->em_u.em_sc_gprs_val.nmo, | |
136 val_tmp->em_u.em_sc_gprs_val.net_ctrl.spgc_ccch_sup, | |
137 val_tmp->em_u.em_sc_gprs_val.net_ctrl.priority_access_thr, | |
138 val_tmp->em_u.em_sc_gprs_val.cba, val_tmp->em_u.em_sc_gprs_val.rac, | |
139 val_tmp->em_u.em_sc_gprs_val.tav, val_tmp->em_u.em_sc_gprs_val.dsc, | |
140 val_tmp->em_u.em_sc_gprs_val.c31, val_tmp->em_u.em_sc_gprs_val.c32, | |
141 val_tmp->em_u.em_sc_gprs_val.nco); | |
142 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
143 break; | |
144 #endif /* GPRS */ | |
145 case EM_SUBCLASS_NC: | |
146 sprintf(g_sa, "%s%d", me, val_tmp->em_u.em_nc_val.no_ncells); | |
147 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
148 | |
149 sprintf(g_sa, "%d,%d,%d,%d,%d,%d", | |
150 val_tmp->em_u.em_nc_val.arfcn_nc[0], val_tmp->em_u.em_nc_val.arfcn_nc[1], | |
151 val_tmp->em_u.em_nc_val.arfcn_nc[2], val_tmp->em_u.em_nc_val.arfcn_nc[3], | |
152 val_tmp->em_u.em_nc_val.arfcn_nc[4], val_tmp->em_u.em_nc_val.arfcn_nc[5]); | |
153 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
154 | |
155 sprintf(g_sa, "%d,%d,%d,%d,%d,%d", | |
156 val_tmp->em_u.em_nc_val.c1_nc[0], val_tmp->em_u.em_nc_val.c1_nc[1], | |
157 val_tmp->em_u.em_nc_val.c1_nc[2], val_tmp->em_u.em_nc_val.c1_nc[3], | |
158 val_tmp->em_u.em_nc_val.c1_nc[4], val_tmp->em_u.em_nc_val.c1_nc[5]); | |
159 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
160 | |
161 sprintf(g_sa, "%d,%d,%d,%d,%d,%d", | |
162 val_tmp->em_u.em_nc_val.c2_nc[0], val_tmp->em_u.em_nc_val.c2_nc[1], | |
163 val_tmp->em_u.em_nc_val.c2_nc[2], val_tmp->em_u.em_nc_val.c2_nc[3], | |
164 val_tmp->em_u.em_nc_val.c2_nc[4], val_tmp->em_u.em_nc_val.c2_nc[5]); | |
165 io_sendMessage(srcId, g_sa,ATI_NORMAL_OUTPUT); | |
166 | |
167 sprintf(g_sa,"%d,%d,%d,%d,%d,%d", | |
168 val_tmp->em_u.em_nc_val.rxlev_nc[0], val_tmp->em_u.em_nc_val.rxlev_nc[1], | |
169 val_tmp->em_u.em_nc_val.rxlev_nc[2], val_tmp->em_u.em_nc_val.rxlev_nc[3], | |
170 val_tmp->em_u.em_nc_val.rxlev_nc[4], val_tmp->em_u.em_nc_val.rxlev_nc[5]); | |
171 io_sendMessage(srcId, g_sa,ATI_NORMAL_OUTPUT); | |
172 | |
173 sprintf(g_sa,"%d,%d,%d,%d,%d,%d", | |
174 val_tmp->em_u.em_nc_val.bsic_nc[0], val_tmp->em_u.em_nc_val.bsic_nc[1], | |
175 val_tmp->em_u.em_nc_val.bsic_nc[2], val_tmp->em_u.em_nc_val.bsic_nc[3], | |
176 val_tmp->em_u.em_nc_val.bsic_nc[4], val_tmp->em_u.em_nc_val.bsic_nc[5]); | |
177 io_sendMessage(srcId, g_sa,ATI_NORMAL_OUTPUT); | |
178 | |
179 sprintf(g_sa,"%d,%d,%d,%d,%d,%d", | |
180 val_tmp->em_u.em_nc_val.cell_id_nc[0], val_tmp->em_u.em_nc_val.cell_id_nc[1], | |
181 val_tmp->em_u.em_nc_val.cell_id_nc[2], val_tmp->em_u.em_nc_val.cell_id_nc[3], | |
182 val_tmp->em_u.em_nc_val.cell_id_nc[4], val_tmp->em_u.em_nc_val.cell_id_nc[5]); | |
183 io_sendMessage(srcId, g_sa,ATI_NORMAL_OUTPUT); | |
184 | |
185 sprintf(g_sa,"%d,%d,%d,%d,%d,%d", | |
186 val_tmp->em_u.em_nc_val.lac_nc[0], val_tmp->em_u.em_nc_val.lac_nc[1], | |
187 val_tmp->em_u.em_nc_val.lac_nc[2], val_tmp->em_u.em_nc_val.lac_nc[3], | |
188 val_tmp->em_u.em_nc_val.lac_nc[4], val_tmp->em_u.em_nc_val.lac_nc[5]); | |
189 io_sendMessage(srcId, g_sa,ATI_NORMAL_OUTPUT); | |
190 | |
191 sprintf(g_sa,"%d,%d,%d,%d,%d,%d", | |
192 val_tmp->em_u.em_nc_val.frame_offset[0], val_tmp->em_u.em_nc_val.frame_offset[1], | |
193 val_tmp->em_u.em_nc_val.frame_offset[2], val_tmp->em_u.em_nc_val.frame_offset[3], | |
194 val_tmp->em_u.em_nc_val.frame_offset[4], val_tmp->em_u.em_nc_val.frame_offset[5]); | |
195 io_sendMessage(srcId, g_sa,ATI_NORMAL_OUTPUT); | |
196 | |
197 sprintf(g_sa,"%ld,%ld,%ld,%ld,%ld,%ld", | |
198 val_tmp->em_u.em_nc_val.time_alignmt[0], val_tmp->em_u.em_nc_val.time_alignmt[1], | |
199 val_tmp->em_u.em_nc_val.time_alignmt[2], val_tmp->em_u.em_nc_val.time_alignmt[3], | |
200 val_tmp->em_u.em_nc_val.time_alignmt[4], val_tmp->em_u.em_nc_val.time_alignmt[5]); | |
201 io_sendMessage(srcId, g_sa,ATI_NORMAL_OUTPUT); | |
202 | |
203 sprintf(g_sa,"%ld,%ld,%ld,%ld,%ld,%ld", | |
204 val_tmp->em_u.em_nc_val.cba_nc[0], val_tmp->em_u.em_nc_val.cba_nc[1], | |
205 val_tmp->em_u.em_nc_val.cba_nc[2], val_tmp->em_u.em_nc_val.cba_nc[3], | |
206 val_tmp->em_u.em_nc_val.cba_nc[4], val_tmp->em_u.em_nc_val.cba_nc[5]); | |
207 io_sendMessage(srcId, g_sa,ATI_NORMAL_OUTPUT); | |
208 | |
209 sprintf(g_sa,"%d,%d,%d,%d,%d,%d", | |
210 val_tmp->em_u.em_nc_val.cbq_nc[0], val_tmp->em_u.em_nc_val.cbq_nc[1], | |
211 val_tmp->em_u.em_nc_val.cbq_nc[2], val_tmp->em_u.em_nc_val.cbq_nc[3], | |
212 val_tmp->em_u.em_nc_val.cbq_nc[4], val_tmp->em_u.em_nc_val.cbq_nc[5]); | |
213 io_sendMessage(srcId, g_sa,ATI_NORMAL_OUTPUT); | |
214 | |
215 sprintf(g_sa,"%d,%d,%d,%d,%d,%d", | |
216 val_tmp->em_u.em_nc_val.cell_type_ind[0], val_tmp->em_u.em_nc_val.cell_type_ind[1], | |
217 val_tmp->em_u.em_nc_val.cell_type_ind[2], val_tmp->em_u.em_nc_val.cell_type_ind[3], | |
218 val_tmp->em_u.em_nc_val.cell_type_ind[4], val_tmp->em_u.em_nc_val.cell_type_ind[5]); | |
219 io_sendMessage(srcId, g_sa,ATI_NORMAL_OUTPUT); | |
220 | |
221 sprintf(g_sa,"%d,%d,%d,%d,%d,%d", | |
222 val_tmp->em_u.em_nc_val.rac[0], val_tmp->em_u.em_nc_val.rac[1], | |
223 val_tmp->em_u.em_nc_val.rac[2], val_tmp->em_u.em_nc_val.rac[3], | |
224 val_tmp->em_u.em_nc_val.rac[4], val_tmp->em_u.em_nc_val.rac[5]); | |
225 io_sendMessage(srcId, g_sa,ATI_NORMAL_OUTPUT); | |
226 | |
227 sprintf(g_sa,"%d,%d,%d,%d,%d,%d", | |
228 val_tmp->em_u.em_nc_val.cell_resel_offset[0], val_tmp->em_u.em_nc_val.cell_resel_offset[1], | |
229 val_tmp->em_u.em_nc_val.cell_resel_offset[2], val_tmp->em_u.em_nc_val.cell_resel_offset[3], | |
230 val_tmp->em_u.em_nc_val.cell_resel_offset[4], val_tmp->em_u.em_nc_val.cell_resel_offset[5]); | |
231 io_sendMessage(srcId, g_sa,ATI_NORMAL_OUTPUT); | |
232 | |
233 sprintf(g_sa,"%d,%d,%d,%d,%d,%d", | |
234 val_tmp->em_u.em_nc_val.temp_offset[0], val_tmp->em_u.em_nc_val.temp_offset[1], | |
235 val_tmp->em_u.em_nc_val.temp_offset[2], val_tmp->em_u.em_nc_val.temp_offset[3], | |
236 val_tmp->em_u.em_nc_val.temp_offset[4], val_tmp->em_u.em_nc_val.temp_offset[5]); | |
237 io_sendMessage(srcId, g_sa,ATI_NORMAL_OUTPUT); | |
238 | |
239 sprintf(g_sa,"%d,%d,%d,%d,%d,%d", | |
240 val_tmp->em_u.em_nc_val.rxlev_acc_min[0], val_tmp->em_u.em_nc_val.rxlev_acc_min[1], | |
241 val_tmp->em_u.em_nc_val.rxlev_acc_min[2], val_tmp->em_u.em_nc_val.rxlev_acc_min[3], | |
242 val_tmp->em_u.em_nc_val.rxlev_acc_min[4], val_tmp->em_u.em_nc_val.rxlev_acc_min[5]); | |
243 io_sendMessage(srcId, g_sa,ATI_NORMAL_OUTPUT); | |
244 break; | |
245 case EM_SUBCLASS_LOC_PAG: | |
246 sprintf(g_sa,"%s%d,%d,%d%d%d,%d%d%d,%ld", | |
247 me, | |
248 val_tmp->em_u.em_loc_val.bs_pa_mfrms, val_tmp->em_u.em_loc_val.t3212, | |
249 val_tmp->em_u.em_loc_val.mcc[0], val_tmp->em_u.em_loc_val.mcc[1], val_tmp->em_u.em_loc_val.mcc[2], | |
250 val_tmp->em_u.em_loc_val.mnc[0], val_tmp->em_u.em_loc_val.mnc[1], val_tmp->em_u.em_loc_val.mnc[2], | |
251 val_tmp->em_u.em_loc_val.tmsi); | |
252 io_sendMessage(srcId, g_sa,ATI_NORMAL_OUTPUT); | |
253 break; | |
254 case EM_SUBCLASS_PLMN: | |
255 sprintf(g_sa,"%s%d,%d,%d,%d,%d", | |
256 me, | |
257 val_tmp->em_u.em_plmn_val.no_creq_max, val_tmp->em_u.em_plmn_val.reest_flag, | |
258 val_tmp->em_u.em_plmn_val.txpwr_max, val_tmp->em_u.em_plmn_val.rxlev_min, | |
259 em_relcs); | |
260 io_sendMessage(srcId, g_sa,ATI_NORMAL_OUTPUT); | |
261 break; | |
262 case EM_SUBCLASS_CIPH_HOP_DTX: | |
263 sprintf(g_sa,"%s%d,%d,%d,%d,%d,%d", | |
264 me, | |
265 val_tmp->em_u.em_cip_val.ciph_stat, | |
266 val_tmp->em_u.em_cip_val.hop, | |
267 val_tmp->em_u.em_cip_val.arfcn, | |
268 val_tmp->em_u.em_cip_val.hsn, | |
269 val_tmp->em_u.em_cip_val.dtx_stat, | |
270 val_tmp->em_u.em_cip_val.v_start); | |
271 io_sendMessage(srcId, g_sa,ATI_NORMAL_OUTPUT); | |
272 | |
273 if(val_tmp->em_u.em_cip_val.hop) | |
274 { | |
275 sprintf(g_sa,"%d,%d", | |
276 val_tmp->em_u.em_cip_val.hop_chn.maio, | |
277 val_tmp->em_u.em_cip_val.hop_chn.nr_arfcns); | |
278 io_sendMessage(srcId, g_sa,ATI_NORMAL_OUTPUT); | |
279 | |
280 i=0; | |
281 j=0; | |
282 /* The while loop exits when the content of ma[] equals 0xFFFF and the index exceeds the value 63 */ | |
283 while(val_tmp->em_u.em_cip_val.hop_chn.ma[j] NEQ NOT_PRESENT_16BIT AND j<EM_MAX_MA_CHANNELS) | |
284 { | |
285 i+=sprintf(g_sa+i, "%d,", val_tmp->em_u.em_cip_val.hop_chn.ma[j++]); | |
286 if (i>(int)sizeof(g_sa)-20) /* Check if we reach the buffer limit */ | |
287 { | |
288 io_sendMessage(srcId, g_sa,ATI_ECHO_OUTPUT); /* and send the data in chunks w/o CRLF */ | |
289 i=0; | |
290 g_sa[0]='\0'; | |
291 } | |
292 } | |
293 if(i>0) | |
294 { | |
295 g_sa[i-1]='\0'; | |
296 io_sendMessage(srcId, g_sa,ATI_NORMAL_OUTPUT); | |
297 } | |
298 | |
299 if(val_tmp->em_u.em_cip_val.v_start) | |
300 { | |
301 sprintf(g_sa,"%d,%d", | |
302 val_tmp->em_u.em_cip_val.hop_chn2.maio, | |
303 val_tmp->em_u.em_cip_val.hop_chn2.nr_arfcns); | |
304 io_sendMessage(srcId, g_sa,ATI_NORMAL_OUTPUT); | |
305 | |
306 i=0; | |
307 j=0; | |
308 /* The while loop exits when the content of ma[] equals 0xFFFF and the index exceeds the value 63 */ | |
309 while(val_tmp->em_u.em_cip_val.hop_chn2.ma[j] NEQ NOT_PRESENT_16BIT AND j<EM_MAX_MA_CHANNELS) | |
310 { | |
311 i+=sprintf(g_sa+i, "%d,", val_tmp->em_u.em_cip_val.hop_chn2.ma[j++]); | |
312 if (i>(int)sizeof(g_sa)-20) | |
313 { | |
314 io_sendMessage(srcId, g_sa,ATI_ECHO_OUTPUT); | |
315 i=0; | |
316 g_sa[0]='\0'; | |
317 } | |
318 } | |
319 if(i>0) | |
320 { | |
321 g_sa[i-1]='\0'; | |
322 io_sendMessage(srcId, g_sa,ATI_NORMAL_OUTPUT); | |
323 } | |
324 } | |
325 } /* hopping is configured */ | |
326 | |
327 break; | |
328 case EM_SUBCLASS_POWER: | |
329 sprintf(g_sa,"%s%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", | |
330 me, | |
331 val_tmp->em_u.em_power_val.classm2.rev_lev, val_tmp->em_u.em_power_val.classm2.es_ind, | |
332 val_tmp->em_u.em_power_val.classm2.a5_1, val_tmp->em_u.em_power_val.classm2.rf_pow_cap, | |
333 val_tmp->em_u.em_power_val.classm2.ps_cap, val_tmp->em_u.em_power_val.classm2.ss_screen, | |
334 val_tmp->em_u.em_power_val.classm2.sm_cap, val_tmp->em_u.em_power_val.classm2.freq_cap, | |
335 val_tmp->em_u.em_power_val.classm2.class_3, val_tmp->em_u.em_power_val.classm2.cmsp, | |
336 val_tmp->em_u.em_power_val.classm2.a5_3, val_tmp->em_u.em_power_val.classm2.a5_2); | |
337 io_sendMessage(srcId, g_sa,ATI_NORMAL_OUTPUT); | |
338 | |
339 sprintf(g_sa,"%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", | |
340 val_tmp->em_u.em_power_val.classm3.mb_sub, val_tmp->em_u.em_power_val.classm3.a5_7, | |
341 val_tmp->em_u.em_power_val.classm3.a5_6, val_tmp->em_u.em_power_val.classm3.a5_5, | |
342 val_tmp->em_u.em_power_val.classm3.a5_4, val_tmp->em_u.em_power_val.classm3.v_radio_cap_2, | |
343 val_tmp->em_u.em_power_val.classm3.radio_cap_2, val_tmp->em_u.em_power_val.classm3.v_radio_cap_1, | |
344 val_tmp->em_u.em_power_val.classm3.radio_cap_1, val_tmp->em_u.em_power_val.classm3.v_r_support, | |
345 val_tmp->em_u.em_power_val.classm3.r_support, val_tmp->em_u.em_power_val.classm3.v_m_s_class, | |
346 val_tmp->em_u.em_power_val.classm3.m_s_class, val_tmp->em_u.em_power_val.classm3.ucs2_treat, | |
347 val_tmp->em_u.em_power_val.classm3.ext_meas_cap, val_tmp->em_u.em_power_val.classm3.v_meas_cap, | |
348 val_tmp->em_u.em_power_val.classm3.meas_cap.sw_time, val_tmp->em_u.em_power_val.classm3.meas_cap.sws_time); | |
349 io_sendMessage(srcId, g_sa,ATI_NORMAL_OUTPUT); | |
350 break; | |
351 case EM_SUBCLASS_ID: | |
352 i=0; | |
353 i=sprintf(g_sa,"%s%d,%d,%d,%d,", | |
354 me, | |
355 val_tmp->em_u.em_id_val.em_imeisv.ident_type, | |
356 val_tmp->em_u.em_id_val.em_imeisv.odd_even, | |
357 val_tmp->em_u.em_id_val.em_imeisv.v_ident_dig, | |
358 val_tmp->em_u.em_id_val.em_imeisv.c_ident_dig); | |
359 for(j=0; j<15; j++) { | |
360 i+=sprintf(g_sa+i,"%d,", val_tmp->em_u.em_id_val.em_imeisv.ident_dig[j]); | |
361 } | |
362 i+=sprintf(g_sa+i,"%d", val_tmp->em_u.em_id_val.em_imeisv.ident_dig[15]); | |
363 io_sendMessage(srcId, g_sa,ATI_NORMAL_OUTPUT); | |
364 | |
365 i=0; | |
366 i=sprintf(g_sa,"%d,%d,%d,%d,", | |
367 val_tmp->em_u.em_id_val.em_imsi.ident_type, | |
368 val_tmp->em_u.em_id_val.em_imsi.odd_even, | |
369 val_tmp->em_u.em_id_val.em_imsi.v_ident_dig, | |
370 val_tmp->em_u.em_id_val.em_imsi.c_ident_dig); | |
371 for(j=0; j<15; j++) { | |
372 i+=sprintf(g_sa+i,"%d,", val_tmp->em_u.em_id_val.em_imsi.ident_dig[j]); | |
373 } | |
374 i+=sprintf(g_sa+i,"%d", val_tmp->em_u.em_id_val.em_imsi.ident_dig[15]); | |
375 io_sendMessage(srcId, g_sa,ATI_NORMAL_OUTPUT); | |
376 | |
377 sprintf(g_sa,"%ld", val_tmp->em_u.em_id_val.tmsi); | |
378 io_sendMessage(srcId, g_sa,ATI_NORMAL_OUTPUT); | |
379 break; | |
380 case EM_SUBCLASS_SW_VERSION: | |
381 #if !defined (WIN32) | |
382 sprintf(g_sa,"%s%s",ver,l1_version()); | |
383 io_sendMessage(srcId, g_sa,ATI_NORMAL_OUTPUT); | |
384 sprintf(g_sa,"%s%s",ver,dl_version()); | |
385 io_sendMessage(srcId, g_sa,ATI_NORMAL_OUTPUT); | |
386 sprintf(g_sa,"%s%s",ver,rr_version()); | |
387 io_sendMessage(srcId, g_sa,ATI_NORMAL_OUTPUT); | |
388 sprintf(g_sa,"%s%s",ver,mm_version()); | |
389 io_sendMessage(srcId, g_sa,ATI_NORMAL_OUTPUT); | |
390 sprintf(g_sa,"%s%s",ver,cc_version()); | |
391 io_sendMessage(srcId, g_sa,ATI_NORMAL_OUTPUT); | |
392 sprintf(g_sa,"%s%s",ver,ss_version()); | |
393 io_sendMessage(srcId, g_sa,ATI_NORMAL_OUTPUT); | |
394 sprintf(g_sa,"%s%s",ver,sim_version()); | |
395 io_sendMessage(srcId, g_sa,ATI_NORMAL_OUTPUT); | |
396 sprintf(g_sa,"%s%s",ver,sms_version()); | |
397 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
398 #else | |
399 sprintf(g_sa,"%s%s",ver,"ALR"); | |
400 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
401 sprintf(g_sa,"%s%s",ver,"DL"); | |
402 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
403 sprintf(g_sa,"%s%s",ver,"RR"); | |
404 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
405 sprintf(g_sa,"%s%s",ver,"MM"); | |
406 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
407 sprintf(g_sa,"%s%s",ver,"CC"); | |
408 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
409 sprintf(g_sa,"%s%s",ver,"SMS"); | |
410 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
411 sprintf(g_sa,"%s%s",ver,"SS"); | |
412 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
413 sprintf(g_sa,"%s%s",ver,"ACI"); | |
414 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
415 #endif /* WIN 32 */ | |
416 break; | |
417 #ifdef GPRS | |
418 case EM_SUBCLASS_GMM: /*SAP needed*/ | |
419 sprintf(g_sa, "%s%d,%u,%u,%u,%u,%d,%d,%d", | |
420 me, | |
421 val_tmp->em_u.em_gmm_val.ready_state, | |
422 val_tmp->em_u.em_gmm_val.tlli, | |
423 val_tmp->em_u.em_gmm_val.ptmsi, | |
424 val_tmp->em_u.em_gmm_val.ptmsi_sig, | |
425 val_tmp->em_u.em_gmm_val.ready_timer, | |
426 val_tmp->em_u.em_gmm_val.ciphering_algorithm, | |
427 val_tmp->em_u.em_gmm_val.t3312.t3312_deactivated, | |
428 val_tmp->em_u.em_gmm_val.t3312.t3312_val); | |
429 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
430 break; | |
431 case EM_SUBCLASS_GRLC: | |
432 sprintf(g_sa, "%s%d,%d,%d,%d,%d,%d,%d,%d,%d", | |
433 me, | |
434 val_tmp->em_u.em_grlc_val.grlc_state, | |
435 val_tmp->em_u.em_grlc_val.tbf_mod, | |
436 val_tmp->em_u.em_grlc_val.ul_tbf_par.tfi, | |
437 val_tmp->em_u.em_grlc_val.ul_tbf_par.mac_mod, | |
438 val_tmp->em_u.em_grlc_val.ul_tbf_par.ul_nb_block, | |
439 val_tmp->em_u.em_grlc_val.ul_tbf_par.cv, | |
440 val_tmp->em_u.em_grlc_val.ul_tbf_par.cs, | |
441 val_tmp->em_u.em_grlc_val.dl_tbf_par.tfi, | |
442 val_tmp->em_u.em_grlc_val.dl_tbf_par.mac_mod); | |
443 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
444 break; | |
445 #endif /*GPRS*/ | |
446 case EM_SUBCLASS_AMR: | |
447 sprintf(g_sa, "%s%d,%d,%d,%d,%d,%d,", | |
448 me, | |
449 val_tmp->em_u.em_amr_val.amr_vocoder, | |
450 val_tmp->em_u.em_amr_val.amr_icmi, | |
451 val_tmp->em_u.em_amr_val.amr_icm, | |
452 val_tmp->em_u.em_amr_val.amr_acs, | |
453 val_tmp->em_u.em_amr_val.amr_first_codec, | |
454 val_tmp->em_u.em_amr_val.amr_nr_modes); | |
455 | |
456 #ifdef _SIMULATION_ | |
457 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); /* Simulation needs CRLF */ | |
458 #else | |
459 io_sendMessage(srcId, g_sa, ATI_ECHO_OUTPUT); /* send without CRLF */ | |
460 #endif | |
461 | |
462 sprintf(g_sa, "%d,%d,%d,%d,%d,%d", | |
463 val_tmp->em_u.em_amr_val.amr_cod_prop[0].amr_codec_thr, val_tmp->em_u.em_amr_val.amr_cod_prop[0].amr_codec_hyst, | |
464 val_tmp->em_u.em_amr_val.amr_cod_prop[1].amr_codec_thr, val_tmp->em_u.em_amr_val.amr_cod_prop[1].amr_codec_hyst, | |
465 val_tmp->em_u.em_amr_val.amr_cod_prop[2].amr_codec_thr, val_tmp->em_u.em_amr_val.amr_cod_prop[2].amr_codec_hyst); | |
466 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
467 break; | |
468 #ifdef GPRS | |
469 case EM_SUBCLASS_PDP: | |
470 sprintf(g_sa, "%s%d", me,MAX_CID); | |
471 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
472 | |
473 for(cid=1;cid<=MAX_PDP_CTXT;cid++) | |
474 { | |
475 c_state = get_state_over_cid( cid ); | |
476 | |
477 p_pdp_context_node = pdp_context_find_node_from_cid( cid ); | |
478 | |
479 if((c_state EQ PDP_CONTEXT_STATE_INVALID) OR (p_pdp_context_node EQ NULL)) | |
480 | |
481 sprintf(g_sa, "%d", c_state); | |
482 else | |
483 { | |
484 if ( p_pdp_context_node->attributes.pdp_addr.ctrl_ip_address EQ NAS_is_ipv4 ) | |
485 { | |
486 sprintf(g_sa, "%d,%s,%s,%s", | |
487 c_state, | |
488 p_pdp_context_node->attributes.pdp_type, | |
489 p_pdp_context_node->attributes.pdp_apn, | |
490 ((c_state EQ PDP_CONTEXT_STATE_INVALID) OR (c_state EQ PDP_CONTEXT_STATE_DATA_LINK)) | |
491 ? p_pdp_context_node->internal_data.pdp_address_allocated.ip_address.ipv4_addr.a4 : | |
492 p_pdp_context_node->attributes.pdp_addr.ip_address.ipv4_addr.a4); | |
493 | |
494 } | |
495 else if ( p_pdp_context_node->attributes.pdp_addr.ctrl_ip_address EQ NAS_is_ipv6 ) | |
496 { | |
497 sprintf(g_sa, "%d,%s,%s,%s", | |
498 c_state, | |
499 p_pdp_context_node->attributes.pdp_type, | |
500 p_pdp_context_node->attributes.pdp_apn, | |
501 ((c_state EQ PDP_CONTEXT_STATE_INVALID) OR (c_state EQ PDP_CONTEXT_STATE_DATA_LINK)) | |
502 ? p_pdp_context_node->internal_data.pdp_address_allocated.ip_address.ipv6_addr.a6 : | |
503 p_pdp_context_node->attributes.pdp_addr.ip_address.ipv6_addr.a6); | |
504 } | |
505 } | |
506 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
507 | |
508 } /* MAX_CID */ | |
509 | |
510 break; | |
511 #endif | |
512 default: | |
513 break; | |
514 } /* switch */ | |
515 } | |
516 | |
517 GLOBAL void rCI_PercentEMET ( /*UBYTE srcId,*/ T_DRV_SIGNAL_EM_EVENT * Signal ) | |
518 { | |
519 int i=0, j=0; | |
520 UBYTE srcId = srcId_cb; | |
521 | |
522 TRACE_FUNCTION("rCI_PercentEMET ()"); | |
523 | |
524 if (Signal->Data.alr.length NEQ 0) | |
525 { | |
526 char *me="%EMET L1: "; | |
527 | |
528 i+=sprintf(g_sa+i, "%s",me); | |
529 for(j=0; j<Signal->Data.alr.length; j++) { | |
530 i+=sprintf(g_sa+i,"%d,", *(Signal->Pointer++)); | |
531 } | |
532 | |
533 i+=sprintf(g_sa+i,"%s", "FF"); | |
534 } | |
535 if (Signal->Data.dl.length NEQ 0) | |
536 { | |
537 char *me="%EMET DL: "; | |
538 | |
539 i+=sprintf(g_sa+i, "%s",me); | |
540 for(j=0; j<Signal->Data.dl.length; j++) { | |
541 i+=sprintf(g_sa+i,"%d,", *(Signal->Pointer++)); | |
542 } | |
543 | |
544 i+=sprintf(g_sa+i,"%s", "FF"); | |
545 } | |
546 if (Signal->Data.rr.length NEQ 0) | |
547 { | |
548 char *me="%EMET RR: "; | |
549 | |
550 i+=sprintf(g_sa+i, "%s",me); | |
551 for(j=0; j<Signal->Data.rr.length; j++) { | |
552 i+=sprintf(g_sa+i,"%d,", *(Signal->Pointer++)); | |
553 } | |
554 | |
555 i+=sprintf(g_sa+i,"%s", "FF"); | |
556 } | |
557 if (Signal->Data.mm.length NEQ 0) | |
558 { | |
559 char *me="%EMET MM: "; | |
560 | |
561 i+=sprintf(g_sa+i, "%s",me); | |
562 for(j=0; j<Signal->Data.mm.length; j++) { | |
563 i+=sprintf(g_sa+i,"%d,", *(Signal->Pointer++)); | |
564 } | |
565 | |
566 i+=sprintf(g_sa+i,"%s", "FF"); | |
567 } | |
568 if (Signal->Data.cc.length NEQ 0) | |
569 { | |
570 char *me="%EMET CC: "; | |
571 | |
572 i+=sprintf(g_sa+i, "%s",me); | |
573 for(j=0; j<Signal->Data.cc.length; j++) { | |
574 i+=sprintf(g_sa+i,"%d,", *(Signal->Pointer++)); | |
575 } | |
576 | |
577 i+=sprintf(g_sa+i,"%s", "FF"); | |
578 } | |
579 if (Signal->Data.ss.length NEQ 0) | |
580 { | |
581 char *me="%EMET SS: "; | |
582 | |
583 i+=sprintf(g_sa+i, "%s",me); | |
584 for(j=0; j<Signal->Data.ss.length; j++) { | |
585 i+=sprintf(g_sa+i,"%d,", *(Signal->Pointer++)); | |
586 } | |
587 | |
588 i+=sprintf(g_sa+i,"%s", "FF"); | |
589 } | |
590 if (Signal->Data.sms.length NEQ 0) | |
591 { | |
592 char *me="%EMET SMS: "; | |
593 | |
594 i+=sprintf(g_sa+i, "%s",me); | |
595 for(j=0; j<Signal->Data.sms.length; j++) { | |
596 i+=sprintf(g_sa+i,"%d,", *(Signal->Pointer++)); | |
597 } | |
598 | |
599 i+=sprintf(g_sa+i,"%s", "FF"); | |
600 } | |
601 if (Signal->Data.sim.length NEQ 0) | |
602 { | |
603 char *me="%EMET SIM: "; | |
604 | |
605 i+=sprintf(g_sa+i, "%s",me); | |
606 for(j=0; j<Signal->Data.sim.length; j++) { | |
607 i+=sprintf(g_sa+i,"%d,", *(Signal->Pointer++)); | |
608 } | |
609 | |
610 i+=sprintf(g_sa+i,"%s", "FF"); | |
611 } | |
612 if (i EQ 0) | |
613 { | |
614 char *me="%EMET END"; | |
615 i=sprintf(g_sa, "%s",me); | |
616 } | |
617 | |
618 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
619 | |
620 } /* rCI_PercentEMET */ | |
621 | |
622 | |
623 GLOBAL void rCI_PercentEMETS ( UBYTE entity ) | |
624 { | |
625 TRACE_FUNCTION("rCI_PercentEMETS ()"); | |
626 } | |
627 | |
628 /*+++++++++++++++++++++++++++++++++++++++++ E O F +++++++++++++++++++++++++++++++++++++++++*/ | |
629 |