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