comparison src/ui/bmi/mmiDummy.c @ 3:67bfe9f274f6

src/ui: import of src/ui3 from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 16 Oct 2020 06:33:10 +0000
parents
children c0052fe355d3
comparison
equal deleted inserted replaced
2:3a14ee9a9843 3:67bfe9f274f6
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: Basic MMI
13 $Project code: BMI (6349)
14 $Module: Start
15 $File: MmiDummy.c
16 $Revision: 1.0
17
18 $Author: Condat(UK)
19 $Date: 25/10/00
20
21 ********************************************************************************
22
23 Description:
24
25
26
27 ********************************************************************************
28 $History: MmiDummy.c
29
30 July 09, 2005 REF : MMI-22565 - a0876501
31 Description: IMEI CD byte calculation added
32 Solution: Byte alignment done for IMEI display.
33
34 May 02, 2005 REF : LOCOSTO-ENH-30818 - xpradipg
35 Description: IMEI retreival by posting a call to ACI sAT_xx API
36 Solution: The direct call to cl_get_imeisv() is replaced with the
37 call to the callNUmber() which inturn calls sAT_Dn() and
38 retrieves the IMEI info
39
40 *******************************************************************************
41
42 Include files
43
44 *******************************************************************************/
45
46
47 #define ENTITY_MFW
48
49 /* includes */
50 #include <string.h>
51 #include <stdio.h>
52 #include <stdlib.h>
53
54 #if defined (NEW_FRAME)
55
56 #include "typedefs.h"
57 #include "vsi.h"
58 #include "pei.h"
59 #include "custom.h"
60 #include "gsm.h"
61
62 #else
63
64 #include "STDDEFS.H"
65 #include "custom.h"
66 #include "gsm.h"
67 #include "vsi.h"
68
69 #endif
70 //NM
71 #include "gdi.h"
72 #include "audio.h"
73 #ifndef FF_2TO1_PS
74 #include "cl_imei.h" /* IMEI common library */
75 #endif
76 //NM
77
78 #include "mfw_sys.h"
79 #include "mfw_mfw.h"
80 #include "mfw_win.h"
81 #include "mfw_kbd.h"
82 #include "mfw_lng.h"
83 #include "mfw_icn.h"
84
85 #include "mon_aci.h"
86 #include "tok.h"
87 #ifndef PCM_2_FFS
88 #include "pcm.h"
89 #else
90 #include "prim.h"
91 #endif
92
93
94
95 #include "message.h"
96 #include "prim.h"
97 #include "aci_cmh.h"
98 //NM
99
100 /* SPR#1428 - SH - New Editor changes */
101 #ifndef NEW_EDITOR
102 #include "mfw_edt.h"
103 #endif
104 #include "mfw_mnu.h"
105 #include "mfw_sat.h"
106 #include "mfw_nm.h"
107 #include "mfw_tim.h"
108 #include "mfw_phb.h"
109 #include "mfw_sms.h"
110
111 #include "dspl.h"
112
113 #include "ksd.h"
114 #include "psa.h"
115
116 #include "MmiVersion.h"
117 #include "MmiMmi.h"
118 #include "MmiDummy.h"
119 #include "MmiDialogs.h"
120 #include "MmiLists.h"
121
122 #include "MmiMain.h"
123 // May 02, 2005 REF : LOCOSTO-ENH-30818 - xpradipg
124 #ifdef FF_MMI_ATC_MIGRATION
125 #define ATD_IMEI "*#06#"
126 #define IMEI_LEN 15
127 EXTERN void callNumber(UBYTE *number);
128 #endif
129
130
131 #ifdef NEPTUNE_BOARD
132 extern const UBYTE C_DEFAULT_IMEISV[CL_IMEI_SIZE];
133 #endif
134
135
136 // May 02, 2005 REF : LOCOSTO-ENH-30818 - xpradipg
137 #ifdef FF_MMI_ATC_MIGRATION
138 char imei[IMEI_LEN+1];
139 #endif
140
141 // July 09, 2005 REF : MMI-22565 - a0876501
142 extern UBYTE getCdByteFromImei(UBYTE *imei);
143
144
145 //Added by Muthu for PCM Replacemeny
146
147 #ifdef PCM_2_FFS
148 #define PSPDF_IMEI_ID "/gsm/IMEI" /* Int. Mobile Equipment Id */
149 #endif
150
151 /*******************************************************************************************
152 *
153 * Global definition of message function plus some dummies
154 *
155 *******************************************************************************************/
156
157 void mmi_send_event (T_MFW_HND win, USHORT event, USHORT value, void * parameter)
158 {
159
160 if (win){
161 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
162 T_MMI_CONTROL * control = (T_MMI_CONTROL *)win_data->user;
163
164 if (control->dialog NEQ 0)
165 (control->dialog) (win, event, value, parameter);
166 }
167 }
168
169 UBYTE idle_screen_has_focus()
170 {
171 return TRUE;
172 }
173
174 // May 02, 2005 REF : LOCOSTO-ENH-30818 - xpradipg
175 // this function is no more referenced hence omit it
176 #ifdef FF_MMI_ATC_MIGRATION
177 /*******************************************************************************
178
179 $Function: mmi_imei_retrieve
180
181 $Description: This function invokes sAT_Dn() to retrieve the IMEI and store it
182 in the global variabel "imei".
183
184 $Returns:
185
186 $Arguments:
187 *******************************************************************************/
188 void mmi_imei_retrieve()
189 {
190 callNumber((UBYTE*)ATD_IMEI);
191 }
192 #else
193 /*******************************************************************************
194
195 $Function: get_imei
196
197 $Description: This function invokes the operation for key sequence
198 command for getting the IMEI.
199
200 $Returns:
201
202 $Arguments:
203 *******************************************************************************/
204 int get_imei(char *imei)
205 {
206 #ifdef FF_2TO1_PS
207 UBYTE retVal; /* holds return value */
208
209 /* x0045876, 14-Aug-2006 (WR - "version" was declared but never referenced) */
210 #ifndef PCM_2_FFS
211 UBYTE version; /* holds version */
212 #endif
213
214 #ifdef PCM_2_FFS
215 UBYTE buf[8]; // Sizeof ( T_PSPDF_IMEI )
216 #else
217 UBYTE buf[SIZE_EF_IMEI];
218 #endif
219
220 TRACE_FUNCTION ("get_imei()");
221
222 #ifdef PCM_2_FFS
223 /* OMAPS00059546 : If there is no IMEI file, copying the default imei
224 has been added */
225 retVal = ffs_file_read((UBYTE *)PSPDF_IMEI_ID, buf, sizeof(T_PSPDF_IMEI) );
226 if (retVal != sizeof(T_PSPDF_IMEI))
227 {
228 TRACE_ERROR("CL FFS read ERROR (IMEI) -> Default values used");
229 memcpy(buf, C_DEFAULT_IMEISV, sizeof(T_PSPDF_IMEI));
230 }
231 #else
232 retVal = pcm_ReadFile ((UBYTE *)EF_IMEI_ID, SIZE_EF_IMEI, buf, &version);
233 if( retVal EQ PCM_INVALID_SIZE OR retVal EQ PCM_INVALID_FILE )
234 return( FALSE );
235 #endif
236
237 #else
238 UBYTE buf[CL_IMEI_SIZE];
239
240 TRACE_FUNCTION ("get_imei()");
241
242 cl_get_imeisv(CL_IMEI_SIZE, buf, CL_IMEI_GET_STORED_IMEI);
243 #endif
244
245 /* OMAPS00059546 : BCD Conversion for IMEI has been added for NEPTUNE */
246 #ifdef NEPTUNE_BOARD
247 imei[0] = ( buf [0] & 0x0F) +0x30;
248 imei[1] = ((buf [0] >> 4) & 0x0F)+0x30;
249 imei[2] = ( buf [1] & 0x0F)+0x30;
250 imei[3] = ((buf [1] >> 4) & 0x0F)+0x30;
251 imei[4] = ( buf [2] & 0x0F)+0x30;
252 imei[5] = ((buf [2] >> 4) & 0x0F)+0x30;
253 imei[6] = ( buf [3] & 0x0F)+0x30;
254 imei[7] = ((buf [3] >> 4) & 0x0F)+0x30;
255 imei[8] = ( buf [4] & 0x0F)+0x30;
256 imei[9] = ((buf [4] >> 4) & 0x0F)+0x30;
257 imei[10] = ( buf [5] & 0x0F)+0x30;
258 imei[11] = ((buf [5] >> 4) & 0x0F)+0x30;
259 imei[12] = ( buf [6] & 0x0F)+0x30;
260 imei[13] = ((buf [6] >> 4) & 0x0F)+0x30;
261 imei[14] = ((getCdByteFromImei(buf)) & 0x0F)+0x30;
262 imei[15] = ( buf [7] & 0x0F)+0x30;
263 imei[16] = ((buf [7] >> 4) & 0x0F)+0x30;
264 imei[17] = 0;
265 #else
266 imei[0] = ((buf [0] >> 4) & 0x0F)+0x30;
267 imei[1] = ( buf [0] & 0x0F) +0x30;
268 imei[2] = ((buf [1] >> 4) & 0x0F)+0x30;
269 imei[3] = ( buf [1] & 0x0F)+0x30;
270 imei[4] = ((buf [2] >> 4) & 0x0F)+0x30;
271 imei[5] = ( buf [2] & 0x0F)+0x30;
272 imei[6] = ((buf [3] >> 4) & 0x0F)+0x30;
273 imei[7] = ( buf [3] & 0x0F)+0x30;
274 imei[8] = ((buf [4] >> 4) & 0x0F)+0x30;
275 imei[9] = ( buf [4] & 0x0F)+0x30;
276 imei[10] = ((buf [5] >> 4) & 0x0F)+0x30;
277 imei[11] = ( buf [5] & 0x0F)+0x30;
278 imei[12] = ((buf [6] >> 4) & 0x0F)+0x30;
279 imei[13] = ( buf [6] & 0x0F)+0x30;
280 // July 09, 2005 REF : MMI-22565 - a0876501
281 // For calculating the Cd byte
282 imei[14] = ((getCdByteFromImei(buf)) & 0x0F)+0x30;
283 imei[15] = (( buf [7] >> 4) & 0x0F)+0x30;
284 imei[16] = ( buf [7] & 0x0F)+0x30;
285 imei[17] = 0;
286 #endif
287
288 TRACE_EVENT_P8("MMI INFO IMEI: TAC %1c%1c%1c%1c%1c%1c%1c%1c",
289 imei[0], imei[1], imei[2], imei[3],
290 imei[4], imei[5], imei[6], imei[7]);
291 TRACE_EVENT_P6("MMI INFO IMEI: SNR %1c%1c%1c%1c%1c%1c",
292 imei[8], imei[9], imei[10], imei[11],
293 imei[12], imei[13]);
294 TRACE_EVENT_P4("MMI INFO IMEI: SV CD %1c%1c%1c%1c", imei[14], imei[15], imei[16],imei[17]);
295
296 return( TRUE );
297 }
298 #endif
299
300 char* get_build_user()
301 {
302 return BUILD_USER;
303 }
304
305 char* get_build_date()
306 {
307 return BUILD_DATE;
308 }
309
310 char* get_build_time()
311 {
312 return BUILD_TIME;
313 }
314
315 /************************ End of functions *************************************************/
316
317 #ifndef FF_WAP
318 void rAT_WAP_start_gprs_login(void)
319 {
320 //Dummy function - WAP disabled/not compiled
321 }
322 #endif
323 /* END OF DUMMY FUNCTIONS */