comparison g23m/condat/ms/src/aci/cmh_emq.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 :
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 query functions related to the
18 | SAP for engineering mode.
19 +-----------------------------------------------------------------------------
20 */
21
22 #ifndef ACI_EM_C
23 #define ACI_EM_C
24 #endif
25
26 #include "aci_all.h"
27 /*===== INCLUDES ===================================================*/
28 #include "aci_cmh.h"
29 #include "ati_cmd.h"
30 #include "aci_io.h"
31
32 #include "psa.h"
33 #ifdef FAX_AND_DATA
34 #include "aci_fd.h"
35 #endif
36 #include "cmh.h"
37 #include "aci_em.h"
38 #include "cmh_em.h"
39
40
41 /*==== EXPORT =====================================================*/
42 /*
43 EXTERN UBYTE em_subclass_sc (UBYTE em_type);
44 EXTERN UBYTE em_subclass_sc_gprs (UBYTE em_type);
45 EXTERN UBYTE em_subclass_nc (UBYTE em_type);
46 EXTERN UBYTE em_subclass_loc_pag (UBYTE em_type);
47 EXTERN UBYTE em_subclass_plmn (UBYTE em_type);
48 EXTERN UBYTE em_subclass_ciph_hop_dtx (UBYTE em_type);
49 EXTERN UBYTE em_subclass_power (UBYTE em_type);
50 EXTERN UBYTE em_subclass_id (UBYTE em_type);
51 EXTERN UBYTE em_subclass_version (UBYTE em_type); */
52 EXTERN void cmhEM (T_EM_VAL * val_tmp);
53 EXTERN void cmhEMET (T_DRV_SIGNAL_EM_EVENT * Signal);
54
55 /*==== VARIABLES ==================================================*/
56
57 GLOBAL T_EM_SHRD_PRM emPrm;
58 GLOBAL T_EM_SHRD_PRM emetPrm;
59 GLOBAL T_EM_SHRD_PRM emetsPrm;
60
61 /*==== CONSTANTS ==================================================*/
62
63 /*==== FUNCTIONS ==================================================*/
64
65 LOCAL void em_at_cbfkt(T_DRV_SIGNAL_EM * Signal)
66 {
67 T_EM_VAL val_tmp;
68
69 TRACE_FUNCTION ("em_at_cbfkt()");
70
71 memset(&val_tmp, 0x00, sizeof(T_EM_VAL));
72
73 val_tmp.em_utype = Signal->SignalType;
74 switch (Signal->SignalType)
75 {
76 case EM_SUBCLASS_SC:
77 memcpy(&val_tmp.em_u.em_sc_val, &Signal->UserData.sc, sizeof(T_EM_SC_INFO_CNF));
78 break;
79 case EM_SUBCLASS_SC_GPRS:
80 memcpy(&val_tmp.em_u.em_sc_gprs_val, &Signal->UserData.sc_gprs, sizeof(T_EM_SC_GPRS_INFO_CNF));
81 break;
82 case EM_SUBCLASS_NC:
83 memcpy(&val_tmp.em_u.em_nc_val, &Signal->UserData.nc, sizeof(T_EM_NC_INFO_CNF));
84 break;
85 case EM_SUBCLASS_LOC_PAG:
86 memcpy(&val_tmp.em_u.em_loc_val, &Signal->UserData.log_pag, sizeof(T_EM_LOC_PAG_INFO_CNF));
87 break;
88 case EM_SUBCLASS_PLMN:
89 memcpy(&val_tmp.em_u.em_plmn_val, &Signal->UserData.plmn, sizeof(T_EM_PLMN_INFO_CNF));
90 break;
91 case EM_SUBCLASS_CIPH_HOP_DTX:
92 memcpy(&val_tmp.em_u.em_cip_val, &Signal->UserData.cip, sizeof(T_EM_CIP_HOP_DTX_INFO_CNF));
93 break;
94 case EM_SUBCLASS_POWER:
95 memcpy(&val_tmp.em_u.em_power_val, &Signal->UserData.power, sizeof(T_EM_POWER_INFO_CNF));
96 break;
97 case EM_SUBCLASS_ID:
98 memcpy(&val_tmp.em_u.em_id_val, &Signal->UserData.id, sizeof(T_EM_IDENTITY_INFO_CNF));
99 break;
100 case EM_SUBCLASS_SW_VERSION:
101 memcpy(&val_tmp.em_u.em_ver_val, &Signal->UserData.version, sizeof(T_EM_SW_VER));
102 break;
103 case EM_SUBCLASS_GMM:
104 memcpy(&val_tmp.em_u.em_gmm_val, &Signal->UserData.gmm, sizeof(T_EM_GMM_INFO_CNF));
105 break;
106 case EM_SUBCLASS_GRLC:
107 memcpy(&val_tmp.em_u.em_grlc_val, &Signal->UserData.grlc, sizeof(T_EM_GRLC_INFO_CNF));
108 break;
109 case EM_SUBCLASS_AMR:
110 memcpy(&val_tmp.em_u.em_amr_val, &Signal->UserData.amr, sizeof(T_EM_AMR_INFO_CNF));
111 break;
112 case EM_SUBCLASS_PDP:
113 break;
114 default:
115 break;
116 }
117
118 cmhEM( &val_tmp );
119 }
120
121 LOCAL void em_event_at_cbfkt(T_DRV_SIGNAL_EM_EVENT * Signal)
122 {
123 /*
124 * Copy the data in an internal variable
125 */
126 T_DRV_SIGNAL_EM_EVENT Signal_tmp;
127
128 memcpy(&Signal_tmp, Signal, sizeof(T_DRV_SIGNAL_EM_EVENT));
129
130 cmhEMET (&Signal_tmp);
131 }
132
133
134 GLOBAL T_ACI_RETURN sAT_PercentEM ( T_ACI_CMD_SRC srcId,
135 T_EM_AT_MODE mode,
136 T_EM_AT_TYPE type)
137 {
138 UBYTE em_class = 0;
139 UBYTE em_subclass = 0;
140 UBYTE em_type = mode;
141 UBYTE val;
142
143 TRACE_FUNCTION ("sAT_PercentEM ()");
144
145 /*
146 *-------------------------------------------------------------------
147 * check command source
148 *-------------------------------------------------------------------
149 */
150 if(!cmh_IsVldCmdSrc (srcId))
151 {
152 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter );
153 return( AT_FAIL );
154 }
155 emPrm.srcId = srcId;
156
157 if(mode EQ PCO_REP) /*request EM data as trace output*/
158 {
159 em_subclass_pco_bitmap(type); /*function to send EM_PCO_TRACE_REQ to RR (and GMM) */
160 return AT_CMPL;
161 }
162
163 switch(type)
164 {
165 case EM_AT_SC:
166 em_class = EM_CLASS_INFRA_DATA;
167 em_subclass = EM_SUBCLASS_SC;
168 break;
169 #ifdef GPRS
170 case EM_AT_SC_GPRS:
171 em_class = EM_CLASS_INFRA_DATA;
172 em_subclass = EM_SUBCLASS_SC_GPRS;
173 break;
174 #endif /* GPRS */
175 case EM_AT_NC:
176 em_class = EM_CLASS_INFRA_DATA;
177 em_subclass = EM_SUBCLASS_NC;
178 break;
179 case EM_AT_LOC_PAG:
180 em_class = EM_CLASS_INFRA_DATA;
181 em_subclass = EM_SUBCLASS_LOC_PAG;
182 break;
183 case EM_AT_PLMN:
184 em_class = EM_CLASS_INFRA_DATA;
185 em_subclass = EM_SUBCLASS_PLMN;
186 break;
187 case EM_AT_CIPH_HOP_DTX:
188 em_class = EM_CLASS_INFRA_DATA;
189 em_subclass = EM_SUBCLASS_CIPH_HOP_DTX;
190 break;
191 case EM_AT_POWER:
192 em_class = EM_CLASS_MOBILE_DATA;
193 em_subclass = EM_SUBCLASS_POWER;
194 break;
195 case EM_AT_ID:
196 em_class = EM_CLASS_MOBILE_DATA;
197 em_subclass = EM_SUBCLASS_ID;
198 break;
199 case EM_AT_VER:
200 em_class = EM_CLASS_MOBILE_DATA;
201 em_subclass = EM_SUBCLASS_SW_VERSION;
202 break;
203 #ifdef GPRS
204 case EM_AT_GMM:
205 em_class = EM_CLASS_INFRA_DATA;
206 em_subclass = EM_SUBCLASS_GMM;
207 break;
208 case EM_AT_GRLC:
209 em_class = EM_CLASS_INFRA_DATA;
210 em_subclass = EM_SUBCLASS_GRLC;
211 break;
212 #endif /* GPRS */
213 case EM_AT_AMR:
214 em_class = EM_CLASS_INFRA_DATA;
215 em_subclass = EM_SUBCLASS_AMR;
216 break;
217 #ifdef GPRS
218 case EM_AT_PDP:
219 em_class = EM_CLASS_INFRA_DATA;
220 em_subclass = EM_SUBCLASS_PDP;
221 break;
222 #endif
223 default:
224 return AT_FAIL;
225 } /* switch */
226
227 val = em_Read_Data_Parameter( em_class, em_subclass, em_type, em_at_cbfkt );
228
229 if(em_subclass == EM_SUBCLASS_PDP)
230 return AT_CMPL;
231
232 return AT_EXCT;
233
234 } /* sAT_PercentEM */
235
236 GLOBAL T_ACI_RETURN sAT_PercentEMET( T_ACI_CMD_SRC srcId,
237 UBYTE type)
238 {
239 UBYTE val;
240
241 TRACE_FUNCTION ("sAT_PercentEMET ()");
242
243 /*
244 *-------------------------------------------------------------------
245 * check command source
246 *-------------------------------------------------------------------
247 */
248 if(!cmh_IsVldCmdSrc (srcId))
249 {
250 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter );
251 return( AT_FAIL );
252 }
253 emetPrm.srcId = srcId;
254
255 val = em_Read_Event_Parameter (type, em_event_at_cbfkt);
256
257 return AT_CMPL;
258 } /* sAT_PercentEMET */
259
260 GLOBAL T_ACI_RETURN sAT_PercentEMETS( T_ACI_CMD_SRC srcId, UBYTE subclass,
261 ULONG bitm_h, ULONG bitm_l )
262 {
263 UBYTE val;
264
265 TRACE_FUNCTION ("sAT_PercentEMETS ()");
266
267 /*
268 *-------------------------------------------------------------------
269 * check command source
270 *-------------------------------------------------------------------
271 */
272 if(!cmh_IsVldCmdSrc (srcId))
273 {
274 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter );
275 return( AT_FAIL );
276 }
277 emetsPrm.srcId = srcId;
278
279 val = em_Set_EventTrace (subclass, bitm_h, bitm_l);
280
281 return AT_CMPL;
282 } /* sAT_PercentEMETS */
283
284
285
286 /*+++++++++++++++++++++++++++++++++++++++++ E O F +++++++++++++++++++++++++++++++++++++++++*/
287
288