comparison src/ui/mfw/mfw_phb.c @ 188:92abb46dc1ba

src/ui/mfw/*.[ch]: rm trailing white space
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 19 Jan 2021 06:10:27 +0000
parents 67bfe9f274f6
children
comparison
equal deleted inserted replaced
187:a33dd8a5dcc9 188:92abb46dc1ba
13 HISTORY: 13 HISTORY:
14 14
15 June 05, 2007 DR:OMAPS00133241 x0061560(sateeshg) 15 June 05, 2007 DR:OMAPS00133241 x0061560(sateeshg)
16 Description:ASTEC29607,SIM:The sim card should not return 9240 still. 16 Description:ASTEC29607,SIM:The sim card should not return 9240 still.
17 Solution :New enum MFW_PHB_EXCT been sent while the command AT_EXCT is in progress 17 Solution :New enum MFW_PHB_EXCT been sent while the command AT_EXCT is in progress
18 18
19 Nov 03, 2006 DR:OMAPS00097209 a0393213(R.Prabakar) 19 Nov 03, 2006 DR:OMAPS00097209 a0393213(R.Prabakar)
20 API Needed for Maximum Length Of Each Phonebook Category In SIM 20 API Needed for Maximum Length Of Each Phonebook Category In SIM
21 Solution: The interface of pb_read_sizes() changed. While calling the function it should be taken care of. 21 Solution: The interface of pb_read_sizes() changed. While calling the function it should be taken care of.
22 22
23 Aug 18, 2006 ER: OMAPS00089840 x0039928 23 Aug 18, 2006 ER: OMAPS00089840 x0039928
24 Description: Changes to be made in MMI for the functionality "Delete all" ADN entries 24 Description: Changes to be made in MMI for the functionality "Delete all" ADN entries
25 Solution: A new menu item "Delete All" is added in the phone book menu 25 Solution: A new menu item "Delete All" is added in the phone book menu
26 to delete all the sim entries 26 to delete all the sim entries
27 27
28 July 17, 2006 DR: OMAPS00082792 x0039928 28 July 17, 2006 DR: OMAPS00082792 x0039928
29 Description:Changes to be done in MMI for Move all entries from SIM to FFS (Defect 76492) 29 Description:Changes to be done in MMI for Move all entries from SIM to FFS (Defect 76492)
30 Solution: Added condition to check for AT_EXCT return for sAT_PlusCPBW 30 Solution: Added condition to check for AT_EXCT return for sAT_PlusCPBW
31 31
32 Oct 27, 2005 REF: OMAPS 48881 b-nekkare 32 Oct 27, 2005 REF: OMAPS 48881 b-nekkare
33 Description: PhoneBook: The modify option under phonebook doesn't 33 Description: PhoneBook: The modify option under phonebook doesn't
34 work as expected. 34 work as expected.
35 Solution: In case of SIM storage,deleted the previous 2nd comparision 35 Solution: In case of SIM storage,deleted the previous 2nd comparision
36 with TON as then it would be TRUE if the previous saved 36 with TON as then it would be TRUE if the previous saved
37 number had a preceding'+'. So currently only checking for 37 number had a preceding'+'. So currently only checking for
38 '+' to figure out the TON. 38 '+' to figure out the TON.
39 39
40 40
41 Apr 14, 2005 REF: CRR 29991 xpradipg 41 Apr 14, 2005 REF: CRR 29991 xpradipg
42 Description: Optimisation 5: Remove the static allocation and use dynamic 42 Description: Optimisation 5: Remove the static allocation and use dynamic
43 allocation/ deallocation for pb_list and black_list 43 allocation/ deallocation for pb_list and black_list
44 Solution: The static definition is removed and replaced with the dynamic 44 Solution: The static definition is removed and replaced with the dynamic
45 allocation 45 allocation
46 46
47 47
48 March 1 ,2004 REF: CRR 27832 x0012852 48 March 1 ,2004 REF: CRR 27832 x0012852
49 Bug:SIM PIN2 related Actions are displying wrong Error Response. 49 Bug:SIM PIN2 related Actions are displying wrong Error Response.
50 Fix:MFW calls sAT_PlusCPBS() with third parameter as NULL. 50 Fix:MFW calls sAT_PlusCPBS() with third parameter as NULL.
51 */ 51 */
52 #define ENTITY_MFW 52 #define ENTITY_MFW
53 53
117 117
118 /* SPR#1112 - SH - Required for internal phonebook */ 118 /* SPR#1112 - SH - Required for internal phonebook */
119 #ifdef INT_PHONEBOOK 119 #ifdef INT_PHONEBOOK
120 #include "ATBPbGI.h" 120 #include "ATBPbGI.h"
121 #endif 121 #endif
122 122
123 /*************** MACRO definition ***********************************/ 123 /*************** MACRO definition ***********************************/
124 // Apr 14, 2005 REF: CRR 29991 xpradipg 124 // Apr 14, 2005 REF: CRR 29991 xpradipg
125 // MACRO to allocate and deallocate memory for pb_list 125 // MACRO to allocate and deallocate memory for pb_list
126 #ifdef FF_MMI_OPTIM 126 #ifdef FF_MMI_OPTIM
127 #define PB_LIST_ALLOC(ptr,size) \ 127 #define PB_LIST_ALLOC(ptr,size) \
130 return MFW_PHB_FAIL; 130 return MFW_PHB_FAIL;
131 #define PB_LIST_DEALLOC(ptr,size)\ 131 #define PB_LIST_DEALLOC(ptr,size)\
132 if(ptr)\ 132 if(ptr)\
133 mfwFree((U8*)ptr, size); 133 mfwFree((U8*)ptr, size);
134 #define PB_LIST_SIZE (sizeof(T_ACI_PB_ENTR)*PHB_MAX_ENTRY_NUM) 134 #define PB_LIST_SIZE (sizeof(T_ACI_PB_ENTR)*PHB_MAX_ENTRY_NUM)
135 135
136 #else 136 #else
137 #define PB_LIST_ALLOC(ptr, size) 137 #define PB_LIST_ALLOC(ptr, size)
138 #define PB_LIST_DEALLOC(ptr, size) 138 #define PB_LIST_DEALLOC(ptr, size)
139 #endif 139 #endif
140 /********* current define *******************************************/ 140 /********* current define *******************************************/
141 // Apr 14, 2005 REF: CRR 29991 xpradipg 141 // Apr 14, 2005 REF: CRR 29991 xpradipg
142 // remove the static allocation 142 // remove the static allocation
143 #ifndef FF_MMI_OPTIM 143 #ifndef FF_MMI_OPTIM
144 static T_ACI_PB_ENTR pb_list[PHB_MAX_ENTRY_NUM]; 144 static T_ACI_PB_ENTR pb_list[PHB_MAX_ENTRY_NUM];
173 T_MFW_HND phb_create(T_MFW_HND hWin, T_MFW_EVENT event, T_MFW_CB cbfunc) 173 T_MFW_HND phb_create(T_MFW_HND hWin, T_MFW_EVENT event, T_MFW_CB cbfunc)
174 { 174 {
175 T_MFW_HDR *hdr; 175 T_MFW_HDR *hdr;
176 T_MFW_PHB *phb_para; 176 T_MFW_PHB *phb_para;
177 MfwHdr *insert_status =0; 177 MfwHdr *insert_status =0;
178 178
179 TRACE_FUNCTION ("phb_create()"); 179 TRACE_FUNCTION ("phb_create()");
180 180
181 hdr = (T_MFW_HDR *) mfwAlloc(sizeof (T_MFW_HDR)); 181 hdr = (T_MFW_HDR *) mfwAlloc(sizeof (T_MFW_HDR));
182 phb_para = (T_MFW_PHB *) mfwAlloc(sizeof (T_MFW_PHB)); 182 phb_para = (T_MFW_PHB *) mfwAlloc(sizeof (T_MFW_PHB));
183 183
184 if (!hdr OR !phb_para) 184 if (!hdr OR !phb_para)
185 { 185 {
186 TRACE_ERROR("ERROR: phb_create() Mem Alloc Failed."); 186 TRACE_ERROR("ERROR: phb_create() Mem Alloc Failed.");
187 187
188 if(hdr) 188 if(hdr)
189 mfwFree((U8*)hdr,sizeof(MfwHdr)); 189 mfwFree((U8*)hdr,sizeof(MfwHdr));
190 if(phb_para) 190 if(phb_para)
191 mfwFree((U8*)phb_para,sizeof(T_MFW_PHB)); 191 mfwFree((U8*)phb_para,sizeof(T_MFW_PHB));
192 192
193 return FALSE; 193 return FALSE;
194 } 194 }
195 195
196 /* 196 /*
197 * initialisation of the handler 197 * initialisation of the handler
229 */ 229 */
230 230
231 T_MFW_RES phb_delete(T_MFW_HND h) 231 T_MFW_RES phb_delete(T_MFW_HND h)
232 { 232 {
233 TRACE_FUNCTION ("phb_delete()"); 233 TRACE_FUNCTION ("phb_delete()");
234 234
235 if (!h OR !((T_MFW_HDR *)h)->data) 235 if (!h OR !((T_MFW_HDR *)h)->data)
236 return MFW_RES_ILL_HND; 236 return MFW_RES_ILL_HND;
237 237
238 if (!mfwRemove((T_MFW_HDR *)h)) 238 if (!mfwRemove((T_MFW_HDR *)h))
239 return MFW_RES_ILL_HND; 239 return MFW_RES_ILL_HND;
254 PURPOSE : send a event signal. 254 PURPOSE : send a event signal.
255 255
256 */ 256 */
257 257
258 void phb_signal(T_MFW_EVENT event, void * para) 258 void phb_signal(T_MFW_EVENT event, void * para)
259 {/*MC, SPR 1389, we have to enable the display whenever 259 {/*MC, SPR 1389, we have to enable the display whenever
260 we send an event up to the MMI*/ 260 we send an event up to the MMI*/
261 UBYTE temp = dspl_Enable(0); 261 UBYTE temp = dspl_Enable(0);
262 262
263 TRACE_FUNCTION ("phb_signal()"); 263 TRACE_FUNCTION ("phb_signal()");
264 if (mfwSignallingMethod EQ 0) 264 if (mfwSignallingMethod EQ 0)
265 { 265 {
266 /* 266 /*
267 * focus is on a window 267 * focus is on a window
543 case NPI_Private: return MFW_NPI_PRIVATE; 543 case NPI_Private: return MFW_NPI_PRIVATE;
544 case NPI_National: return MFW_NPI_NATIONAL; 544 case NPI_National: return MFW_NPI_NATIONAL;
545 #ifdef FF_2TO1_PS 545 #ifdef FF_2TO1_PS
546 case NPI_Ermes: return MFW_NPI_M_ERMES; 546 case NPI_Ermes: return MFW_NPI_M_ERMES;
547 case NPI_Cts: return MFW_NPI_M_CTS; 547 case NPI_Cts: return MFW_NPI_M_CTS;
548 #else 548 #else
549 case NPI_ERMES: return MFW_NPI_M_ERMES; 549 case NPI_ERMES: return MFW_NPI_M_ERMES;
550 case NPI_CTS: return MFW_NPI_M_CTS; 550 case NPI_CTS: return MFW_NPI_M_CTS;
551 #endif 551 #endif
552 default: return MFW_NPI_UNKNOWN;/*a0393213 warnings removal-npi changed to MFW_NPI_UNKNOWN*/ 552 default: return MFW_NPI_UNKNOWN;/*a0393213 warnings removal-npi changed to MFW_NPI_UNKNOWN*/
553 } 553 }
554 } 554 }
555 555
556 556
627 */ 627 */
628 628
629 void phb_init() 629 void phb_init()
630 { 630 {
631 TRACE_FUNCTION ("phb_init()"); 631 TRACE_FUNCTION ("phb_init()");
632 632
633 return; 633 return;
634 } 634 }
635 635
636 /* 636 /*
637 +--------------------------------------------------------------------+ 637 +--------------------------------------------------------------------+
657 UBYTE x; 657 UBYTE x;
658 // Apr 14, 2005 REF: CRR 29991 xpradipg 658 // Apr 14, 2005 REF: CRR 29991 xpradipg
659 // Define the local pointer since it occupies close to 650 bytes 659 // Define the local pointer since it occupies close to 650 bytes
660 #ifdef FF_MMI_OPTIM 660 #ifdef FF_MMI_OPTIM
661 T_ACI_PB_ENTR *pb_list; 661 T_ACI_PB_ENTR *pb_list;
662 #endif 662 #endif
663 TRACE_FUNCTION ("phb_read_entries()"); 663 TRACE_FUNCTION ("phb_read_entries()");
664 TRACE_EVENT_P4("book%d index%d mode%d num%d", book, index, mode, num_entries); 664 TRACE_EVENT_P4("book%d index%d mode%d num%d", book, index, mode, num_entries);
665 665
666 /* SPR#1112 - SH - Internal phonebook */ 666 /* SPR#1112 - SH - Internal phonebook */
667 #ifdef INT_PHONEBOOK 667 #ifdef INT_PHONEBOOK
728 728
729 /* select phonebook */ 729 /* select phonebook */
730 if (sAT_PlusCPBS(CMD_SRC_LCL, phb_codePhbType ((T_MFW_PHB_TYPE) book ), NULL) NEQ AT_CMPL) 730 if (sAT_PlusCPBS(CMD_SRC_LCL, phb_codePhbType ((T_MFW_PHB_TYPE) book ), NULL) NEQ AT_CMPL)
731 return MFW_PHB_FAIL; 731 return MFW_PHB_FAIL;
732 732
733 // March 1 ,2004 REF: CRR 27832 x0012852 733 // March 1 ,2004 REF: CRR 27832 x0012852
734 // Bug:SIM PIN2 related Actions are displying wrong Error Response. 734 // Bug:SIM PIN2 related Actions are displying wrong Error Response.
735 // Fix:MFW calls sAT_PlusCPBS() with third parameter as NULL. 735 // Fix:MFW calls sAT_PlusCPBS() with third parameter as NULL.
736 736
737 /* Read entries */ 737 /* Read entries */
738 entries->book = book; 738 entries->book = book;
739 rcd_num = 0; 739 rcd_num = 0;
740 start_ind = index; 740 start_ind = index;
741 stop_ind = index + (num_entries - 1); 741 stop_ind = index + (num_entries - 1);
742 // Apr 14, 2005 REF: CRR 29991 xpradipg 742 // Apr 14, 2005 REF: CRR 29991 xpradipg
743 // dynamic allocation 743 // dynamic allocation
744 PB_LIST_ALLOC(pb_list,PB_LIST_SIZE); 744 PB_LIST_ALLOC(pb_list,PB_LIST_SIZE);
745 while (num_entries > 0) 745 while (num_entries > 0)
746 { 746 {
747 for (i=0; i<PHB_MAX_ENTRY_NUM; i++) 747 for (i=0; i<PHB_MAX_ENTRY_NUM; i++)
748 pb_list[i].index = -1; 748 pb_list[i].index = -1;
749 749
834 834
835 835
836 836
837 /* SPR#1727 - DS - Merged updated version from 1.6 branch. */ 837 /* SPR#1727 - DS - Merged updated version from 1.6 branch. */
838 838
839 /* Test that the last 6 digits match. 839 /* Test that the last 6 digits match.
840 If there are less than 6 numbers - its probably not a phone number. 840 If there are less than 6 numbers - its probably not a phone number.
841 GW- For emergency calls check a full exact match for the full (but short) length 841 GW- For emergency calls check a full exact match for the full (but short) length
842 */ 842 */
843 int numbersMatch(char * num1, char* num2) 843 int numbersMatch(char * num1, char* num2)
844 { 844 {
903 /*SPR2102, removed dbg variable*/ 903 /*SPR2102, removed dbg variable*/
904 // Apr 14, 2005 REF: CRR 29991 xpradipg 904 // Apr 14, 2005 REF: CRR 29991 xpradipg
905 // local pointer definition 905 // local pointer definition
906 #ifdef FF_MMI_OPTIM 906 #ifdef FF_MMI_OPTIM
907 T_ACI_PB_ENTR *pb_list; 907 T_ACI_PB_ENTR *pb_list;
908 #endif 908 #endif
909 TRACE_FUNCTION ("phb_find_entries()"); 909 TRACE_FUNCTION ("phb_find_entries()");
910 910
911 /* SPR#1112 - SH - Internal phonebook */ 911 /* SPR#1112 - SH - Internal phonebook */
912 #ifdef INT_PHONEBOOK 912 #ifdef INT_PHONEBOOK
913 if (book EQ PHB_IPB) 913 if (book EQ PHB_IPB)
954 } 954 }
955 955
956 /* select phonebook */ 956 /* select phonebook */
957 if (sAT_PlusCPBS(CMD_SRC_LCL, phb_codePhbType ((T_MFW_PHB_TYPE) book ), NULL) NEQ AT_CMPL) 957 if (sAT_PlusCPBS(CMD_SRC_LCL, phb_codePhbType ((T_MFW_PHB_TYPE) book ), NULL) NEQ AT_CMPL)
958 return MFW_PHB_FAIL; 958 return MFW_PHB_FAIL;
959 959
960 // March 1 ,2004 REF: CRR 27832 x0012852 960 // March 1 ,2004 REF: CRR 27832 x0012852
961 // Bug:SIM PIN2 related Actions are displying wrong Error Response. 961 // Bug:SIM PIN2 related Actions are displying wrong Error Response.
962 // Fix:MFW calls sAT_PlusCPBS() with third parameter as NULL. 962 // Fix:MFW calls sAT_PlusCPBS() with third parameter as NULL.
963 963
964 964
965 TRACE_FUNCTION ("phb_find_entries()-got phonebook"); 965 TRACE_FUNCTION ("phb_find_entries()-got phonebook");
981 findText.len = MINIMUM(search_pattern->len, MAX_ALPHA_LEN); 981 findText.len = MINIMUM(search_pattern->len, MAX_ALPHA_LEN);
982 memcpy(findText.data, search_pattern->data, findText.len); 982 memcpy(findText.data, search_pattern->data, findText.len);
983 } 983 }
984 else 984 else
985 { 985 {
986 findText.len = MINIMUM(search_pattern->len, MAX_PHB_NUM_LEN-1); //GW -SPR#762 986 findText.len = MINIMUM(search_pattern->len, MAX_PHB_NUM_LEN-1); //GW -SPR#762
987 strncpy((char *)findText.data, (char *)search_pattern->data, findText.len); 987 strncpy((char *)findText.data, (char *)search_pattern->data, findText.len);
988 findText.data[findText.len] = '\0'; 988 findText.data[findText.len] = '\0';
989 } 989 }
990 findText.cs = CS_Sim; 990 findText.cs = CS_Sim;
991 if (cmhPHB_PlusCPBF(CMD_SRC_LCL, 991 if (cmhPHB_PlusCPBF(CMD_SRC_LCL,
992 &findText, 992 &findText,
993 sr_type, 993 sr_type,
994 search_mode, 994 search_mode,
995 /*ADDED BY RAVI - ACI CHANGES - 5-10-2005*/ 995 /*ADDED BY RAVI - ACI CHANGES - 5-10-2005*/
996 #if (defined(FF_2TO1_PS) && BOARD != 61) 996 #if (defined(FF_2TO1_PS) && BOARD != 61)
997 (UBYTE *)index, 997 (UBYTE *)index,
998 #else 998 #else
999 index, 999 index,
1000 #endif 1000 #endif
1001 /*END ADDITION - RAVI - 5-10-2005*/ 1001 /*END ADDITION - RAVI - 5-10-2005*/
1002 &found, 1002 &found,
1003 pb_list) EQ AT_CMPL) 1003 pb_list) EQ AT_CMPL)
1004 { 1004 {
1005 /*SPR 2102, removed traces which were causing a crash for long phone numbers*/ 1005 /*SPR 2102, removed traces which were causing a crash for long phone numbers*/
1007 { 1007 {
1008 if ((pb_list[i].index != -1) && (rcd_num < sum)) 1008 if ((pb_list[i].index != -1) && (rcd_num < sum))
1009 { 1009 {
1010 TRACE_FUNCTION ("phb_find_entries()-found entry"); 1010 TRACE_FUNCTION ("phb_find_entries()-found entry");
1011 /*SPR 2102, removed traces which were causing a crash for long phone numbers*/ 1011 /*SPR 2102, removed traces which were causing a crash for long phone numbers*/
1012 1012
1013 if (numbersMatch((char*)pb_list[i].number,(char*)search_pattern->data)) 1013 if (numbersMatch((char*)pb_list[i].number,(char*)search_pattern->data))
1014 { 1014 {
1015 TRACE_FUNCTION ("phb_find_entries()-numbers match"); 1015 TRACE_FUNCTION ("phb_find_entries()-numbers match");
1016 entries->entry[rcd_num].book = phb_decodePhbType (pb_list[i].book); 1016 entries->entry[rcd_num].book = phb_decodePhbType (pb_list[i].book);
1017 entries->entry[rcd_num].index = (UBYTE)pb_list[i].index; 1017 entries->entry[rcd_num].index = (UBYTE)pb_list[i].index;
1036 { 1036 {
1037 #ifdef FF_2TO1_PS 1037 #ifdef FF_2TO1_PS
1038 entries->num_entries = (U16)found; 1038 entries->num_entries = (U16)found;
1039 #else 1039 #else
1040 entries->num_entries = found; 1040 entries->num_entries = found;
1041 #endif 1041 #endif
1042 search_mode = CPBF_MOD_NextSearch; 1042 search_mode = CPBF_MOD_NextSearch;
1043 } 1043 }
1044 } 1044 }
1045 else 1045 else
1046 break; 1046 break;
1127 } 1127 }
1128 1128
1129 /* select phonebook */ 1129 /* select phonebook */
1130 if (sAT_PlusCPBS(CMD_SRC_LCL, phb_codePhbType ( (T_MFW_PHB_TYPE)book ), NULL) NEQ AT_CMPL) 1130 if (sAT_PlusCPBS(CMD_SRC_LCL, phb_codePhbType ( (T_MFW_PHB_TYPE)book ), NULL) NEQ AT_CMPL)
1131 return MFW_PHB_FAIL; 1131 return MFW_PHB_FAIL;
1132 1132
1133 // March 1 ,2004 REF: CRR 27832 x0012852 1133 // March 1 ,2004 REF: CRR 27832 x0012852
1134 // Bug:SIM PIN2 related Actions are displying wrong Error Response. 1134 // Bug:SIM PIN2 related Actions are displying wrong Error Response.
1135 // Fix:MFW calls sAT_PlusCPBS() with third parameter as NULL. 1135 // Fix:MFW calls sAT_PlusCPBS() with third parameter as NULL.
1136 1136
1137 entries->book = book; 1137 entries->book = book;
1138 rcd_num = 0; 1138 rcd_num = 0;
1139 sum = num_entries; 1139 sum = num_entries;
1140 search_mode = CPBF_MOD_NewSearch; 1140 search_mode = CPBF_MOD_NewSearch;
1141 1141
1151 1151
1152 if (cmhPHB_PlusCPBF(CMD_SRC_LCL, 1152 if (cmhPHB_PlusCPBF(CMD_SRC_LCL,
1153 &findText, 1153 &findText,
1154 sr_type, 1154 sr_type,
1155 search_mode, 1155 search_mode,
1156 /*ADDED BY RAVI - ACI CHANGES - 5-10-2005 */ 1156 /*ADDED BY RAVI - ACI CHANGES - 5-10-2005 */
1157 #if (defined(FF_2TO1_PS) && BOARD != 61) 1157 #if (defined(FF_2TO1_PS) && BOARD != 61)
1158 (UBYTE *)index, 1158 (UBYTE *)index,
1159 #else 1159 #else
1160 index, 1160 index,
1161 #endif 1161 #endif
1162 /*END ADDITION - RAVI - 5-10-2005 */ 1162 /*END ADDITION - RAVI - 5-10-2005 */
1163 &found, 1163 &found,
1164 pb_list) EQ AT_CMPL) 1164 pb_list) EQ AT_CMPL)
1165 { 1165 {
1166 for (i=0; i<PHB_MAX_ENTRY_NUM; i++) 1166 for (i=0; i<PHB_MAX_ENTRY_NUM; i++)
1188 { 1188 {
1189 #ifdef FF_2TO1_PS 1189 #ifdef FF_2TO1_PS
1190 entries->num_entries = (U16)found; 1190 entries->num_entries = (U16)found;
1191 #else 1191 #else
1192 entries->num_entries = found; 1192 entries->num_entries = found;
1193 #endif 1193 #endif
1194 search_mode = CPBF_MOD_NextSearch; 1194 search_mode = CPBF_MOD_NextSearch;
1195 } 1195 }
1196 } 1196 }
1197 else 1197 else
1198 break; 1198 break;
1234 UBYTE avail; 1234 UBYTE avail;
1235 #else 1235 #else
1236 SHORT used; 1236 SHORT used;
1237 SHORT total; 1237 SHORT total;
1238 SHORT avail; 1238 SHORT avail;
1239 #endif 1239 #endif
1240 // END ADDITION - RAVI - 5-10-2005 1240 // END ADDITION - RAVI - 5-10-2005
1241 #ifdef TI_PS_FFS_PHB 1241 #ifdef TI_PS_FFS_PHB
1242 UBYTE nlength; 1242 UBYTE nlength;
1243 #endif 1243 #endif
1244 SHORT used_ext; 1244 SHORT used_ext;
1280 return MFW_PHB_FAIL; 1280 return MFW_PHB_FAIL;
1281 1281
1282 /* select phonebook */ 1282 /* select phonebook */
1283 if (sAT_PlusCPBS(CMD_SRC_LCL, phb_codePhbType ((T_MFW_PHB_TYPE) book ), NULL) NEQ AT_CMPL) 1283 if (sAT_PlusCPBS(CMD_SRC_LCL, phb_codePhbType ((T_MFW_PHB_TYPE) book ), NULL) NEQ AT_CMPL)
1284 return MFW_PHB_FAIL; 1284 return MFW_PHB_FAIL;
1285 1285
1286 // March 1 ,2004 REF: CRR 27832 x0012852 1286 // March 1 ,2004 REF: CRR 27832 x0012852
1287 // Bug:SIM PIN2 related Actions are displying wrong Error Response. 1287 // Bug:SIM PIN2 related Actions are displying wrong Error Response.
1288 // Fix:MFW calls sAT_PlusCPBS() with third parameter as NULL. 1288 // Fix:MFW calls sAT_PlusCPBS() with third parameter as NULL.
1289 1289
1290 memset(&dt, 0, sizeof(T_ACI_VP_ABS)); 1290 memset(&dt, 0, sizeof(T_ACI_VP_ABS));
1291 if (book EQ PHB_LDN 1291 if (book EQ PHB_LDN
1341 status->avail_entries = (U16)avail; 1341 status->avail_entries = (U16)avail;
1342 #else 1342 #else
1343 status->max_entries = total; 1343 status->max_entries = total;
1344 status->used_entries = used; 1344 status->used_entries = used;
1345 status->avail_entries = avail; 1345 status->avail_entries = avail;
1346 #endif 1346 #endif
1347 //x0061560 Date May17,07 (sateeshg) OMAPS00133241 1347 //x0061560 Date May17,07 (sateeshg) OMAPS00133241
1348 return MFW_PHB_OK; 1348 return MFW_PHB_OK;
1349 case AT_EXCT: 1349 case AT_EXCT:
1350 #ifndef TI_PS_FFS_PHB // Flushing not necessary with FFS based SIM PHB 1350 #ifndef TI_PS_FFS_PHB // Flushing not necessary with FFS based SIM PHB
1351 if (book EQ PHB_LDN 1351 if (book EQ PHB_LDN
1352 OR book EQ PHB_LRN 1352 OR book EQ PHB_LRN
1355 1355
1356 pb_write_eeprom(); 1356 pb_write_eeprom();
1357 } 1357 }
1358 #endif 1358 #endif
1359 1359
1360 //x0061560 Date May16,07 (sateeshg) OMAPS00133241 1360 //x0061560 Date May16,07 (sateeshg) OMAPS00133241
1361 return MFW_PHB_EXCT; 1361 return MFW_PHB_EXCT;
1362 1362
1363 default: 1363 default:
1364 return MFW_PHB_FAIL; 1364 return MFW_PHB_FAIL;
1365 } 1365 }
1384 UBYTE avail; 1384 UBYTE avail;
1385 #else 1385 #else
1386 SHORT used; 1386 SHORT used;
1387 SHORT total; 1387 SHORT total;
1388 SHORT avail; 1388 SHORT avail;
1389 #endif 1389 #endif
1390 // END ADDITION BY RAVI - 5-10-2005 1390 // END ADDITION BY RAVI - 5-10-2005
1391 #ifdef TI_PS_FFS_PHB 1391 #ifdef TI_PS_FFS_PHB
1392 UBYTE nlength; 1392 UBYTE nlength;
1393 #endif 1393 #endif
1394 SHORT used_ext; 1394 SHORT used_ext;
1429 1429
1430 /* select phonebook */ 1430 /* select phonebook */
1431 if (sAT_PlusCPBS(CMD_SRC_LCL, phb_codePhbType ( (T_MFW_PHB_TYPE)book ), NULL) NEQ AT_CMPL) 1431 if (sAT_PlusCPBS(CMD_SRC_LCL, phb_codePhbType ( (T_MFW_PHB_TYPE)book ), NULL) NEQ AT_CMPL)
1432 return MFW_PHB_FAIL; 1432 return MFW_PHB_FAIL;
1433 1433
1434 // March 1 ,2004 REF: CRR 27832 x0012852 1434 // March 1 ,2004 REF: CRR 27832 x0012852
1435 // Bug:SIM PIN2 related Actions are displying wrong Error Response. 1435 // Bug:SIM PIN2 related Actions are displying wrong Error Response.
1436 // Fix:MFW calls sAT_PlusCPBS() with third parameter as NULL. 1436 // Fix:MFW calls sAT_PlusCPBS() with third parameter as NULL.
1437 1437
1438 1438
1439 memset(&dt, 0, sizeof(T_ACI_VP_ABS)); 1439 memset(&dt, 0, sizeof(T_ACI_VP_ABS));
1440 1440
1441 //July 17, 2006 DR: OMAPS00082792 x0039928 1441 //July 17, 2006 DR: OMAPS00082792 x0039928
1442 phb_result = sAT_PlusCPBW(CMD_SRC_LCL, index, NULL, NULL, NULL, &dt); 1442 phb_result = sAT_PlusCPBW(CMD_SRC_LCL, index, NULL, NULL, NULL, &dt);
1460 status->avail_entries = (U16)avail; 1460 status->avail_entries = (U16)avail;
1461 #else 1461 #else
1462 status->max_entries = total; 1462 status->max_entries = total;
1463 status->used_entries = used; 1463 status->used_entries = used;
1464 status->avail_entries = avail; 1464 status->avail_entries = avail;
1465 #endif 1465 #endif
1466 case AT_EXCT: 1466 case AT_EXCT:
1467 return MFW_PHB_OK; 1467 return MFW_PHB_OK;
1468 default: 1468 default:
1469 return MFW_PHB_FAIL; 1469 return MFW_PHB_FAIL;
1470 } 1470 }
1489 /*a0393213 warnings removal - CLCK_FAC_Fd changed to FAC_Fd after ACI enum changes*/ 1489 /*a0393213 warnings removal - CLCK_FAC_Fd changed to FAC_Fd after ACI enum changes*/
1490 if (ss_set_clck(FAC_Fd, CLCK_MOD_Lock, 1490 if (ss_set_clck(FAC_Fd, CLCK_MOD_Lock,
1491 (char *)passwd, CLASS_VceDatFaxSms, MFW_PHB) != MFW_SS_OK) 1491 (char *)passwd, CLASS_VceDatFaxSms, MFW_PHB) != MFW_SS_OK)
1492 { 1492 {
1493 return MFW_PHB_FAIL; 1493 return MFW_PHB_FAIL;
1494 } 1494 }
1495 } 1495 }
1496 if (book EQ PHB_ADN) 1496 if (book EQ PHB_ADN)
1497 { 1497 {
1498 /*a0393213 warnings removal - CLCK_FAC_Fd changed to FAC_Fd after ACI enum changes*/ 1498 /*a0393213 warnings removal - CLCK_FAC_Fd changed to FAC_Fd after ACI enum changes*/
1499 if (ss_set_clck(FAC_Fd, CLCK_MOD_Unlock, 1499 if (ss_set_clck(FAC_Fd, CLCK_MOD_Unlock,
1581 } 1581 }
1582 else 1582 else
1583 ton_npi.ton = TON_Unknown; 1583 ton_npi.ton = TON_Unknown;
1584 1584
1585 ton_npi.npi = NPI_IsdnTelephony; 1585 ton_npi.npi = NPI_IsdnTelephony;
1586 cmhPHB_toaMrg ( &ton_npi, &toa ); 1586 cmhPHB_toaMrg ( &ton_npi, &toa );
1587 1587
1588 /* --->>>--- */ 1588 /* --->>>--- */
1589 #if defined(FF_2TO1_PS) 1589 #if defined(FF_2TO1_PS)
1590 if (pb_check_fdn(FDN, number, &found, &entry, toa) NEQ PHB_OK) 1590 if (pb_check_fdn(FDN, number, &found, &entry, toa) NEQ PHB_OK)
1591 return MFW_PHB_FAIL; 1591 return MFW_PHB_FAIL;
1592 if (found) 1592 if (found)
1593 return PHB_FDN; 1593 return PHB_FDN;
1594 1594
1595 #else 1595 #else
1596 /* The old pb_check_fdn() either delivered PHB_OK and found == 1 or 1596 /* The old pb_check_fdn() either delivered PHB_OK and found == 1 or
1597 * PHB_FAIL and found == 0. Other combintations were not possibe, 1597 * PHB_FAIL and found == 0. Other combintations were not possibe,
1598 * especially PHB_OK and found == 0. Some unreachable / dead code here. 1598 * especially PHB_OK and found == 0. Some unreachable / dead code here.
1599 * Found on g23m S621 by HM 21-Sep-2005 */ 1599 * Found on g23m S621 by HM 21-Sep-2005 */
1600 if (pb_check_fdn(toa, number) NEQ PHB_OK) 1600 if (pb_check_fdn(toa, number) NEQ PHB_OK)
1601 return MFW_PHB_FAIL; 1601 return MFW_PHB_FAIL;
1602 return PHB_FDN; 1602 return PHB_FDN;
1606 #if defined(FF_2TO1_PS) 1606 #if defined(FF_2TO1_PS)
1607 { 1607 {
1608 T_ACI_PB_ENTR *pb_list; 1608 T_ACI_PB_ENTR *pb_list;
1609 if (sAT_PlusCPBS(CMD_SRC_LCL, PB_STOR_Bd, NULL) NEQ AT_CMPL) 1609 if (sAT_PlusCPBS(CMD_SRC_LCL, PB_STOR_Bd, NULL) NEQ AT_CMPL)
1610 return MFW_PHB_FAIL; 1610 return MFW_PHB_FAIL;
1611 1611
1612 1612
1613 // March 1 ,2004 REF: CRR 27832 x0012852 SELIM 1613 // March 1 ,2004 REF: CRR 27832 x0012852 SELIM
1614 // Bug:SIM PIN2 related Actions are displying wrong Error Response. 1614 // Bug:SIM PIN2 related Actions are displying wrong Error Response.
1615 // Fix:MFW calls sAT_PlusCPBS() with third parameter as NULL. 1615 // Fix:MFW calls sAT_PlusCPBS() with third parameter as NULL.
1616 1616
1617 text.len = MINIMUM(strlen((char *)number), PHB_MAX_LEN-1); //GW -SPR#762 - was MAX_ALPHA_LEN-1); 1617 text.len = MINIMUM(strlen((char *)number), PHB_MAX_LEN-1); //GW -SPR#762 - was MAX_ALPHA_LEN-1);
1618 strncpy((char *)text.data, (char *)number, text.len); 1618 strncpy((char *)text.data, (char *)number, text.len);
1619 text.data[text.len] = '\0'; 1619 text.data[text.len] = '\0';
1620 text.cs = CS_Sim; 1620 text.cs = CS_Sim;
1621 // Apr 14, 2005 REF: CRR 29991 xpradipg 1621 // Apr 14, 2005 REF: CRR 29991 xpradipg
1642 // Apr 14, 2005 REF: CRR 29991 xpradipg 1642 // Apr 14, 2005 REF: CRR 29991 xpradipg
1643 // deallocat memory 1643 // deallocat memory
1644 PB_LIST_DEALLOC(pb_list, PB_LIST_SIZE); 1644 PB_LIST_DEALLOC(pb_list, PB_LIST_SIZE);
1645 return PHB_OK; 1645 return PHB_OK;
1646 } 1646 }
1647 #endif 1647 #endif
1648 1648
1649 } 1649 }
1650 1650
1651 1651
1652 /* 1652 /*
1668 UBYTE avail; 1668 UBYTE avail;
1669 #else 1669 #else
1670 SHORT used; 1670 SHORT used;
1671 SHORT total; 1671 SHORT total;
1672 SHORT avail; 1672 SHORT avail;
1673 #endif 1673 #endif
1674 1674
1675 // END ADDITION BY RAVI - 5-10-2005 1675 // END ADDITION BY RAVI - 5-10-2005
1676 T_PHB_TYPE type;/*a0393213 warnings removal-data type of 'type' changed from UBYTE*/ 1676 T_PHB_TYPE type;/*a0393213 warnings removal-data type of 'type' changed from UBYTE*/
1677 #ifdef TI_PS_FFS_PHB 1677 #ifdef TI_PS_FFS_PHB
1678 UBYTE num_len; 1678 UBYTE num_len;
1687 TRACE_FUNCTION("phb_get_status()"); 1687 TRACE_FUNCTION("phb_get_status()");
1688 1688
1689 /* SPR#1112 - SH - Internal phonebook */ 1689 /* SPR#1112 - SH - Internal phonebook */
1690 #ifdef INT_PHONEBOOK 1690 #ifdef INT_PHONEBOOK
1691 if (status->book EQ PHB_IPB) 1691 if (status->book EQ PHB_IPB)
1692 { 1692 {
1693 GI_pb_Info(status); 1693 GI_pb_Info(status);
1694 return MFW_PHB_OK; 1694 return MFW_PHB_OK;
1695 } 1695 }
1696 #endif 1696 #endif
1697 1697
1736 #if !defined(TI_PS_FFS_PHB) 1736 #if !defined(TI_PS_FFS_PHB)
1737 if (pb_read_status(type, &service, &total, &used, 1737 if (pb_read_status(type, &service, &total, &used,
1738 &tag_len, &avail,&used_ext, &total_ext) == PHB_FAIL) 1738 &tag_len, &avail,&used_ext, &total_ext) == PHB_FAIL)
1739 return MFW_PHB_FAIL; 1739 return MFW_PHB_FAIL;
1740 #else 1740 #else
1741 if (pb_read_sizes (type, &total, &used, &num_len, &tag_len, 1741 if (pb_read_sizes (type, &total, &used, &num_len, &tag_len,
1742 &used_ext, &total_ext) == PHB_FAIL) /*a0393213 OMAPS00097209 - interface of pb_read_sizes has been changed in ACI side*/ 1742 &used_ext, &total_ext) == PHB_FAIL) /*a0393213 OMAPS00097209 - interface of pb_read_sizes has been changed in ACI side*/
1743 return MFW_PHB_FAIL; 1743 return MFW_PHB_FAIL;
1744 avail = total - used; 1744 avail = total - used;
1745 #endif 1745 #endif
1746 1746
1751 status->avail_entries = (U16)avail; 1751 status->avail_entries = (U16)avail;
1752 #else 1752 #else
1753 status->max_entries = total; 1753 status->max_entries = total;
1754 status->used_entries = used; 1754 status->used_entries = used;
1755 status->avail_entries = avail; 1755 status->avail_entries = avail;
1756 #endif 1756 #endif
1757 return MFW_PHB_OK; 1757 return MFW_PHB_OK;
1758 } 1758 }
1759 1759
1760 1760
1761 /* 1761 /*
1834 book == PHB_SDN OR 1834 book == PHB_SDN OR
1835 book == PHB_UPN) 1835 book == PHB_UPN)
1836 1836
1837 { 1837 {
1838 #ifdef TI_PS_FFS_PHB 1838 #ifdef TI_PS_FFS_PHB
1839 /* 1839 /*
1840 * When we're returning MFW_PHB_OK and the book is a SIM book 1840 * When we're returning MFW_PHB_OK and the book is a SIM book
1841 * normally we're not really finished with the operation here 1841 * normally we're not really finished with the operation here
1842 * as the synchronization to the SIM is still ongoing. 1842 * as the synchronization to the SIM is still ongoing.
1843 */ 1843 */
1844 phb_return = pb_del_book((T_PHB_TYPE)book);/*a0393213 warnings removal-explicit typecasting done*/ 1844 phb_return = pb_del_book((T_PHB_TYPE)book);/*a0393213 warnings removal-explicit typecasting done*/
1845 if ((phb_return EQ PHB_OK) OR (phb_return EQ PHB_EXCT)) 1845 if ((phb_return EQ PHB_OK) OR (phb_return EQ PHB_EXCT))
2052 phb_signal(E_PHB_UPN_LIST, &upn_list); 2052 phb_signal(E_PHB_UPN_LIST, &upn_list);
2053 return; 2053 return;
2054 } 2054 }
2055 2055
2056 #ifdef PCM_2_FFS 2056 #ifdef PCM_2_FFS
2057 if (ffs_ReadRecord((UBYTE *)PSPDF_UPN_ID, (UBYTE *)&efupn, 2057 if (ffs_ReadRecord((UBYTE *)PSPDF_UPN_ID, (UBYTE *)&efupn,
2058 sizeof( T_PSPDF_UPN ) , (USHORT)(i+1), 1 ) == sizeof( T_PSPDF_UPN ) ) 2058 sizeof( T_PSPDF_UPN ) , (USHORT)(i+1), 1 ) == sizeof( T_PSPDF_UPN ) )
2059 #else 2059 #else
2060 pcm_ReadRecord((UBYTE *)EF_UPN_ID, 2060 pcm_ReadRecord((UBYTE *)EF_UPN_ID,
2061 1, 2061 1,
2062 SIZE_EF_UPN, 2062 SIZE_EF_UPN,
2066 2066
2067 #endif 2067 #endif
2068 for (i=0; i<max_rcd; i++) 2068 for (i=0; i<max_rcd; i++)
2069 { 2069 {
2070 #ifdef PCM_2_FFS 2070 #ifdef PCM_2_FFS
2071 if (ffs_ReadRecord((UBYTE *)PSPDF_UPN_ID, (UBYTE *)&efupn, 2071 if (ffs_ReadRecord((UBYTE *)PSPDF_UPN_ID, (UBYTE *)&efupn,
2072 sizeof( T_PSPDF_UPN ) , (USHORT)(i+1), 1 ) == sizeof( T_PSPDF_UPN ) ) 2072 sizeof( T_PSPDF_UPN ) , (USHORT)(i+1), 1 ) == sizeof( T_PSPDF_UPN ) )
2073 #else 2073 #else
2074 if (pcm_ReadRecord((UBYTE *)EF_UPN_ID, 2074 if (pcm_ReadRecord((UBYTE *)EF_UPN_ID,
2075 (USHORT)(i+1), 2075 (USHORT)(i+1),
2076 SIZE_EF_UPN, 2076 SIZE_EF_UPN,
2127 */ 2127 */
2128 2128
2129 void phb_get_upn(void) 2129 void phb_get_upn(void)
2130 { 2130 {
2131 /*a0393213 compiler warnings removal - removed variables phb_entry, phb_list*/ 2131 /*a0393213 compiler warnings removal - removed variables phb_entry, phb_list*/
2132 2132
2133 T_MFW_PHB_STATUS status; 2133 T_MFW_PHB_STATUS status;
2134 int i; 2134 int i;
2135 SHORT start_ind; 2135 SHORT start_ind;
2136 SHORT stop_ind; 2136 SHORT stop_ind;
2137 SHORT last_ind; 2137 SHORT last_ind;
2138 // Apr 14, 2005 REF: CRR 29991 xpradipg 2138 // Apr 14, 2005 REF: CRR 29991 xpradipg
2139 // local pointer definition 2139 // local pointer definition
2140 #ifdef FF_MMI_OPTIM 2140 #ifdef FF_MMI_OPTIM
2141 T_ACI_PB_ENTR *pb_list; 2141 T_ACI_PB_ENTR *pb_list;
2142 #endif 2142 #endif
2143 2143
2144 TRACE_FUNCTION("phb_get_upn()"); 2144 TRACE_FUNCTION("phb_get_upn()");
2145 2145
2146 2146
2147 2147
2148 memset(&status, 0, sizeof(status)); 2148 memset(&status, 0, sizeof(status));
2149 status.book = PHB_UPN; 2149 status.book = PHB_UPN;
2150 phb_get_status(&status); 2150 phb_get_status(&status);
2151 2151
2152 upn_list.count = 0; 2152 upn_list.count = 0;
2153 /* select phonebook */ 2153 /* select phonebook */
2154 if (sAT_PlusCPBS(CMD_SRC_LCL, phb_codePhbType ( PHB_UPN ), NULL) NEQ AT_CMPL) 2154 if (sAT_PlusCPBS(CMD_SRC_LCL, phb_codePhbType ( PHB_UPN ), NULL) NEQ AT_CMPL)
2155 2155
2156 // March 1 ,2004 REF: CRR 27832 x0012852 2156 // March 1 ,2004 REF: CRR 27832 x0012852
2157 // Bug:SIM PIN2 related Actions are displying wrong Error Response. 2157 // Bug:SIM PIN2 related Actions are displying wrong Error Response.
2158 // Fix:MFW calls sAT_PlusCPBS() with third parameter as NULL. 2158 // Fix:MFW calls sAT_PlusCPBS() with third parameter as NULL.
2159 2159
2160 phb_signal(E_PHB_UPN_LIST, &upn_list); 2160 phb_signal(E_PHB_UPN_LIST, &upn_list);
2161 2161
2162 start_ind = 1; 2162 start_ind = 1;
2163 stop_ind = 1; 2163 stop_ind = 1;
2164 upn_list.count = 0; 2164 upn_list.count = 0;
2166 // allocate memory 2166 // allocate memory
2167 #ifdef FF_MMI_OPTIM 2167 #ifdef FF_MMI_OPTIM
2168 pb_list = (T_ACI_PB_ENTR*)mfwAlloc(PB_LIST_SIZE); 2168 pb_list = (T_ACI_PB_ENTR*)mfwAlloc(PB_LIST_SIZE);
2169 if(NULL == pb_list) 2169 if(NULL == pb_list)
2170 return; 2170 return;
2171 #endif 2171 #endif
2172 for (i=0; i<status.used_entries; i++) 2172 for (i=0; i<status.used_entries; i++)
2173 { 2173 {
2174 2174
2175 if (cmhPHB_PlusCPBR(CMD_SRC_LCL, 2175 if (cmhPHB_PlusCPBR(CMD_SRC_LCL,
2176 SR_TYP_Index, 2176 SR_TYP_Index,