comparison g23m/condat/ms/src/aci/gaci_ret.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 : GPRS AT Command Interpreter Call-Back Functions.
18 +-----------------------------------------------------------------------------
19 */
20
21 #ifdef GPRS
22
23 #ifndef GACI_RET_C
24 #define GACI_RET_C
25 #endif
26
27 #include "aci_all.h"
28
29 /*
30 * includes
31 */
32 #include "dti.h" /* functionality of the dti library */
33 #include "aci_cmh.h"
34 #include "ati_cmd.h"
35 #include "aci_cmd.h"
36 #include "aci_io.h"
37 #include "aci.h"
38 #include "l4_tim.h"
39 #include "aci_lst.h"
40
41 #include "dti_conn_mng.h"
42
43 #include "gaci.h"
44 #include "gaci_cmh.h"
45 #include "psa.h"
46 #include "psa_sm.h"
47
48 #include "cmh.h"
49 #include "cmh_sm.h"
50
51 #include "aci_io.h"
52 #include "aci_mem.h"
53
54 #include "ati_int.h"
55
56 /*
57 +--------------------------------------------------------------------+
58 | PROJECT : GPRS (8441) MODULE : GACI_RET |
59 | STATE : code ROUTINE : rCI_PlusCGACT |
60 +--------------------------------------------------------------------+
61
62 PURPOSE : handles rCI_PlusCGACT call back
63
64 */
65 GLOBAL void rCI_PlusCGACT ( SHORT link_id )
66 {
67 UBYTE srcId = srcId_cb;
68 T_ATI_SRC_PARAMS *src_params = find_element (ati_src_list, srcId, search_ati_src_id);
69
70 TRACE_FUNCTION("rCI_PlusCGACT()");
71
72 src_params->curAtCmd = AT_CMD_NONE;
73
74 }
75
76 /*
77 +--------------------------------------------------------------------+
78 | PROJECT : GPRS (8441) MODULE : GACI_RET |
79 | STATE : code ROUTINE : rCI_PlusCGDATA |
80 +--------------------------------------------------------------------+
81
82 PURPOSE : handles rCI_PlusCGDATA call back
83
84 */
85 GLOBAL void rCI_PlusCGDATA ( SHORT link_id )
86 {
87 UBYTE srcId = srcId_cb;
88 T_ATI_SRC_PARAMS *src_params = find_element (ati_src_list, srcId, search_ati_src_id);
89
90 TRACE_FUNCTION("rCI_PlusCGDATA()");
91
92 src_params->curAtCmd = AT_CMD_NONE;
93
94 }
95
96 /*
97 +--------------------------------------------------------------------+
98 | PROJECT : GPRS (8441) MODULE : GACI_RET |
99 | STATE : code ROUTINE : rCI_PlusCGANS |
100 +--------------------------------------------------------------------+
101
102 PURPOSE : handles rCI_PlusCGANS call back
103
104 */
105 GLOBAL void rCI_PlusCGANS ( SHORT link_id )
106 {
107 UBYTE srcId = srcId_cb;
108 T_ATI_SRC_PARAMS *src_params = find_element (ati_src_list, srcId, search_ati_src_id);
109
110 TRACE_FUNCTION("rCI_PlusCGANS()");
111
112 src_params->curAtCmd = AT_CMD_NONE;
113
114 }
115
116 /*
117 +--------------------------------------------------------------------+
118 | PROJECT : GPRS (8441) MODULE : GACI_RET |
119 | STATE : code ROUTINE : rCI_PlusCGEREP |
120 +--------------------------------------------------------------------+
121
122 PURPOSE : handles rCI_PlusCGEREP call back
123
124 */
125 GLOBAL void rCI_PlusCGEREP ( T_CGEREP_EVENT event, T_CGEREP_EVENT_REP_PARAM *param )
126 {
127 char *me="+CGEV: ";
128 UBYTE srcId = srcId_cb;
129
130 TRACE_FUNCTION("rCI_PlusCGEREP()");
131
132 if (ati_user_output_cfg[srcId].CGEREP_mode EQ 0)
133 {
134 return; /* don't indicate +CGEV to a source on which AT+CGEREP was not set up */
135 }
136
137 if( CGEREP_MODE_DICARD_RESERVED EQ ati_user_output_cfg[srcId].CGEREP_mode AND
138 uart_is_mt_te_link () NEQ FALSE )
139 {
140 return;
141 }
142
143 switch ( event )
144 {
145 case CGEREP_EVENT_REJECT:
146 sprintf(g_sa,"%s%s \"%s\",\"%s\"", me, "REJECT", param->reject.pdp_type, param->reject.pdp_addr);
147 break;
148 case CGEREP_EVENT_NW_REACT:
149 sprintf(g_sa,"%s%s \"%s\",\"%s\",%hd", me, "NW REACT", param->act.pdp_type, param->act.pdp_addr, param->act.cid);
150 break;
151 case CGEREP_EVENT_NW_DEACT:
152 sprintf(g_sa,"%s%s \"%s\",\"%s\",%hd", me, "NW DEACT", param->act.pdp_type, param->act.pdp_addr, param->act.cid);
153 break;
154 case CGEREP_EVENT_ME_DEACT:
155 sprintf(g_sa,"%s%s \"%s\",\"%s\",%hd", me, "ME DEACT", param->act.pdp_type, param->act.pdp_addr, param->act.cid);
156 break;
157 case CGEREP_EVENT_NW_DETACH:
158 sprintf(g_sa,"%s%s", me, "NW DETACH" );
159 break;
160 case CGEREP_EVENT_ME_DETACH:
161 sprintf(g_sa,"%s%s", me, "ME DETACH" );
162 break;
163 case CGEREP_EVENT_NW_CLASS:
164 sprintf(g_sa,"%s%s", me, "NW CLASS" );
165 break;
166 case CGEREP_EVENT_ME_CLASS:
167 sprintf(g_sa,"%s%s", me, "ME CLASS" );
168 break;
169 }
170
171 if ( CGEREP_MODE_BUFFER NEQ ati_user_output_cfg[srcId].CGEREP_mode AND
172 uart_is_mt_te_link () EQ FALSE)
173 {
174 io_sendIndication(srcId, g_sa, ATI_FORCED_OUTPUT);
175 }
176 else
177 { /* write in event reporting buffer */
178 cmhSM_save_event(event, param);
179 }
180 }
181
182 /*
183 +--------------------------------------------------------------------+
184 | PROJECT : GPRS (8441) MODULE : GACI_RET |
185 | STATE : code ROUTINE : rCI_PercentCGEV |
186 +--------------------------------------------------------------------+
187
188 PURPOSE : handles rCI_PercentCGEREP call back
189
190 */
191 GLOBAL void rCI_PercentCGEV ( T_CGEREP_EVENT event, T_CGEREP_EVENT_REP_PARAM *param )
192 {
193 char *me="%CGEV: ";
194 UBYTE srcId = srcId_cb;
195
196 TRACE_FUNCTION("rCI_PercentCGEV()");
197
198 if (ati_user_output_cfg[srcId].Percent_CGEREP_stat EQ 0)
199 {
200 return; /* don't indicate %CGEV to a source on which AT%CGEREP was not set up */
201 }
202
203 switch ( event )
204 {
205 case CGEREP_EVENT_REJECT:
206 sprintf(g_sa,"%s%s \"%s\",\"%s\"", me, "REJECT", param->reject.pdp_type, param->reject.pdp_addr);
207 break;
208 case CGEREP_EVENT_NW_REACT:
209 sprintf(g_sa,"%s%s \"%s\",\"%s\",%hd", me, "NW REACT", param->act.pdp_type, param->act.pdp_addr, param->act.cid);
210 break;
211 case CGEREP_EVENT_NW_DEACT:
212 sprintf(g_sa,"%s%s \"%s\",\"%s\",%hd", me, "NW DEACT", param->act.pdp_type, param->act.pdp_addr, param->act.cid);
213 break;
214 case CGEREP_EVENT_ME_DEACT:
215 sprintf(g_sa,"%s%s \"%s\",\"%s\",%hd", me, "ME DEACT", param->act.pdp_type, param->act.pdp_addr, param->act.cid);
216 break;
217 case CGEREP_EVENT_NW_DETACH:
218 sprintf(g_sa,"%s%s", me, "NW DETACH" );
219 break;
220 case CGEREP_EVENT_ME_DETACH:
221 sprintf(g_sa,"%s%s", me, "ME DETACH" );
222 break;
223 case CGEREP_EVENT_NW_CLASS:
224 sprintf(g_sa,"%s%s", me, "NW CLASS" );
225 break;
226 case CGEREP_EVENT_ME_CLASS:
227 sprintf(g_sa,"%s%s", me, "ME CLASS" );
228 break;
229 case CGEREP_EVENT_NW_ACT:
230 sprintf(g_sa,"%s%s \"%s\",\"%s\",%hd", me, "NW ACT", param->act.pdp_type, param->act.pdp_addr, param->act.cid);
231 break;
232 case CGEREP_EVENT_ME_ACT:
233 sprintf(g_sa,"%s%s \"%s\",\"%s\",%hd", me, "ME ACT", param->act.pdp_type, param->act.pdp_addr, param->act.cid);
234 break;
235 }
236
237 io_sendIndication(srcId, g_sa, ATI_NORMAL_OUTPUT);
238
239 }
240
241 /*
242 +--------------------------------------------------------------------+
243 | PROJECT : GPRS (8441) MODULE : GACI_RET |
244 | STATE : code ROUTINE : rCI_PlusCGREG |
245 +--------------------------------------------------------------------+
246
247 PURPOSE : handles rCI_PlusCGREG call back
248
249 */
250 GLOBAL void rCI_PlusCGREG ( T_CGREG_STAT stat, USHORT lac, USHORT ci )
251 {
252 TRACE_FUNCTION("rCI_PlusCGREG()");
253
254 r_plus_percent_CREG ( srcId_cb,
255 stat,
256 lac,
257 ci,
258 PlusCGREG_CMD,
259 P_CREG_GPRS_Support_Unknown, /*ACI-SPR-17218: ignored*/
260 FALSE );
261 }
262
263 /*
264 +--------------------------------------------------------------------+
265 | PROJECT : GPRS (8441) MODULE : GACI_RET |
266 | STATE : code ROUTINE : rCI_changedQOS |
267 +--------------------------------------------------------------------+
268
269 PURPOSE : dummy function
270
271 */
272 GLOBAL void rCI_changedQOS ( SHORT cid, T_QOS *qos )
273 {
274 }
275
276 /*
277 +--------------------------------------------------------------------+
278 | PROJECT : GPRS (8441) MODULE : GACI_RET |
279 | STATE : code ROUTINE : rCI_PercentSNCNT |
280 +--------------------------------------------------------------------+
281
282 PURPOSE : handles rCI_PercentSNCNT call back
283
284 */
285 GLOBAL void rCI_PercentSNCNT ( UBYTE c_id,
286 ULONG octets_uplink,
287 ULONG octets_downlink,
288 ULONG packets_uplink,
289 ULONG packets_downlink )
290 {
291 TRACE_FUNCTION("rCI_PercentSNCNT()");
292
293 sprintf(g_sa,"%s: %d, %d, %d, %d, %d", "%SNCNT", c_id,
294 octets_uplink, octets_downlink,
295 packets_uplink, packets_downlink);
296
297 io_sendMessage(srcId_cb, g_sa, ATI_NORMAL_OUTPUT);
298
299 }
300
301 /*
302 +--------------------------------------------------------------------+
303 | PROJECT : GPRS (8441) MODULE : GACI_RET |
304 | STATE : code ROUTINE : rCI_PercentCGREG |
305 +--------------------------------------------------------------------+
306
307 PURPOSE : handles rCI_PercentCGREG call back
308
309 */
310 GLOBAL void rCI_PercentCGREG ( T_P_CGREG_STAT stat, USHORT lac, USHORT ci, BOOL bActiveContext )
311 {
312 TRACE_FUNCTION("rCI_PercentCGREG()");
313
314 r_plus_percent_CREG ( srcId_cb,
315 stat,
316 lac,
317 ci,
318 PercentCGREG_CMD,
319 P_CREG_GPRS_Support_Unknown, /*ACI-SPR-17218: ignored*/
320 bActiveContext);
321
322 }
323
324 /* sbh...15/01/02. If MFW defined, then these functions are duplicated */
325
326 #if !defined(MFW) && !defined(FF_MMI_RIV)
327
328 /*
329 +--------------------------------------------------------------------+
330 | PROJECT : GPRS (8441) MODULE : GACI_RET |
331 | STATE : code ROUTINE : rAT_PlusCGACT |
332 +--------------------------------------------------------------------+
333
334 PURPOSE : handles rAT_PlusCGACT call back
335
336 */
337 GLOBAL void rAT_PlusCGACT ( SHORT link_id )
338 {
339
340 TRACE_FUNCTION("rAT_PlusCGACT()");
341
342
343 }
344
345 /*
346 +--------------------------------------------------------------------+
347 | PROJECT : GPRS (8441) MODULE : GACI_RET |
348 | STATE : code ROUTINE : rAT_PlusCGDATA |
349 +--------------------------------------------------------------------+
350
351 PURPOSE : handles rAT_PlusCGDATA call back
352
353 */
354 GLOBAL void rAT_PlusCGDATA ( SHORT link_id )
355 {
356
357 TRACE_FUNCTION("rAT_PlusCGDATA()");
358
359
360 }
361
362 /*
363 +--------------------------------------------------------------------+
364 | PROJECT : GPRS (8441) MODULE : GACI_RET |
365 | STATE : code ROUTINE : rAT_PlusCGANS |
366 +--------------------------------------------------------------------+
367
368 PURPOSE : handles rAT_PlusCGANS call back
369
370 */
371 GLOBAL void rAT_PlusCGANS ( SHORT link_id )
372 {
373
374 TRACE_FUNCTION("rAT_PlusCGANS()");
375
376
377 }
378
379 /*
380 +--------------------------------------------------------------------+
381 | PROJECT : GPRS (8441) MODULE : GACI_RET |
382 | STATE : code ROUTINE : rAT_PlusCGEREP |
383 +--------------------------------------------------------------------+
384
385 PURPOSE : handles rAT_PlusCGEREP call back
386
387 */
388 GLOBAL void rAT_PlusCGEREP ( T_CGEREP_EVENT event, T_CGEREP_EVENT_REP_PARAM *param )
389 {
390
391 TRACE_FUNCTION("rAT_PlusCGEREP()");
392
393
394 }
395
396 /*
397 +--------------------------------------------------------------------+
398 | PROJECT : GPRS (8441) MODULE : GACI_RET |
399 | STATE : code ROUTINE : rAT_PercentCGEV |
400 +--------------------------------------------------------------------+
401
402 PURPOSE : handles rAT_PercentCGEV call back
403
404 */
405 GLOBAL void rAT_PercentCGEV (T_CGEREP_EVENT event, T_CGEREP_EVENT_REP_PARAM *param )
406 {
407
408 TRACE_FUNCTION("rAT_PercentCGEV()");
409
410 }
411 /*
412 +--------------------------------------------------------------------+
413 | PROJECT : GPRS (8441) MODULE : GACI_RET |
414 | STATE : code ROUTINE : rAT_PlusCGREG |
415 +--------------------------------------------------------------------+
416
417 PURPOSE : handles rAT_PlusCGREG call back
418
419 */
420 GLOBAL void rAT_PlusCGREG ( T_CGREG_STAT stat, USHORT lac, USHORT ci )
421 {
422
423 TRACE_FUNCTION("rAT_PlusCGREG()");
424
425
426 }
427 /*
428 +--------------------------------------------------------------------+
429 | PROJECT : GPRS (8441) MODULE : GACI_RET |
430 | STATE : code ROUTINE : rAT_changedQOS |
431 +--------------------------------------------------------------------+
432
433 PURPOSE : inform over the network initiated QOS modification
434
435 */
436 GLOBAL void rAT_changedQOS ( SHORT cid, T_QOS *qos )
437 {
438
439 TRACE_FUNCTION("rAT_changedQOS()");
440
441
442 }
443
444 /*
445 +--------------------------------------------------------------------+
446 | PROJECT : GPRS (8441) MODULE : GACI_RET |
447 | STATE : code ROUTINE : rCI_PercentSNCNT |
448 +--------------------------------------------------------------------+
449
450 PURPOSE : handles rCI_PercentSNCNT call back
451
452 */
453 GLOBAL void rAT_PercentSNCNT ( UBYTE c_id,
454 ULONG octets_uplink,
455 ULONG octets_downlink,
456 ULONG packets_uplink,
457 ULONG packets_downlink )
458 {
459 TRACE_FUNCTION("rAT_PercentSNCNT()");
460
461 }
462
463
464 /*
465 +--------------------------------------------------------------------+
466 | PROJECT : GPRS (8441) MODULE : GACI_RET |
467 | STATE : code ROUTINE : rAT_PercentCGREG |
468 +--------------------------------------------------------------------+
469
470 PURPOSE : handles rAT_PercentCGREG call back
471
472 */
473 GLOBAL void rAT_PercentCGREG ( T_P_CGREG_STAT stat, USHORT lac, USHORT ci, BOOL bActiveContext )
474 {
475
476 TRACE_FUNCTION("rAT_PercentCGREG()");
477
478
479 }
480
481 #endif /* MFW || FF_MMI_RIV */
482
483
484 #endif /* GPRS */