comparison g23m/condat/ms/src/bmi/ATBWapACI.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 CONDAT (UK)
4
5 ********************************************************************************
6
7 This software product is the property of Condat (UK) Ltd and may not be
8 disclosed to any third party without the express permission of the owner.
9
10 ********************************************************************************
11
12 $Project name:
13 $Project code:
14 $Module:
15 $File: ATBWapACI.c
16 $Revision:
17
18 $Author: Condat(UK)
19 $Date:
20
21 ********************************************************************************
22
23 Description:
24 Provides an interface between the ATB and the ACI.
25
26
27 ********************************************************************************
28
29 $History: ATBWapACI.c
30
31 x0035544Nov 29, 2005 REF: MMI-SPR-33833(OMAPS00055207)
32 MMI making Riviera calls without using proper header files. So added appropriate header files.
33
34 xrashmic 20 Dec, 2005 OMAPS00061232 (on behalf of xreddymn)
35 Displaying of error message when image decoding fails
36
37 xrashmic 30 Aug, 2005 MMI-SPR-34024(OMAPS00048918) mem leak fix
38 Freeing ImageReq data in WAP memory only for plugin images.
39
40 Nov 02, 2005 DR OMAPS00052132 xdeepadh
41 Bug:Not able to access the SMS inbox and also not able to send SMS in Locosto Lite build
42 Fix: The ATI Enums usage has been put under the FF_ATI flag.
43
44 xrashmic 17 Aug, 2005 MMI-SPR-31364
45 When it is detected that a very large page is being opened, the wap adapter sends a message.
46 We need to exit wap and display a error dialog as we have memory constraints.
47
48 xreddymn Jun-29-2005 MMI-ENH-32467:
49 Handling of animated GIF images
50
51 July 18 2005 REF: MMI-SPR-32012 x0012849
52 To change the functionality of RSK , when there is no page to go back.
53
54 xrashmic 29 Jun, 2005 MMI-SPR-32462
55 Patch given by Kyle for display of table border
56
57 xreddymn Jun-21-2005 MMI-SPR-30291: Send one message for the entire profile,
58 instead of sending one parameter at a time, to the WAP adapter
59
60 xreddymn May-15-2005 MMI-SPR-30962: Added changes to maintain WAP busy state
61 during MMS transactions.
62
63 xreddymn May-14-2005 MMI-SPR-30834: added send memory free indication
64 from MMI to WAP
65
66 xrashmic 12 May, 2005 MMI-SPR-30834
67 For input text box, adding of [] is moved from wap adapter to bmi
68
69 xreddymn Mar-22-2005 MMI-SPR-29767
70 Modified behaviour of SL push message handling in MMI
71
72 xreddymn Mar-11-2005 MMI-SPR-29510
73 Enabled listing of SL WAP push messages
74
75 xreddymn Mar-05-2005 MMI-SPR-26144
76 Disabled dialog boxes that affect MMS send display
77
78 xrashmic 08 Feb, 2005 MMI-SPR-27853
79 Error handling in sending MMS and also displaying the progress value
80
81 xreddymn Mar-11-2005 MMI-SPR-29510
82 Enabled listing of SL WAP push messages
83
84 Jan-24-2005 MMI-SPR-28135 - xreddymn: WAP_OTA settings saved in WAP profiles
85
86 xrashmic 21 Jan, 2005 MMI-SPR-28223
87 Saving the information passed by wap adapter if the image is from plugin or normal wap page.
88
89 Dec-10-2003 MMI-SPR-26159 - xreddymn: Prevent duplicate entries in History List
90
91 15/05/2003 - SPR#1983 - SH - Updated to latest from 1.6.3 version.
92
93 $End
94
95 *******************************************************************************/
96
97
98
99 #ifndef PSA_WAPS_C
100 #define PSA_WAPS_C
101 #endif
102
103 #ifdef MFW
104 #define ENTITY_MFW
105 #else
106 #ifdef SMI
107 #define ENTITY_SMI
108 #else
109 #define ENTITY_ACI
110 #endif
111 #endif
112
113 #define ACI_MEMBER
114
115 /*==== INCLUDES ===================================================*/
116
117 #include <stdio.h>
118 #include <string.h>
119 #include <stdlib.h>
120
121 #include "typedefs.h"
122 #include "pconst.cdg"
123 #include "mconst.cdg"
124 #include "message.h"
125 #include "ccdapi.h"
126 #include "vsi.h"
127 #include "custom.h"
128 #include "gsm.h"
129 #include "prim.h"
130 #include "cnf_aci.h"
131 #include "mon_aci.h"
132 #include "pei.h"
133 #include "tok.h"
134 #include "message.h"
135 #include "prim.h"
136 #include "aci_cmh.h"
137 #include "ati_cmd.h"
138 #include "aci_cmd.h"
139
140 /* BEGIN ADD: Sumit : Req ID: : 31-Mar-2005*/
141 #ifndef NEPTUNE_BOARD
142 /* END ADD: Sumit : Req ID: : 31-Mar-2005*/
143 #include "ffs/ffs.h"
144 /* BEGIN ADD: Sumit : Req ID: : 31-Mar-2005*/
145 #else
146 #include "ffs.h"
147 #endif
148 /* END ADD: Sumit : Req ID: : 31-Mar-2005*/
149
150 #ifdef FF_GPF_TCPIP
151 #include "leconfig.h"
152 #include "capimic.h"
153 #include "aapimic.h"
154
155
156 #include "wapmic_types.h"
157 #include "wapmic_codec.h"
158 #else
159 #include "gledef.h"
160 #include "capiclnt.h"
161 #include "aapiclnt.h"
162
163 #include "wap_types.h"
164 #include "wap_codec.h"
165 #endif
166
167
168 #include "ATBData.h"
169 #include "ATBWapACI.h"
170
171 #include "ATBWapAUI.h"
172 #include "dspl.h"
173
174 #ifdef GPRS
175 #include "gaci_cmh.h"
176 #endif
177
178 //x0035544 29 Nov, 2005 MMI-SPR-55207
179 #ifndef NEPTUNE_BOARD //x0035544 Sudha - Guarded the below header files for Neptune.
180 #include "rvf/rvf_api.h" // for the function rvf_delay()
181 #endif
182 #ifdef FF_GPF_TCPIP
183 #include "tapimmi.h"
184
185 #include "socket_api.h"
186 #include "wapmic_sdlh.h"
187
188 // xreddymn Jan-24-2005 MMI-SPR-28135: WAP_OTA settings saved in WAP profiles
189 #include "mfw_ss.h" // For definitions of MFW_ASCII, MFW_DCS_UCS2
190
191 int ATB_convert_String( char * ipString, UBYTE ipDataType, int ipLength,
192 char * opString, UBYTE opDataType, int opLength, UBYTE addNull);
193 void ATB_wap_profile_add(T_WAP_PROFILE *p);
194
195 #endif
196
197
198 EXTERN char *atD (char *cl,UBYTE srcId);
199
200 //xrashmic 21 Jan, 2005 MMI-SPR-28223
201
202 /*******************************************************************************
203
204 $Function: M_MMI_WAP_READY_IND
205
206 $Description: Indicate to WAP that MMI is ready to receive events
207
208 $Returns: None.
209
210 $Arguments: parameter - data block
211
212 *******************************************************************************/
213
214
215 void M_MMI_WAP_READY_IND(T_MMI_WAP_READY_IND *parameter)
216 {
217 #ifdef TRACE_ATBWAPACI
218 TRACE_FUNCTION("M_MMI_WAP_READY_IND");
219 #endif
220
221 mmi_coder(WAP_READY_IND_ID,(void*)parameter);
222
223 return;
224 }
225
226
227 /*******************************************************************************
228
229 $Function: M_MMI_WAP_START_IND
230
231 $Description: Tell WAP Browser to start up
232
233 $Returns: None.
234
235 $Arguments: parameter - data block
236
237 *******************************************************************************/
238
239 #ifdef CO_UDP_IP
240 void M_MMI_WAP_START_IND(T_MMI_WAP_START_IND *parameter)
241 #else
242 void M_MMI_WAP_START_IND(T_MMI_WAP_START_USER_AGENT_REQ *parameter)
243 #endif
244 {
245 #ifdef TRACE_ATBWAPACI
246 TRACE_FUNCTION("M_MMI_WAP_START_IND");
247 #endif
248
249 mmi_coder(WAP_START_IND_ID,(void*)parameter);
250
251 return;
252 }
253
254
255 /*******************************************************************************
256
257 $Function: M_MMI_WAP_NEW_VIEW_IND
258
259 $Description: Tell WAP Browser to start a new view
260
261 $Returns: None.
262
263 $Arguments: parameter - data block
264
265 *******************************************************************************/
266
267
268 void M_MMI_WAP_NEW_VIEW_IND(T_MMI_WAP_NEW_VIEW_IND *parameter)
269 {
270 #ifdef TRACE_ATBWAPACI
271 TRACE_FUNCTION("M_MMI_WAP_NEW_VIEW_IND");
272 TRACE_EVENT_P1("MMI object ID: %d",parameter->object_id);
273 TRACE_EVENT_P2("id/uamode: %d, %d", parameter->object_id, parameter->uaMode);
274 TRACE_EVENT_P2("width/height: %d, %d", parameter->view_width, parameter->view_height);
275 TRACE_EVENT_P2("font height: %d, width of 'A': %d", parameter->font_height, parameter->font_width[65]);
276 TRACE_EVENT_P2("unicode height: %d, unicode width: %d", parameter->unicode_width, parameter->unicode_height);
277 #endif
278
279 mmi_coder(WAP_NEW_VIEW_IND_ID,(void*)parameter);
280
281 return;
282 }
283
284
285 /*******************************************************************************
286
287 $Function: M_MMI_WAP_TERMINATE_IND
288
289 $Description: Tell WAP Browser to terminate.
290
291 $Returns: None.
292
293 $Arguments: parameter - data block
294
295 *******************************************************************************/
296
297 void M_MMI_WAP_TERMINATE_IND(T_MMI_WAP_TERMINATE_IND *parameter)
298 {
299 #ifdef TRACE_ATBWAPACI
300 TRACE_FUNCTION("M_MMI_WAP_TERMINATE_IND");
301 #endif
302
303 mmi_coder(WAP_TERMINATE_IND_ID,(void*)parameter);
304
305 return;
306 }
307
308
309 /*******************************************************************************
310
311 $Function: M_MMI_WAP_CLOSE_VIEW_IND
312
313 $Description: Close the specified view.
314
315 $Returns: None.
316
317 $Arguments: parameter - data block
318
319 *******************************************************************************/
320
321 void M_MMI_WAP_CLOSE_VIEW_IND(T_MMI_WAP_CLOSE_VIEW_IND *parameter)
322 {
323 #ifdef TRACE_WAP_WAPMMI
324 TRACE_FUNCTION("M_MMI_WAP_CLOSE_VIEW_IND");
325 TRACE_EVENT_P1("MMI object ID: %d",parameter->object_id);
326 #endif
327
328 mmi_coder(WAP_CLOSE_VIEW_IND_ID,(void*)parameter);
329
330 return;
331 }
332
333
334 /*******************************************************************************
335
336
337 $Function: M_MMI_WAP_CONFIGURE_IND
338
339 $Description: Send configuration information to WAP Browser
340
341 $Returns: None.
342
343 $Arguments: parameter - data block
344
345 *******************************************************************************/
346
347 void M_MMI_WAP_CONFIGURE_IND(T_MMI_WAP_CONFIGURE_IND *parameter)
348 {
349 #ifdef TRACE_ATBWAPACI
350 TRACE_FUNCTION("M_MMI_WAP_CONFIGURE_IND");
351 TRACE_EVENT_P1("MMI object ID: %d",parameter->object_id);
352 TRACE_EVENT_P3( "Type, Param, Length: %d, %d, %d", parameter->type, parameter->param, parameter->length);
353 TRACE_EVENT_P1( "Integer Value: %d", parameter->intvalue);
354 if (parameter->length>0)
355 ATB_trace_string(parameter->strvalue, parameter->length);
356 #endif
357
358 mmi_coder(WAP_CONFIGURE_IND_ID,(void*)parameter);
359
360 return;
361 }
362
363
364 /*******************************************************************************
365
366
367 $Function: M_MMI_WAP_CONNECTION_CONFIGURE_IND
368
369 $Description: Send configuration information to WAP Browser
370
371 $Returns: None.
372
373 $Arguments: parameter - data block
374
375 *******************************************************************************/
376
377 void M_MMI_WAP_CONNECTION_CONFIGURE_IND(T_MMI_WAP_CONNECTION_CONFIGURE_IND *parameter)
378 {
379 #ifdef TRACE_ATBWAPACI
380 TRACE_FUNCTION("M_MMI_WAP_CONNECTION_CONFIGURE_IND");
381 TRACE_EVENT_P1("MMI object ID: %d",parameter->object_id);
382 TRACE_EVENT_P3( "Type, Channel_id, Length: %d, %d, %d", parameter->type, parameter->channel_id, parameter->length);
383 TRACE_EVENT_P1( "Integer Value: %d", parameter->intvalue);
384 ATB_trace_string(parameter->strvalue, parameter->length);
385 #endif
386
387 mmi_coder(WAP_CONNECTION_CONFIGURE_IND_ID,(void*)parameter);
388
389 return;
390 }
391
392
393 /*******************************************************************************
394
395
396 $Function: M_MMI_WAP_DOWNLOAD_URL_IND
397
398 $Description: Requests WAP Browser to download a URL
399
400 $Returns: None.
401
402 $Arguments: parameter - data block
403
404 *******************************************************************************/
405
406 void M_MMI_WAP_DOWNLOAD_URL_IND(T_MMI_WAP_DOWNLOAD_URL_IND *parameter)
407 {
408 #ifdef TRACE_ATBWAPACI
409 TRACE_FUNCTION("M_MMI_WAP_DOWNLOAD_URL_IND");
410 TRACE_EVENT_P1("MMI object ID: %d",parameter->object_id);
411 TRACE_EVENT_P2( "URL length, Reload: %d, %d", parameter->url_length, parameter->reload);
412 ATB_trace_string(parameter->Url, parameter->url_length);
413 #endif
414
415 mmi_coder(WAP_DOWNLOAD_URL_IND_ID,(void*)parameter);
416
417 return;
418 }
419
420
421 /*******************************************************************************
422
423
424 $Function: M_MMI_WAP_BROWSE_CONTROL_IND
425
426 $Description: Sends browsing request to WAP Browser
427
428 $Returns: None.
429
430 $Arguments: parameter - data block
431
432 *******************************************************************************/
433
434 void M_MMI_WAP_BROWSE_CONTROL_IND(T_MMI_WAP_BROWSE_CONTROL_IND *parameter)
435 {
436 #ifdef TRACE_ATBWAPACI
437 TRACE_FUNCTION("M_MMI_WAP_BROWSE_CONTROL_IND");
438 TRACE_EVENT_P1("MMI object ID: %d",parameter->object_id);
439 TRACE_EVENT_P1( "Browse command: %d", parameter->browse_command);
440 #endif
441
442 mmi_coder(WAP_BROWSE_CONTROL_IND_ID,(void*)parameter);
443
444 return;
445 }
446
447
448 /*******************************************************************************
449
450
451 $Function: M_MMI_WAP_KEY_SELECTED_IND
452
453 $Description: Indicate to Browser that a WAP Key has been selected.
454
455 $Returns: None.
456
457 $Arguments: parameter - data block
458
459 *******************************************************************************/
460
461 void M_MMI_WAP_KEY_SELECTED_IND(T_MMI_WAP_KEY_SELECTED_IND *parameter)
462 {
463 #ifdef TRACE_ATBWAPACI
464 TRACE_FUNCTION("M_MMI_WAP_KEY_SELECTED_IND");
465 TRACE_EVENT_P1("MMI object ID: %d",parameter->object_id);
466 TRACE_EVENT_P1( "keyId: %d", parameter->keyId);
467 #endif
468
469 mmi_coder(WAP_KEY_SELECTED_IND_ID,(void*)parameter);
470
471 return;
472 }
473
474
475 /*******************************************************************************
476
477
478 $Function: M_MMI_WAP_INPUT_DIALOG_CNF
479
480 $Description: Confirmation of input dialog.
481
482 $Returns: None.
483
484 $Arguments: parameter - data block
485
486 *******************************************************************************/
487
488 void M_MMI_WAP_INPUT_DIALOG_CNF(T_MMI_WAP_INPUT_DIALOG_CNF *parameter)
489 {
490 #ifdef TRACE_ATBWAPACI
491 TRACE_FUNCTION("M_MMI_WAP_INPUT_DIALOG_CNF");
492 TRACE_EVENT_P1("MMI object ID: %d",parameter->object_id);
493 TRACE_EVENT_P2( "dialog_id, edited: %d, %d", parameter->dialog_id, parameter->edited);
494 ATB_trace_ushort_string(parameter->Text, parameter->text_length);
495 #endif
496
497 mmi_coder(WAP_INPUT_DIALOG_CNF_ID,(void*)parameter);
498
499 return;
500 }
501
502
503 /*******************************************************************************
504
505
506 $Function: M_MMI_WAP_PASSWORD_DIALOG_CNF
507
508 $Description: Confirmation of password dialog.
509
510 $Returns: None.
511
512 $Arguments: parameter - data block
513
514 *******************************************************************************/
515
516 void M_MMI_WAP_PASSWORD_DIALOG_CNF(T_MMI_WAP_PASSWORD_DIALOG_CNF *parameter)
517 {
518 #ifdef TRACE_ATBWAPACI
519 TRACE_FUNCTION("M_MMI_WAP_PASSWORD_DIALOG_CNF");
520 TRACE_EVENT_P1("MMI object ID: %d",parameter->object_id);
521 TRACE_EVENT_P1( "MMI dialog_id: %d", parameter->dialog_id);
522 ATB_trace_string(parameter->Input, parameter->input_length);
523 ATB_trace_string(parameter->Password, parameter->password_length);
524 #endif
525
526 mmi_coder(WAP_PASSWORD_DIALOG_CNF_ID,(void*)parameter);
527
528 return;
529 }
530
531
532 /*******************************************************************************
533
534
535 $Function: M_MMI_WAP_CONFIRM_DIALOG_CNF
536
537 $Description: Confirmation of confirm dialog.
538
539 $Returns: None
540
541 $Arguments: parameter - data block
542
543 *******************************************************************************/
544
545 void M_MMI_WAP_CONFIRM_DIALOG_CNF(T_MMI_WAP_CONFIRM_DIALOG_CNF *parameter)
546 {
547 #ifdef TRACE_ATBWAPACI
548 TRACE_FUNCTION("M_MMI_WAP_CONFIRM_DIALOG_CNF");
549 TRACE_EVENT_P1("MMI object ID: %d",parameter->object_id);
550 TRACE_EVENT_P2( "MMI dialog_id: %d, Answer: %d", parameter->dialog_id, parameter->answer);
551 #endif
552
553 mmi_coder(WAP_CONFIRM_DIALOG_CNF_ID,(void*)parameter);
554
555 return;
556 }
557
558
559 /*******************************************************************************
560
561
562 $Function: M_MMI_WAP_INFO_DIALOG_CNF
563
564 $Description: Confirmation of info dialog.
565
566 $Returns: None.
567
568 $Arguments: parameter - data block
569
570 *******************************************************************************/
571
572 void M_MMI_WAP_INFO_DIALOG_CNF(T_MMI_WAP_INFO_DIALOG_CNF *parameter)
573 {
574 #ifdef TRACE_ATBWAPACI
575 TRACE_FUNCTION("M_MMI_WAP_INFO_DIALOG_CNF");
576 TRACE_EVENT_P1("MMI object ID: %d",parameter->object_id);
577 TRACE_EVENT_P1( "MMI dialog_id: %d", parameter->dialog_id);
578 #endif
579
580 mmi_coder(WAP_INFO_DIALOG_CNF_ID,(void*)parameter);
581
582 return;
583 }
584
585
586 /*******************************************************************************
587
588
589 $Function: M_MMI_WAP_DRAW_CARD_REQ
590
591 $Description: Request WAP Browser to draw the current card.
592
593 $Returns: None.
594
595 $Arguments: parameter - data block
596
597 *******************************************************************************/
598
599 void M_MMI_WAP_DRAW_CARD_REQ(T_MMI_WAP_DRAW_CARD_REQ *parameter)
600 {
601 T_WAP_VIEW *View = ATB_wap_get_view(parameter->object_id);
602
603 #ifdef TRACE_ATBWAPACI
604 TRACE_FUNCTION("M_MMI_WAP_DRAW_CARD_REQ");
605 TRACE_EVENT_P1("MMI object ID: %d",parameter->object_id);
606 #endif
607
608 if (View)
609 mmi_coder(WAP_DRAW_CARD_REQ_ID,(void*)parameter);
610
611 return;
612 }
613
614
615 /*******************************************************************************
616
617
618 $Function: M_MMI_WAP_CONNECT_CNF
619
620 $Description: Confirmation to WAP Browser that WAP call is connected
621
622 $Returns: None.
623
624 $Arguments: parameter - data block
625
626 *******************************************************************************/
627
628 void M_MMI_WAP_CONNECT_CNF(T_MMI_WAP_CONNECT_CNF *parameter)
629 {
630 #ifdef TRACE_ATBWAPACI
631 TRACE_FUNCTION("M_MMI_WAP_CONNECT_CNF");
632 TRACE_EVENT_P1("MMI object ID: %d",parameter->object_id);
633 #endif
634
635 mmi_coder(WAP_CONNECT_CNF_ID,(void*)parameter);
636
637 return;
638 }
639
640
641 /*******************************************************************************
642
643 $Function: M_MMI_WAP_DISCONNECT_IND
644
645 $Description: Tell WAP Browser to disconnect
646
647 $Returns: None.
648
649 $Arguments: parameter - data block
650
651 *******************************************************************************/
652
653 void M_MMI_WAP_DISCONNECT_IND(T_MMI_WAP_DISCONNECT_IND *parameter)
654 {
655 #ifdef TRACE_ATBWAPACI
656 TRACE_FUNCTION("M_MMI_WAP_DISCONNECT_IND");
657 TRACE_EVENT_P1("MMI object ID: %d",parameter->object_id);
658 #endif
659
660 mmi_coder(WAP_DISCONNECT_IND_ID,(void*)parameter);
661
662 return;
663 }
664
665
666 /*******************************************************************************
667
668
669 $Function: M_MMI_WAP_CACHE_PREPARE_IND
670
671 $Description: Tell WAP Browser to prepare the cache for shutdown
672
673 $Returns: None
674
675 $Arguments: parameter - data block
676
677 *******************************************************************************/
678
679 void M_MMI_WAP_CACHE_PREPARE_IND(T_MMI_WAP_CACHE_PREPARE_IND *parameter)
680 {
681 #ifdef TRACE_ATBWAPACI
682 TRACE_FUNCTION("M_MMI_WAP_CACHE_PREPARE_IND");
683 #endif
684
685 mmi_coder(WAP_CACHE_PREPARE_IND_ID,(void*)parameter);
686
687 return;
688 }
689
690
691 #ifdef FF_GPF_TCPIP
692 /*******************************************************************************
693
694 $Function: M_MMI_WAP_CONFIG_CNF
695
696 $Description: SPR#2086 - SH - SAR
697
698 $Returns: None
699
700 $Arguments: parameter - data block
701
702 *******************************************************************************/
703
704 void M_MMI_WAP_CONFIG_CNF(T_MMI_WAP_CONFIG_CNF *parameter)
705 {
706 #ifdef TRACE_ATBWAPACI
707 TRACE_FUNCTION("M_MMI_WAP_CONFIG_CNF");
708 #endif
709
710 mmi_coder(WAP_CONFIG_CNF_ID,(void*)parameter);
711
712 return;
713 }
714
715 /*******************************************************************************
716
717 $Function: M_MMI_WAP_CONTENT_REQ
718
719 $Description: SPR#2086 - SH - SAR
720
721 $Returns: None
722
723 $Arguments: parameter - data block
724
725 *******************************************************************************/
726
727 void M_MMI_WAP_CONTENT_REQ(T_MMI_WAP_CONTENT_REQ *parameter)
728 {
729 #ifdef TRACE_ATBWAPACI
730 TRACE_FUNCTION("M_MMI_WAP_GET_CONTENT_REQ");
731 #endif
732
733 mmi_coder(WAP_CONTENT_REQ_ID,(void*)parameter);
734
735 return;
736 }
737
738 /*******************************************************************************
739
740 $Function: M_MMI_WAP_CONTENT_POST_REQ
741
742 $Description: SPR#2086 - SH - SAR
743
744 $Returns: None
745
746 $Arguments: parameter - data block
747
748 *******************************************************************************/
749
750 void M_MMI_WAP_CONTENT_POST_REQ(T_MMI_WAP_CONTENT_POST_REQ *parameter)
751 {
752 #ifdef TRACE_ATBWAPACI
753 TRACE_FUNCTION("M_MMI_WAP_CONTENT_POST_REQ");
754 #endif
755
756 mmi_coder(WAP_CONTENT_POST_REQ_ID,(void*)parameter);
757
758 return;
759 }
760
761
762 /*******************************************************************************
763
764 $Function: M_MMI_WAP_CONTENT_POST_MORE_IND
765
766 $Description: SPR#2086 - SH - SAR
767
768 $Returns: None
769
770 $Arguments: parameter - data block
771
772 *******************************************************************************/
773
774 void M_MMI_WAP_CONTENT_POST_MORE_REQ(T_MMI_WAP_CONTENT_POST_MORE_REQ *parameter)
775 {
776 #ifdef TRACE_ATBWAPACI
777 TRACE_FUNCTION("M_MMI_WAP_CONTENT_POST_MORE_REQ");
778 #endif
779
780 mmi_coder(WAP_CONTENT_POST_MORE_REQ_ID,(void*)parameter);
781
782 return;
783 }
784
785 /*******************************************************************************
786
787 $Function: M_MMI_WAP_CONTENT_CNF
788
789 $Description: SPR#2086 - SH - SAR
790
791 $Returns: None
792
793 $Arguments: parameter - data block
794
795 *******************************************************************************/
796
797 void M_MMI_WAP_CONTENT_CNF(T_MMI_WAP_CONTENT_CNF *parameter)
798 {
799 #ifdef TRACE_ATBWAPACI
800 TRACE_FUNCTION("M_MMI_WAP_CONTENT_CNF");
801 #endif
802
803 mmi_coder(WAP_CONTENT_CNF_ID,(void*)parameter);
804
805 return;
806 }
807
808
809 /*******************************************************************************
810
811 $Function: M_MMI_WAP_CONTENT_CANCEL_IND
812
813 $Description: SPR#2086 - SH - SAR
814
815 $Returns: None
816
817 $Arguments: parameter - data block
818
819 *******************************************************************************/
820
821 void M_MMI_WAP_CONTENT_CANCEL_IND(T_MMI_WAP_CONTENT_CANCEL_IND *parameter)
822 {
823 #ifdef TRACE_ATBWAPACI
824 TRACE_FUNCTION("M_MMI_WAP_CONTENT_CANCEL_IND");
825 #endif
826
827 mmi_coder(WAP_CONTENT_CANCEL_IND_ID,(void*)parameter);
828
829 return;
830 }
831
832
833 /*******************************************************************************
834
835 $Function: M_MMI_WAP_PUSH_LOAD_SI_IND
836
837 $Description: Load the service pointed to by a SI
838 SPR#2086 - Added
839
840 $Returns: None.
841
842 $Arguments: parameter - Data block
843
844 *******************************************************************************/
845
846 void M_MMI_WAP_PUSH_LOAD_SI_IND(T_MMI_WAP_PUSH_LOAD_SI_IND *parameter)
847 {
848 #ifdef TRACE_ATBWAPACI
849 TRACE_FUNCTION("M_MMI_WAP_PUSH_LOAD_SI_IND");
850 #endif
851
852 mmi_coder(WAP_PUSH_LOAD_SI_IND_ID,(void*)parameter);
853
854 return;
855 }
856
857 /*******************************************************************************
858
859 $Function: M_MMI_WAP_PUSH_DELETE_SI_IND
860
861 $Description: Delete an SI
862 SPR#2086 - Added
863
864 $Returns: None.
865
866 $Arguments: parameter - Data block
867
868 *******************************************************************************/
869
870 void M_MMI_WAP_PUSH_DELETE_SI_IND(T_MMI_WAP_PUSH_DELETE_SI_IND *parameter)
871 {
872 #ifdef TRACE_ATBWAPACI
873 TRACE_FUNCTION("M_MMI_WAP_PUSH_DELETE_SI_IND");
874 #endif
875
876 mmi_coder(WAP_PUSH_DELETE_SI_IND_ID,(void*)parameter);
877
878 return;
879
880 }
881
882
883 /*******************************************************************************
884
885 $Function: M_MMI_WAP_PUSH_GET_SI_INFO_REQ
886
887 $Description: Request info on an SI
888 SPR#2086 - Added
889
890 $Returns: None.
891
892 $Arguments: parameter - Data block
893
894 *******************************************************************************/
895
896 void M_MMI_WAP_PUSH_GET_SI_INFO_REQ(T_MMI_WAP_PUSH_GET_SI_INFO_REQ *parameter)
897 {
898 #ifdef TRACE_ATBWAPACI
899 TRACE_FUNCTION("M_MMI_WAP_PUSH_GET_SI_INFO_REQ");
900 #endif
901
902 mmi_coder(WAP_PUSH_GET_SI_INFO_REQ_ID,(void*)parameter);
903
904 return;
905
906 }
907
908 /*******************************************************************************
909
910 $Function: M_MMI_WAP_PUSH_LOAD_SL_IND
911
912 $Description: Load the service pointed to by an SL
913 SPR#2086 - Added
914
915 $Returns: None.
916
917 $Arguments: parameter - Data block
918
919 *******************************************************************************/
920
921 void M_MMI_WAP_PUSH_LOAD_SL_IND(T_MMI_WAP_PUSH_LOAD_SL_IND *parameter)
922 {
923
924 #ifdef TRACE_WAP_WAPMMI
925 TRACE_EVENT("M_MMI_WAP_PUSH_LOAD_SL_IND");
926 #endif
927
928 mmi_coder(WAP_PUSH_LOAD_SL_IND_ID,(void*)parameter);
929
930 return;
931 }
932
933
934 /*******************************************************************************
935
936 $Function: M_MMI_WAP_PUSH_DELETE_SL_IND
937
938 $Description: Delete an SL
939 SPR#2086 - Added
940
941 $Returns: None.
942
943 $Arguments: parameter - Data block
944
945 *******************************************************************************/
946
947 void M_MMI_WAP_PUSH_DELETE_SL_IND(T_MMI_WAP_PUSH_DELETE_SL_IND *parameter)
948 {
949 #ifdef TRACE_WAP_WAPMMI
950 TRACE_EVENT("M_MMI_WAP_PUSH_DELETE_SL_IND");
951 #endif
952
953 mmi_coder(WAP_PUSH_DELETE_SL_IND_ID,(void*)parameter);
954
955 return;
956
957 }
958
959
960 /*******************************************************************************
961
962 $Function: M_MMI_WAP_PUSH_GET_SL_INFO_REQ
963
964 $Description: Request info on an SL
965 SPR#2086 - Added
966
967 $Returns: None.
968
969 $Arguments: parameter - Data block
970
971 *******************************************************************************/
972
973 void M_MMI_WAP_PUSH_GET_SL_INFO_REQ(T_MMI_WAP_PUSH_GET_SL_INFO_REQ *parameter)
974 {
975
976 #ifdef TRACE_WAP_WAPMMI
977 TRACE_EVENT("M_MMI_WAP_PUSH_GET_SL_INFO_REQ");
978 #endif
979
980 mmi_coder(WAP_PUSH_GET_SL_INFO_REQ_ID,(void*)parameter);
981
982 return;
983
984 }
985
986
987 /*******************************************************************************
988
989 $Function: M_MMI_WAP_PUSH_CONNECTION_CNF
990
991 $Description: Confirm that Push connection information has been set up
992 SPR#2086 - Added
993
994 $Returns: None.
995
996 $Arguments: parameter - Data block
997
998 *******************************************************************************/
999
1000 void M_MMI_WAP_PUSH_CONNECTION_CNF(T_MMI_WAP_PUSH_CONNECTION_CNF *parameter)
1001 {
1002
1003 #ifdef TRACE_WAP_WAPMMI
1004 TRACE_EVENT("M_MMI_WAP_PUSH_CONNECTION_CNF");
1005 #endif
1006
1007 mmi_coder(WAP_PUSH_CONNECTION_CNF_ID,(void*)parameter);
1008
1009 return;
1010
1011 }
1012
1013
1014 /*******************************************************************************
1015
1016 $Function: M_MMI_WAP_PUSH_CHANGE_STATUS_IND
1017
1018 $Description: Change the status of a push message
1019 SPR#2086 - Added
1020
1021 $Returns: None.
1022
1023 $Arguments: parameter - Data block
1024
1025 *******************************************************************************/
1026
1027 void M_MMI_WAP_PUSH_CHANGE_STATUS_IND(T_MMI_WAP_PUSH_CHANGE_STATUS_IND *parameter)
1028 {
1029
1030 #ifdef TRACE_WAP_WAPMMI
1031 TRACE_EVENT("M_MMI_WAP_PUSH_CHANGE_STATUS_IND");
1032 #endif
1033
1034 mmi_coder(WAP_PUSH_CHANGE_STATUS_IND_ID,(void*)parameter);
1035
1036 return;
1037
1038 }
1039
1040 /*******************************************************************************
1041
1042 $Function: M_MMI_WAP_PUSH_REMOVE_MESSAGE_IND
1043
1044 $Description: Remove a push message
1045 SPR#2086 - Added
1046
1047 $Returns: None.
1048
1049 $Arguments: parameter - Data block
1050
1051 *******************************************************************************/
1052
1053 void M_MMI_WAP_PUSH_REMOVE_MESSAGE_IND(T_MMI_WAP_PUSH_REMOVE_MESSAGE_IND *parameter)
1054 {
1055
1056 #ifdef TRACE_WAP_WAPMMI
1057 TRACE_EVENT("M_MMI_WAP_PUSH_REMOVE_MESSAGE_IND");
1058 #endif
1059
1060 mmi_coder(WAP_PUSH_REMOVE_MESSAGE_IND_ID,(void*)parameter);
1061
1062 return;
1063
1064 }
1065
1066 /*******************************************************************************
1067
1068 $Function: MMI_WAP_PUSH_CHECK_UNLOADED_MSG_REQ
1069
1070 $Description: Check if there are any unloaded messages
1071 SPR#2086 - Added
1072
1073 $Returns: None.
1074
1075 $Arguments: parameter - Data block
1076
1077 *******************************************************************************/
1078
1079 void M_MMI_WAP_PUSH_CHECK_UNLOADED_MSG_REQ(T_MMI_WAP_PUSH_CHECK_UNLOADED_MSG_REQ *parameter)
1080 {
1081
1082 #ifdef TRACE_WAP_WAPMMI
1083 TRACE_EVENT("M_MMI_WAP_PUSH_CHECK_UNLOADED_MSG_REQ");
1084 #endif
1085
1086 mmi_coder(WAP_PUSH_CHECK_UNLOADED_MSG_REQ_ID,(void*)parameter);
1087
1088 return;
1089
1090 }
1091
1092
1093 /*******************************************************************************
1094
1095
1096 $Function: M_MMI_WAP_PUSH_SAVE_TO_FLASH_IND
1097
1098 $Description: Save push repository to flash
1099 SPR#2086 - Added
1100
1101 $Returns: None.
1102
1103 $Arguments: parameter - Data block
1104
1105 *******************************************************************************/
1106
1107 void M_MMI_WAP_PUSH_SAVE_TO_FLASH_IND(T_MMI_WAP_PUSH_SAVE_TO_FLASH_IND *parameter)
1108 {
1109
1110 #ifdef TRACE_WAP_WAPMMI
1111 TRACE_EVENT("M_MMI_WAP_PUSH_SAVE_TO_FLASH_IND");
1112 #endif
1113
1114 mmi_coder(WAP_PUSH_SAVE_TO_FLASH_IND_ID,(void*)parameter);
1115
1116 return;
1117
1118 }
1119
1120 /*******************************************************************************
1121
1122 $Function: M_MMI_WAP_PUSH_SMS_RECEIVED_IND
1123
1124 $Description: WAP SMS has been received
1125 SPR#2086 - Added
1126
1127 $Returns: None
1128
1129 $Arguments: parameter - Data block
1130
1131 *******************************************************************************/
1132
1133 void M_MMI_WAP_PUSH_SMS_RECEIVED_IND(T_MMI_WAP_PUSH_SMS_RECEIVED_IND *parameter)
1134 {
1135 #ifdef TRACE_WAP_WAPMMI
1136 TRACE_EVENT("M_MMI_WAP_PUSH_SMS_RECEIVED_IND");
1137 #endif
1138
1139 mmi_coder(WAP_PUSH_SMS_RECEIVED_IND_ID, (void*)parameter);
1140
1141 return;
1142 }
1143
1144 /*******************************************************************************
1145
1146 $Function: M_MMI_WAP_PUSH_SMS_SENT_IND
1147
1148 $Description: WAP SMS has been sent
1149 SPR#2086 - Added
1150
1151 $Returns: None
1152
1153 $Arguments: parameter - Data block
1154
1155 *******************************************************************************/
1156
1157 void M_MMI_WAP_PUSH_SMS_SENT_IND(T_MMI_WAP_PUSH_SMS_SENT_IND *parameter)
1158 {
1159
1160 #ifdef TRACE_WAP_WAPMMI
1161 TRACE_EVENT("M_MMI_WAP_PUSH_SMS_SENT_IND");
1162 #endif
1163
1164 mmi_coder(WAP_PUSH_SMS_SENT_IND_ID, (void *)parameter);
1165
1166 return;
1167 }
1168
1169 /*******************************************************************************
1170
1171 $Function: M_MMI_WAP_PUSH_SMS_ERROR_IND
1172
1173 $Description: WAP SMS has not been sent
1174 SPR#2086 - Added
1175
1176 $Returns: None
1177
1178 $Arguments: parameter - Data block
1179
1180 *******************************************************************************/
1181
1182 void M_MMI_WAP_PUSH_SMS_ERROR_IND(T_MMI_WAP_PUSH_SMS_ERROR_IND *parameter)
1183 {
1184
1185 #ifdef TRACE_WAP_WAPMMI
1186 TRACE_EVENT("M_MMI_WAP_PUSH_SMS_ERROR_IND");
1187 #endif
1188
1189 mmi_coder(WAP_PUSH_SMS_ERROR_IND_ID, (void *)parameter);
1190
1191 return;
1192 }
1193
1194 #endif
1195
1196
1197 #ifdef FF_GPF_TCPIP
1198 /*******************************************************************************
1199
1200
1201 $Function: M_WAP_MMI_CONTROL_IND
1202
1203 $Description:
1204
1205 $Returns:
1206
1207 $Arguments: parameter - Data block
1208
1209 *******************************************************************************/
1210
1211 void M_WAP_MMI_CONTROL_IND(T_WAP_MMI_CONTROL_IND *parameter)
1212 {
1213 T_WAP_VIEW *View;
1214
1215 #ifdef TRACE_ATBWAPACI
1216 TRACE_FUNCTION("M_WAP_MMI_CONTROL_IND");
1217 TRACE_EVENT_P1("MMI object ID: %d",parameter->object_id);
1218 TRACE_EVENT_P3( "Status, Error, Click: %d, %d, %d", parameter->status_code, parameter->error_code,
1219 parameter->play_standard_click);
1220 #endif
1221
1222 View = ATB_wap_get_view(parameter->object_id);
1223
1224 /* SPR#1816 - SH - Check if we're shutting down */
1225
1226 if (ATB_wap_status_get(View, ATB_WAP_SHUTTING_DOWN))
1227 {
1228 TRACE_EVENT("*** SHUTTING DOWN ***");
1229 return;
1230 }
1231
1232 /* Intercept fatal error */
1233 //if (parameter->error_code==8002)
1234 //OUT OF MEMORY code 0x903
1235 if (parameter->error_code==2307)
1236 {
1237 AUI_error_dialog(View, parameter->error_code);
1238 return;
1239 }
1240
1241 /* SPR#2086 - SH - Modified slightly to report status values
1242 * correctly when downloading content using SAR */
1243
1244 /* If WSP session failed, try using second IP address */
1245
1246 if (parameter->error_code==1014 && !View->secondaryIP)
1247 {
1248 ATB_wap_secondary_IP(View);
1249 return;
1250 }
1251
1252 /* For any other error, display the error dialog */
1253
1254 if (parameter->error_code!=0 && parameter->error_code != 0x20)
1255 {
1256 AUI_error_dialog(View, parameter->error_code);
1257 return;
1258 }
1259
1260 /* Otherwise, report selected status values */
1261
1262 switch(parameter->status_code)
1263 {
1264 case 12: /* Data is being downloaded */
1265 ATB_wap_status_change(View, ATB_WAP_DOWNLOADING);
1266 break;
1267
1268 case 13: /* Data is no longer being downloaded */
1269 ATB_wap_status_change(View, ATB_WAP_NO_STATUS);
1270 break;
1271
1272 case 7: /* Content taken from network server */
1273 if (View->object_id==WAP_DOWNLOAD_VIEW)
1274 {
1275 ATB_wap_status_change(View, ATB_WAP_DOWNLOADING);
1276 }
1277 break;
1278
1279 case 9: /* Content no longer being taken */
1280 if (View->object_id==WAP_DOWNLOAD_VIEW)
1281 {
1282 ATB_wap_status_change(View, ATB_WAP_NO_STATUS);
1283 }
1284 break;
1285 }
1286
1287 return;
1288 }
1289
1290 #else /* #ifdef FF_GPF_TCPIP */
1291
1292 /*******************************************************************************
1293
1294 $Function: M_WAP_MMI_CONTROL_IND
1295
1296 $Description: Send control information to MMI
1297
1298 $Returns: None.
1299
1300 $Arguments: parameter - data block
1301
1302 *******************************************************************************/
1303
1304 void M_WAP_MMI_CONTROL_IND(T_WAP_MMI_CONTROL_IND *parameter)
1305 {
1306 T_WAP_VIEW *View;
1307
1308 #ifdef TRACE_ATBWAPACI
1309 TRACE_FUNCTION("M_WAP_MMI_CONTROL_IND");
1310 TRACE_EVENT_P1("MMI object ID: %d",parameter->object_id);
1311 TRACE_EVENT_P3( "Status, Error, Click: %d, %d, %d", parameter->status_code, parameter->error_code,
1312 parameter->play_standard_click);
1313 #endif
1314
1315 View = ATB_wap_get_view(parameter->object_id);
1316
1317 /* Check if we're shutting down */
1318
1319 if (ATB_wap_status_get(View, ATB_WAP_SHUTTING_DOWN))
1320 {
1321 TRACE_EVENT("*** SHUTTING DOWN ***");
1322 return;
1323 }
1324
1325 /* Intercept fatal error */
1326
1327 if (parameter->error_code==8002)
1328
1329 {
1330 AUI_error_dialog(View, parameter->error_code);
1331 return;
1332 }
1333
1334 /* For non-fatal error, do not report if there is no view open */
1335
1336 if (!View)
1337 {
1338 TRACE_EVENT("View is NULL");
1339 return;
1340 }
1341
1342 /* Data is being downloaded; update status display */
1343
1344 if (parameter->status_code==14)
1345 {
1346 ATB_wap_status_change(View, ATB_WAP_DOWNLOADING);
1347 }
1348
1349 /* Data is no longer being downloaded */
1350
1351 if (parameter->status_code==15)
1352 {
1353 ATB_wap_status_change(View, ATB_WAP_NO_STATUS);
1354 }
1355
1356 /* If WSP session failed, try using second IP address */
1357
1358 if (parameter->error_code==1014 && !View->secondaryIP)
1359 {
1360 ATB_wap_secondary_IP(View);
1361 return;
1362 }
1363
1364 /* Create error dialog if required */
1365
1366 if (parameter->error_code!=0 && parameter->error_code != 0x20)
1367 {
1368 AUI_error_dialog(View, parameter->error_code);
1369
1370 }
1371
1372 return;
1373 }
1374
1375
1376 #endif /* ! #ifdef FF_GPF_TCPIP */
1377
1378 /*******************************************************************************
1379
1380
1381 $Function: M_WAP_MMI_NEW_KEY_IND
1382
1383 $Description: A new WAP key is to be created.
1384
1385 $Returns: None.
1386
1387 $Arguments: parameter - data block
1388
1389 *******************************************************************************/
1390
1391 void M_WAP_MMI_NEW_KEY_IND(T_WAP_MMI_NEW_KEY_IND *parameter)
1392 {
1393 T_WAP_VIEW *View;
1394
1395 #ifdef TRACE_ATBWAPACI
1396 TRACE_FUNCTION("M_WAP_MMI_NEW_KEY_IND");
1397 TRACE_EVENT_P1("MMI object ID: %d",parameter->object_id);
1398 TRACE_EVENT_P2( "Key ID, Key Type: %d, %d", parameter->keyId, parameter->key_type);
1399 ATB_trace_ushort_string(parameter->Label, parameter->label_length);
1400 #endif
1401
1402 if (!(View = ATB_wap_get_view(parameter->object_id)))
1403 return;
1404
1405 /* SPR#1816 - SH - Check if we're shutting down */
1406
1407 if (ATB_wap_status_get(View, ATB_WAP_SHUTTING_DOWN))
1408 {
1409 TRACE_EVENT("*** SHUTTING DOWN ***");
1410 return;
1411 }
1412
1413 if (parameter->key_type == WAP_KEY_PREV)
1414 AUI_wap_change_soft_key(View, parameter->Label,
1415 (USHORT)parameter->label_length, parameter->keyId);
1416
1417 return;
1418 }
1419
1420
1421 /*******************************************************************************
1422
1423
1424 $Function: M_WAP_MMI_INPUT_DIALOG_REQ
1425
1426 $Description: An input dialog is to be displayed.
1427
1428 $Returns: None.
1429
1430 $Arguments: parameter - data block
1431
1432 *******************************************************************************/
1433
1434 void M_WAP_MMI_INPUT_DIALOG_REQ(T_WAP_MMI_INPUT_DIALOG_REQ *parameter)
1435 {
1436 T_WAP_VIEW *View;
1437
1438 #ifdef TRACE_ATBWAPACI
1439 TRACE_FUNCTION("M_WAP_MMI_INPUT_DIALOG_REQ");
1440 TRACE_EVENT_P1("MMI object ID: %d",parameter->object_id);
1441 TRACE_EVENT_P2( "MMI dialog_id, is_password: %d, %d", parameter->dialog_id, parameter->is_password);
1442 TRACE_EVENT_P3( "MMI empty_ok, visible, size: %d, %d, %d", parameter->empty_ok,
1443 parameter->visible, parameter->size);
1444 ATB_trace_ushort_string(parameter->Title, parameter->title_length);
1445 ATB_trace_ushort_string(parameter->Input, parameter->input_length);
1446 ATB_trace_ushort_string(parameter->Format, parameter->format_length);
1447 #endif // TRACE_ATBWAPACI
1448
1449 if (!(View = ATB_wap_get_view(parameter->object_id)))
1450 return;
1451
1452 /* SPR#1816 - SH - Check if we're shutting down */
1453
1454 if (ATB_wap_status_get(View, ATB_WAP_SHUTTING_DOWN))
1455 {
1456 TRACE_EVENT("*** SHUTTING DOWN ***");
1457 return;
1458 }
1459
1460 #ifdef FF_GPF_TCPIP
1461 AUI_wap_input_dialog_open(parameter, View);
1462 #else
1463 AUI_wap_input_dialog_open(parameter);
1464 #endif
1465
1466 return;
1467 }
1468
1469
1470 /*******************************************************************************
1471
1472
1473 $Function: M_WAP_MMI_PASSWORD_DIALOG_REQ
1474
1475 $Description: A password dialog is to be displayed.
1476
1477 $Returns: None
1478
1479 $Arguments: parameter - data block
1480
1481 *******************************************************************************/
1482
1483 void M_WAP_MMI_PASSWORD_DIALOG_REQ(T_WAP_MMI_PASSWORD_DIALOG_REQ *parameter)
1484 {
1485 T_WAP_VIEW *View;
1486
1487 #ifdef TRACE_ATBWAPACI
1488 TRACE_FUNCTION("M_WAP_MMI_PASSWORD_DIALOG_REQ");
1489 TRACE_EVENT_P1("MMI object ID: %d",parameter->object_id);
1490 TRACE_EVENT_P2( "MMI dialog_id, dialog_type: %d, %d", parameter->dialog_id, parameter->dialog_type);
1491 /* SPR#2393 - SH - Changed password fields */
1492 ATB_trace_string(parameter->Realm, parameter->realm_length);
1493 #endif
1494
1495 if (!(View = ATB_wap_get_view(parameter->object_id)))
1496 return;
1497
1498 /* Check if we're shutting down */
1499
1500 if (ATB_wap_status_get(View, ATB_WAP_SHUTTING_DOWN))
1501 {
1502 TRACE_EVENT("*** SHUTTING DOWN ***");
1503 return;
1504 }
1505
1506 #ifdef FF_GPF_TCPIP
1507 AUI_wap_password_dialog_open(parameter, View);
1508 #else
1509 AUI_wap_password_dialog_open(parameter);
1510 #endif
1511
1512 return;
1513 }
1514
1515
1516 /*******************************************************************************
1517
1518
1519 $Function: M_WAP_MMI_CONFIRM_DIALOG_REQ
1520
1521 $Description: A confirmation dialog is to be displayed.
1522
1523 $Returns: None
1524
1525 $Arguments: parameter - data block
1526
1527 *******************************************************************************/
1528
1529 void M_WAP_MMI_CONFIRM_DIALOG_REQ(T_WAP_MMI_CONFIRM_DIALOG_REQ *parameter)
1530 {
1531 T_WAP_VIEW *View;
1532
1533 #ifdef TRACE_ATBWAPACI
1534 TRACE_FUNCTION("M_WAP_MMI_CONFIRM_DIALOG_REQ");
1535 TRACE_EVENT_P1("MMI object ID: %d",parameter->object_id);
1536 TRACE_EVENT_P1( "MMI dialog_id: %d", parameter->dialog_id);
1537 ATB_trace_ushort_string(parameter->Message, parameter->message_length);
1538 ATB_trace_ushort_string(parameter->Ok_key, parameter->ok_key_length);
1539 ATB_trace_ushort_string(parameter->Cancel_key, parameter->cancel_key_length);
1540 #endif
1541
1542 if (!(View = ATB_wap_get_view(parameter->object_id)))
1543 return;
1544
1545 /* SPR#1816 - SH - Check if we're shutting down */
1546
1547 if (ATB_wap_status_get(View, ATB_WAP_SHUTTING_DOWN))
1548 {
1549 TRACE_EVENT("*** SHUTTING DOWN ***");
1550 return;
1551 }
1552
1553 #ifdef FF_GPF_TCPIP
1554 AUI_wap_confirm_dialog_open(parameter, View);
1555 #else
1556 AUI_wap_confirm_dialog_open(parameter);
1557 #endif
1558
1559 return;
1560 }
1561
1562
1563 /*******************************************************************************
1564
1565
1566 $Function: M_WAP_MMI_INFO_DIALOG_REQ
1567
1568 $Description: An info/alert dialog is to be displayed.
1569
1570 $Returns: None.
1571
1572 $Arguments: parameter - data block
1573
1574 *******************************************************************************/
1575
1576 void M_WAP_MMI_INFO_DIALOG_REQ(T_WAP_MMI_INFO_DIALOG_REQ *parameter)
1577 {
1578 T_WAP_VIEW *View;
1579
1580 #ifdef TRACE_ATBWAPACI
1581 TRACE_FUNCTION("M_WAP_MMI_INFO_DIALOG_REQ");
1582 TRACE_EVENT_P1("MMI object ID: %d",parameter->object_id);
1583 TRACE_EVENT_P1( "MMI dialog_id: %d", parameter->dialog_id);
1584 ATB_trace_ushort_string(parameter->Message, parameter->message_length);
1585 #endif
1586
1587 if (!(View = ATB_wap_get_view(parameter->object_id)))
1588 return;
1589
1590 /* SPR#1816 - SH - Check if we're shutting down */
1591
1592 if (ATB_wap_status_get(View, ATB_WAP_SHUTTING_DOWN))
1593 {
1594 TRACE_EVENT("*** SHUTTING DOWN ***");
1595 return;
1596 }
1597
1598 #ifdef FF_GPF_TCPIP
1599 AUI_wap_info_dialog_open(parameter, View);
1600 #else
1601 AUI_wap_info_dialog_open(parameter);
1602 #endif
1603
1604 return;
1605 }
1606
1607
1608 /*******************************************************************************
1609
1610
1611 $Function: M_WAP_MMI_NEW_CARD_IND
1612
1613 $Description: A new card is to be created.
1614
1615 $Returns: None.
1616
1617 $Arguments: parameter - data block
1618
1619 *******************************************************************************/
1620
1621 void M_WAP_MMI_NEW_CARD_IND(T_WAP_MMI_NEW_CARD_IND *parameter)
1622 {
1623 T_WAP_VIEW *View;
1624 #ifdef CO_UDP_IP
1625 UBYTE *History = (UBYTE *)parameter->History;
1626 U32 historyPointer = History[4] + History[5]*0x100 + History[6]*0x10000 + History[7]*0x1000000;
1627 /* Look at second history entry (bytes 4 to 7) - this is the previous card.
1628 * If this is zero, then there shouldn't be a "back" key */
1629 USHORT historyIndex;
1630 #endif
1631
1632
1633 #ifdef TRACE_ATBWAPACI
1634 TRACE_FUNCTION("M_WAP_MMI_NEW_CARD_IND");
1635 TRACE_EVENT_P1("object ID: %d",parameter->object_id);
1636 TRACE_EVENT_P1( "is_bookmarkable: %d", parameter->is_bookmarkable);
1637 ATB_trace_ushort_string(parameter->Title, parameter->title_length);
1638 ATB_trace_string(parameter->Url, parameter->url_length);
1639 #endif
1640
1641 if (!(View = ATB_wap_get_view(parameter->object_id)))
1642 {
1643 return;
1644 }
1645
1646 /* SPR#1816 - SH - Check if we're shutting down */
1647
1648 if (ATB_wap_status_get(View, ATB_WAP_SHUTTING_DOWN))
1649 {
1650 TRACE_EVENT("*** SHUTTING DOWN ***");
1651 return;
1652 }
1653
1654 /* SPR#1816 - SH - Store title, or "Untitled" if title is blank */
1655
1656 if (parameter->title_length > 0)
1657 {
1658 /* Copy a max of CARD_TITLE_MAX_LEN unicode characters */
1659 parameter->title_length = ATB_uc_text_copy(View->Title, parameter->Title, CARD_TITLE_MAX_LEN);
1660 /* Convert to MMI unicode, store in View->Title */
1661 ATB_uc_text_convert(View->Title, parameter->title_length);
1662 }
1663 else
1664 {
1665 /* Use "Untitled" text tag */
1666 parameter->title_length = AUI_wap_stringID(View->Title, CARD_TITLE_MAX_LEN, WAP_STRING_UNTITLED);
1667 }
1668
1669 /* SPR#1816 - SH - Copy URL, making sure it's not too long */
1670
1671 strncpy(View->URL, parameter->Url, URL_MAX_LEN);
1672
1673 /* Add card name & URL to top of history list
1674 * SPR#1816 - SH - Do this before cropping title */
1675
1676 #ifdef FF_GPF_TCPIP
1677 if (ATB_wap_profile_setting(WAP_STATUS_SAVEHISTORY))
1678 {
1679 // xreddymn Dec-10-2004 MMI-SPR-26159 - Insert title only if insert URL was successful
1680 #if(0) // If set to 1, allows duplicate URLs to be inserted into history list
1681 ATB_wap_entry_insert(WAP_HISTORY_LIST, View->History, (char *)View->Title, 0); // Add as entry 0 (last entry lost)
1682 ATB_wap_entry_insert(WAP_URL_LIST, View->HistoryURL, View->URL, 0);
1683 #else // Insert title only if insert URL was successful
1684 if(ATB_wap_entry_insert(WAP_URL_LIST, View->HistoryURL, View->URL, 0)!=WAP_FAIL)
1685 ATB_wap_entry_insert(WAP_HISTORY_LIST, View->History, (char *)View->Title, 0); // Add as entry 0 (last entry lost)
1686 #endif
1687 }
1688 //changes
1689 #else
1690 if (View->Status & WAP_STATUS_SAVEHISTORY)
1691 {
1692 ATB_wap_entry_insert(View->History, (char *)View->Title, 0); /* Add as entry 0 (last entry lost) */
1693 ATB_wap_entry_insert(View->HistoryURL, View->URL, 0);
1694
1695 }
1696 #endif
1697 //changes
1698 /* Crop title so it fits on screen */
1699
1700 ATB_uc_text_crop(View->Title, parameter->title_length, WAP_SCREEN_WIDTH-WAP_CHAR_WIDTH);
1701
1702 /* Check to see if user can go back from this card */
1703
1704 #ifdef CO_UDP_IP
1705 if (historyPointer != 0)
1706 {
1707 View->CanGoBack = TRUE;
1708 }
1709 else
1710 {
1711 View->CanGoBack = FALSE;
1712 }
1713 #else
1714 View->CanGoBack = TRUE;
1715 #endif
1716
1717 View->CustSoftKeys = FALSE; /* Use default softkeys */
1718
1719 /* SPR#1575 - SH - New card is being read in */
1720
1721 ATB_wap_status_change(View, ATB_WAP_CARD_READING);
1722
1723 return;
1724 }
1725
1726
1727 /*******************************************************************************
1728
1729
1730 $Function: M_WAP_MMI_DRAW_CARD_IND
1731
1732 $Description: Tell MMI to draw the card.
1733
1734 $Returns: None.
1735
1736 $Arguments: parameter - data block
1737
1738 *******************************************************************************/
1739
1740 void M_WAP_MMI_DRAW_CARD_IND(T_WAP_MMI_DRAW_CARD_IND *parameter)
1741 {
1742 T_WAP_VIEW *View;
1743
1744 #ifdef TRACE_ATBWAPACI
1745 TRACE_FUNCTION("M_WAP_MMI_DRAW_CARD_IND");
1746 TRACE_EVENT_P1("object ID: %d",parameter->object_id);
1747 TRACE_EVENT_P2("contentWidth: %d, contentHeight: %d",parameter->contentWidth, parameter->contentHeight);
1748 TRACE_EVENT_P2("contentPosX: %d, contentPosY: %d",parameter->contentPosX, parameter->contentPosY);
1749 #endif
1750
1751 if (!(View = ATB_wap_get_view(parameter->object_id)))
1752 return;
1753
1754 /* SPR#1816 - SH - Check if we're shutting down */
1755
1756 if (ATB_wap_status_get(View, ATB_WAP_SHUTTING_DOWN))
1757 {
1758 TRACE_EVENT("*** SHUTTING DOWN ***");
1759 return;
1760 }
1761
1762 View->cardWidth = parameter->contentWidth;
1763 View->cardHeight = parameter->contentHeight;
1764 View->cardXPosition = parameter->contentPosX;
1765 View->cardYPosition = parameter->contentPosY;
1766
1767 View->acceptUpdate = FALSE;
1768 /* Set to FALSE as default, to ignore any attempts to redraw parts of the card
1769 * rather than the whole card (e.g. when selecting an option). Only allows a card
1770 * to be updated if M_WAP_MMI_CLEAR_CARD_IND is called. */
1771
1772 return;
1773 }
1774
1775
1776 /*******************************************************************************
1777
1778 $Function: M_WAP_MMI_CLEAR_CARD_IND
1779
1780 $Description: Clear the card display. Allows card to be updated.
1781
1782 $Returns: None.
1783
1784 $Arguments: parameter - data block
1785
1786 *******************************************************************************/
1787
1788 void M_WAP_MMI_CLEAR_CARD_IND(T_WAP_MMI_CLEAR_CARD_IND *parameter)
1789 {
1790 T_WAP_VIEW *View;
1791
1792 #ifdef TRACE_ATBWAPACI
1793 TRACE_FUNCTION("M_WAP_MMI_CLEAR_CARD_IND");
1794 TRACE_EVENT_P1("MMI object ID: %d",parameter->object_id);
1795 #endif
1796
1797 if (!(View = ATB_wap_get_view(parameter->object_id)))
1798 return;
1799
1800 /* SPR#1816 - SH - Check if we're shutting down */
1801
1802 if (ATB_wap_status_get(View, ATB_WAP_SHUTTING_DOWN))
1803 {
1804 TRACE_EVENT("*** SHUTTING DOWN ***");
1805 return;
1806 }
1807
1808 View->acceptUpdate = TRUE;
1809
1810 /* Clearing the card means we're going to update the whole thing, so this update
1811 * is permitted (see M_WAP_MMI_DRAW_CARD_IND). */
1812
1813 return;
1814 }
1815
1816
1817 /*******************************************************************************
1818
1819
1820 $Function: M_WAP_MMI_SEND_TEXT_IND
1821
1822
1823 $Description: A text is to be displayed.
1824
1825 $Returns: None.
1826
1827 $Arguments: parameter - data block
1828
1829 *******************************************************************************/
1830
1831 void M_WAP_MMI_SEND_TEXT_IND(T_WAP_MMI_SEND_TEXT_IND *parameter)
1832 {
1833 T_WAP_VIEW *View;
1834 T_WAP_ELEMENT *Element;
1835 T_WAP_MMI_SEND_TEXT_IND *copy;
1836
1837 #ifdef TRACE_ATBWAPACI
1838 TRACE_FUNCTION("M_WAP_MMI_SEND_TEXT_IND");
1839 ATB_trace_ushort_string(parameter->Text, parameter->text_length);
1840 ATB_trace_ushort_string(parameter->Formatstring, parameter->formatstring_length);
1841 #endif
1842
1843 if (!(View = ATB_wap_get_view(parameter->object_id)))
1844 {
1845 #ifdef FF_GPF_TCPIP
1846 // xrashmic 20 Dec, 2005 OMAPS00061232 (on behalf of xreddymn)
1847 // Need to free if the memory was allocated by us in wapadapter.
1848 if(TRUE == parameter->free_flag)
1849 {
1850 T_MMI_WAP_MEM_FREE_IND free_mem_ind;
1851 free_mem_ind.data = (UBYTE*)parameter->Text;
1852 free_mem_ind.imageObject=FALSE;
1853 M_MMI_WAP_FREE_MEM_IND(&free_mem_ind);
1854 }
1855 #endif
1856 return;
1857 }
1858 /* SPR#1816 - SH - Check if we're shutting down */
1859
1860 if (ATB_wap_status_get(View, ATB_WAP_SHUTTING_DOWN))
1861 {
1862 TRACE_EVENT("*** SHUTTING DOWN ***");
1863 #ifdef FF_GPF_TCPIP
1864 // xrashmic 20 Dec, 2005 OMAPS00061232 (on behalf of xreddymn)
1865 // Need to free if the memory was allocated by us in wapadapter.
1866 if(TRUE == parameter->free_flag)
1867 {
1868 T_MMI_WAP_MEM_FREE_IND free_mem_ind;
1869 free_mem_ind.data = (UBYTE*)parameter->Text;
1870 free_mem_ind.imageObject=FALSE;
1871 M_MMI_WAP_FREE_MEM_IND(&free_mem_ind);
1872 }
1873 #endif
1874 return;
1875 }
1876
1877 /* If an update is forbidden, ignore this event */
1878
1879 if (!View->acceptUpdate)
1880 {
1881 #ifdef FF_GPF_TCPIP
1882 // xrashmic 20 Dec, 2005 OMAPS00061232 (on behalf of xreddymn)
1883 // Need to free if the memory was allocated by us in wapadapter.
1884 if(TRUE == parameter->free_flag)
1885 {
1886 T_MMI_WAP_MEM_FREE_IND free_mem_ind;
1887 free_mem_ind.data = (UBYTE*)parameter->Text;
1888 free_mem_ind.imageObject=FALSE;
1889 M_MMI_WAP_FREE_MEM_IND(&free_mem_ind);
1890 }
1891 #endif
1892 return;
1893 }
1894
1895 /* Allocate memory and copy the data */
1896
1897 Element = ATB_wap_buffer_add_element(View, WAP_TEXT); /* SPR#1921 - SH */
1898
1899 copy = (T_WAP_MMI_SEND_TEXT_IND *)AUI_wap_memory_alloc(sizeof(T_WAP_MMI_SEND_TEXT_IND));
1900 memcpy((void *)copy, (void *)parameter, sizeof(T_WAP_MMI_SEND_TEXT_IND));
1901 //xrashmic 12 May, 2005 MMI-SPR-30834
1902 //For input text box, adding of [] is moved from wap adapter to bmi
1903 if(WAP_TEXT_INPUT == parameter->type)
1904 {
1905 if(parameter->text_length==0)
1906 {
1907 copy->text_length=2;
1908 copy->Text = (USHORT *)AUI_wap_memory_alloc((copy->text_length+1)*sizeof(USHORT));
1909 }
1910 else
1911 {
1912 copy->text_length=parameter->text_length+2;
1913 copy->Text = (USHORT *)AUI_wap_memory_alloc((copy->text_length+1)*sizeof(USHORT));
1914 memcpy((void *)(copy->Text+1), (void *)parameter->Text, parameter->text_length*sizeof(USHORT));
1915 }
1916 copy->Text[0] = (USHORT) '[';
1917 copy->Text[copy->text_length-1] = (USHORT) ']';
1918 copy->Text[copy->text_length] = (USHORT) '\0';
1919 }
1920 else
1921 {
1922 if (parameter->text_length != 0)
1923 {
1924 copy->Text = (USHORT *)AUI_wap_memory_alloc(parameter->text_length*sizeof(USHORT));
1925 memcpy((void *)copy->Text, (void *)parameter->Text, parameter->text_length*sizeof(USHORT));
1926 }
1927 }
1928 if (parameter->formatstring_length != 0)
1929 {
1930 copy->Formatstring = (USHORT *)AUI_wap_memory_alloc(parameter->formatstring_length*sizeof(USHORT));
1931 memcpy((void *)copy->Formatstring, (void *)parameter->Text, parameter->formatstring_length*sizeof(USHORT));
1932 }
1933
1934 Element->data = (void *)copy;
1935
1936 #ifdef FF_GPF_TCPIP
1937 // xrashmic 20 Dec, 2005 OMAPS00061232 (on behalf of xreddymn)
1938 // Need to free if the memory was allocated by us in wapadapter.
1939 if(TRUE == parameter->free_flag)
1940 {
1941 T_MMI_WAP_MEM_FREE_IND free_mem_ind;
1942 free_mem_ind.data = (UBYTE*)parameter->Text;
1943 free_mem_ind.imageObject=FALSE;
1944 M_MMI_WAP_FREE_MEM_IND(&free_mem_ind);
1945 }
1946 #endif
1947 return;
1948 }
1949
1950 #ifdef FF_GPF_TCPIP
1951 /*******************************************************************************
1952
1953
1954 $Function: M_WAP_MMI_RADIO_BUTTON_IND
1955
1956
1957 $Description: A radio button is to be displayed.
1958
1959 $Returns: None.
1960
1961 $Arguments: parameter - data block
1962
1963 *******************************************************************************/
1964
1965 void M_WAP_MMI_RADIO_BUTTON_IND(T_WAP_MMI_RADIO_BUTTON_IND *parameter)
1966 {
1967
1968 #ifdef TRACE_ATBWAPACI
1969 TRACE_FUNCTION("M_WAP_MMI_RADIO_BUTTON_IND");
1970 TRACE_EVENT_P2("MMI object ID: %d, element ID: %d",parameter->object_id, parameter->element_id);
1971 TRACE_EVENT_P2("MMI active, selected: %d, %d", parameter->active, parameter->selected);
1972 TRACE_EVENT_P2("MMI pX, pY: %d, %d", parameter->pX, parameter->pY);
1973 TRACE_EVENT_P2("MMI pWidth, pHeight: %d, %d", parameter->pWidth, parameter->pHeight);
1974 #endif
1975
1976 return;
1977 }
1978
1979 /*******************************************************************************
1980
1981
1982 $Function: M_WAP_MMI_DRAW_BORDER_IND
1983
1984 $Description: A border element is to be displayed.
1985 //kyle 29 Jun, 2005 MMI-SPR-32462
1986 $Returns: None.
1987
1988 $Arguments: parameter - data block
1989
1990 *******************************************************************************/
1991
1992 void M_WAP_MMI_DRAW_BORDER_IND(T_WAP_MMI_DRAW_BORDER_IND *parameter)
1993 {
1994
1995 T_WAP_VIEW *View;
1996 T_WAP_ELEMENT *Element;
1997 T_WAP_MMI_DRAW_BORDER_IND *copy;
1998
1999 #ifdef TRACE_ATBWAPACI
2000 TRACE_FUNCTION("M_WAP_MMI_DRAW_BORDER_IND");
2001 TRACE_EVENT_P1("WAP object ID: %d",parameter->object_id);
2002 TRACE_EVENT_P4("Bottom border pX, pY, pWidth, pHeight: %d, %d, %d, %d", parameter->borderBottom.pX, parameter->borderBottom.pY, parameter->borderBottom.pWidth, parameter->borderBottom.pHeight);
2003 TRACE_EVENT_P4("Left border pX, pY, pWidth, pHeight: %d, %d, %d, %d", parameter->borderLeft.pX, parameter->borderLeft.pY, parameter->borderLeft.pWidth, parameter->borderLeft.pHeight);
2004 TRACE_EVENT_P4("Right border pX, pY, pWidth, pHeight: %d, %d, %d, %d", parameter->borderRight.pX, parameter->borderRight.pY, parameter->borderRight.pWidth, parameter->borderRight.pHeight);
2005 TRACE_EVENT_P4("Top border pX, pY, pWidth, pHeight: %d, %d, %d, %d", parameter->borderTop.pX, parameter->borderTop.pY, parameter->borderTop.pWidth, parameter->borderTop.pHeight);
2006 #endif
2007
2008 if (!(View = ATB_wap_get_view(parameter->object_id)))
2009 return;
2010
2011 /* SPR#1816 - SH - Check if we're shutting down */
2012
2013 if (ATB_wap_status_get(View, ATB_WAP_SHUTTING_DOWN))
2014 {
2015 TRACE_EVENT("*** SHUTTING DOWN ***");
2016 return;
2017 }
2018
2019 /* If an update is forbidden, ignore this event */
2020
2021 if (!View->acceptUpdate)
2022 return;
2023
2024 /* Allocate memory and copy the data */
2025
2026 Element = ATB_wap_buffer_add_element(View, WAP_BORDER); /* SPR#1921 - SH */
2027
2028 copy = (T_WAP_MMI_DRAW_BORDER_IND *)AUI_wap_memory_alloc(sizeof(T_WAP_MMI_DRAW_BORDER_IND));
2029 memcpy((void *)copy, (void *)parameter, sizeof(T_WAP_MMI_DRAW_BORDER_IND));
2030
2031 Element->data = (void *)copy;
2032
2033 return;
2034 }
2035
2036 #endif
2037
2038 /*******************************************************************************
2039
2040 $Function: M_WAP_MMI_SEND_IMAGE_IND
2041
2042 $Description: An image is to be displayed.
2043
2044 $Returns: None.
2045
2046 $Arguments: parameter - data block
2047
2048 *******************************************************************************/
2049
2050 void M_WAP_MMI_SEND_IMAGE_IND(T_WAP_MMI_SEND_IMAGE_IND *parameter)
2051 {
2052 T_WAP_VIEW *View;
2053 T_WAP_ELEMENT *Element;
2054 T_WAP_MMI_SEND_IMAGE_IND *copy;
2055 #ifdef FF_GPF_TCPIP
2056 T_MMI_WAP_MEM_FREE_IND free_mem_ind; //xrashmic 30 Aug, 2005 MMI-SPR-34024(OMAPS00048918) mem leak fix
2057 #endif
2058
2059 #ifdef TRACE_ATBWAPACI
2060 TRACE_FUNCTION("M_WAP_MMI_SEND_IMAGE_IND");
2061 TRACE_EVENT_P1("MMI object ID: %d",parameter->object_id);
2062 #endif
2063
2064 if (!(View = ATB_wap_get_view(parameter->object_id)))
2065 {
2066 #ifdef FF_GPF_TCPIP
2067 // xrashmic 20 Dec, 2005 OMAPS00061232 (on behalf of xreddymn)
2068 // Need to free if the memory was allocated for plugin image in wapadapter.
2069 if(parameter->pluginImage)
2070 {
2071 free_mem_ind.data = parameter->ImageReq;
2072 free_mem_ind.imageObject=TRUE;
2073 M_MMI_WAP_FREE_MEM_IND(&free_mem_ind);
2074 }
2075 #endif
2076 return;
2077 }
2078
2079 /* SPR#1816 - SH - Check if we're shutting down */
2080
2081 if (ATB_wap_status_get(View, ATB_WAP_SHUTTING_DOWN))
2082 {
2083 TRACE_EVENT("*** SHUTTING DOWN ***");
2084 #ifdef FF_GPF_TCPIP
2085 // xrashmic 20 Dec, 2005 OMAPS00061232 (on behalf of xreddymn)
2086 // Need to free if the memory was allocated for plugin image in wapadapter.
2087 if(parameter->pluginImage)
2088 {
2089 free_mem_ind.data = parameter->ImageReq;
2090 free_mem_ind.imageObject=TRUE;
2091 M_MMI_WAP_FREE_MEM_IND(&free_mem_ind);
2092 }
2093 #endif
2094 return;
2095 }
2096
2097 /* If an update is forbidden, ignore this event */
2098
2099 if (!View->acceptUpdate)
2100 {
2101 #ifdef FF_GPF_TCPIP
2102 // xrashmic 20 Dec, 2005 OMAPS00061232 (on behalf of xreddymn)
2103 // Need to free if the memory was allocated for plugin image in wapadapter.
2104 if(parameter->pluginImage)
2105 {
2106 free_mem_ind.data = parameter->ImageReq;
2107 free_mem_ind.imageObject=TRUE;
2108 M_MMI_WAP_FREE_MEM_IND(&free_mem_ind);
2109 }
2110 #endif
2111 return;
2112 }
2113 #ifdef FF_GPF_TCPIP
2114 //xrashmic 21 Jan, 2005 MMI-SPR-28223
2115 //Saving the information passed by wap adapter if the image is from plugin or normal wap page.
2116 if(parameter->pluginImage)
2117 Element = ATB_wap_buffer_add_element(View, WAP_PLUGIN_IMAGE); /* SPR#1921 - SH */
2118 else
2119 #endif
2120 Element = ATB_wap_buffer_add_element(View, WAP_IMAGE); /* SPR#1921 - SH */
2121 copy = (T_WAP_MMI_SEND_IMAGE_IND *)AUI_wap_memory_alloc(sizeof(T_WAP_MMI_SEND_IMAGE_IND));
2122 if (copy)
2123 {
2124 memcpy((void *)copy, (void *)parameter, sizeof(T_WAP_MMI_SEND_IMAGE_IND));
2125
2126
2127 #ifdef FF_GPF_TCPIP
2128 //xrashmic 30 Aug, 2005 MMI-SPR-34024(OMAPS00048918) mem leak fix
2129 // Only for plugin images make a copy at bmi.
2130 if(parameter->pluginImage)
2131 {
2132 if (parameter->image_length != 0)
2133 {
2134 copy->Image = (UBYTE *)AUI_wap_memory_alloc(parameter->image_length*sizeof(UBYTE));
2135 memcpy((void *)copy->Image, (void *)parameter->Image, parameter->image_length*sizeof(UBYTE));
2136 }
2137 }
2138 else
2139 copy->Image = (UBYTE*)parameter->Image;
2140 #else
2141 if (parameter->image_length != 0)
2142 {
2143 copy->Image = (UBYTE *)AUI_wap_memory_alloc(parameter->image_length*sizeof(UBYTE));
2144 memcpy((void *)copy->Image, (void *)parameter->Image, parameter->image_length*sizeof(UBYTE));
2145 }
2146 #endif
2147 }
2148
2149 Element->data = (void *)copy;
2150
2151 #ifdef FF_GPF_TCPIP
2152 //xrashmic 30 Aug, 2005 MMI-SPR-34024(OMAPS00048918) mem leak fix
2153 //freeing ImageReq data in WAP memory only for plugin images.
2154 if(parameter->pluginImage)
2155 {
2156 // xreddymn MMI-SPR-30834 May-14-2005: free ImageReq data in WAP memory
2157 free_mem_ind.data = parameter->ImageReq;
2158 // xrashmic 20 Dec, 2005 OMAPS00061232 (on behalf of xreddymn)
2159 // Add this to differentiate between image objects and text objects to be freed in wap adapter
2160 free_mem_ind.imageObject=TRUE;
2161 M_MMI_WAP_FREE_MEM_IND(&free_mem_ind);
2162 }
2163 #endif
2164 return;
2165 }
2166
2167
2168 /*******************************************************************************
2169
2170
2171 $Function: M_WAP_MMI_SEND_TABLE_IND
2172
2173 $Description: A table/fieldset is to be displayed.
2174
2175 $Returns: None.
2176
2177 $Arguments: parameter - data block
2178
2179 *******************************************************************************/
2180
2181 void M_WAP_MMI_SEND_TABLE_IND(T_WAP_MMI_SEND_TABLE_IND *parameter)
2182 {
2183 T_WAP_VIEW *View;
2184 T_WAP_ELEMENT *Element;
2185 T_WAP_MMI_SEND_TABLE_IND *copy;
2186
2187 #ifdef TRACE_ATBWAPACI
2188 TRACE_FUNCTION("M_WAP_MMI_SEND_TABLE_IND");
2189 TRACE_EVENT_P1("object ID: %d",parameter->object_id);
2190 TRACE_EVENT_P2("Columns: %d, Rows: %d",parameter->cols_length, parameter->rows_length);
2191 TRACE_EVENT_P4("pX: %d, pY: %d, pWidth: %d, pHeight: %d",parameter->pX, parameter->pY, parameter->pWidth, parameter->pHeight);
2192 ATB_trace_ushort_string(parameter->Title, parameter->title_length);
2193 #endif
2194
2195 if (!(View = ATB_wap_get_view(parameter->object_id)))
2196 return;
2197
2198 /* SPR#1816 - SH - Check if we're shutting down */
2199
2200 if (ATB_wap_status_get(View, ATB_WAP_SHUTTING_DOWN))
2201 {
2202 TRACE_EVENT("*** SHUTTING DOWN ***");
2203 return;
2204 }
2205
2206 /* If an update is forbidden, ignore this event */
2207
2208 if (!View->acceptUpdate)
2209 return;
2210
2211 /* Allocate memory and copy the data */
2212
2213 Element = ATB_wap_buffer_add_element(View, WAP_TABLE); /* SPR#1921 - SH */
2214
2215 copy = (T_WAP_MMI_SEND_TABLE_IND *)AUI_wap_memory_alloc(sizeof(T_WAP_MMI_SEND_TABLE_IND));
2216 memcpy((void *)copy, (void *)parameter, sizeof(T_WAP_MMI_SEND_TABLE_IND));
2217
2218 if (parameter->title_length != 0)
2219 {
2220 copy->Title = (USHORT *)AUI_wap_memory_alloc(parameter->title_length*sizeof(USHORT));
2221 memcpy((void *)copy->Title, (void *)parameter->Title, parameter->title_length*sizeof(USHORT));
2222 }
2223 if (parameter->cols_length != 0)
2224 {
2225 copy->ColWidth = (SHORT *)AUI_wap_memory_alloc(parameter->cols_length*sizeof(SHORT));
2226 memcpy((void *)copy->ColWidth, (void *)parameter->ColWidth, parameter->cols_length*sizeof(SHORT));
2227 }
2228 if (parameter->rows_length != 0)
2229 {
2230 copy->RowHeight = (SHORT *)AUI_wap_memory_alloc(parameter->rows_length*sizeof(SHORT));
2231 memcpy((void *)copy->RowHeight, (void *)parameter->RowHeight, parameter->rows_length*sizeof(SHORT));
2232 }
2233 Element->data = (void *)copy;
2234
2235 return;
2236 }
2237
2238
2239 /*******************************************************************************
2240
2241
2242 $Function: M_WAP_MMI_CARD_DRAW_COMPLETED_IND
2243
2244 $Description: Card drawing is completed, card may be displayed.
2245
2246 $Returns: None.
2247
2248 $Arguments: parameter - data block
2249
2250 *******************************************************************************/
2251
2252 void M_WAP_MMI_CARD_DRAW_COMPLETED_IND(T_WAP_MMI_CARD_DRAW_COMPLETED_IND *parameter)
2253 {
2254 T_WAP_VIEW *View;
2255 UBYTE temp;
2256 // July 13 2005 REF: MMI-SPR-32012 x0012849
2257 // To change the functionality of RSK, when there is no page to go back
2258 #ifdef FF_GPF_TCPIP
2259 if(HISTORY_NOT_AVAILABLE== parameter->object_id)
2260 {
2261 ExitWAP(WAP_NONE);
2262 return;
2263 }
2264 //xrashmic 17 Aug, 2005 MMI-SPR-31364
2265 //When it is detected that a very large page is being opened, the wap adapter sends this message.
2266 //We need to exit wap and display a error dialog as we have memory constraints.
2267 else if(OUT_OF_MEM_LARGE_PAGE == parameter->object_id )
2268 {
2269 ExitWAP(WAP_OUT_OF_MEM);
2270 return;
2271 }
2272
2273 #endif
2274 if (!(View = ATB_wap_get_view(parameter->object_id)))
2275 return;
2276
2277 /* SPR#1816 - SH - Check if we're shutting down */
2278
2279 if (ATB_wap_status_get(View, ATB_WAP_SHUTTING_DOWN))
2280 {
2281 TRACE_EVENT("*** SHUTTING DOWN ***");
2282 return;
2283 }
2284
2285 temp = dspl_Enable(0);
2286
2287 #ifdef TRACE_ATBWAPACI
2288 TRACE_FUNCTION("M_WAP_MMI_CARD_DRAW_COMPLETED_IND");
2289 TRACE_EVENT_P1("MMI object ID: %d",parameter->object_id);
2290 #endif
2291
2292 /* If an update is forbidden, ignore this event */
2293
2294 if (!View->acceptUpdate)
2295 {
2296 dspl_Enable(temp);
2297 return;
2298 }
2299
2300 /* Destroy the current card, and make the new buffered card the current card */
2301
2302 ATB_wap_buffer_clear(View);
2303 View->ElementHeader = View->NewElementHeader;
2304 View->NewElementHeader = NULL;
2305
2306 AUI_wap_card_show_req(View);
2307 dspl_Enable(temp);
2308
2309 return;
2310 }
2311
2312
2313 /*******************************************************************************
2314
2315
2316 $Function: M_WAP_MMI_CONNECT_REQ
2317
2318 $Description: The connection (GSM or GPRS) can now be made.
2319 The GSM connection occurs in this function.
2320 The GPRS attachment is made in this function. Once GPRS is
2321 attached, the connection proceeds in function connect_gprs() below.
2322
2323 $Returns: None.
2324
2325 $Arguments: parameter - data block
2326
2327 *******************************************************************************/
2328 #ifdef FF_GPF_TCPIP
2329
2330 extern void M4_DebugStringMessage(char *in_string, UINT8 ucNumber,unsigned long para);
2331 // xreddymn Mar-05-2005 MMI-SPR-26144: This function is called to check if
2332 // a MMS send operation was cancelled by the user
2333 extern UBYTE AUI_mms_cancel_status(void);
2334
2335 void M_WAP_MMI_CONNECT_REQ(T_WAP_MMI_CONNECT_REQ *parameter)
2336 {
2337 T_WAP_VIEW *View;
2338 char temp[NUMBER_MAX_LEN+1];
2339 T_ACI_BS_SPEED speed;
2340
2341
2342 T_SOCK_BEARER_INFO bearer_data;
2343 T_SOCKET_NODE *bearer_node = NULL;
2344 T_SOCK_RESULT result;
2345
2346
2347 #ifdef TRACE_ATBWAPACI
2348 TRACE_FUNCTION("M_WAP_MMI_CONNECT_REQ");
2349 TRACE_EVENT_P2("MMI object ID: %d, bearer status: %d", parameter->object_id, parameter->bearer_status);
2350 #endif
2351
2352 // xreddymn Feb-23-2005 MMI-SPR-26144: If the user has pressed Cancel, do not connect
2353 if(AUI_mms_cancel_status()) return;
2354
2355 if (!(View = ATB_wap_get_view(parameter->object_id)))
2356 return;
2357
2358 /* SPR#1816 - SH - Check if we're shutting down */
2359
2360 if (ATB_wap_status_get(View, ATB_WAP_SHUTTING_DOWN))
2361 {
2362 TRACE_EVENT("*** SHUTTING DOWN ***");
2363 return;
2364 }
2365
2366
2367
2368 if(parameter->bearer_status == 1)
2369 {
2370
2371 TRACE_EVENT("SAPI_BEARER_REQUEST");
2372
2373 bearer_data.bearer_handle = 0;
2374 bearer_data.app_handle = parameter->wap_app_handle;
2375
2376 switch (View->Profile->AccessType)
2377 {
2378 case WAP_CS_DATA:
2379 {
2380 bearer_data.bearer_type = SOCK_BEARER_GSM;
2381 bearer_data.phone_nr_valid = TRUE;
2382 bearer_data.cid = 1;
2383 bearer_data.user_id_valid = TRUE;
2384 bearer_data.password_valid = TRUE;
2385 strcpy(bearer_data.phone_nr, View->Profile->DialupNumber);
2386 strcpy(bearer_data.user_id, View->Profile->Username);
2387 strcpy(bearer_data.password, View->Profile->Password);
2388 bearer_data.precedence = 0;
2389 bearer_data.delay = 0;
2390 bearer_data.reliability = 0;
2391 bearer_data.peak_throughput = 0;
2392 bearer_data.mean_througput = 0;
2393
2394 bearer_data.ip_address = SOCK_IPADDR_ANY;
2395 bearer_data.dns1 = SOCK_IPADDR_ANY;
2396 bearer_data.dns2 = SOCK_IPADDR_ANY;
2397 bearer_data.gateway = SOCK_IPADDR_ANY;
2398 bearer_data.authtype = SOCK_AUTH_NO;
2399 bearer_data.data_compr = FALSE;
2400 bearer_data.header_comp = FALSE;
2401 bearer_data.shareable = FALSE;
2402
2403 break;
2404 }
2405 #ifdef GPRS
2406 case WAP_GPRS_DATA:
2407 {
2408 bearer_data.bearer_type = SOCK_BEARER_GPRS;
2409 bearer_data.apn_valid = TRUE;
2410 bearer_data.cid = 1;
2411 bearer_data.user_id_valid = TRUE;
2412 bearer_data.password_valid = TRUE;
2413 strcpy(bearer_data.apn, View->Profile->APN);
2414 strcpy(bearer_data.user_id, View->Profile->Username);
2415 strcpy(bearer_data.password, View->Profile->Password);
2416 bearer_data.precedence = 0;
2417 bearer_data.delay = 0;
2418 bearer_data.reliability = 0;
2419 bearer_data.peak_throughput = 0;
2420 bearer_data.mean_througput = 0;
2421 bearer_data.user_id_valid = TRUE;
2422 bearer_data.password_valid = TRUE;
2423
2424 bearer_data.ip_address = SOCK_IPADDR_ANY;
2425 bearer_data.dns1 = SOCK_IPADDR_ANY;
2426 bearer_data.dns2 = SOCK_IPADDR_ANY;
2427 bearer_data.gateway = SOCK_IPADDR_ANY;
2428 bearer_data.authtype = SOCK_AUTH_NO;
2429 bearer_data.data_compr = FALSE;
2430 bearer_data.header_comp = FALSE;
2431 bearer_data.shareable = FALSE;
2432
2433 break;
2434 }
2435 }
2436 #endif
2437
2438 bearer_node = (T_SOCKET_NODE *)parameter->node;
2439
2440 if(bearer_node == NULL)
2441 {
2442 TRACE_ERROR("Error: M_WAP_MMI_CONNECT_REQ()");
2443 return;
2444 }
2445
2446 result = sock_open_bearer((T_SOCK_API_INSTANCE)parameter->instance, SOCK_BEARER_AS_SPECIFIED, 0,&bearer_data, wap_sock_app_callback, bearer_node);
2447
2448 if(result != SOCK_RESULT_OK)
2449 {
2450 TRACE_ERROR("M_WAP_MMI_CONNECT_REQ(): error in sock_open_bearer()");
2451 TRACE_EVENT_P1("result: %d", result);
2452 return;
2453 }
2454 else
2455 {
2456 TRACE_EVENT_P1("sock_open_bearer(): socket_api_instance: %d", result);
2457 }
2458 }
2459 else
2460 {
2461 TRACE_ERROR("M_WAP_MMI_CONNECT_REQ(): Unknown bearer status");
2462 }
2463
2464
2465
2466 return;
2467 }
2468
2469
2470 /*******************************************************************************
2471
2472 $Function: connect
2473
2474 $Description: Connect
2475 SPR#2086 - Added
2476
2477 $Returns: None
2478
2479 $Arguments: object_id - the current session
2480
2481 *******************************************************************************/
2482
2483 void connect(UBYTE object_id)
2484 {
2485 T_WAP_VIEW *View;
2486 char temp[NUMBER_MAX_LEN+1];
2487 T_ACI_BS_SPEED speed;
2488
2489 char TraceBuffer[100];
2490
2491
2492 sprintf(TraceBuffer, "connect called");
2493 //M4_DebugStringMessage( TraceBuffer,(strlen(TraceBuffer)), 0);
2494
2495 if (!(View = ATB_wap_get_view(object_id)))
2496 return;
2497
2498 switch (View->Profile->AccessType)
2499 {
2500 case WAP_CS_DATA:
2501 /* CSD call - connect straight away */
2502
2503 sAT_PercentPPP(0,1,View->Profile->Username, View->Profile->Password, USE_NO_PPP_FOR_AAA);
2504 sAT_PercentWAP(0,0);
2505 sAT_PercentWAP(0,1);
2506
2507 /* Set the connection speed */
2508
2509 switch(View->Profile->ConnectionSpeed)
2510 {
2511 case WAP_ANALOGUE:
2512 speed = BS_SPEED_AUTO;
2513 break;
2514 case WAP_ISDN9600:
2515 speed = BS_SPEED_9600_V110;
2516 break;
2517 case WAP_ISDN14400:
2518 speed = BS_SPEED_14400_V110;
2519 break;
2520 default:
2521 speed = BS_SPEED_9600_V34;
2522 break;
2523 }
2524 //Nov 02, 2005 DR OMAPS00052132 xdeepadh
2525 //The usage of ATI enum is put under the flag FF_ATI
2526 #ifdef FF_ATI
2527 sAT_PlusCBST(CMD_SRC_ATI_1, speed, CBST_NAM_Asynch, CBST_CE_NonTransparent);
2528 /* Make the call */
2529 sprintf(temp, "=%s", View->Profile->DialupNumber);
2530 atD(temp,CMD_SRC_ATI_1);
2531 #endif //FF_ATI
2532 break;
2533
2534 #ifdef GPRS
2535 case WAP_GPRS_DATA:
2536 {
2537 /* GPRS call - attach now. If attached, connect.
2538 * If not, wait until attach succeeds */
2539
2540 T_CGATT_STATE regstate;
2541
2542 /* Check to see if attached */
2543
2544 qAT_PlusCGATT ( CMD_SRC_LCL, &regstate );
2545 #ifdef TRACE_ATBWAPACI
2546 TRACE_EVENT_P1("Reg state: %d", regstate);
2547 #endif
2548
2549 /* If we're not attached, attempt to do so */
2550
2551 if (regstate!=CGATT_STATE_ATTACHED)
2552 {
2553 /* Display status "attaching" */
2554 ATB_wap_status_change(View, ATB_WAP_ATTACHING);
2555 /* Attempt to attach */
2556 sAT_PlusCGATT ( CMD_SRC_LCL, CGATT_STATE_ATTACHED );
2557 }
2558 /* Otherwise, go straight to GPRS connection */
2559 else
2560 {
2561 connect_gprs(object_id);
2562 }
2563 }
2564 break;
2565 #endif
2566
2567 default:
2568 TRACE_EVENT("ERROR: Illegal access type!");
2569 AUI_error_dialog(View, ERROR_CALL_DISCONNECTED);
2570 break;
2571 }
2572 }
2573
2574 #else /* #ifdef FF_GPF_TCPIP */
2575
2576 void M_WAP_MMI_CONNECT_REQ(T_WAP_MMI_CONNECT_REQ *parameter)
2577 {
2578 T_WAP_VIEW *View;
2579 char temp[NUMBER_MAX_LEN+1];
2580 T_ACI_BS_SPEED speed;
2581
2582 #ifdef TRACE_ATBWAPACI
2583 TRACE_FUNCTION("M_WAP_MMI_CONNECT_REQ");
2584 TRACE_EVENT_P1("MMI object ID: %d",parameter->object_id);
2585 #endif
2586
2587 if (!(View = ATB_wap_get_view(parameter->object_id)))
2588 return;
2589
2590 /* Check if we're shutting down */
2591
2592 if (ATB_wap_status_get(View, ATB_WAP_SHUTTING_DOWN))
2593 {
2594 TRACE_EVENT("*** SHUTTING DOWN ***");
2595 return;
2596 }
2597
2598 switch (View->Profile->AccessType)
2599 {
2600 case WAP_CS_DATA:
2601 /* CSD call - connect straight away */
2602
2603 sAT_PercentPPP(0,1,View->Profile->Username, View->Profile->Password, USE_NO_PPP_FOR_AAA);
2604 sAT_PercentWAP(0,0);
2605 sAT_PercentWAP(0,1);
2606
2607 /* Set the connection speed */
2608
2609 switch(View->Profile->ConnectionSpeed)
2610 {
2611 case WAP_ANALOGUE:
2612 speed = BS_SPEED_AUTO;
2613 break;
2614 case WAP_ISDN9600:
2615 speed = BS_SPEED_9600_V110;
2616 break;
2617 case WAP_ISDN14400:
2618 speed = BS_SPEED_14400_V110;
2619 break;
2620 default:
2621 speed = BS_SPEED_9600_V34;
2622 break;
2623 }
2624 //Nov 02, 2005 DR OMAPS00052132 xdeepadh
2625 //The usage of ATI enum is put under the flag FF_ATI
2626 #ifdef FF_ATI
2627 sAT_PlusCBST(CMD_SRC_ATI_1, speed, CBST_NAM_Asynch, CBST_CE_NonTransparent);
2628 /* Make the call */
2629 sprintf(temp, "=%s", View->Profile->DialupNumber);
2630 atD(temp,CMD_SRC_ATI_1);
2631 #endif //FF_ATI
2632 break;
2633
2634 #ifdef GPRS
2635 case WAP_GPRS_DATA:
2636 {
2637 /* GPRS call - attach now. If attached, connect.
2638 * If not, wait until attach succeeds */
2639
2640 T_CGATT_STATE regstate;
2641
2642 /* Check to see if attached */
2643
2644 qAT_PlusCGATT ( CMD_SRC_LCL, &regstate );
2645 #ifdef TRACE_ATBWAPACI
2646 TRACE_EVENT_P1("Reg state: %d", regstate);
2647 #endif
2648
2649 /* If we're not attached, attempt to do so */
2650
2651 if (regstate!=CGATT_STATE_ATTACHED)
2652 {
2653 /* Display status "attaching" */
2654 ATB_wap_status_change(View, ATB_WAP_ATTACHING);
2655 /* Attempt to attach */
2656 sAT_PlusCGATT ( CMD_SRC_LCL, CGATT_STATE_ATTACHED );
2657 }
2658 /* Otherwise, go straight to GPRS connection */
2659 else
2660 {
2661 connect_gprs(parameter->object_id);
2662 }
2663 }
2664 #endif
2665 }
2666
2667 return;
2668 }
2669
2670
2671 #endif /* ! #ifdef FF_GPF_TCPIP */
2672
2673 #ifdef GPRS
2674 #ifdef FF_GPF_TCPIP
2675 extern void M4_DebugStringMessage(char *in_string, UINT8 ucNumber,unsigned long para);
2676 void PowerOnGPRSAttach(void)
2677 {
2678 T_CGATT_STATE regstate;
2679 char temp[50];
2680
2681 /* Modified to detect if GPRS attach fails. Check to see if attached */
2682 qAT_PlusCGATT ( CMD_SRC_LCL, &regstate );
2683
2684 sprintf(temp, "PowerOnGPRSAttach called!");
2685 //M4_DebugStringMessage( temp,(strlen(temp)), 0);
2686
2687 /* If we're not attached, attempt to do so */
2688 if (regstate!=CGATT_STATE_ATTACHED)
2689 {
2690 sprintf(temp, "sAT_PlusCGATT called!");
2691 //M4_DebugStringMessage( temp,(strlen(temp)), 0);
2692
2693 /* Attempt to attach */
2694 sAT_PlusCGATT ( CMD_SRC_LCL, CGATT_STATE_ATTACHED );
2695 }
2696 }
2697
2698 void mms_gprs_deattach(void)
2699 {
2700 T_CGATT_STATE regstate;
2701 char temp[50];
2702
2703 sprintf(temp, "mms_gprs_deattach called!");
2704 //M4_DebugStringMessage( temp,(strlen(temp)), 0);
2705
2706 qAT_PlusCGATT ( CMD_SRC_LCL, &regstate );
2707
2708 if (regstate == CGATT_STATE_ATTACHED)
2709 {
2710 sprintf(temp, "mms_gprs_deattach need to deattach!");
2711 //M4_DebugStringMessage( temp, (strlen(temp)), 0);
2712
2713 /* Attempt to deattach */
2714 sAT_PlusCGATT ( CMD_SRC_LCL, CGATT_STATE_DETACHED );
2715 rvf_delay(100);
2716 }
2717
2718 return;
2719 }
2720
2721 void mms_gprs_attach(void)
2722 {
2723 T_CGATT_STATE regstate;
2724 char temp[50];
2725 UINT8 i;
2726 UINT8 ucAttachTime;
2727
2728 /* Modified to detect if GPRS attach fails. Check to see if attached */
2729 qAT_PlusCGATT ( CMD_SRC_LCL, &regstate );
2730 TRACE_EVENT_P1("Reg state: %d", regstate);
2731
2732 sprintf(temp, "mms_gprs_attach called!");
2733 //M4_DebugStringMessage( temp,(strlen(temp)), 0);
2734
2735 /* If we're not attached, attempt to do so */
2736 if (regstate!=CGATT_STATE_ATTACHED)
2737 {
2738 sprintf(temp, "sAT_PlusCGATT called!");
2739 //M4_DebugStringMessage( temp,(strlen(temp)), 0);
2740
2741 /* Attempt to attach */
2742 sAT_PlusCGATT ( CMD_SRC_LCL, CGATT_STATE_ATTACHED );
2743
2744 ucAttachTime = 24;
2745
2746 for (i = 0;i < ucAttachTime;i++)//120s for GPRS
2747 {
2748 qAT_PlusCGATT ( CMD_SRC_LCL, &regstate );
2749 if (regstate == CGATT_STATE_ATTACHED)
2750 {
2751 break;
2752 }
2753
2754 /*delay 5s*/
2755 rvf_delay(1000);
2756 }
2757
2758 if (i == ucAttachTime)
2759 {
2760 sprintf(temp, "mms_gprs_attach failed after 5s %03d* ",ucAttachTime);
2761 //M4_DebugStringMessage( temp,(strlen(temp)), 0);
2762 }
2763 else
2764 {
2765 sprintf(temp, "mms_gprs_attach success!");
2766 //M4_DebugStringMessage( temp,(strlen(temp)), i);
2767 }
2768 }
2769
2770 }
2771
2772 /*******************************************************************************
2773
2774
2775 $Function: connect_gprs
2776
2777 $Description: GPRS is attached; now activate PDP context
2778 SPR#1982 - SH
2779 - Tidy up variables a little.
2780 - Change '1' to GPRS_CID_1
2781 - Put traces inside #ifdefs
2782
2783 $Returns: None.
2784
2785 $Arguments: View - the current view
2786
2787 *******************************************************************************/
2788
2789 void connect_gprs(UBYTE object_id)
2790 {
2791 SHORT cids[MAX_CID_PLUS_EINS];
2792 BOOL states[MAX_CID_PLUS_EINS];
2793 T_GPRS_CONT_REC context;
2794 T_ACI_RETURN ret;
2795 T_WAP_VIEW *View;
2796 SHORT contextId;
2797 SHORT arrayPos;
2798 char dialString[10];
2799
2800 TRACE_FUNCTION("connect_gprs()");
2801
2802 if (!(View = ATB_wap_get_view(object_id)))
2803 return;
2804
2805 /* Select the context ID */
2806
2807 contextId = GPRS_CID_1;
2808
2809
2810 if (object_id==WAP_PUSH_VIEW)
2811 {
2812 contextId = GPRS_CID_2;
2813 }
2814
2815
2816 /* Check to see if context already active */
2817 memset (states, FALSE, sizeof(states));
2818 memset (cids, 0, sizeof(cids));
2819
2820 qAT_PlusCGACT ( CMD_SRC_LCL, states, cids );
2821
2822 if (contextId==cids[0] || cids[0]==INVALID_CID)
2823 arrayPos = 0;
2824 else
2825 arrayPos = 1;
2826
2827 #ifdef TRACE_ATBWAPACI
2828 TRACE_EVENT_P1("Context 0: %d", cids[0]);
2829 #endif
2830
2831 /* If context doesn't exist, define it
2832 * Use GPRS_CID_1 rather than number '1'*/
2833
2834 if ( cids[arrayPos] == INVALID_CID)
2835 {
2836 #ifdef TRACE_ATBWAPACI
2837 TRACE_EVENT("Defining new context.");
2838 #endif
2839
2840 states[arrayPos] = FALSE;
2841
2842 strncpy((char *)context.apn, View->Profile->APN, MAX_APN_LEN);
2843 strcpy((char*)context.pdp_type, "IP");
2844 memset(context.pdp_addr, '\0', MAX_PDP_ADDR_LEN);
2845 context.d_comp = CGDCONT_D_COMP_OMITTED;
2846 context.h_comp = CGDCONT_H_COMP_OMITTED;
2847 memset(&context.qos, 0, sizeof(T_QOS));
2848 memset(&context.min_qos, 0 ,sizeof(T_QOS));
2849
2850 ret = sAT_PlusCGDCONT(CMD_SRC_LCL, contextId, &context);
2851
2852 #ifdef TRACE_ATBWAPACI
2853 TRACE_EVENT_P1("CGDCONT Return = %d",ret);
2854 #endif
2855
2856 if (ret==AT_FAIL)
2857 {
2858 ATB_wap_data_call_disconnected(View);
2859 AUI_error_dialog(View, ERROR_GPRS_NOT_SUPPORTED);
2860 return;
2861 }
2862 }
2863
2864 /* Removed duplicate call to qAT_PlusCGACT.
2865 * If context isn't activated, call CGPCO */
2866
2867 if (states[arrayPos])
2868 {
2869 #ifdef TRACE_ATBWAPACI
2870 TRACE_EVENT("Context is activated.");
2871 #endif
2872 ATB_data_call_connected(View); /* SPR#2086 */
2873 }
2874 else
2875 {
2876 #ifdef TRACE_ATBWAPACI
2877 TRACE_EVENT("Context not activated.");
2878 #endif
2879
2880 ret = sAT_PercentCGPCO (
2881 CMD_SRC_LCL,
2882 contextId,
2883 ACI_PCO_AUTH_PROT_PAP,
2884 (CHAR *)View->Profile->Username,
2885 (CHAR *)View->Profile->Password,
2886 NULL,
2887 NULL);//liuyu add NULL for build
2888
2889 #ifdef TRACE_ATBWAPACI
2890 TRACE_EVENT_P1("CGPCO Return = %d", ret);
2891 #endif
2892
2893 if (ret==AT_FAIL)
2894 {
2895 ATB_wap_data_call_disconnected(View); /* SPR#2086 */
2896 AUI_error_dialog(View, ERROR_GPRS_NOT_SUPPORTED);
2897 return;
2898 }
2899
2900 //sprintf(dialString, "*98**1*%d#", contextId);
2901 //"*98*1#"
2902 //sAT_Dn(CMD_SRC_LCL,"*98*1#",D_CLIR_OVRD_Default,D_CUG_CTRL_NotPresent,D_TOC_Data);
2903 ret = sAT_Dn(
2904 CMD_SRC_LCL,
2905 //dialString,
2906 "*98*1#",
2907 D_CLIR_OVRD_Default,
2908 D_CUG_CTRL_NotPresent,
2909 D_TOC_Data);
2910
2911 switch (ret)
2912 {
2913 case (AT_CMPL): /*operation completed*/
2914 case (AT_EXCT):
2915 break;
2916
2917 default:
2918 ATB_wap_data_call_disconnected(View);
2919 AUI_error_dialog(View, ERROR_CALL_DISCONNECTED);
2920 #ifdef TRACE_ATBWAPACI
2921 TRACE_EVENT("Error occurred in connection.");
2922 #endif
2923 return;
2924 break;
2925 }
2926 }
2927
2928 return;
2929 }
2930 #else /* #ifdef FF_GPF_TCPIP */
2931
2932 void connect_gprs(UBYTE object_id)
2933 {
2934 SHORT cids[MAX_CID_PLUS_EINS];
2935 BOOL states[MAX_CID_PLUS_EINS];
2936 T_GPRS_CONT_REC context;
2937 T_ACI_RETURN ret;
2938 UBYTE minsize;
2939 T_WAP_VIEW *View;
2940
2941 TRACE_FUNCTION("connect_gprs()");
2942
2943 if (!(View = ATB_wap_get_view(object_id)))
2944 return;
2945
2946 /* Check to see if context already active */
2947 memset (states, FALSE, sizeof(states));
2948 memset (cids, 0, sizeof(cids));
2949
2950 qAT_PlusCGACT ( CMD_SRC_LCL, states, cids );
2951
2952 #ifdef TRACE_ATBWAPACI
2953 TRACE_EVENT_P1("Context 0: %d", cids[0]);
2954 #endif
2955
2956 /* If context doesn't exist, define it */
2957
2958 if ( cids[0] == INVALID_CID)
2959 {
2960 #ifdef TRACE_ATBWAPACI
2961 TRACE_EVENT("Defining new context.");
2962 #endif
2963 /* SPR#2138 - SH - If context not defined, it is not activated */
2964 states[0] = FALSE;
2965 }
2966
2967 /* SPR#2415 - SH - Define context, whether or not it was defined before */
2968
2969 minsize = (MAX_APN_LEN<(URL_MAX_LEN+1))?MAX_APN_LEN:(URL_MAX_LEN+1);
2970 memset(&context.apn,'\0',MAX_APN_LEN);
2971 memcpy(&context.apn,&View->Profile->APN,minsize);
2972 strcpy((char*)context.pdp_type,"IP");
2973 minsize = (MAX_PDP_ADDR_LEN<(IPADDRESS_MAX_LEN+1))?MAX_PDP_ADDR_LEN:(IPADDRESS_MAX_LEN+1);
2974 memset(&context.pdp_addr,'\0',MAX_PDP_ADDR_LEN);
2975 context.d_comp = CGDCONT_D_COMP_OMITTED;
2976 context.h_comp = CGDCONT_H_COMP_OMITTED;
2977 memset(&context.qos,0,sizeof(T_QOS));
2978 memset(&context.min_qos,0,sizeof(T_QOS));
2979
2980 ret = sAT_PlusCGDCONT(CMD_SRC_LCL,GPRS_CID_1,&context);
2981
2982 #ifdef TRACE_ATBWAPACI
2983 TRACE_EVENT_P1("CGDCONT Return = %d",ret);
2984 #endif
2985
2986 if (ret==AT_FAIL)
2987 {
2988 AUI_error_dialog(View, ERROR_GPRS_NOT_SUPPORTED);
2989 return;
2990 }
2991
2992 /* Removed duplicate call to qAT_PlusCGACT.
2993 * If context isn't activated, call CGPCO */
2994
2995 if (states[0])
2996 {
2997 #ifdef TRACE_ATBWAPACI
2998 TRACE_EVENT("Context is activated.");
2999 #endif
3000 ATB_data_call_connected(); /* SPR#2138 */
3001 }
3002 else
3003 {
3004 #ifdef TRACE_ATBWAPACI
3005 TRACE_EVENT("Context not activated.");
3006 #endif
3007
3008 ret = sAT_PercentCGPCO (
3009 CMD_SRC_LCL,
3010 GPRS_CID_1,
3011 ACI_PCO_AUTH_PROT_PAP,
3012 (CHAR *)View->Profile->Username,
3013 (CHAR *)View->Profile->Password,
3014 NULL,
3015 NULL
3016 );
3017
3018 #ifdef TRACE_ATBWAPACI
3019 TRACE_EVENT_P1("CGPCO Return = %d", ret);
3020 #endif
3021
3022 if (ret==AT_FAIL)
3023 {
3024 AUI_error_dialog(View, ERROR_GPRS_NOT_SUPPORTED);
3025 return;
3026 }
3027
3028 ret = sAT_Dn(CMD_SRC_LCL,"*98*1#",D_CLIR_OVRD_Default,D_CUG_CTRL_NotPresent,D_TOC_Data);
3029
3030 switch (ret)
3031 {
3032 case (AT_CMPL): /*operation completed*/
3033 case (AT_EXCT):
3034 break;
3035
3036 default:
3037 AUI_error_dialog(View, ERROR_CALL_DISCONNECTED);
3038 #ifdef TRACE_ATBWAPACI
3039 TRACE_EVENT("Error occurred in connection.");
3040 #endif
3041 return;
3042 break;
3043 }
3044
3045 return;
3046 }
3047 }
3048
3049 #endif /* #ifdef FF_GPF_TCPIP */
3050 #endif
3051
3052 // xreddymn May-15-2005 MMI-SPR-30962: external functions
3053 extern void MMS_set_WAP_busy(void);
3054 extern void MMS_reset_WAP_busy(void);
3055 extern void MMS_process_push_queue(void);
3056
3057 /*******************************************************************************
3058
3059
3060 $Function: M_WAP_MMI_DISCONNECTED_IND
3061
3062 $Description: A disconnection has occurred.
3063
3064 $Returns: None
3065
3066 $Arguments: parameter - data block
3067
3068 *******************************************************************************/
3069
3070 void M_WAP_MMI_DISCONNECTED_IND(T_WAP_MMI_DISCONNECTED_IND *parameter)
3071 {
3072 T_WAP_VIEW *View;
3073
3074 #ifdef TRACE_ATBWAPACI
3075 TRACE_FUNCTION("M_WAP_MMI_DISCONNECTED_IND");
3076 TRACE_EVENT_P1("MMI object ID: %d",parameter->object_id);
3077 #endif
3078 #ifdef FF_GPF_TCPIP
3079 // xreddymn Feb-23-2005 MMI-SPR-26144
3080 AUI_mms_cancel_status();
3081 #endif
3082 if (!(View = ATB_wap_get_view(parameter->object_id)))
3083 return;
3084
3085 /* SPR#1816 - SH - Check if we're shutting down */
3086
3087 if (ATB_wap_status_get(View, ATB_WAP_SHUTTING_DOWN))
3088 {
3089 TRACE_EVENT("*** SHUTTING DOWN ***");
3090 return;
3091 }
3092
3093 #ifdef FF_GPF_TCPIP
3094 // xreddymn Feb-17-2005 MMI-SPR-26144: Disabled info dialogs
3095 // as they appear when sending MMS
3096 if(ATB_WAP_ATTACH_FAILED == parameter->error)
3097 {
3098 //xrashmic 08 Feb, 2005 MMI-SPR-27853
3099 //Need to indicate the BMI when there are GPRS errors
3100 ATB_wap_status_change(View, ATB_WAP_ATTACH_FAILED);
3101 }
3102 else if(ATB_WAP_ACTIVATE_FAILED == parameter->error)
3103 {
3104 //xrashmic 08 Feb, 2005 MMI-SPR-27853
3105 //Need to indicate the BMI when there are GPRS errors
3106 ATB_wap_status_change(View, ATB_WAP_ACTIVATE_FAILED);
3107 }
3108 #endif
3109
3110 /* SPR#1574 - SH - Removed parameter */
3111 ATB_wap_status_change(View,ATB_WAP_ONLINE_CONNECTION_CLOSED);
3112
3113 #ifdef FF_GPF_TCPIP
3114 // xreddymn May-15-2005 MMI-SPR-30962: If MMS transaction is complete,
3115 // clear WAP busy state.
3116 MMS_reset_WAP_busy();
3117 MMS_process_push_queue();
3118 #endif
3119
3120 return;
3121 }
3122
3123
3124 /*******************************************************************************
3125
3126
3127 $Function: M_WAP_MMI_READY_CNF
3128
3129 $Description: SPR#1569 - SH - Added this function
3130 Confirm that WAP has completed the operation.
3131
3132 $Returns: None.
3133
3134 $Arguments: parameter - data block
3135
3136 *******************************************************************************/
3137
3138 void M_WAP_MMI_READY_CNF(T_WAP_MMI_READY_CNF *parameter)
3139 {
3140 #ifdef TRACE_ATBWAPACI
3141 TRACE_FUNCTION("M_WAP_MMI_READY_CNF");
3142 TRACE_EVENT_P1("Event id = %d", parameter->event_id);
3143 #endif
3144
3145 switch (parameter->event_id)
3146 {
3147 case WAP_START_IND_ID:
3148 ATB_wap_start_done();
3149 break;
3150 case WAP_NEW_VIEW_IND_ID:
3151 ATB_wap_new_view_done();
3152 break;
3153 case WAP_CLOSE_VIEW_IND_ID:
3154 ATB_wap_close_view_done();
3155 break;
3156 case WAP_TERMINATE_IND_ID:
3157 ATB_wap_terminate_done();
3158 break;
3159 /* SPR#1824 - SH - Cache is prepared */
3160 case WAP_CACHE_PREPARE_IND_ID:
3161 ATB_wap_cache_prepare_done();
3162 break;
3163 }
3164 return;
3165 }
3166
3167
3168 /*******************************************************************************
3169
3170 $Function: disconnect_wap_call
3171
3172 $Description: Disconnect GPRS WAP call in progress.
3173
3174 $Returns: SPR#1982 - SH
3175 TRUE if connection is disconnected, FALSE if disconnection in progress
3176
3177 $Arguments: access_type - WAP_GPRS_DATA or WAP_CS_DATA
3178
3179 *******************************************************************************/
3180
3181 UBYTE disconnect_wap_call(UBYTE access_type)
3182 {
3183 UBYTE disconnected;
3184 T_ACI_RETURN ret;
3185 #ifdef GPRS
3186 SHORT cids[MAX_CID_PLUS_EINS] = {GPRS_CID_1, INVALID_CID};
3187 #endif
3188
3189 TRACE_FUNCTION("disconnect_wap_call()");
3190
3191 disconnected = TRUE;
3192
3193 #ifdef GPRS
3194 if (access_type==WAP_GPRS_DATA)
3195 {
3196 /* SPR#1875 - SH - Update data counter */
3197
3198 sAT_PercentSNCNT(CMD_SRC_LCL, TRUE);
3199
3200 ret = sAT_PlusCGACT(CMD_SRC_LCL, CGACT_STATE_DEACTIVATED, cids);
3201
3202 #ifdef TRACE_ATBWAPACI
3203 TRACE_EVENT_P1("Result of sAT_PlusCGACT = %d", ret);
3204 #endif
3205
3206 /* If detaching will take a little time, show a please wait dialog */
3207
3208 if (ret==AT_EXCT)
3209 {
3210 disconnected = FALSE;
3211 }
3212 }
3213 #endif
3214 return disconnected;
3215 }
3216
3217 #ifdef FF_GPF_TCPIP
3218 /*******************************************************************************
3219
3220
3221 $Function: M_WAP_MMI_CONFIG_REQ
3222
3223 $Description: SPR#2086 - SH - SAR
3224
3225 $Returns: None
3226
3227 $Arguments: parameter - data block
3228
3229 *******************************************************************************/
3230
3231 void M_WAP_MMI_CONFIG_REQ(T_WAP_MMI_CONFIG_REQ *parameter)
3232 {
3233 T_MMI_WAP_CONFIG_CNF parameter2;
3234 T_WAP_VIEW *View;
3235 T_WAP_PROFILE *httpClientProfile;
3236
3237
3238 #ifdef TRACE_WAP_WAPMMI
3239 TRACE_EVENT("M_WAP_MMI_CONFIG_REQ");
3240 TRACE_EVENT_P1("MMI object ID: %d",parameter->object_id);
3241 #endif
3242
3243 parameter2.object_id = parameter->object_id;
3244
3245 /* Check if any view exists, create a new invisible view if not */
3246
3247 if (!(View = ATB_wap_get_view(parameter->object_id)))
3248 {
3249 View = ATB_wap_new_view_invisible(parameter->object_id);
3250 ATB_wap_change_view(parameter->object_id);
3251 }
3252
3253 ATB_wap_profile_send(View);
3254
3255 /* Set default channel */
3256 ATB_wap_config_int(View, configDEFAULT_CHANNEL, View->channel);
3257
3258 /* Setup stack mode */
3259 httpClientProfile = View->Profile;
3260 if (httpClientProfile->Port1 == 9201)
3261 {
3262 ATB_wap_conn_config_int(View, configCONNECTION_TYPE, CONNECTION_TYPE_WSP_CO);
3263 TRACE_EVENT("CONNECTION_TYPE_WSP_CO at the location 2 called");
3264 }
3265 else
3266 {
3267 ATB_wap_conn_config_int(View, configCONNECTION_TYPE, CONNECTION_TYPE_TCP);
3268 TRACE_EVENT("CONNECTION_TYPE_TCP at the location 2 called");
3269 }
3270
3271
3272 /* Set connection port */
3273 ATB_wap_conn_config_int(View, configCLIENT_PORT, WAP_DOWNLOAD_LOCAL_PORT);
3274
3275 /* Set online status (FALSE = not always online) */
3276 //ATB_wap_conn_config_int(View, configONLINE, FALSE);
3277
3278 parameter2.success = TRUE;
3279
3280 M_MMI_WAP_CONFIG_CNF(&parameter2);
3281
3282 return;
3283 }
3284
3285
3286 /*******************************************************************************
3287
3288 $Function: M_WAP_MMI_CONTENT_IND
3289
3290 $Description: SPR#2086 - SH - SAR
3291
3292 $Returns: None
3293
3294 $Arguments: parameter - data block
3295
3296 *******************************************************************************/
3297
3298 void M_WAP_MMI_CONTENT_IND(T_WAP_MMI_CONTENT_IND *parameter)
3299 {
3300 T_MMI_WAP_CONTENT_CNF parameter2;
3301
3302 #ifdef TRACE_WAP_WAPMMI
3303 TRACE_EVENT("W_WAP_MMI_CONTENT_IND");
3304 TRACE_EVENT_P2("URL ID: %d, data length = %d", parameter->urlID, parameter->data_length);
3305 TRACE_EVENT_P2("moreData: %d, totalSize = %d", parameter->moreData, parameter->totalSize);
3306 #endif
3307
3308 ATB_wap_content(
3309 parameter->urlID,
3310 parameter->Data,
3311 parameter->data_length,
3312 parameter->moreData | parameter->moreSegments,
3313 parameter->ContentType,
3314 parameter->contentType_length,
3315 parameter->totalSize,
3316 parameter->errorNo
3317 );
3318
3319 if (parameter->moreSegments==FALSE && parameter->moreData==TRUE)
3320 {
3321 TRACE_EVENT("Fetching more data");
3322 parameter2.urlID = parameter->urlID;
3323 M_MMI_WAP_CONTENT_CNF(&parameter2);
3324 }
3325
3326 return;
3327 }
3328
3329 /*******************************************************************************
3330
3331 $Function: M_WAP_MMI_CONTENT_POST_CNF
3332
3333 $Description: SPR#2086 - SH - SAR
3334
3335 $Returns: None
3336
3337 $Arguments: parameter - data block
3338
3339 *******************************************************************************/
3340
3341 void M_WAP_MMI_CONTENT_POST_CNF(T_WAP_MMI_CONTENT_POST_CNF *parameter)
3342 {
3343 extern void mms_proc_content_post_cnf(UINT8 urlID);
3344
3345 #ifdef TRACE_WAP_WAPMMI
3346 TRACE_EVENT("M_WAP_MMI_CONTENT_POST_CNF");
3347 TRACE_EVENT_P1("urlID = %d", parameter->urlID);
3348 #endif
3349
3350 //TISHMMS Project
3351 ////xmzhou_trace_string_value("M_WAP_MMI_CONTENT_POST_CNF called parameter->urlID = ", parameter->urlID);
3352 mms_proc_content_post_cnf(parameter->urlID);
3353 return;
3354 }
3355
3356 /*******************************************************************************
3357
3358 $Function: copy_IP_address
3359
3360 $Description: Copies IP address from one string to another. Ensures that the
3361 destination string is in the form: AAA.BBB.CCC.DDD
3362
3363 $Returns: None
3364
3365 $Arguments: dst: Pointer to the destination string. On returning from this
3366 function, this will contain the form: AAA.BBB.CCC.DDD
3367 src: Pointer to the source string. This is a string representing
3368 an IP address, where each field is seperated by a Dot (.)
3369
3370 xreddymn Jan-24-2005 MMI-SPR-28135: WAP_OTA
3371
3372 *******************************************************************************/
3373
3374 void copy_IP_address(char *dst, char *src, S32 length)
3375 {
3376 S32 i=0, j, k=0, count, number;
3377 U8 number_string[8];
3378 for(count=0;count<4;count++)
3379 {
3380 j=0;
3381 while((src[i]!='\0') && (src[i]!='.') && (j<4))
3382 {
3383 number_string[j]=src[i];
3384 i++;
3385 j++;
3386 }
3387 if(src[i]=='.') i++;
3388 number_string[j]='\0';
3389 number=atoi((char*)number_string);
3390 if(count==3) sprintf((char*)&dst[k],"%03d",number);
3391 else sprintf((char*)&dst[k],"%03d.",number);
3392 k+=4;
3393 }
3394 }
3395
3396 void M_WAP_MMI_BROWSER_SET_CSD_IND(T_WAP_MMI_BROWSER_SET_CSD_IND *parameter)
3397 {
3398 T_WAP_PROFILE new_profile;
3399 S32 length;
3400 #ifdef TRACE_WAP_WAPMMI
3401 TRACE_EVENT("M_WAP_MMI_BROWSER_SET_CSD_IND");
3402 TRACE_EVENT_P1("Profile name = %s", parameter->OTA_profileName);
3403 TRACE_EVENT_P1("Homepage URL = %s", parameter->OTA_homepageUrl);
3404 TRACE_EVENT_P1("Dialstring = %s", parameter->OTA_CSD_dialstring);
3405 TRACE_EVENT_P1("Proxy = %s", parameter->OTA_proxy);
3406 TRACE_EVENT_P1("Port = %d", parameter->OTA_port);
3407 #endif
3408 // xreddymn Jan-24-2005 MMI-SPR-28135: WAP_OTA settings saved in WAP profiles
3409 new_profile.AccessType=WAP_CS_DATA;
3410 if(parameter->OTA_profileName_length==0)
3411 {
3412 ATB_convert_String((char*)"No name", MFW_ASCII, strlen("No name"),
3413 (char*)new_profile.Title, MFW_DCS_UCS2, CARD_TITLE_MAX_LEN, TRUE);
3414 }
3415 else
3416 {
3417 ATB_convert_String((char*)parameter->OTA_profileName, MFW_ASCII, parameter->OTA_profileName_length,
3418 (char*)new_profile.Title, MFW_DCS_UCS2, CARD_TITLE_MAX_LEN, TRUE);
3419 }
3420 length=parameter->OTA_homepageUrl_length;
3421 if(length>(URL_MAX_LEN+1)) length=URL_MAX_LEN+1;
3422 strncpy(new_profile.Homepage,parameter->OTA_homepageUrl,length);
3423 new_profile.ConnectionType=WAP_CONTINUOUS;
3424 if((strncmp(parameter->OTA_CSD_callType,"ISDN",parameter->OTA_CSD_callType_length)==0) || (strncmp(parameter->OTA_CSD_callType,"isdn",parameter->OTA_CSD_callType_length)==0))
3425 {
3426 new_profile.ConnectionSpeed=WAP_ISDN9600;
3427 }
3428 else
3429 {
3430 new_profile.ConnectionSpeed=WAP_ANALOGUE;
3431 }
3432 new_profile.ResponseTimer=60;
3433 new_profile.Port1=parameter->OTA_port;
3434 new_profile.Port2=parameter->OTA_port;
3435 length=parameter->OTA_proxy_length;
3436 if(length>(IPADDRESS_MAX_LEN+1)) length=IPADDRESS_MAX_LEN+1;
3437 copy_IP_address(new_profile.IPAddress1,parameter->OTA_proxy,length);
3438 copy_IP_address(new_profile.IPAddress2,parameter->OTA_proxy,length);
3439 length=parameter->OTA_CSD_dialstring_length;
3440 if(length>(NUMBER_MAX_LEN+1)) length=NUMBER_MAX_LEN+1;
3441 strncpy(new_profile.DialupNumber,parameter->OTA_CSD_dialstring,length);
3442 length=parameter->OTA_PPP_username_length;
3443 if(length==0)
3444 {
3445 strcpy(new_profile.Username,"");
3446 }
3447 else
3448 {
3449 if(length>(USERNAME_MAX_LEN+1)) length=USERNAME_MAX_LEN+1;
3450 strncpy(new_profile.Username,parameter->OTA_PPP_username,length);
3451 }
3452 length=parameter->OTA_PPP_password_length;
3453 if(length==0)
3454 {
3455 strcpy(new_profile.Password,"");
3456 }
3457 else
3458 {
3459 if(length>(PASSWORD_MAX_LEN+1)) length=PASSWORD_MAX_LEN+1;
3460 strncpy(new_profile.Password,parameter->OTA_PPP_password,length);
3461 }
3462 new_profile.Security=FALSE;
3463 strcpy(new_profile.NameServer1,"");
3464 strcpy(new_profile.NameServer2,"");
3465 new_profile.PPGAuthentication=FALSE;
3466 new_profile.WirelessProfiledHTTP=TRUE;
3467 ATB_wap_profile_add(&new_profile);
3468 return;
3469 }
3470
3471 void M_WAP_MMI_BROWSER_SET_GPRS_IND(T_WAP_MMI_BROWSER_SET_GPRS_IND *parameter)
3472 {
3473 T_WAP_PROFILE new_profile;
3474 S32 length;
3475 #ifdef TRACE_WAP_WAPMMI
3476 TRACE_EVENT("M_WAP_MMI_BROWSER_SET_GPRS_IND");
3477 TRACE_EVENT_P1("Profile name = %s", parameter->OTA_profileName);
3478 TRACE_EVENT_P1("Homepage URL = %s", parameter->OTA_homepageUrl);
3479 TRACE_EVENT_P1("APN = %s", parameter->OTA_GPRS_APN);
3480 TRACE_EVENT_P1("Proxy = %s", parameter->OTA_proxy);
3481 TRACE_EVENT_P1("Port = %d", parameter->OTA_port);
3482 #endif
3483 // xreddymn Jan-24-2005 MMI-SPR-28135: WAP_OTA settings saved in WAP profiles
3484 new_profile.AccessType=WAP_GPRS_DATA;
3485 if(parameter->OTA_profileName_length==0)
3486 {
3487 ATB_convert_String((char*)"No name", MFW_ASCII, strlen("No name"),
3488 (char*)new_profile.Title, MFW_DCS_UCS2, CARD_TITLE_MAX_LEN, TRUE);
3489 }
3490 else
3491 {
3492 ATB_convert_String((char*)parameter->OTA_profileName, MFW_ASCII, parameter->OTA_profileName_length,
3493 (char*)new_profile.Title, MFW_DCS_UCS2, CARD_TITLE_MAX_LEN, TRUE);
3494 }
3495 length=parameter->OTA_homepageUrl_length;
3496 if(length>(URL_MAX_LEN+1)) length=URL_MAX_LEN+1;
3497 strncpy(new_profile.Homepage,parameter->OTA_homepageUrl,length);
3498 new_profile.ConnectionType=WAP_CONTINUOUS;
3499 new_profile.ResponseTimer=60;
3500 new_profile.Port1=parameter->OTA_port;
3501 new_profile.Port2=parameter->OTA_port;
3502 length=parameter->OTA_proxy_length;
3503 if(length>(IPADDRESS_MAX_LEN+1)) length=IPADDRESS_MAX_LEN+1;
3504 copy_IP_address(new_profile.IPAddress1,parameter->OTA_proxy,length);
3505 copy_IP_address(new_profile.IPAddress2,parameter->OTA_proxy,length);
3506 length=parameter->OTA_GPRS_APN_length;
3507 if(length>(URL_MAX_LEN+1)) length=URL_MAX_LEN+1;
3508 strncpy(new_profile.APN,parameter->OTA_GPRS_APN,length);
3509 length=parameter->OTA_proxy_username_length;
3510 if(length==0)
3511 {
3512 strcpy(new_profile.Username,"");
3513 }
3514 else
3515 {
3516 if(length>(USERNAME_MAX_LEN+1)) length=USERNAME_MAX_LEN+1;
3517 strncpy(new_profile.Username,parameter->OTA_proxy_username,length);
3518 }
3519 length=parameter->OTA_proxy_password_length;
3520 if(length==0)
3521 {
3522 strcpy(new_profile.Password,"");
3523 }
3524 else
3525 {
3526 if(length>(PASSWORD_MAX_LEN+1)) length=PASSWORD_MAX_LEN+1;
3527 strncpy(new_profile.Password,parameter->OTA_proxy_password,length);
3528 }
3529 new_profile.Security=FALSE;
3530 strcpy(new_profile.NameServer1,"");
3531 strcpy(new_profile.NameServer2,"");
3532 new_profile.PPGAuthentication=FALSE;
3533 new_profile.WirelessProfiledHTTP=TRUE;
3534 ATB_wap_profile_add(&new_profile);
3535 return;
3536 }
3537
3538
3539 void M_WAP_MMI_MMS_SET_CSD_IND(T_WAP_MMI_MMS_SET_CSD_IND *parameter)
3540 {
3541
3542 #ifdef TRACE_WAP_WAPMMI
3543 TRACE_EVENT("M_WAP_MMI_MMS_SET_CSD_IND");
3544 TRACE_EVENT_P1("Profile name = %s", parameter->OTA_profileName);
3545 TRACE_EVENT_P1("MMSC URL = %s", parameter->OTA_mmsUrl);
3546 TRACE_EVENT_P1("Dialstring = %s", parameter->OTA_CSD_dialstring);
3547 TRACE_EVENT_P1("Proxy = %s", parameter->OTA_proxy);
3548 TRACE_EVENT_P1("Port = %d", parameter->OTA_port);
3549 #endif
3550
3551 return;
3552 }
3553
3554 void M_WAP_MMI_MMS_SET_GPRS_IND(T_WAP_MMI_MMS_SET_GPRS_IND *parameter)
3555 {
3556
3557 #ifdef TRACE_WAP_WAPMMI
3558 TRACE_EVENT("M_WAP_MMI_MMS_SET_GPRS_IND");
3559 TRACE_EVENT_P1("Profile name = %s", parameter->OTA_profileName);
3560 TRACE_EVENT_P1("MMSC URL = %s", parameter->OTA_mmsUrl);
3561 TRACE_EVENT_P1("APN = %s", parameter->OTA_GPRS_APN);
3562 TRACE_EVENT_P1("Proxy = %s", parameter->OTA_proxy);
3563 TRACE_EVENT_P1("Port = %d", parameter->OTA_port);
3564 #endif
3565
3566 return;
3567 }
3568
3569 void M_WAP_MMI_BROWSER_BOOKMARKS_IND(T_WAP_MMI_BROWSER_BOOKMARKS_IND *parameter)
3570 {
3571
3572 #ifdef TRACE_WAP_WAPMMI
3573 TRACE_EVENT("M_WAP_MMI_BROWSER_BOOKMARKS_IND");
3574 TRACE_EVENT_P1("Number of bookmarks = %d", parameter->OTA_numberOfBookmarks);
3575 TRACE_EVENT_P1("First bookmark name = %s", parameter->OTA_bookmarkName_1);
3576 TRACE_EVENT_P1("First bookmark url = %s", parameter->OTA_bookmarkUrl_1);
3577 #endif
3578
3579 return;
3580 }
3581 void M_WAP_MMI_SYNCML_GENERAL_SET_IND(T_WAP_MMI_SYNCML_GENERAL_SET_IND *parameter)
3582 {
3583
3584 #ifdef TRACE_WAP_WAPMMI
3585 TRACE_EVENT("M_WAP_MMI_SYNCML_GENERAL_SET_IND");
3586 TRACE_EVENT_P1("Host address = %s", parameter->OTASYNC_HostAddr);
3587 TRACE_EVENT_P1("Database URI = %s", parameter->OTASYNC_URI);
3588 TRACE_EVENT_P1("Connection port = %d", parameter->OTASYNC_Port);
3589 #endif
3590
3591 return;
3592 }
3593
3594 void M_WAP_MMI_SYNCML_CONTENT_SET_IND(T_WAP_MMI_SYNCML_CONTENT_SET_IND *parameter)
3595 {
3596
3597 #ifdef TRACE_WAP_WAPMMI
3598 TRACE_EVENT("M_WAP_MMI_SYNCML_CONTENT_SET_IND");
3599 TRACE_EVENT_P1("Content type = %s", parameter->OTASYNC_CTType);
3600 TRACE_EVENT_P1("Content version = %s", parameter->OTASYNC_CTVer);
3601 #endif
3602
3603 return;
3604 }
3605 /*******************************************************************************
3606
3607 $Function: M_WAP_MMI_PUSH_NEW_SI_IND
3608
3609 $Description: New SI is received
3610 SPR#2086 - Added
3611
3612 $Returns: None
3613
3614 $Arguments: parameter - Data block
3615
3616 *******************************************************************************/
3617
3618 void M_WAP_MMI_PUSH_NEW_SI_IND(T_WAP_MMI_PUSH_NEW_SI_IND *parameter)
3619 {
3620 #ifdef TRACE_ATBWAPACI
3621 TRACE_EVENT("M_WAP_MMI_PUSH_NEW_SI_IND");
3622 #endif
3623
3624 ATB_wap_push_SI_new(
3625 parameter->id,
3626 parameter->created,
3627 parameter->expires,
3628 parameter->Message,
3629 parameter->message_length,
3630 parameter->expired,
3631 parameter->Url,
3632 parameter->url_length,
3633 parameter->priority,
3634 parameter->InitURL,
3635 parameter->initURL_length,
3636 parameter->applicationType,
3637 parameter->newChannelId );
3638
3639 return;
3640 }
3641
3642 /*******************************************************************************
3643
3644 $Function: M_WAP_MMI_PUSH_SI_INFO_IND
3645
3646 $Description: SI info is received
3647 SPR#2086 - Added
3648
3649 $Returns: None
3650
3651 $Arguments: parameter - Data block
3652
3653 *******************************************************************************/
3654
3655 void M_WAP_MMI_PUSH_SI_INFO_IND(T_WAP_MMI_PUSH_SI_INFO_IND *parameter)
3656 {
3657 #ifdef TRACE_ATBWAPACI
3658 TRACE_EVENT("M_WAP_MMI_PUSH_SI_INFO_IND");
3659 #endif
3660
3661 ATB_wap_push_SI_info(
3662 parameter->id,
3663 parameter->status,
3664 parameter->created,
3665 parameter->expires,
3666 parameter->Message,
3667 parameter->message_length,
3668 parameter->expired,
3669 parameter->Url,
3670 parameter->url_length,
3671 parameter->priority,
3672 parameter->InitURL,
3673 parameter->initURL_length);
3674
3675 return;
3676 }
3677
3678 /*******************************************************************************
3679
3680 $Function: M_WAP_MMI_PUSH_NEW_SL_IND
3681
3682 $Description: New SL is received
3683 SPR#2086 - Added
3684
3685 $Returns: None
3686
3687 $Arguments: parameter - Data block
3688
3689 *******************************************************************************/
3690
3691 void M_WAP_MMI_PUSH_NEW_SL_IND(T_WAP_MMI_PUSH_NEW_SL_IND *parameter)
3692 {
3693 #ifdef TRACE_ATBWAPACI
3694 TRACE_EVENT("M_WAP_MMI_PUSH_NEW_SL_IND");
3695 #endif
3696
3697 // xreddymn Mar-22-2005 MMI-SPR-29767: Modified handling of SL messages
3698 // xreddymn Mar-11-2005 MMI-SPR-29510: Enabled support for SL messages
3699 ATB_wap_push_SL_new(
3700 parameter->id,
3701 parameter->Url,
3702 parameter->url_length,
3703 parameter->priority,
3704 parameter->InitURL,
3705 parameter->initURL_length,
3706 parameter->applicationType,
3707 parameter->newChannelId );
3708
3709 return;
3710 }
3711
3712 /*******************************************************************************
3713
3714 $Function: M_WAP_MMI_PUSH_SL_INFO_IND
3715
3716 $Description: SL info is received
3717 SPR#2086 - Added
3718
3719 $Returns: None
3720
3721 $Arguments: parameter - Data block
3722
3723 *******************************************************************************/
3724
3725 void M_WAP_MMI_PUSH_SL_INFO_IND(T_WAP_MMI_PUSH_SL_INFO_IND *parameter)
3726 {
3727 #ifdef TRACE_ATBWAPACI
3728 TRACE_EVENT("M_WAP_MMI_PUSH_SL_INFO_IND");
3729 #endif
3730
3731
3732 return;
3733 }
3734
3735 /*******************************************************************************
3736
3737 $Function: M_WAP_MMI_PUSH_MESSAGE_CHANGE_IND
3738
3739 $Description: A message status has changed
3740 SPR#2086 - Added
3741
3742 $Returns: None
3743
3744 $Arguments: parameter - Data block
3745
3746 *******************************************************************************/
3747
3748 void M_WAP_MMI_PUSH_MESSAGE_CHANGE_IND(T_WAP_MMI_PUSH_MESSAGE_CHANGE_IND *parameter)
3749 {
3750 #ifdef TRACE_ATBWAPACI
3751 TRACE_EVENT("M_WAP_MMI_PUSH_MESSAGE_CHANGE_IND");
3752 #endif
3753
3754 return;
3755 }
3756
3757
3758 /*******************************************************************************
3759
3760 $Function: M_WAP_MMI_PUSH_REPOSITORY_FULL_IND
3761
3762 $Description: The push repository is full
3763 SPR#2086 - Added
3764
3765 $Returns: None
3766
3767 $Arguments: parameter - Data block
3768
3769 *******************************************************************************/
3770
3771 void M_WAP_MMI_PUSH_REPOSITORY_FULL_IND(T_WAP_MMI_PUSH_REPOSITORY_FULL_IND *parameter)
3772 {
3773 #ifdef TRACE_ATBWAPACI
3774 TRACE_EVENT("M_WAP_MMI_PUSH_REPOSITORY_FULL_IND");
3775 #endif
3776
3777 return;
3778 }
3779
3780
3781 /*******************************************************************************
3782
3783 $Function: M_WAP_MMI_PUSH_CONNECTION_REQ
3784
3785 $Description: A request to set up the push connection
3786 SPR#2086 - Added
3787
3788 $Returns: None
3789
3790 $Arguments: parameter - Data block
3791
3792 *******************************************************************************/
3793
3794 void M_WAP_MMI_PUSH_CONNECTION_REQ(T_WAP_MMI_PUSH_CONNECTION_REQ *parameter)
3795 {
3796 T_MMI_WAP_PUSH_CONNECTION_CNF parameter2;
3797 T_WAP_VIEW *View;
3798 ULONG IPAddressLong;
3799
3800 #ifdef TRACE_WAP_WAPMMI
3801 TRACE_EVENT("M_WAP_MMI_PUSH_CONNECTION_REQ");
3802 #endif
3803
3804 /* Check if any view exists, create a new invisible view if not */
3805
3806 if (!(View = ATB_wap_get_view(PUSH_USER_AGENT)))
3807 {
3808 View = ATB_wap_new_view_invisible(PUSH_USER_AGENT);
3809 }
3810
3811 /* Setup stack mode */
3812 ATB_wap_conn_config_int(View, configACCESS_TYPE, parameter->stackMode);
3813
3814 /* Setup access type- CSD by default */
3815 if (parameter->accessType!=BEARER_ANY)
3816 {
3817 ATB_wap_conn_config_int(View, configACCESS_TYPE, parameter->accessType);
3818 }
3819 else
3820 {
3821 ATB_wap_conn_config_int(View, configACCESS_TYPE, BEARER_GSM_CSD);
3822 }
3823
3824 /* Setup gateway address */
3825 ATB_conv_str_to_IP(parameter->Address, parameter->address_length, &IPAddressLong);
3826 ATB_wap_conn_config_str(View, configPROXY_ADDRESS, (CHAR *)&IPAddressLong, sizeof(ULONG));
3827
3828 /* Set connection port */
3829 ATB_wap_conn_config_int(View, configCLIENT_PORT, WAP_LOCAL_PORT);
3830
3831 /* Set online status (FALSE = not always online) */
3832 //ATB_wap_conn_config_int(View, configONLINE, FALSE);
3833
3834 /* Setup timeout */
3835 ATB_wap_conn_config_int(View, configTIMEOUT, WAP_DEFAULT_RESPONSE_TIME);
3836
3837 /* Set connection port 1 */
3838 ATB_wap_conn_config_int(View, WAP_setPort1, WAP_DEFAULT_PORT);
3839
3840 /* Set connection port 2 */
3841 ATB_wap_conn_config_int(View, WAP_setPort2, WAP_DEFAULT_PORT);
3842
3843 ATB_wap_config_int(View, configPPG_AUTHENTICATION_REQUIRED, 0);
3844
3845 parameter2.siaId = parameter->siaId;
3846 parameter2.channelId = WAP_CHANNEL_ID;
3847 parameter2.success = TRUE;
3848
3849 M_MMI_WAP_PUSH_CONNECTION_CNF(&parameter2);
3850
3851 return;
3852 }
3853
3854
3855 /*******************************************************************************
3856
3857 $Function: M_WAP_MMI_PUSH_UNLOADED_MSG_CNF
3858
3859 $Description: Indicates if there are unloaded messages in the Push inbox
3860 SPR#2086 - Added
3861
3862 $Returns: None
3863
3864 $Arguments: parameter - Data block
3865
3866 *******************************************************************************/
3867
3868 void M_WAP_MMI_PUSH_UNLOADED_MSG_CNF(T_WAP_MMI_PUSH_UNLOADED_MSG_CNF *parameter)
3869 {
3870 TRACE_FUNCTION("M_WAP_MMI_PUSH_UNLOADED_MSG_CNF");
3871
3872 return;
3873 }
3874
3875
3876 /*******************************************************************************
3877
3878 $Function: M_WAP_MMI_PUSH_SMS_SEND_IND
3879
3880 $Description: Request for MMI to send an SMS
3881 SPR#2086 - Added
3882
3883 $Returns: None
3884
3885 $Arguments: parameter - Data block
3886
3887 *******************************************************************************/
3888
3889 void M_WAP_MMI_PUSH_SMS_SEND_IND(T_WAP_MMI_PUSH_SMS_SEND_IND *parameter)
3890 {
3891 #ifdef TRACE_WAP_WAPMMI
3892 TRACE_EVENT("M_WAP_MMI_PUSH_SMS_SEND_IND");
3893 TRACE_EVENT_P1("destination_length: %d", parameter->destination_length);
3894 TRACE_EVENT_P1("data_length: %d", parameter->data_length);
3895 #endif
3896
3897 ATB_wap_push_SMS_send(
3898 parameter->Smsc,
3899 parameter->smsc_length,
3900 parameter->Destination,
3901 parameter->destination_length,
3902 parameter->Data,
3903 parameter->data_length);
3904
3905 return;
3906 }
3907
3908 // xreddymn Mar-25-2005 MMI-SPR-26144: send data indication
3909 // this is used to update progress when sending MMS
3910 /*******************************************************************************
3911
3912 $Function: M_WAP_MMI_NET_SEND_IND
3913
3914 $Description: NET SEND indication
3915
3916 $Returns: None.
3917
3918 $Arguments: parameter - data block
3919
3920 *******************************************************************************/
3921
3922 void M_WAP_MMI_NET_SEND_IND(T_WAP_MMI_NET_SEND_IND *parameter)
3923 {
3924 #ifdef TRACE_ATBWAPACI
3925 TRACE_FUNCTION("M_WAP_MMI_NET_SEND_IND");
3926 #endif
3927 #ifdef FF_GPF_TCPIP
3928 AUI_wap_net_send_ind();
3929 #endif
3930 }
3931
3932 // xreddymn MMI-SPR-30834 May-14-2005
3933 /*******************************************************************************
3934
3935 $Function: M_MMI_WAP_FREE_MEM_IND
3936
3937 $Description: Called by MMI to free data in WAP memory
3938
3939 $Returns: None.
3940
3941 $Arguments: parameter - data block
3942
3943 *******************************************************************************/
3944
3945 void M_MMI_WAP_FREE_MEM_IND(T_MMI_WAP_MEM_FREE_IND *parameter)
3946 {
3947 #ifdef TRACE_ATBWAPACI
3948 TRACE_EVENT("M_MMI_WAP_FREE_MEM_IND");
3949 #endif
3950
3951 mmi_coder(WAP_MEM_FREE_IND_ID, (void *)parameter);
3952
3953 return;
3954 }
3955
3956 // xreddymn Jun-21-2005 MMI-SPR-30291
3957 /*******************************************************************************
3958
3959 $Function: M_MMI_WAP_SEND_PROFILE_IND
3960
3961 $Description: Sends profile data from MMI to WAP adapter
3962
3963 $Returns: None.
3964
3965 $Arguments: parameter - data block
3966
3967 *******************************************************************************/
3968
3969 void M_MMI_WAP_SEND_PROFILE_IND(T_MMI_WAP_SEND_PROFILE_IND *parameter)
3970 {
3971 #ifdef TRACE_WAP_WAPMMI
3972 TRACE_EVENT("M_MMI_WAP_SEND_PROFILE_IND");
3973 #endif
3974
3975 mmi_coder(WAP_SEND_PROFILE_IND_ID, (void *)parameter);
3976
3977 return;
3978 }
3979
3980 #endif
3981 /* #ifdef FF_GPF_TCPIP */