comparison g23m/condat/ms/src/aci/cmh_smq.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 | protocol stack adapter for GPRS session management ( SM ).
19 +-----------------------------------------------------------------------------
20 */
21
22 #ifdef GPRS
23
24 #ifndef CMH_SMQ_C
25 #define CMH_SMQ_C
26 #endif
27
28 #include "aci_all.h"
29
30 /*==== INCLUDES ===================================================*/
31 #include "dti.h" /* functionality of the dti library */
32 #include "aci_cmh.h"
33 #include "ati_cmd.h"
34 #include "aci_cmd.h"
35
36 #include "pcm.h"
37
38 #include "dti_conn_mng.h"
39 #include "dti_cntrl_mng.h"
40
41 #include "gaci.h"
42 #include "gaci_cmh.h"
43 #include "psa.h"
44 #include "psa_sm.h"
45
46 #include "cmh.h"
47 #include "cmh_sm.h"
48
49 #include "psa_gmm.h"
50
51 /*==== CONSTANTS ==================================================*/
52
53 /*==== EXPORT =====================================================*/
54
55 /*==== VARIABLES ==================================================*/
56
57 /*==== FUNCTIONS ==================================================*/
58
59 /*
60 +--------------------------------------------------------------------+
61 | PROJECT : GPRS (8441) MODULE : CMH_SMQ |
62 | STATE : finished ROUTINE : qAT_PlusCGQREQ |
63 +--------------------------------------------------------------------+
64
65 PURPOSE : This is the functional counterpart to the +CGQREG? AT
66 command which returns current settings for each defined PDP context.
67 */
68 GLOBAL T_ACI_RETURN qAT_PlusCGQREQ ( T_ACI_CMD_SRC srcId, T_QOS **qos, SHORT *cid)
69 {
70 USHORT i, j;
71 TRACE_FUNCTION ("qAT_PlusCGQREQ()");
72
73 /*
74 *-------------------------------------------------------------------
75 * check command source - should be Serial link ?
76 *-------------------------------------------------------------------
77 */
78 if ( !cmh_IsVldCmdSrc (srcId) ) {
79 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter );
80 return( AT_FAIL );
81 }
82
83 /*
84 *-------------------------------------------------------------------
85 * fill in parameters
86 *-------------------------------------------------------------------
87 */
88 for ( i=j=0; i < MAX_CID; i++ )
89 {
90 if ( get_state_over_cid((SHORT) (i + 1)) EQ CS_DEFINED )
91 {
92 qos[j] = &pdp_context[i].con.qos;
93 cid [j] = i + 1 ;
94 j++;
95 }
96 }
97 qos[j] = NULL;
98 cid[j] = -1;
99
100 return( AT_CMPL );
101 }
102
103
104 /*
105 +--------------------------------------------------------------------+
106 | PROJECT : GPRS (8441) MODULE : CMH_SMQ |
107 | STATE : finished ROUTINE : qAT_PlusCGQMIN |
108 +--------------------------------------------------------------------+
109
110 PURPOSE : This is the functional counterpart to the +CGQMIN? AT
111 command which returns current settings for each defined PDP context.
112 */
113 GLOBAL T_ACI_RETURN qAT_PlusCGQMIN ( T_ACI_CMD_SRC srcId, T_QOS **qos, SHORT *cid)
114 {
115 USHORT i,j;
116 TRACE_FUNCTION ("qAT_PlusCGQMIN()");
117
118 /*
119 *-------------------------------------------------------------------
120 * check command source - should be Serial link ?
121 *-------------------------------------------------------------------
122 */
123 if ( !cmh_IsVldCmdSrc (srcId) ) {
124 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter );
125 return( AT_FAIL );
126 }
127
128 /*
129 *-------------------------------------------------------------------
130 * fill in parameters
131 *-------------------------------------------------------------------
132 */
133 for ( i=j=0; i < MAX_CID; i++ )
134 {
135 if ( get_state_over_cid((SHORT) (i + 1)) EQ CS_DEFINED )
136 {
137 qos[j] = &pdp_context[i].con.min_qos;
138 cid[j] = i + 1 ;
139 j++;
140 }
141 }
142 qos[j] = NULL;
143 cid [j] = -1;
144
145 return( AT_CMPL );
146 }
147
148 /*
149 +--------------------------------------------------------------------+
150 | PROJECT : GPRS (8441) MODULE : CMH_SMQ |
151 | STATE : finished ROUTINE : qAT_PlusCGDCONT |
152 +--------------------------------------------------------------------+
153
154 PURPOSE : This is the functional counterpart to the +CGCONT? AT
155 command which returns current settings for each defined PDP context.
156 */
157
158 GLOBAL T_ACI_RETURN qAT_PlusCGDCONT ( T_ACI_CMD_SRC srcId, T_GPRS_CONT_REC (*Ctxt)[MAX_CID_PLUS_EINS],
159 SHORT *cid )
160 {
161 T_CONTEXT_STATE state;
162 USHORT i,j;
163 TRACE_FUNCTION ("qAT_PlusCGDCONT()");
164
165 /*
166 *-------------------------------------------------------------------
167 * check command source - should be Serial link ?
168 *-------------------------------------------------------------------
169 */
170 if ( !cmh_IsVldCmdSrc (srcId) ) {
171 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter );
172 return( AT_FAIL );
173 }
174
175 /*
176 *-------------------------------------------------------------------
177 * fill in parameters
178 *-------------------------------------------------------------------
179 */
180 for ( i=j=0; i < MAX_CID; i++ )
181 {
182 state = get_state_over_cid((SHORT) (i + 1));
183 if ( state NEQ CS_UNDEFINED )
184 {
185 memcpy (&((*Ctxt)[j]), &pdp_context[i].con, sizeof(T_GPRS_CONT_REC));
186
187 if ( state EQ CS_ACTIVATED || state EQ CS_DATA_LINK)
188 if ( strcmp(pdp_context[i].con.pdp_addr, pdp_context[i].allocated_pdp_addr) )
189 (*Ctxt)[j].pdp_addr[0] = 0;
190
191 cid[j] = i + 1 ;
192 j++;
193 }
194 }
195 cid [j] = INVALID_CID;
196
197 return( AT_CMPL );
198 }
199
200 /*
201 +--------------------------------------------------------------------+
202 | PROJECT : GPRS (8441) MODULE : CMH_SMQ |
203 | STATE : finished ROUTINE : qAT_PlusCGACT |
204 +--------------------------------------------------------------------+
205
206 PURPOSE : This is the functional counterpart to the +CGACT? AT
207 command which returns current activation states for all defined PDP context.
208 */
209
210 GLOBAL T_ACI_RETURN qAT_PlusCGACT ( T_ACI_CMD_SRC srcId, BOOL *states, SHORT *cid )
211 {
212 T_CONTEXT_STATE state = CS_INVALID_STATE;
213 USHORT i,j;
214
215 TRACE_FUNCTION ("qAT_PlusCGACT()");
216
217 /*
218 *-------------------------------------------------------------------
219 * check command source - should be Serial link ?
220 *-------------------------------------------------------------------
221 */
222 if ( !cmh_IsVldCmdSrc (srcId) ) {
223 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter );
224 return( AT_FAIL );
225 }
226
227 /*
228 *-------------------------------------------------------------------
229 * fill in parameters
230 *-------------------------------------------------------------------
231 */
232 for ( i=j=0; i < MAX_CID; i++ )
233 {
234 state = get_state_over_cid((SHORT) (i + 1));
235 if ( state NEQ CS_UNDEFINED && state NEQ CS_INVALID_STATE )
236 {
237 if ( state EQ CS_ACTIVATED || state EQ CS_DATA_LINK )
238 states[j] = TRUE;
239 else
240 states[j] = FALSE;
241
242 cid[j] = i + 1 ;
243 j++;
244 }
245 }
246 cid [j] = INVALID_CID;
247
248 return( AT_CMPL );
249 }
250
251 /*
252 +--------------------------------------------------------------------+
253 | PROJECT : GPRS (8441) MODULE : CMH_SMQ |
254 | STATE : finished ROUTINE : qAT_PlusCGAUTO |
255 +--------------------------------------------------------------------+
256
257 PURPOSE : This is the functional counterpart to the +CGAUTO? AT
258 command which returns current mode of automatic response
259 to network requests.
260 */
261
262 GLOBAL T_ACI_RETURN qAT_PlusCGAUTO ( T_ACI_CMD_SRC srcId, T_CGAUTO_N *n)
263 {
264
265 TRACE_FUNCTION ("qAT_PlusCGAUTO()");
266
267 /*
268 *-------------------------------------------------------------------
269 * check command source - should be Serial link ?
270 *-------------------------------------------------------------------
271 */
272 if ( !cmh_IsVldCmdSrc (srcId) ) {
273 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter );
274 return( AT_FAIL );
275 }
276
277 /*
278 *-------------------------------------------------------------------
279 * fill in parameters
280 *-------------------------------------------------------------------
281 */
282 *n = (T_CGAUTO_N) automatic_response_mode;
283
284 return( AT_CMPL );
285 }
286
287 GLOBAL T_ACI_RETURN qAT_PlusCGEREP ( T_ACI_CMD_SRC srcId, T_CGEREP_MODE *mode, T_CGEREP_BFR *bfr )
288 {
289
290 TRACE_FUNCTION ("qAT_PlusCGEREP()");
291
292 /*
293 *-------------------------------------------------------------------
294 * check command source - should be Serial link ?
295 *-------------------------------------------------------------------
296 */
297 if ( !cmh_IsVldCmdSrc (srcId) ) {
298 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter );
299 return( AT_FAIL );
300 }
301
302 /*
303 *-------------------------------------------------------------------
304 * fill in parameters
305 *-------------------------------------------------------------------
306 */
307 *mode = ati_user_output_cfg[srcId].CGEREP_mode;
308 *bfr = ati_user_output_cfg[srcId].CGEREP_bfr;
309
310 return( AT_CMPL );
311 }
312
313 GLOBAL T_ACI_RETURN qAT_PlusCGSMS ( T_ACI_CMD_SRC srcId, T_CGSMS_SERVICE *service )
314 {
315
316 TRACE_FUNCTION ("qAT_PlusCGSMS()");
317
318 /*
319 *-------------------------------------------------------------------
320 * check command source - should be Serial link ?
321 *-------------------------------------------------------------------
322 */
323 if ( !cmh_IsVldCmdSrc (srcId) ) {
324 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter );
325 return( AT_FAIL );
326 }
327
328 /*
329 *-------------------------------------------------------------------
330 * fill in parameters
331 *-------------------------------------------------------------------
332 */
333 *service = sm_cgsms_service;
334
335 return( AT_CMPL );
336 }
337
338 #endif /* GPRS */
339 /*==== EOF ========================================================*/