comparison src/g23m-aci/aci/cmh_emq.c @ 162:53929b40109c

src/g23m-aci: initial import from TCS3.2/LoCosto
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 11 Oct 2016 02:02:43 +0000
parents
children
comparison
equal deleted inserted replaced
161:4557e2a9c18e 162:53929b40109c
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
142 TRACE_FUNCTION ("sAT_PercentEM ()");
143
144 /*
145 *-------------------------------------------------------------------
146 * check command source
147 *-------------------------------------------------------------------
148 */
149 if(!cmh_IsVldCmdSrc (srcId))
150 {
151 return( AT_FAIL );
152 }
153 emPrm.srcId = srcId;
154
155 if(mode EQ PCO_REP) /*request EM data as trace output*/
156 {
157 em_subclass_pco_bitmap(type); /*function to send EM_PCO_TRACE_REQ to RR (and GMM) */
158 return AT_CMPL;
159 }
160
161 switch(type)
162 {
163 case EM_AT_SC:
164 em_class = EM_CLASS_INFRA_DATA;
165 em_subclass = EM_SUBCLASS_SC;
166 break;
167 #ifdef GPRS
168 case EM_AT_SC_GPRS:
169 em_class = EM_CLASS_INFRA_DATA;
170 em_subclass = EM_SUBCLASS_SC_GPRS;
171 break;
172 #endif /* GPRS */
173 case EM_AT_NC:
174 em_class = EM_CLASS_INFRA_DATA;
175 em_subclass = EM_SUBCLASS_NC;
176 break;
177 case EM_AT_LOC_PAG:
178 em_class = EM_CLASS_INFRA_DATA;
179 em_subclass = EM_SUBCLASS_LOC_PAG;
180 break;
181 case EM_AT_PLMN:
182 em_class = EM_CLASS_INFRA_DATA;
183 em_subclass = EM_SUBCLASS_PLMN;
184 break;
185 case EM_AT_CIPH_HOP_DTX:
186 em_class = EM_CLASS_INFRA_DATA;
187 em_subclass = EM_SUBCLASS_CIPH_HOP_DTX;
188 break;
189 case EM_AT_POWER:
190 em_class = EM_CLASS_MOBILE_DATA;
191 em_subclass = EM_SUBCLASS_POWER;
192 break;
193 case EM_AT_ID:
194 em_class = EM_CLASS_MOBILE_DATA;
195 em_subclass = EM_SUBCLASS_ID;
196 break;
197 case EM_AT_VER:
198 em_class = EM_CLASS_MOBILE_DATA;
199 em_subclass = EM_SUBCLASS_SW_VERSION;
200 break;
201 #ifdef GPRS
202 case EM_AT_GMM:
203 em_class = EM_CLASS_INFRA_DATA;
204 em_subclass = EM_SUBCLASS_GMM;
205 break;
206 case EM_AT_GRLC:
207 em_class = EM_CLASS_INFRA_DATA;
208 em_subclass = EM_SUBCLASS_GRLC;
209 break;
210 #endif /* GPRS */
211 case EM_AT_AMR:
212 em_class = EM_CLASS_INFRA_DATA;
213 em_subclass = EM_SUBCLASS_AMR;
214 break;
215 #ifdef GPRS
216 case EM_AT_PDP:
217 em_class = EM_CLASS_INFRA_DATA;
218 em_subclass = EM_SUBCLASS_PDP;
219 break;
220 #endif
221 default:
222 return AT_FAIL;
223 } /* switch */
224
225 em_Read_Data_Parameter( em_class, em_subclass, em_type, em_at_cbfkt );
226
227 if(em_subclass == EM_SUBCLASS_PDP)
228 return AT_CMPL;
229
230 return AT_EXCT;
231
232 } /* sAT_PercentEM */
233
234 GLOBAL T_ACI_RETURN sAT_PercentEMET( T_ACI_CMD_SRC srcId,
235 UBYTE type)
236 {
237
238 TRACE_FUNCTION ("sAT_PercentEMET ()");
239
240 /*
241 *-------------------------------------------------------------------
242 * check command source
243 *-------------------------------------------------------------------
244 */
245 if(!cmh_IsVldCmdSrc (srcId))
246 {
247 return( AT_FAIL );
248 }
249 emetPrm.srcId = srcId;
250 em_Read_Event_Parameter (type, em_event_at_cbfkt);
251
252 return AT_CMPL;
253 } /* sAT_PercentEMET */
254
255 GLOBAL T_ACI_RETURN sAT_PercentEMETS( T_ACI_CMD_SRC srcId, UBYTE subclass,
256 ULONG bitm_h, ULONG bitm_l )
257 {
258
259 TRACE_FUNCTION ("sAT_PercentEMETS ()");
260
261 /*
262 *-------------------------------------------------------------------
263 * check command source
264 *-------------------------------------------------------------------
265 */
266 if(!cmh_IsVldCmdSrc (srcId))
267 {
268 return( AT_FAIL );
269 }
270 emetsPrm.srcId = srcId;
271
272 em_Set_EventTrace (subclass, bitm_h, bitm_l);
273
274 return AT_CMPL;
275 } /* sAT_PercentEMETS */
276
277
278
279 /*+++++++++++++++++++++++++++++++++++++++++ E O F +++++++++++++++++++++++++++++++++++++++++*/
280
281