comparison src/g23m-aci/aci/cmh_mmiq.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 : GSM-PS (6147)
4 | Modul : CMH_MMIS
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 | protocol stack adapter for the man machine interface.
19 +-----------------------------------------------------------------------------
20 */
21
22 #ifndef CMH_MMIQ_C
23 #define CMH_MMIQ_C
24 #endif
25
26 #include "aci_all.h"
27
28 /*==== INCLUDES ===================================================*/
29 #include "aci_cmh.h"
30 #include "psa_mmi.h"
31 #include "cmh_mmi.h"
32 #include "pcm.h"
33
34 #ifdef UART
35 #include "dti.h"
36 #include "dti_conn_mng.h"
37 #endif
38
39
40 #ifdef FAX_AND_DATA
41 #include "aci_fd.h"
42 #endif /* of #ifdef FAX_AND_DATA */
43 #include "psa.h"
44 #include "psa_sim.h"
45 #include "cmh.h"
46 #include "cmh_sim.h"
47 #include "aoc.h"
48
49 /*==== CONSTANTS ==================================================*/
50
51 /*==== EXPORT =====================================================*/
52
53 /*==== VARIABLES ==================================================*/
54
55 /* Implements Measure#32: Row 971, 976, 1023 & 1072 */
56 const char * const ef_clng_id = EF_CLNG_ID;
57 /* Implements Measure#32: Row 972, 1024 & 1041 */
58 char * const au_str = "au";
59
60 /*==== FUNCTIONS ==================================================*/
61
62 /*
63 +--------------------------------------------------------------------+
64 | PROJECT : GSM-PS (6147) MODULE : CMH_MMIQ |
65 | STATE : code ROUTINE : qAT_PlusCLAN |
66 +--------------------------------------------------------------------+
67
68 PURPOSE : This is the functional counterpart to the +CLAN AT command
69 which is responsible for query supporetd language code in
70 ME.
71 */
72
73 GLOBAL T_ACI_RETURN qAT_PlusCLAN ( T_ACI_CMD_SRC srcId,
74 T_ACI_LAN_SUP* lngCode )
75 {
76 /* Implements Measure#32: Row 971 */
77 pcm_FileInfo_Type fileInfo;
78 EF_CLNG lng;
79 T_SIM_CMD_PRM * pSIMCmdPrm; /* points to SIM command parameters */
80 /* Implements Measure#32: Row 972 */
81
82 TRACE_FUNCTION ("qAT_PlusCLAN()");
83
84 /*
85 *-------------------------------------------------------------------
86 * check command source
87 *-------------------------------------------------------------------
88 */
89 if(!cmh_IsVldCmdSrc (srcId))
90 {
91 return( AT_FAIL );
92 }
93
94 pSIMCmdPrm = &cmhPrm[srcId].simCmdPrm;
95
96 /*
97 *-------------------------------------------------------------------
98 * read supported language from ME
99 *-------------------------------------------------------------------
100 */
101 /* Implements Measure#32: Row 971 */
102 if (pcm_GetFileInfo ( ( UBYTE* ) ef_clng_id, &fileInfo) NEQ PCM_OK)
103 {
104 ACI_ERR_DESC( ACI_ERR_CLASS_Cme, CME_ERR_Unknown );
105 return( AT_FAIL );
106 }
107 else
108 {
109
110 /* Implements Measure#32: Row 971 */
111 if ( pcm_ReadFile ( (UBYTE*)ef_clng_id,
112 fileInfo.FileSize,
113 (UBYTE*) &lng,
114 &fileInfo.Version) EQ PCM_OK )
115 {
116 memcpy(lngCode->str, &lng.data[0], 2);
117 }
118 else
119 {
120 ACI_ERR_DESC( ACI_ERR_CLASS_Cms, CMS_ERR_MemFail );
121 return( AT_FAIL );
122 }
123 }
124 /*
125 *-------------------------------------------------------------------
126 * Read EF ELP or LP from the sim if Automatic language is selected
127 *-------------------------------------------------------------------
128 */
129
130 /* Implements Measure#32: Row 972 */
131 if (!strcmp(lngCode->str, au_str))
132 {
133 /*
134 *-------------------------------------------------------------
135 * check entity status
136 *-------------------------------------------------------------
137 */
138 if( simEntStat.curCmd NEQ AT_CMD_NONE )
139 return( AT_BUSY );
140
141 pSIMCmdPrm -> CLANact = CLAN_ACT_Read;
142
143 /*
144 *-------------------------------------------------------------
145 * request EF ELP from SIM
146 *-------------------------------------------------------------
147 */
148 /* Implements Measure 150 and 159 */
149 return cmhSIM_ReqLanguage_LP_or_ELP ( srcId, SIM_ELP );
150 }
151
152 return( AT_CMPL );
153 }
154
155 /*
156 +--------------------------------------------------------------------+
157 | PROJECT : GSM-PS (6147) MODULE : CMH_MMIQ |
158 | STATE : code ROUTINE : qAT_PlusCLAE |
159 +--------------------------------------------------------------------+
160
161 PURPOSE : This is the functional counterpart to the +CLAE? AT command
162 which returns the current setting of mode .
163
164 <mode>: Enable or Disable the unsolicited result code,
165 when the language in the ME is changend.
166
167 */
168
169 GLOBAL T_ACI_RETURN qAT_PlusCLAE (T_ACI_CMD_SRC srcId,
170 T_ACI_CLAE_MOD *mode)
171
172 {
173 T_PHB_CMD_PRM * pPHBCmdPrm; /* points to PHB command parameter */
174
175
176 TRACE_FUNCTION ("qAT_PlusCLAE()");
177
178 /*
179 *-------------------------------------------------------------------
180 * check command source
181 *-------------------------------------------------------------------
182 */
183 if(!cmh_IsVldCmdSrc (srcId))
184 {
185 return( AT_FAIL );
186 }
187
188 pPHBCmdPrm = &cmhPrm[srcId].phbCmdPrm;
189
190 /*
191 *-------------------------------------------------------------------
192 * fill parameter mode
193 *-------------------------------------------------------------------
194 */
195 *mode= pPHBCmdPrm->CLAEmode;
196
197 return( AT_CMPL );
198 }
199
200 #ifdef TI_PS_FF_AT_P_CMD_CUST
201 /*
202 +-------------------------------------------------------------------+
203 | PROJECT : GSM-PS (6147) MODULE : CMH_MMIQ |
204 | ROUTINE : qAT_PercentCUST |
205 +-------------------------------------------------------------------+
206
207 PURPOSE : This function will set the customisation mode for the ACI and
208 other required entities
209 */
210
211 GLOBAL T_ACI_RETURN qAT_PercentCUST( T_ACI_CMD_SRC srcId,
212 T_CUST_MOD *customisation_mode)
213 {
214 /*
215 *-------------------------------------------------------------------
216 * check command source
217 *-------------------------------------------------------------------
218 */
219 if(!cmh_IsVldCmdSrc (srcId))
220 {
221 return( AT_FAIL );
222 }
223
224 *customisation_mode = (T_CUST_MOD)simShrdPrm.setPrm[srcId].cust_mode;
225
226 return (AT_CMPL);
227 }
228 #endif /* TI_PS_FF_AT_P_CMD_CUST */
229
230 /*
231 +-------------------------------------------------------------------+
232 | PROJECT : GSM-PS (6147) MODULE : CMH_MMIQ |
233 | ROUTINE : qAT_PercentSATCC |
234 +-------------------------------------------------------------------+
235
236 PURPOSE : This function will query the Call Control mode from the ACI
237 */
238
239 GLOBAL T_ACI_RETURN qAT_PercentSATCC( T_ACI_CMD_SRC srcId,
240 T_SAT_CC_MOD *sat_cc_mode)
241 {
242 /*
243 *-------------------------------------------------------------------
244 * check command source
245 *-------------------------------------------------------------------
246 */
247 if(!cmh_IsVldCmdSrc (srcId))
248 {
249 return( AT_FAIL );
250 }
251
252 *sat_cc_mode = (T_SAT_CC_MOD)simShrdPrm.setPrm[srcId].sat_cc_mode;
253
254 return (AT_CMPL);
255 }
256
257 /*==== EOF ========================================================*/
258
259
260
261
262
263
264
265
266
267