|
@@ -155,7 +155,7 @@ META_RESULT SmartPhoneSN::WriteNvramLoop() |
|
@@ -155,7 +155,7 @@ META_RESULT SmartPhoneSN::WriteNvramLoop() |
|
155
|
}
|
155
|
}
|
|
156
|
else //Target already in modem meta mode
|
156
|
else //Target already in modem meta mode
|
|
157
|
{
|
157
|
{
|
|
158
|
- spNextStage = SP_CHECK_CAL_FT_FLAG_STAGE;
|
158
|
+ spNextStage = SP_IMEI_RD_STAGE;
|
|
159
|
}
|
159
|
}
|
|
160
|
}
|
160
|
}
|
|
161
|
else
|
161
|
else
|
|
@@ -163,7 +163,7 @@ META_RESULT SmartPhoneSN::WriteNvramLoop() |
|
@@ -163,7 +163,7 @@ META_RESULT SmartPhoneSN::WriteNvramLoop() |
|
163
|
spNextStage = SP_WRITE_TEMP_STAGE;
|
163
|
spNextStage = SP_WRITE_TEMP_STAGE;
|
|
164
|
}
|
164
|
}
|
|
165
|
break;
|
165
|
break;
|
|
166
|
-
|
166
|
+
|
|
167
|
case SP_AP2MD_STAGE:
|
167
|
case SP_AP2MD_STAGE:
|
|
168
|
fBeginProcess += fStep;
|
168
|
fBeginProcess += fStep;
|
|
169
|
iRet = APSwithToModemMeta_Ex();
|
169
|
iRet = APSwithToModemMeta_Ex();
|
|
@@ -177,634 +177,65 @@ META_RESULT SmartPhoneSN::WriteNvramLoop() |
|
@@ -177,634 +177,65 @@ META_RESULT SmartPhoneSN::WriteNvramLoop() |
|
177
|
spNextStage = SP_END_STAGE;
|
177
|
spNextStage = SP_END_STAGE;
|
|
178
|
}
|
178
|
}
|
|
179
|
break;
|
179
|
break;
|
|
180
|
-
|
|
|
|
181
|
- case SP_CHECK_CAL_FT_FLAG_STAGE:
|
|
|
|
182
|
- #ifdef __TOPWELL_QCTEST__
|
|
|
|
183
|
- if (g_sMetaComm.bCheckCalFlag || g_sMetaComm.bCheckFtFlag || g_sMetaComm.bCheckQCFlag)
|
|
|
|
184
|
- #else
|
|
|
|
185
|
- if (g_sMetaComm.bCheckCalFlag || g_sMetaComm.bCheckFtFlag)
|
|
|
|
186
|
- #endif
|
|
|
|
187
|
- {
|
|
|
|
188
|
- char tmpBuf[2048] = {0};
|
|
|
|
189
|
- iRet = REQ_ReadModem_NVRAM_Start(WRITE_BARCODE, tmpBuf, 1);
|
|
|
|
190
|
- if (iRet == META_SUCCESS)
|
|
|
|
191
|
- {
|
|
|
|
192
|
- bool bCheckPass = true;
|
|
|
|
193
|
- bCheckPass = Check_some_barcode(tmpBuf);
|
|
|
|
194
|
- if (bCheckPass == true)
|
|
|
|
195
|
- {
|
|
|
|
196
|
- spNextStage = SP_IMEI_RD_STAGE;
|
|
|
|
197
|
- }
|
|
|
|
198
|
- else
|
|
|
|
199
|
- {
|
|
|
|
200
|
- iRet = META_FAILED;
|
|
|
|
201
|
- spNextStage = SP_END_STAGE;
|
|
|
|
202
|
- }
|
|
|
|
203
|
- }
|
|
|
|
204
|
- else
|
|
|
|
205
|
- {
|
|
|
|
206
|
- UpdateUIMsg("ERROR!! Read Barcode: MetaResult = %s", ResultToString(iRet));
|
|
|
|
207
|
- spNextStage = SP_END_STAGE;
|
|
|
|
208
|
- }
|
|
|
|
209
|
- }
|
|
|
|
210
|
- else
|
|
|
|
211
|
- {
|
|
|
|
212
|
- spNextStage = SP_BARCODE_MD_STAGE;
|
|
|
|
213
|
- }
|
|
|
|
214
|
- break;
|
180
|
+
|
|
215
|
case SP_IMEI_RD_STAGE:
|
181
|
case SP_IMEI_RD_STAGE:
|
|
216
|
{
|
182
|
{
|
|
217
|
CString str_imei;
|
183
|
CString str_imei;
|
|
218
|
- int a_imei_ary[16];
|
|
|
|
219
|
- int a_imei_ary2[16];
|
184
|
+ char a_imei_ary[16];
|
|
|
|
185
|
+ char a_imei_ary2[16];
|
|
220
|
char tmpBuf1[20] = {0};
|
186
|
char tmpBuf1[20] = {0};
|
|
221
|
char tmpBuf2[20] = {0};
|
187
|
char tmpBuf2[20] = {0};
|
|
222
|
iRet = REQ_ReadModem_NVRAM_Start(WRITE_IMEI, tmpBuf1, 1);
|
188
|
iRet = REQ_ReadModem_NVRAM_Start(WRITE_IMEI, tmpBuf1, 1);
|
|
223
|
iRet2 = REQ_ReadModem_NVRAM_Start(WRITE_IMEI, tmpBuf2, 2);
|
189
|
iRet2 = REQ_ReadModem_NVRAM_Start(WRITE_IMEI, tmpBuf2, 2);
|
|
224
|
-
|
|
|
|
225
|
-
|
|
|
|
226
|
if (iRet == META_SUCCESS || iRet2 == META_SUCCESS)
|
190
|
if (iRet == META_SUCCESS || iRet2 == META_SUCCESS)
|
|
227
|
{
|
191
|
{
|
|
228
|
-
|
|
|
|
229
|
- if(strspn(tmpBuf1, "0123456789") != strlen(tmpBuf1))
|
|
|
|
230
|
- {
|
|
|
|
231
|
- iRet = META_FAILED;
|
|
|
|
232
|
- }
|
|
|
|
233
|
-
|
|
|
|
234
|
-
|
|
|
|
235
|
- if(strspn(tmpBuf2, "0123456789") != strlen(tmpBuf2))
|
|
|
|
236
|
- {
|
|
|
|
237
|
- iRet2 = META_FAILED;
|
|
|
|
238
|
- }
|
|
|
|
239
|
-
|
|
|
|
240
|
- memset(a_imei_ary,0,sizeof(int)*16);
|
|
|
|
241
|
- memset(a_imei_ary2,0,sizeof(int)*16);
|
|
|
|
242
|
-
|
|
|
|
243
|
- a_imei_ary[0] = (byte)(tmpBuf1[0])%16;
|
|
|
|
244
|
- a_imei_ary[1] = (byte)(tmpBuf1[0])/16;
|
|
|
|
245
|
- a_imei_ary[2] = (byte)(tmpBuf1[1])%16;
|
|
|
|
246
|
- a_imei_ary[3] = (byte)(tmpBuf1[1])/16;
|
|
|
|
247
|
- a_imei_ary[4] = (byte)(tmpBuf1[2])%16;
|
|
|
|
248
|
- a_imei_ary[5] = (byte)(tmpBuf1[2])/16;
|
|
|
|
249
|
- a_imei_ary[6] = (byte)(tmpBuf1[3])%16;
|
|
|
|
250
|
- a_imei_ary[7] = (byte)(tmpBuf1[3])/16;
|
|
|
|
251
|
- a_imei_ary[8] = (byte)(tmpBuf1[4])%16;
|
|
|
|
252
|
- a_imei_ary[9] = (byte)(tmpBuf1[4])/16;
|
|
|
|
253
|
- a_imei_ary[10] = (byte)(tmpBuf1[5])%16;
|
|
|
|
254
|
- a_imei_ary[11] = (byte)(tmpBuf1[5])/16;
|
|
|
|
255
|
- a_imei_ary[12] = (byte)(tmpBuf1[6])%16;
|
|
|
|
256
|
- a_imei_ary[13] = (byte)(tmpBuf1[6])/16;
|
|
|
|
257
|
- a_imei_ary[14] = (byte)(tmpBuf1[7])%16;
|
|
|
|
258
|
-
|
|
|
|
259
|
- a_imei_ary2[0] = (byte)(tmpBuf2[0])%16;
|
|
|
|
260
|
- a_imei_ary2[1] = (byte)(tmpBuf2[0])/16;
|
|
|
|
261
|
- a_imei_ary2[2] = (byte)(tmpBuf2[1])%16;
|
|
|
|
262
|
- a_imei_ary2[3] = (byte)(tmpBuf2[1])/16;
|
|
|
|
263
|
- a_imei_ary2[4] = (byte)(tmpBuf2[2])%16;
|
|
|
|
264
|
- a_imei_ary2[5] = (byte)(tmpBuf2[2])/16;
|
|
|
|
265
|
- a_imei_ary2[6] = (byte)(tmpBuf2[3])%16;
|
|
|
|
266
|
- a_imei_ary2[7] = (byte)(tmpBuf2[3])/16;
|
|
|
|
267
|
- a_imei_ary2[8] = (byte)(tmpBuf2[4])%16;
|
|
|
|
268
|
- a_imei_ary2[9] = (byte)(tmpBuf2[4])/16;
|
|
|
|
269
|
- a_imei_ary2[10] = (byte)(tmpBuf2[5])%16;
|
|
|
|
270
|
- a_imei_ary2[11] = (byte)(tmpBuf2[5])/16;
|
|
|
|
271
|
- a_imei_ary2[12] = (byte)(tmpBuf2[6])%16;
|
|
|
|
272
|
- a_imei_ary2[13] = (byte)(tmpBuf2[6])/16;
|
|
|
|
273
|
- a_imei_ary2[14] = (byte)(tmpBuf2[7])%16;
|
|
|
|
274
|
-
|
|
|
|
275
|
- str_imei.Format("%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d,%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d",
|
|
|
|
276
|
- a_imei_ary[0],a_imei_ary[1],a_imei_ary[2],a_imei_ary[3],a_imei_ary[4],
|
|
|
|
277
|
- a_imei_ary[5],a_imei_ary[6],a_imei_ary[7],a_imei_ary[8],a_imei_ary[9],
|
|
|
|
278
|
- a_imei_ary[10],a_imei_ary[11],a_imei_ary[12],a_imei_ary[13],a_imei_ary[14],
|
|
|
|
279
|
- a_imei_ary2[0],a_imei_ary2[1],a_imei_ary2[2],a_imei_ary2[3],a_imei_ary2[4],
|
|
|
|
280
|
- a_imei_ary2[5],a_imei_ary2[6],a_imei_ary2[7],a_imei_ary2[8],a_imei_ary2[9],
|
|
|
|
281
|
- a_imei_ary2[10],a_imei_ary2[11],a_imei_ary2[12],a_imei_ary2[13],a_imei_ary2[14]
|
|
|
|
282
|
- );
|
|
|
|
283
|
- /* for(int i=0;i<14;i++)
|
|
|
|
284
|
- {
|
|
|
|
285
|
-
|
|
|
|
286
|
-
|
|
|
|
287
|
- }*/
|
|
|
|
288
|
-
|
|
|
|
289
|
- //g_pMainDlg->myrslt_imei= _T("PASS");
|
|
|
|
290
|
-
|
|
|
|
291
|
- if (iRet == META_SUCCESS || iRet2 == META_SUCCESS)
|
192
|
+ memset(a_imei_ary,0,16);
|
|
|
|
193
|
+ memset(a_imei_ary2,0,16);
|
|
|
|
194
|
+ for (int loop = 0;loop<15;loop++)
|
|
|
|
195
|
+ {
|
|
|
|
196
|
+ if (loop%2 == 0)
|
|
|
|
197
|
+ {
|
|
|
|
198
|
+ a_imei_ary[loop] = 0x30 + (byte)(tmpBuf1[loop/2])%16;
|
|
|
|
199
|
+ a_imei_ary2[loop] = 0x30 + (byte)(tmpBuf2[loop/2])%16;
|
|
|
|
200
|
+ }
|
|
|
|
201
|
+ else
|
|
|
|
202
|
+ {
|
|
|
|
203
|
+ a_imei_ary[loop] = 0x30 + (byte)(tmpBuf1[loop/2])/16;
|
|
|
|
204
|
+ a_imei_ary2[loop] = 0x30 + (byte)(tmpBuf2[loop/2])/16;
|
|
|
|
205
|
+ }
|
|
|
|
206
|
+ }
|
|
|
|
207
|
+ a_imei_ary[15] = 0;
|
|
|
|
208
|
+ a_imei_ary2[15] = 0;
|
|
|
|
209
|
+ if (iRet == META_SUCCESS || iRet2 == META_SUCCESS)
|
|
292
|
{
|
210
|
{
|
|
293
|
- UpdateUIMsg("IMEI read successfully "+str_imei);
|
|
|
|
294
|
- }
|
|
|
|
295
|
- else
|
|
|
|
296
|
- {
|
|
|
|
297
|
- UpdateUIMsg("IMEI failed to read");
|
|
|
|
298
|
- }
|
|
|
|
299
|
-
|
211
|
+ g_pMainDlg->GetDlgItem(IDC_STATIC_IMEI1)->SetWindowText(a_imei_ary);
|
|
|
|
212
|
+ g_pMainDlg->GetDlgItem(IDC_STATIC_IMEI2)->SetWindowText(a_imei_ary2);
|
|
|
|
213
|
+ if (g_pMainDlg->myscanimei1 == CString(a_imei_ary) &&
|
|
|
|
214
|
+ g_pMainDlg->myscanimei2 == CString(a_imei_ary2))
|
|
|
|
215
|
+ {
|
|
|
|
216
|
+ UpdateUIMsg("IMEI matches successfully!!!");
|
|
|
|
217
|
+ }
|
|
|
|
218
|
+ else
|
|
|
|
219
|
+ {
|
|
|
|
220
|
+ UpdateUIMsg("IMEI wrong!!!");
|
|
|
|
221
|
+ }
|
|
|
|
222
|
+ }
|
|
|
|
223
|
+ else
|
|
|
|
224
|
+ {
|
|
|
|
225
|
+ UpdateUIMsg("IMEI failed to read");
|
|
|
|
226
|
+ }
|
|
300
|
spNextStage = SP_END_STAGE;
|
227
|
spNextStage = SP_END_STAGE;
|
|
301
|
}
|
228
|
}
|
|
302
|
else
|
229
|
else
|
|
303
|
{
|
230
|
{
|
|
304
|
- //g_pMainDlg->myrslt_imei= _T("Fail");
|
|
|
|
305
|
UpdateUIMsg("IMEI failed to read");
|
231
|
UpdateUIMsg("IMEI failed to read");
|
|
306
|
spNextStage = SP_END_STAGE;
|
232
|
spNextStage = SP_END_STAGE;
|
|
307
|
}
|
233
|
}
|
|
308
|
-
|
|
|
|
309
|
- if(iRet == META_SUCCESS)
|
|
|
|
310
|
- {
|
|
|
|
311
|
- g_pMainDlg->myrslt_imei= _T("PASS");
|
|
|
|
312
|
- }
|
|
|
|
313
|
- else
|
|
|
|
314
|
- {
|
|
|
|
315
|
- g_pMainDlg->myrslt_imei= _T("Fail");
|
|
|
|
316
|
- }
|
|
|
|
317
|
-
|
|
|
|
318
|
- if(iRet2 == META_SUCCESS)
|
|
|
|
319
|
- {
|
|
|
|
320
|
- g_pMainDlg->myrslt_imei = g_pMainDlg->myrslt_imei+ _T(",PASS");
|
|
|
|
321
|
- }
|
|
|
|
322
|
- else
|
|
|
|
323
|
- {
|
|
|
|
324
|
- g_pMainDlg->myrslt_imei = g_pMainDlg->myrslt_imei+ _T(",Fail");
|
|
|
|
325
|
- }
|
|
|
|
326
|
-
|
|
|
|
327
|
-
|
|
|
|
328
|
- }
|
|
|
|
329
|
- break;
|
|
|
|
330
|
-
|
|
|
|
331
|
-
|
|
|
|
332
|
-
|
|
|
|
333
|
- case SP_BARCODE_MD_STAGE:
|
|
|
|
334
|
- if (g_sMetaComm.sWriteOption.bWriteIMEI)
|
|
|
|
335
|
- {
|
|
|
|
336
|
- if (mdNums == 1 && g_sMetaComm.sIMEIOption.iImeiNums == 1)
|
|
|
|
337
|
- {
|
|
|
|
338
|
- multiIMEIOption = SINGLE_MD_SINGLE_IMEI;
|
|
|
|
339
|
- }
|
|
|
|
340
|
- else if (mdNums == 1 && g_sMetaComm.sIMEIOption.iImeiNums >= 2)
|
|
|
|
341
|
- {
|
|
|
|
342
|
- multiIMEIOption = SINGLE_MD_MULTI_IMEI;
|
|
|
|
343
|
- }
|
|
|
|
344
|
- else if (mdNums == 2)
|
|
|
|
345
|
- {
|
|
|
|
346
|
- if (m_iC2kProject != 0 && g_sMetaComm.sIMEIOption.iImeiNums == 1)
|
|
|
|
347
|
- {
|
|
|
|
348
|
- multiIMEIOption = SINGLE_MD_SINGLE_IMEI;
|
|
|
|
349
|
- }
|
|
|
|
350
|
- if (m_iC2kProject != 0 && g_sMetaComm.sIMEIOption.iImeiNums >= 2 )
|
|
|
|
351
|
- {
|
|
|
|
352
|
- multiIMEIOption = SINGLE_MD_MULTI_IMEI;
|
|
|
|
353
|
- }
|
|
|
|
354
|
- if (g_sMetaComm.eTargetType == SMART_PHONE_DUALMODEM && g_sMetaComm.sIMEIOption.iImeiNums == 2)
|
|
|
|
355
|
- {
|
|
|
|
356
|
- multiIMEIOption = DUAL_MD_DUAL_IMEI;
|
|
|
|
357
|
- }
|
|
|
|
358
|
- }
|
|
|
|
359
|
- else
|
|
|
|
360
|
- {
|
|
|
|
361
|
- multiIMEIOption = MULTIIMEI_RESERVE;
|
|
|
|
362
|
- }
|
|
|
|
363
|
- }
|
|
|
|
364
|
- spNextStage = SP_IMEI_MD_STAGE;
|
|
|
|
365
|
-
|
|
|
|
366
|
- break;
|
|
|
|
367
|
-
|
|
|
|
368
|
- case SP_IMEI_MD_STAGE:
|
|
|
|
369
|
-
|
|
|
|
370
|
- bWriteModemFail = false;
|
|
|
|
371
|
- for (MDIndex = 0; MDIndex < mdNums && bWriteModemFail == false; MDIndex++)
|
|
|
|
372
|
- {
|
|
|
|
373
|
- //When MDIndex = 0, database already init by EnterModemMetaToInitModemDB() function
|
|
|
|
374
|
- //So just need to load MDIndex >= 1 MD database
|
|
|
|
375
|
- if (mdNums >= 2 && MDIndex >= 1 && m_iC2kProject == 0)
|
|
|
|
376
|
- {
|
|
|
|
377
|
- fBeginProcess += fStep;
|
|
|
|
378
|
- iRet = SwitchMDByIndex(MDIndex);
|
|
|
|
379
|
- if (iRet != META_SUCCESS)
|
|
|
|
380
|
- {
|
|
|
|
381
|
- UpdateUIMsg("ERROR!!SwitchMDByIndex[%d] : MetaResult = %s", MDIndex, ResultToString(iRet));
|
|
|
|
382
|
- bWriteModemFail = true;
|
|
|
|
383
|
- break;
|
|
|
|
384
|
- }
|
|
|
|
385
|
- else
|
|
|
|
386
|
- {
|
|
|
|
387
|
- fBeginProcess += fStep;
|
|
|
|
388
|
- iRet = LoadModemDatabase(MDIndex);
|
|
|
|
389
|
- if (iRet != META_SUCCESS)
|
|
|
|
390
|
- {
|
|
|
|
391
|
- UpdateUIMsg("ERROR!!LoadModemDatabase[%d] : MetaResult = %s", MDIndex, ResultToString(iRet));
|
|
|
|
392
|
- bWriteModemFail = true;
|
|
|
|
393
|
- break;
|
|
|
|
394
|
- }
|
|
|
|
395
|
- }
|
|
|
|
396
|
- }
|
|
|
|
397
|
-
|
|
|
|
398
|
- if (g_sMetaComm.sWriteOption.bWriteBarcode && (MDIndex == 0 || (mdNums >= 2 && MDIndex >= 1 && m_iC2kProject == 0)))
|
|
|
|
399
|
- {
|
|
|
|
400
|
- fBeginProcess += fStep;
|
|
|
|
401
|
- MTRACE(g_hEBOOT_DEBUG, "Barcode[%d] = \"%s\"", MDIndex, m_sScanData.strBarcode);
|
|
|
|
402
|
- iRet = REQ_WriteModem_NVRAM_Start(WRITE_BARCODE, m_sScanData.strBarcode, 1);
|
|
|
|
403
|
- if (iRet != META_SUCCESS)
|
|
|
|
404
|
- {
|
|
|
|
405
|
- UpdateUIMsg("ERROR!! Barcode[%d] : MetaResult = %s", MDIndex, ResultToString(iRet));
|
|
|
|
406
|
- bWriteModemFail = true;
|
|
|
|
407
|
- break;
|
|
|
|
408
|
- }
|
|
|
|
409
|
- }
|
|
|
|
410
|
-
|
|
|
|
411
|
- if (g_sMetaComm.sWriteOption.bWriteIMEI && (MDIndex == 0 || (mdNums >= 2 && MDIndex >= 1 && m_iC2kProject == 0)))
|
|
|
|
412
|
- {
|
|
|
|
413
|
- if (multiIMEIOption == SINGLE_MD_SINGLE_IMEI || multiIMEIOption == SINGLE_MD_MULTI_IMEI)
|
|
|
|
414
|
- {
|
|
|
|
415
|
- for (int i = 0; i < g_sMetaComm.sIMEIOption.iImeiNums; i++)
|
|
|
|
416
|
- {
|
|
|
|
417
|
- fBeginProcess += fStep;
|
|
|
|
418
|
- IMEI_index = i;
|
|
|
|
419
|
- MTRACE(g_hEBOOT_DEBUG, "IMEI[%d] = \"%s\"", i, m_sScanData.strIMEI[i]);
|
|
|
|
420
|
-
|
|
|
|
421
|
- iRet = REQ_WriteModem_NVRAM_Start(WRITE_IMEI, m_sScanData.strIMEI[i], i + 1);
|
|
|
|
422
|
- if (iRet != META_SUCCESS)
|
|
|
|
423
|
- {
|
|
|
|
424
|
- if (m_bNeedBackupIMEI)
|
|
|
|
425
|
- {
|
|
|
|
426
|
- strncpy(g_AutoGenData.sIMEI.Next, m_strBackupIMEI, strlen(m_strBackupIMEI));
|
|
|
|
427
|
- }
|
|
|
|
428
|
-
|
|
|
|
429
|
- UpdateUIMsg("ERROR!! IMEI[%d] : MetaResult = %s", i, ResultToString(iRet));
|
|
|
|
430
|
- bWriteModemFail = true;
|
|
|
|
431
|
- break;
|
|
|
|
432
|
- }
|
|
|
|
433
|
- }
|
|
|
|
434
|
- }
|
|
|
|
435
|
- else if (multiIMEIOption == DUAL_MD_DUAL_IMEI)
|
|
|
|
436
|
- {
|
|
|
|
437
|
- fBeginProcess += fStep;
|
|
|
|
438
|
- int i = 0;
|
|
|
|
439
|
- i = MDIndex;
|
|
|
|
440
|
- IMEI_index = MDIndex;
|
|
|
|
441
|
- if (m_bDSDAProject)
|
|
|
|
442
|
- {
|
|
|
|
443
|
- IMEI_index = 0;
|
|
|
|
444
|
- }
|
|
|
|
445
|
-
|
|
|
|
446
|
- MTRACE(g_hEBOOT_DEBUG, "IMEI[%d] = \"%s\"", i, m_sScanData.strIMEI[i]);
|
|
|
|
447
|
- iRet = REQ_WriteModem_NVRAM_Start(WRITE_IMEI, m_sScanData.strIMEI[i], IMEI_index + 1);
|
|
|
|
448
|
- if (iRet != META_SUCCESS)
|
|
|
|
449
|
- {
|
|
|
|
450
|
- if (m_bNeedBackupIMEI)
|
|
|
|
451
|
- {
|
|
|
|
452
|
- strncpy(g_AutoGenData.sIMEI.Next, m_strBackupIMEI, strlen(m_strBackupIMEI));
|
|
|
|
453
|
- }
|
|
|
|
454
|
-
|
|
|
|
455
|
- UpdateUIMsg("ERROR!! IMEI[%d] : MetaResult = %s", i, ResultToString(iRet));
|
|
|
|
456
|
- bWriteModemFail = true;
|
|
|
|
457
|
- break;
|
|
|
|
458
|
- }
|
|
|
|
459
|
- }
|
|
|
|
460
|
-
|
|
|
|
461
|
- if (iRet == META_SUCCESS)
|
|
|
|
462
|
- {
|
|
|
|
463
|
- if ((IMEI_index + 1) == g_sMetaComm.sIMEIOption.iImeiNums)
|
|
|
|
464
|
- {
|
|
|
|
465
|
- if (g_sMetaComm.sIMEIOption.bLockIMEI)
|
|
|
|
466
|
- {
|
|
|
|
467
|
- iRet = META_NVRAM_LockDown_r(m_hMauiMetaHandle, 5000);
|
|
|
|
468
|
- if (iRet != META_SUCCESS)
|
|
|
|
469
|
- {
|
|
|
|
470
|
- bWriteModemFail = true;
|
|
|
|
471
|
- break;
|
|
|
|
472
|
- }
|
|
|
|
473
|
- }
|
|
|
|
474
|
- }
|
|
|
|
475
|
- }
|
|
|
|
476
|
- else
|
|
|
|
477
|
- {
|
|
|
|
478
|
- bWriteModemFail = true;
|
|
|
|
479
|
- break;
|
|
|
|
480
|
- }
|
|
|
|
481
|
- }//end if(g_sMetaComm.sWriteOption.bWriteIMEI)
|
|
|
|
482
|
- }//end for(MDIndex = 0; MDIndex < mdNums; MDIndex++)
|
|
|
|
483
|
-
|
|
|
|
484
|
- // Backup imei to SDS
|
|
|
|
485
|
- if (!bWriteModemFail && m_bDSDAProject)
|
|
|
|
486
|
- {
|
|
|
|
487
|
- _BOOL BackupResult = DSDA_ExternalModemBackup();
|
|
|
|
488
|
- if (_TRUE != BackupResult)
|
|
|
|
489
|
- {
|
|
|
|
490
|
- UpdateUIMsg("ERROR!! Backup external modem fail!");
|
|
|
|
491
|
- spNextStage = SP_C2K_STAGE;
|
|
|
|
492
|
- break;
|
|
|
|
493
|
- }
|
|
|
|
494
|
- }
|
|
|
|
495
|
-
|
|
|
|
496
|
- if (bWriteModemFail == true)
|
|
|
|
497
|
- {
|
|
|
|
498
|
- spNextStage = SP_END_STAGE;
|
|
|
|
499
|
- }
|
|
|
|
500
|
- else
|
|
|
|
501
|
- {
|
|
|
|
502
|
- spNextStage = SP_C2K_STAGE;
|
|
|
|
503
|
- }
|
|
|
|
504
|
-
|
|
|
|
505
|
- break;
|
|
|
|
506
|
-
|
|
|
|
507
|
- case SP_C2K_STAGE:
|
|
|
|
508
|
- fBeginProcess += fStep;
|
|
|
|
509
|
- if (g_sMetaComm.sWriteOption.bWriteMeid || g_sMetaComm.sWriteOption.bWriteEsn)
|
|
|
|
510
|
- {
|
|
|
|
511
|
- if (m_iC2kProject != 0)
|
|
|
|
512
|
- iRet = EnterC2KGen90();
|
|
|
|
513
|
- else
|
|
|
|
514
|
- iRet = EnterC2KGen93();
|
|
|
|
515
|
-
|
|
|
|
516
|
- if (iRet != META_SUCCESS)
|
|
|
|
517
|
- {
|
|
|
|
518
|
- spNextStage = SP_END_STAGE;
|
|
|
|
519
|
- break;
|
|
|
|
520
|
- }
|
|
|
|
521
|
- }
|
|
|
|
522
|
- spNextStage = SP_MD2AP_STAGE;
|
|
|
|
523
|
- break;
|
|
|
|
524
|
-
|
|
|
|
525
|
- case SP_MD2AP_STAGE:
|
|
|
|
526
|
-
|
|
|
|
527
|
- if (g_sMetaComm.sIMEIOption.bLockOtp)
|
|
|
|
528
|
- {
|
|
|
|
529
|
- iRet = LockOTP();
|
|
|
|
530
|
- if (iRet != 0)
|
|
|
|
531
|
- {
|
|
|
|
532
|
- spNextStage = SP_END_STAGE;
|
|
|
|
533
|
- break;
|
|
|
|
534
|
- }
|
|
|
|
535
|
- }
|
|
|
|
536
|
-
|
|
|
|
537
|
- fBeginProcess += fStep;
|
|
|
|
538
|
- iRet = ModemSwithToAPMeta();
|
|
|
|
539
|
- if (iRet == META_SUCCESS)
|
|
|
|
540
|
- {
|
|
|
|
541
|
- spNextStage = SP_WRITE_TEMP_STAGE;
|
|
|
|
542
|
- }
|
|
|
|
543
|
- else
|
|
|
|
544
|
- {
|
|
|
|
545
|
- spNextStage = SP_END_STAGE;
|
|
|
|
546
|
- }
|
|
|
|
547
|
- break;
|
|
|
|
548
|
-
|
|
|
|
549
|
- case SP_WRITE_TEMP_STAGE:
|
|
|
|
550
|
- if (QuerySpeakerCalibrationSupport() == SPMETA_DLL::META_SUCCESS && g_sMetaComm.sIMEIOption.Temp_Option.bWriteTemperature) //Query support yes or no from target
|
|
|
|
551
|
- {
|
|
|
|
552
|
- fBeginProcess += fStep;
|
|
|
|
553
|
- float minTemp = 20.0;
|
|
|
|
554
|
- float maxTemp = 30.0;
|
|
|
|
555
|
- float curTemp = 0.0;
|
|
|
|
556
|
- curTemp = atof(g_sMetaComm.sIMEIOption.Temp_Option.strTemperatureData);
|
|
|
|
557
|
-
|
|
|
|
558
|
- MTRACE(g_hEBOOT_DEBUG, "CurTemperature = \"%s\"", g_sMetaComm.sIMEIOption.Temp_Option.strTemperatureData);
|
|
|
|
559
|
- if ((minTemp <= curTemp) && (curTemp <= maxTemp))
|
|
|
|
560
|
- {
|
|
|
|
561
|
- iRet = REQ_WriteAP_NVRAM_Start(WRITE_TEMPERATURE, g_sMetaComm.sIMEIOption.Temp_Option.strTemperatureData, 1);
|
|
|
|
562
|
- if (iRet == META_SUCCESS)
|
|
|
|
563
|
- {
|
|
|
|
564
|
- spNextStage = SP_BT_ADDRESS_STAGE;
|
|
|
|
565
|
- }
|
|
|
|
566
|
- else
|
|
|
|
567
|
- {
|
|
|
|
568
|
- UpdateUIMsg("ERROR!! Audio_Temperature : MetaResult = %s", ResultToString_SP(iRet));
|
|
|
|
569
|
- spNextStage = SP_END_STAGE;
|
|
|
|
570
|
- }
|
|
|
|
571
|
- }
|
|
|
|
572
|
- else
|
|
|
|
573
|
- {
|
|
|
|
574
|
- UpdateUIMsg("Warning: Temperature must be between 20.0~30.0, please reset current temperature!!");
|
|
|
|
575
|
- MTRACE(g_hEBOOT_DEBUG, "Warning: Temperature must be between 20.0~30.0, please reset current temperature!!");
|
|
|
|
576
|
- iRet = META_FAILED;
|
|
|
|
577
|
- spNextStage = SP_END_STAGE;
|
|
|
|
578
|
- }
|
|
|
|
579
|
- }
|
|
|
|
580
|
- else
|
|
|
|
581
|
- {
|
|
|
|
582
|
- spNextStage = SP_BT_ADDRESS_STAGE;
|
|
|
|
583
|
- }
|
|
|
|
584
|
- break;
|
|
|
|
585
|
-
|
|
|
|
586
|
- case SP_BT_ADDRESS_STAGE:
|
|
|
|
587
|
- if (g_sMetaComm.sWriteOption.bWriteBT)
|
|
|
|
588
|
- {
|
|
|
|
589
|
- fBeginProcess += fStep;
|
|
|
|
590
|
- MTRACE(g_hEBOOT_DEBUG, "BT = \"%s\"", m_sScanData.strBTAddr);
|
|
|
|
591
|
- iRet = REQ_WriteAP_NVRAM_Start(WRITE_BT, m_sScanData.strBTAddr, 1);
|
|
|
|
592
|
- if (iRet == META_SUCCESS)
|
|
|
|
593
|
- {
|
|
|
|
594
|
- spNextStage = SP_WIFI_ADDRESS_STAGE;
|
|
|
|
595
|
- }
|
|
|
|
596
|
- else
|
|
|
|
597
|
- {
|
|
|
|
598
|
- UpdateUIMsg("ERROR!! BT : MetaResult = %s", ResultToString_SP(iRet));
|
|
|
|
599
|
- spNextStage = SP_END_STAGE;
|
|
|
|
600
|
- }
|
|
|
|
601
|
- }
|
|
|
|
602
|
- else
|
|
|
|
603
|
- {
|
|
|
|
604
|
- spNextStage = SP_WIFI_ADDRESS_STAGE;
|
|
|
|
605
|
- }
|
|
|
|
606
|
- break;
|
|
|
|
607
|
-
|
|
|
|
608
|
- case SP_WIFI_ADDRESS_STAGE:
|
|
|
|
609
|
- if (g_sMetaComm.sWriteOption.bWriteWifi)
|
|
|
|
610
|
- {
|
|
|
|
611
|
- fBeginProcess += fStep;
|
|
|
|
612
|
- MTRACE(g_hEBOOT_DEBUG, "Wifi = \"%s\"", m_sScanData.strWifiAddr);
|
|
|
|
613
|
- iRet = REQ_WriteAP_NVRAM_Start(WRITE_WIFI, m_sScanData.strWifiAddr, 1);
|
|
|
|
614
|
- if (iRet == META_SUCCESS)
|
|
|
|
615
|
- {
|
|
|
|
616
|
- spNextStage = SP_ETHERNET_MAC_STAGE;
|
|
|
|
617
|
- }
|
|
|
|
618
|
- else
|
|
|
|
619
|
- {
|
|
|
|
620
|
- UpdateUIMsg("ERROR!! Wifi : MetaResult = %s", ResultToString_SP(iRet));
|
|
|
|
621
|
- spNextStage = SP_END_STAGE;
|
|
|
|
622
|
- }
|
|
|
|
623
|
- }
|
|
|
|
624
|
- else
|
|
|
|
625
|
- {
|
|
|
|
626
|
- spNextStage = SP_ETHERNET_MAC_STAGE;
|
|
|
|
627
|
- }
|
|
|
|
628
|
- break;
|
|
|
|
629
|
-
|
|
|
|
630
|
- case SP_ETHERNET_MAC_STAGE:
|
|
|
|
631
|
- if (g_sMetaComm.sWriteOption.bWriteEthernetMac)
|
|
|
|
632
|
- {
|
|
|
|
633
|
- fBeginProcess += fStep;
|
|
|
|
634
|
- MTRACE(g_hEBOOT_DEBUG, "Ethernet Mac = \"%s\"", m_sScanData.strEthernetMac);
|
|
|
|
635
|
- iRet = REQ_WriteAP_NVRAM_Start(WRITE_ETHERNET_MAC, m_sScanData.strEthernetMac, 1);
|
|
|
|
636
|
- if (iRet == META_SUCCESS)
|
|
|
|
637
|
- {
|
|
|
|
638
|
- spNextStage = SP_HDCP_STAGE;
|
|
|
|
639
|
- }
|
|
|
|
640
|
- else
|
|
|
|
641
|
- {
|
|
|
|
642
|
- UpdateUIMsg("ERROR!! Ethernet Mac : MetaResult = %s", ResultToString_SP(iRet));
|
|
|
|
643
|
- spNextStage = SP_END_STAGE;
|
|
|
|
644
|
- }
|
|
|
|
645
|
- }
|
|
|
|
646
|
- else
|
|
|
|
647
|
- {
|
|
|
|
648
|
- spNextStage = SP_HDCP_STAGE;
|
|
|
|
649
|
- }
|
|
|
|
650
|
- break;
|
|
|
|
651
|
-
|
|
|
|
652
|
- case SP_HDCP_STAGE:
|
|
|
|
653
|
- fBeginProcess += fStep;
|
|
|
|
654
|
- if (g_sMetaComm.sWriteOption.bWriteHdcp)
|
|
|
|
655
|
- {
|
|
|
|
656
|
- iRet = REQ_WriteHdcpBinToAPNvram_Start(g_sMetaComm.sLoadFile.strHdcpBinPath);
|
|
|
|
657
|
- if (iRet == META_SUCCESS)
|
|
|
|
658
|
- {
|
|
|
|
659
|
- spNextStage = SP_DRMKEY_STAGE;
|
|
|
|
660
|
- }
|
|
|
|
661
|
- else
|
|
|
|
662
|
- {
|
|
|
|
663
|
- UpdateUIMsg("ERROR!! Hdcp : MetaResult = %s", ResultToString_SP(iRet));
|
|
|
|
664
|
- spNextStage = SP_END_STAGE;
|
|
|
|
665
|
- }
|
|
|
|
666
|
- }
|
|
|
|
667
|
- else
|
|
|
|
668
|
- {
|
|
|
|
669
|
- spNextStage = SP_DRMKEY_STAGE;
|
|
|
|
670
|
- }
|
|
|
|
671
|
- break;
|
|
|
|
672
|
-
|
|
|
|
673
|
- case SP_DRMKEY_STAGE:
|
|
|
|
674
|
- fBeginProcess += fStep;
|
|
|
|
675
|
- if (g_sMetaComm.sWriteOption.bWriteDrm)
|
|
|
|
676
|
- {
|
|
|
|
677
|
- iRet = REQ_InstallDRMKey_Start();
|
|
|
|
678
|
- if (iRet == META_SUCCESS)
|
|
|
|
679
|
- {
|
|
|
|
680
|
- spNextStage = SP_HDCPDATA_INSTALL_STAGE;
|
|
|
|
681
|
- }
|
|
|
|
682
|
- else
|
|
|
|
683
|
- {
|
|
|
|
684
|
- UpdateUIMsg("ERROR!! DRMKey : MetaResult = %s", ResultToString_SP(iRet));
|
|
|
|
685
|
- spNextStage = SP_END_STAGE;
|
|
|
|
686
|
- }
|
|
|
|
687
|
- }
|
|
|
|
688
|
- else
|
|
|
|
689
|
- {
|
|
|
|
690
|
- spNextStage = SP_HDCPDATA_INSTALL_STAGE;
|
|
|
|
691
|
- }
|
|
|
|
692
|
- break;
|
|
|
|
693
|
-
|
|
|
|
694
|
- case SP_HDCPDATA_INSTALL_STAGE:
|
|
|
|
695
|
- fBeginProcess += fStep;
|
|
|
|
696
|
- if (g_sMetaComm.sWriteOption.bInstallHdcpData)
|
|
|
|
697
|
- {
|
|
|
|
698
|
- iRet = REQ_InstallHdcpData_Start(g_sMetaComm.sLoadFile.strHdcpDataPath, g_sMetaComm.sLoadFile.strHdcpCekPath);
|
|
|
|
699
|
- if (iRet == META_SUCCESS)
|
|
|
|
700
|
- {
|
|
|
|
701
|
- spNextStage = SP_DRMKEY_MCID_STAGE;
|
|
|
|
702
|
- }
|
|
|
|
703
|
- else
|
|
|
|
704
|
- {
|
|
|
|
705
|
- UpdateUIMsg("ERROR!! HdcpData : MetaResult = %s", ResultToString_SP(iRet));
|
|
|
|
706
|
- spNextStage = SP_END_STAGE;
|
|
|
|
707
|
- }
|
|
|
|
708
|
- }
|
|
|
|
709
|
- else
|
|
|
|
710
|
- {
|
|
|
|
711
|
- spNextStage = SP_DRMKEY_MCID_STAGE;
|
|
|
|
712
|
- }
|
|
|
|
713
|
- break;
|
|
|
|
714
|
-
|
|
|
|
715
|
- case SP_DRMKEY_MCID_STAGE:
|
|
|
|
716
|
- fBeginProcess += fStep;
|
|
|
|
717
|
- if (g_sMetaComm.sWriteOption.bWriteDrmkeyMCID)
|
|
|
|
718
|
- {
|
|
|
|
719
|
- iRet = REQ_WriteDRMKeyMCID_Start(m_sScanData.strDrmkeyMCID);
|
|
|
|
720
|
- if (iRet == META_SUCCESS)
|
|
|
|
721
|
- {
|
|
|
|
722
|
- spNextStage = SP_BACKUPNV_TO_PC_STAGE;
|
|
|
|
723
|
- }
|
|
|
|
724
|
- else
|
|
|
|
725
|
- {
|
|
|
|
726
|
- UpdateUIMsg("ERROR!! DRMKeyMCID : MetaResult = %s", ResultToString_SP(iRet));
|
|
|
|
727
|
- spNextStage = SP_END_STAGE;
|
|
|
|
728
|
- }
|
|
|
|
729
|
- }
|
|
|
|
730
|
- else
|
|
|
|
731
|
- {
|
|
|
|
732
|
- spNextStage = SP_BACKUPNV_TO_PC_STAGE;
|
|
|
|
733
|
- }
|
|
|
|
734
|
- break;
|
|
|
|
735
|
-
|
|
|
|
736
|
- case SP_BACKUPNV_TO_PC_STAGE:
|
|
|
|
737
|
- if (g_sMetaComm.bCheckBackNVtoPC)
|
|
|
|
738
|
- {
|
|
|
|
739
|
- fBeginProcess += fStep;
|
|
|
|
740
|
- char NumFile[100] = {0};
|
|
|
|
741
|
- iRet = GetNvramFileName(NumFile);
|
|
|
|
742
|
-
|
|
|
|
743
|
- if (iRet == META_SUCCESS)
|
|
|
|
744
|
- {
|
|
|
|
745
|
- iRet = REQ_BackupNvram2PC_Start(NumFile);
|
|
|
|
746
|
- if (iRet != META_SUCCESS)
|
|
|
|
747
|
- {
|
|
|
|
748
|
- UpdateUIMsg("ERROR!! REQ_BackupNvram2PC_Start : MetaResult = %s", ResultToString_SP(iRet));
|
|
|
|
749
|
- spNextStage = SP_END_STAGE;
|
|
|
|
750
|
- }
|
|
|
|
751
|
- else
|
|
|
|
752
|
- {
|
|
|
|
753
|
- spNextStage = SP_BACKUP_NVRAM_STAGE;
|
|
|
|
754
|
- }
|
|
|
|
755
|
- }
|
|
|
|
756
|
- else
|
|
|
|
757
|
- {
|
|
|
|
758
|
- spNextStage = SP_END_STAGE;
|
|
|
|
759
|
- }
|
|
|
|
760
|
- }
|
|
|
|
761
|
- else
|
|
|
|
762
|
- {
|
|
|
|
763
|
- spNextStage = SP_BACKUP_NVRAM_STAGE;
|
|
|
|
764
|
- }
|
|
|
|
765
|
- break;
|
|
|
|
766
|
-
|
|
|
|
767
|
- case SP_BACKUP_NVRAM_STAGE:
|
|
|
|
768
|
- {
|
|
|
|
769
|
- fBeginProcess += fStep;
|
|
|
|
770
|
-
|
|
|
|
771
|
- iRet = REQ_BackupNvram2BinRegion_Start();
|
|
|
|
772
|
- if (iRet != META_SUCCESS)
|
|
|
|
773
|
- {
|
|
|
|
774
|
- m_bBackupNvramSuccess = false;
|
|
|
|
775
|
- UpdateUIMsg("ERROR!! BackUP : MetaResult = %s", ResultToString_SP(iRet));
|
|
|
|
776
|
- spNextStage = SP_END_STAGE;
|
|
|
|
777
|
- }
|
|
|
|
778
|
- else
|
|
|
|
779
|
- {
|
|
|
|
780
|
- m_bBackupNvramSuccess = true;
|
|
|
|
781
|
- spNextStage = SP_PRODINFO_STAGE;
|
|
|
|
782
|
- }
|
|
|
|
783
|
-
|
|
|
|
784
|
- break;
|
|
|
|
785
|
- }
|
|
|
|
786
|
-
|
|
|
|
787
|
- case SP_PRODINFO_STAGE:
|
|
|
|
788
|
- {
|
|
|
|
789
|
- if (m_bWriteProdInfo && g_sMetaComm.bSkipWriteProdInfo == false)
|
|
|
|
790
|
- {
|
|
|
|
791
|
- MTRACE(g_hEBOOT_DEBUG, "Prod_Info = \"...\"");
|
|
|
|
792
|
- fBeginProcess += fStep;
|
|
|
|
793
|
- iRet = REQ_WriteAP_PRODINFO_Start();
|
|
|
|
794
|
- if (iRet != META_SUCCESS)
|
|
|
|
795
|
- {
|
|
|
|
796
|
- UpdateUIMsg("ERROR!! Prod_Info : MetaResult = %s", ResultToString_SP(iRet));
|
|
|
|
797
|
- }
|
|
|
|
798
|
}
|
234
|
}
|
|
799
|
- spNextStage = SP_END_STAGE;
|
|
|
|
800
|
-
|
|
|
|
801
|
break;
|
235
|
break;
|
|
802
|
}
|
236
|
}
|
|
803
|
- }
|
|
|
|
804
|
-
|
|
|
|
805
|
spStage = spNextStage;
|
237
|
spStage = spNextStage;
|
|
806
|
}
|
238
|
}
|
|
807
|
-
|
|
|
|
808
|
MTRACE (g_hEBOOT_DEBUG, "SmartPhoneSN::WriteNvramLoop() end...");
|
239
|
MTRACE (g_hEBOOT_DEBUG, "SmartPhoneSN::WriteNvramLoop() end...");
|
|
809
|
return (META_RESULT)iRet;
|
240
|
return (META_RESULT)iRet;
|
|
810
|
}
|
241
|
}
|
|
@@ -4276,7 +3707,7 @@ void SmartPhoneSN::ThreadMainEntryPoint() |
|
@@ -4276,7 +3707,7 @@ void SmartPhoneSN::ThreadMainEntryPoint() |
|
4276
|
|
3707
|
|
|
4277
|
SPMETA_DLL::VerInfo_V2_Cnf a_v2cnf;
|
3708
|
SPMETA_DLL::VerInfo_V2_Cnf a_v2cnf;
|
|
4278
|
short a_token;
|
3709
|
short a_token;
|
|
4279
|
-
|
3710
|
+
|
|
4280
|
/*For dual talk(external modem) project
|
3711
|
/*For dual talk(external modem) project
|
|
4281
|
* Due to dual talk project can`t switch back and forth between ap and external modem
|
3712
|
* Due to dual talk project can`t switch back and forth between ap and external modem
|
|
4282
|
* When target type select tablet and enable external modem option, mean that will write ap nvram, so need disable write external modem nvram
|
3713
|
* When target type select tablet and enable external modem option, mean that will write ap nvram, so need disable write external modem nvram
|
|
@@ -4284,22 +3715,22 @@ void SmartPhoneSN::ThreadMainEntryPoint() |
|
@@ -4284,22 +3715,22 @@ void SmartPhoneSN::ThreadMainEntryPoint() |
|
4284
|
*/
|
3715
|
*/
|
|
4285
|
bool bWriteBarcode = g_sMetaComm.sWriteOption.bWriteBarcode;
|
3716
|
bool bWriteBarcode = g_sMetaComm.sWriteOption.bWriteBarcode;
|
|
4286
|
bool bWriteIMEI = g_sMetaComm.sWriteOption.bWriteIMEI;
|
3717
|
bool bWriteIMEI = g_sMetaComm.sWriteOption.bWriteIMEI;
|
|
4287
|
-
|
3718
|
+
|
|
4288
|
if (g_sMetaComm.bDualTalk)
|
3719
|
if (g_sMetaComm.bDualTalk)
|
|
4289
|
{
|
3720
|
{
|
|
4290
|
g_sMetaComm.sWriteOption.bWriteBarcode = false;
|
3721
|
g_sMetaComm.sWriteOption.bWriteBarcode = false;
|
|
4291
|
g_sMetaComm.sWriteOption.bWriteIMEI = false;
|
3722
|
g_sMetaComm.sWriteOption.bWriteIMEI = false;
|
|
4292
|
}
|
3723
|
}
|
|
4293
|
-
|
3724
|
+
|
|
4294
|
bNeedLoadAPDB = true;
|
3725
|
bNeedLoadAPDB = true;
|
|
4295
|
-
|
3726
|
+
|
|
4296
|
bool bAnyOperationFail = false;
|
3727
|
bool bAnyOperationFail = false;
|
|
4297
|
META_RESULT MetaResult = META_SUCCESS;
|
3728
|
META_RESULT MetaResult = META_SUCCESS;
|
|
4298
|
SPMETA_DLL::META_RESULT SPMetaResult = SPMETA_DLL::META_SUCCESS;
|
3729
|
SPMETA_DLL::META_RESULT SPMetaResult = SPMETA_DLL::META_SUCCESS;
|
|
4299
|
-
|
3730
|
+
|
|
4300
|
if (g_sMetaComm.bSwithTool)
|
3731
|
if (g_sMetaComm.bSwithTool)
|
|
4301
|
EnableUSBSwitch();
|
3732
|
EnableUSBSwitch();
|
|
4302
|
-
|
3733
|
+
|
|
4303
|
if (g_sMetaComm.bCheckFastbootLock)
|
3734
|
if (g_sMetaComm.bCheckFastbootLock)
|
|
4304
|
{
|
3735
|
{
|
|
4305
|
UpdateUIMsg("Start Adb_Manager_Init() and Set_Fastboot_EnvironmentVariable()...");
|
3736
|
UpdateUIMsg("Start Adb_Manager_Init() and Set_Fastboot_EnvironmentVariable()...");
|
|
@@ -4313,7 +3744,7 @@ void SmartPhoneSN::ThreadMainEntryPoint() |
|
@@ -4313,7 +3744,7 @@ void SmartPhoneSN::ThreadMainEntryPoint() |
|
4313
|
if (!Adb_Manager_Init())
|
3744
|
if (!Adb_Manager_Init())
|
|
4314
|
{
|
3745
|
{
|
|
4315
|
MTRACE (g_hEBOOT_DEBUG, "SmartPhoneSN::Adb_Manager_Init() FAIL...");
|
3746
|
MTRACE (g_hEBOOT_DEBUG, "SmartPhoneSN::Adb_Manager_Init() FAIL...");
|
|
4316
|
-
|
3747
|
+
|
|
4317
|
Adb_Manager_Deinit();
|
3748
|
Adb_Manager_Deinit();
|
|
4318
|
UpdateUIMsg("SmartPhoneSN::Adb_Manager_Init() FAIL...");
|
3749
|
UpdateUIMsg("SmartPhoneSN::Adb_Manager_Init() FAIL...");
|
|
4319
|
return;
|
3750
|
return;
|
|
@@ -4332,163 +3763,161 @@ void SmartPhoneSN::ThreadMainEntryPoint() |
|
@@ -4332,163 +3763,161 @@ void SmartPhoneSN::ThreadMainEntryPoint() |
|
4332
|
*m_pMetaStopFlag = BOOT_STOP;
|
3763
|
*m_pMetaStopFlag = BOOT_STOP;
|
|
4333
|
}
|
3764
|
}
|
|
4334
|
MTRACE (g_hEBOOT_DEBUG, "SmartPhoneSN::MetaHandle_Init() end...");
|
3765
|
MTRACE (g_hEBOOT_DEBUG, "SmartPhoneSN::MetaHandle_Init() end...");
|
|
4335
|
-
|
3766
|
+
|
|
4336
|
//CScanData scanDlg;
|
3767
|
//CScanData scanDlg;
|
|
4337
|
-
|
|
|
|
4338
|
-
|
|
|
|
4339
|
- while(true)
|
|
|
|
4340
|
- {
|
|
|
|
4341
|
- if (*m_pMetaStopFlag == BOOT_STOP)
|
|
|
|
4342
|
- break;
|
|
|
|
4343
|
- if (g_sMetaComm.iStressTest > 1 && iTestCount > 0)
|
|
|
|
4344
|
- {
|
|
|
|
4345
|
- if (iTestCount >= g_sMetaComm.iStressTest)
|
|
|
|
4346
|
- break;
|
|
|
|
4347
|
- }
|
|
|
|
4348
|
- iTestCount++;
|
|
|
|
4349
|
-
|
|
|
|
4350
|
- DebugOnOff(true);
|
|
|
|
4351
|
- MTRACE(g_hEBOOT_DEBUG, "------------------------------------ START -------------------------------------");
|
|
|
|
4352
|
- LogConfig();
|
|
|
|
4353
|
- bAnyOperationFail = false;
|
|
|
|
4354
|
- UpdateMainDlgUI(false, NORMAL);
|
|
|
|
4355
|
- // if(g_sMetaComm.sIMEIOption.Temp_Option.bWriteTemperature)
|
|
|
|
4356
|
- g_pMainDlg->ShowTemperatureOnUI();
|
|
|
|
4357
|
-
|
|
|
|
4358
|
- EnableStartBTN(false);
|
|
|
|
4359
|
-
|
|
|
|
4360
|
- //SPInit() can`t call before SNThread_Init() function
|
|
|
|
4361
|
- SNThread_Init();
|
|
|
|
4362
|
- //MTRACE (g_hEBOOT_DEBUG, "m_bWriteModemNvram = %d,m_sMdInfo.number_of_md = %d", m_bWriteModemNvram, m_sMdInfo.number_of_md);
|
|
|
|
4363
|
- SPInit();
|
|
|
|
4364
|
-
|
|
|
|
4365
|
- SetupMetaModeParameters();
|
|
|
|
4366
|
-
|
|
|
|
4367
|
- UpdateUIMsg("Start load and init AP database...");
|
|
|
|
4368
|
-
|
|
|
|
4369
|
-
|
|
|
|
4370
|
- if (g_sMetaComm.bUsbEnable)
|
|
|
|
4371
|
- {
|
|
|
|
4372
|
- UpdateUIMsg("Wait for usb insert...");
|
|
|
|
4373
|
- }
|
|
|
|
4374
|
-
|
|
|
|
4375
|
- EnableStartBTN(true);
|
|
|
|
4376
|
-
|
|
|
|
4377
|
- MetaResult = (META_RESULT)EnterAPMetaMode();
|
|
|
|
4378
|
- if (MetaResult != META_SUCCESS)
|
|
|
|
4379
|
- {
|
|
|
|
4380
|
- bAnyOperationFail = true;
|
|
|
|
4381
|
- goto End;
|
|
|
|
4382
|
- }
|
|
|
|
4383
|
-
|
|
|
|
4384
|
- if (g_sMetaComm.sDBFileOption.bAPDBFromDUT || g_sMetaComm.sDBFileOption.bMDDBFromDUT)
|
|
|
|
4385
|
- {
|
|
|
|
4386
|
- SPMetaResult = QueryDBFromDUT();
|
|
|
|
4387
|
- if (SPMetaResult != 0)
|
|
|
|
4388
|
- {
|
|
|
|
4389
|
- UpdateUIMsg("Don't support load db from device.");
|
|
|
|
4390
|
- bAnyOperationFail = true;
|
|
|
|
4391
|
- goto End;
|
|
|
|
4392
|
- }
|
|
|
|
4393
|
- }
|
|
|
|
4394
|
-
|
|
|
|
4395
|
- if (bNeedLoadAPDB == true)
|
|
|
|
4396
|
- {
|
|
|
|
4397
|
- // load ap db from dut
|
|
|
|
4398
|
- if (g_sMetaComm.sDBFileOption.bAPDBFromDUT)
|
|
|
|
4399
|
- {
|
|
|
|
4400
|
- MTRACE(g_hEBOOT_DEBUG, "SmartPhoneSN::GetAPDBFromDUT() : Get AP DB from DUT start...");
|
|
|
|
4401
|
- SPMetaResult = GetAPDBFromDUT();
|
|
|
|
4402
|
- if (SPMetaResult != SPMETA_DLL::META_SUCCESS)
|
|
|
|
4403
|
- MTRACE(g_hEBOOT_DEBUG, "SmartPhoneSN::GetMDDBFromDUT() : fail, will try load config DB.");
|
|
|
|
4404
|
- else
|
|
|
|
4405
|
- MTRACE(g_hEBOOT_DEBUG, "SmartPhoneSN::GetAPDBFromDUT() : end.");
|
|
|
|
4406
|
- }
|
|
|
|
4407
|
-
|
|
|
|
4408
|
- MetaResult = (META_RESULT)LoadAPDatabase();
|
|
|
|
4409
|
- if (MetaResult != META_SUCCESS)
|
|
|
|
4410
|
- {
|
|
|
|
4411
|
- bAnyOperationFail = true;
|
|
|
|
4412
|
- UpdateUIMsg("Load AP Database fail, %s", ResultToString_SP(MetaResult));
|
|
|
|
4413
|
- goto End;
|
|
|
|
4414
|
- }
|
|
|
|
4415
|
- }
|
|
|
|
4416
|
-
|
|
|
|
4417
|
- SPMetaResult = SPMETA_DLL::SP_META_QueryIfFunctionSupportedByTarget_r(m_hSPMetaHandle, 500, "SP_META_ENCRYPTED_Support_r");
|
|
|
|
4418
|
- if (SPMetaResult == SPMETA_DLL::META_SUCCESS)
|
|
|
|
4419
|
- {
|
|
|
|
4420
|
- if (QueryEncryptionSupport(&m_hSPMetaHandle))
|
|
|
|
4421
|
- {
|
|
|
|
4422
|
- Encryption Edlg;
|
|
|
|
4423
|
- //Edlg.DoModal();
|
|
|
|
4424
|
- while ((IDOK == Edlg.DoModal() ) && times < 3)
|
|
|
|
4425
|
- {
|
|
|
|
4426
|
- if (!VeritifiEncryption(&m_hSPMetaHandle))
|
|
|
|
4427
|
- {
|
|
|
|
4428
|
- MTRACE(g_hEBOOT_DEBUG, "VeritifiEncryption() retry : %d", times + 1);
|
|
|
|
4429
|
- times = times + 1;
|
|
|
|
4430
|
- }
|
|
|
|
4431
|
- else
|
|
|
|
4432
|
- break;
|
|
|
|
4433
|
- }
|
|
|
|
4434
|
- if (3 == times)
|
|
|
|
4435
|
- {
|
|
|
|
4436
|
- bAnyOperationFail = true;
|
|
|
|
4437
|
- MTRACE(g_hEBOOT_DEBUG, "VeritifiEncryption() retry times more than 3 times!");
|
|
|
|
4438
|
- goto End;
|
|
|
|
4439
|
- }
|
|
|
|
4440
|
- }
|
|
|
|
4441
|
- }
|
|
|
|
4442
|
-
|
|
|
|
4443
|
- if (g_sMetaComm.eTargetType != TABLET_WIFI_ONLY)
|
|
|
|
4444
|
- {
|
|
|
|
4445
|
- // query modem info must after queryEncryption.
|
|
|
|
4446
|
- MTRACE (g_hEBOOT_DEBUG, "SmartPhoneSN::GetSPModemInfo_Ex(): Query modem information start...");
|
|
|
|
4447
|
- Ret = GetSPModemInfo_Ex();
|
|
|
|
4448
|
- if (Ret != 0)
|
|
|
|
4449
|
- {
|
|
|
|
4450
|
- bAnyOperationFail = true;
|
|
|
|
4451
|
- MTRACE_ERR(g_hEBOOT_DEBUG, "SmartPhoneSN::GetSPModemInfo_Ex(): Query modem information fail, MetaResult = %s", ResultToString_SP(Ret));
|
|
|
|
4452
|
- UpdateUIMsg("Query modem information fail, %s", ResultToString_SP(Ret));
|
|
|
|
4453
|
- goto End;
|
|
|
|
4454
|
- }
|
|
|
|
4455
|
- MTRACE (g_hEBOOT_DEBUG, "SmartPhoneSN::GetSPModemInfo_Ex(): Query modem information end.");
|
|
|
|
4456
|
- #ifdef __TOPWELL_QCTEST__
|
3768
|
+
|
|
|
|
3769
|
+
|
|
|
|
3770
|
+ if (*m_pMetaStopFlag == BOOT_STOP)
|
|
|
|
3771
|
+ return;
|
|
|
|
3772
|
+ if (g_sMetaComm.iStressTest > 1 && iTestCount > 0)
|
|
|
|
3773
|
+ {
|
|
|
|
3774
|
+ if (iTestCount >= g_sMetaComm.iStressTest)
|
|
|
|
3775
|
+ return;
|
|
|
|
3776
|
+ }
|
|
|
|
3777
|
+ iTestCount++;
|
|
|
|
3778
|
+
|
|
|
|
3779
|
+ DebugOnOff(true);
|
|
|
|
3780
|
+ MTRACE(g_hEBOOT_DEBUG, "------------------------------------ START -------------------------------------");
|
|
|
|
3781
|
+ LogConfig();
|
|
|
|
3782
|
+ bAnyOperationFail = false;
|
|
|
|
3783
|
+ UpdateMainDlgUI(false, NORMAL);
|
|
|
|
3784
|
+ // if(g_sMetaComm.sIMEIOption.Temp_Option.bWriteTemperature)
|
|
|
|
3785
|
+ g_pMainDlg->ShowTemperatureOnUI();
|
|
|
|
3786
|
+
|
|
|
|
3787
|
+ EnableStartBTN(false);
|
|
|
|
3788
|
+
|
|
|
|
3789
|
+ //SPInit() can`t call before SNThread_Init() function
|
|
|
|
3790
|
+ SNThread_Init();
|
|
|
|
3791
|
+ //MTRACE (g_hEBOOT_DEBUG, "m_bWriteModemNvram = %d,m_sMdInfo.number_of_md = %d", m_bWriteModemNvram, m_sMdInfo.number_of_md);
|
|
|
|
3792
|
+ SPInit();
|
|
|
|
3793
|
+
|
|
|
|
3794
|
+ SetupMetaModeParameters();
|
|
|
|
3795
|
+
|
|
|
|
3796
|
+ UpdateUIMsg("Start load and init AP database...");
|
|
|
|
3797
|
+
|
|
|
|
3798
|
+
|
|
|
|
3799
|
+ if (g_sMetaComm.bUsbEnable)
|
|
|
|
3800
|
+ {
|
|
|
|
3801
|
+ UpdateUIMsg("Wait for usb insert...");
|
|
|
|
3802
|
+ }
|
|
|
|
3803
|
+
|
|
|
|
3804
|
+ EnableStartBTN(true);
|
|
|
|
3805
|
+
|
|
|
|
3806
|
+ MetaResult = (META_RESULT)EnterAPMetaMode();
|
|
|
|
3807
|
+ if (MetaResult != META_SUCCESS)
|
|
|
|
3808
|
+ {
|
|
|
|
3809
|
+ bAnyOperationFail = true;
|
|
|
|
3810
|
+ goto End;
|
|
|
|
3811
|
+ }
|
|
|
|
3812
|
+
|
|
|
|
3813
|
+ if (g_sMetaComm.sDBFileOption.bAPDBFromDUT || g_sMetaComm.sDBFileOption.bMDDBFromDUT)
|
|
|
|
3814
|
+ {
|
|
|
|
3815
|
+ SPMetaResult = QueryDBFromDUT();
|
|
|
|
3816
|
+ if (SPMetaResult != 0)
|
|
|
|
3817
|
+ {
|
|
|
|
3818
|
+ UpdateUIMsg("Don't support load db from device.");
|
|
|
|
3819
|
+ bAnyOperationFail = true;
|
|
|
|
3820
|
+ goto End;
|
|
|
|
3821
|
+ }
|
|
|
|
3822
|
+ }
|
|
|
|
3823
|
+
|
|
|
|
3824
|
+ if (bNeedLoadAPDB == true)
|
|
|
|
3825
|
+ {
|
|
|
|
3826
|
+ // load ap db from dut
|
|
|
|
3827
|
+ if (g_sMetaComm.sDBFileOption.bAPDBFromDUT)
|
|
|
|
3828
|
+ {
|
|
|
|
3829
|
+ MTRACE(g_hEBOOT_DEBUG, "SmartPhoneSN::GetAPDBFromDUT() : Get AP DB from DUT start...");
|
|
|
|
3830
|
+ SPMetaResult = GetAPDBFromDUT();
|
|
|
|
3831
|
+ if (SPMetaResult != SPMETA_DLL::META_SUCCESS)
|
|
|
|
3832
|
+ MTRACE(g_hEBOOT_DEBUG, "SmartPhoneSN::GetMDDBFromDUT() : fail, will try load config DB.");
|
|
|
|
3833
|
+ else
|
|
|
|
3834
|
+ MTRACE(g_hEBOOT_DEBUG, "SmartPhoneSN::GetAPDBFromDUT() : end.");
|
|
|
|
3835
|
+ }
|
|
|
|
3836
|
+
|
|
|
|
3837
|
+ MetaResult = (META_RESULT)LoadAPDatabase();
|
|
|
|
3838
|
+ if (MetaResult != META_SUCCESS)
|
|
|
|
3839
|
+ {
|
|
|
|
3840
|
+ bAnyOperationFail = true;
|
|
|
|
3841
|
+ UpdateUIMsg("Load AP Database fail, %s", ResultToString_SP(MetaResult));
|
|
|
|
3842
|
+ goto End;
|
|
|
|
3843
|
+ }
|
|
|
|
3844
|
+ }
|
|
|
|
3845
|
+
|
|
|
|
3846
|
+ SPMetaResult = SPMETA_DLL::SP_META_QueryIfFunctionSupportedByTarget_r(m_hSPMetaHandle, 500, "SP_META_ENCRYPTED_Support_r");
|
|
|
|
3847
|
+ if (SPMetaResult == SPMETA_DLL::META_SUCCESS)
|
|
|
|
3848
|
+ {
|
|
|
|
3849
|
+ if (QueryEncryptionSupport(&m_hSPMetaHandle))
|
|
|
|
3850
|
+ {
|
|
|
|
3851
|
+ Encryption Edlg;
|
|
|
|
3852
|
+ //Edlg.DoModal();
|
|
|
|
3853
|
+ while ((IDOK == Edlg.DoModal() ) && times < 3)
|
|
|
|
3854
|
+ {
|
|
|
|
3855
|
+ if (!VeritifiEncryption(&m_hSPMetaHandle))
|
|
|
|
3856
|
+ {
|
|
|
|
3857
|
+ MTRACE(g_hEBOOT_DEBUG, "VeritifiEncryption() retry : %d", times + 1);
|
|
|
|
3858
|
+ times = times + 1;
|
|
|
|
3859
|
+ }
|
|
|
|
3860
|
+ else
|
|
|
|
3861
|
+ break;
|
|
|
|
3862
|
+ }
|
|
|
|
3863
|
+ if (3 == times)
|
|
|
|
3864
|
+ {
|
|
|
|
3865
|
+ bAnyOperationFail = true;
|
|
|
|
3866
|
+ MTRACE(g_hEBOOT_DEBUG, "VeritifiEncryption() retry times more than 3 times!");
|
|
|
|
3867
|
+ goto End;
|
|
|
|
3868
|
+ }
|
|
|
|
3869
|
+ }
|
|
|
|
3870
|
+ }
|
|
|
|
3871
|
+
|
|
|
|
3872
|
+ if (g_sMetaComm.eTargetType != TABLET_WIFI_ONLY)
|
|
|
|
3873
|
+ {
|
|
|
|
3874
|
+ // query modem info must after queryEncryption.
|
|
|
|
3875
|
+ MTRACE (g_hEBOOT_DEBUG, "SmartPhoneSN::GetSPModemInfo_Ex(): Query modem information start...");
|
|
|
|
3876
|
+ Ret = GetSPModemInfo_Ex();
|
|
|
|
3877
|
+ if (Ret != 0)
|
|
|
|
3878
|
+ {
|
|
|
|
3879
|
+ bAnyOperationFail = true;
|
|
|
|
3880
|
+ MTRACE_ERR(g_hEBOOT_DEBUG, "SmartPhoneSN::GetSPModemInfo_Ex(): Query modem information fail, MetaResult = %s", ResultToString_SP(Ret));
|
|
|
|
3881
|
+ UpdateUIMsg("Query modem information fail, %s", ResultToString_SP(Ret));
|
|
|
|
3882
|
+ goto End;
|
|
|
|
3883
|
+ }
|
|
|
|
3884
|
+ MTRACE (g_hEBOOT_DEBUG, "SmartPhoneSN::GetSPModemInfo_Ex(): Query modem information end.");
|
|
|
|
3885
|
+#ifdef __TOPWELL_QCTEST__
|
|
|
|
3886
|
+
|
|
4457
|
|
3887
|
|
|
4458
|
-
|
|
|
|
4459
|
SPMETA_DLL::SP_META_GetTargetVerInfoV2_r(m_hSPMetaHandle, &a_v2cnf, &a_token,NULL);
|
3888
|
SPMETA_DLL::SP_META_GetTargetVerInfoV2_r(m_hSPMetaHandle, &a_v2cnf, &a_token,NULL);
|
|
4460
|
{
|
3889
|
{
|
|
4461
|
//int a_verlen = g_pMainDlg->myversion.GetLength();
|
3890
|
//int a_verlen = g_pMainDlg->myversion.GetLength();
|
|
4462
|
//int a_verlen =strlen(g_sMetaComm.check_sw_ver());
|
3891
|
//int a_verlen =strlen(g_sMetaComm.check_sw_ver());
|
|
4463
|
char tmp_checkSwVer[255];
|
3892
|
char tmp_checkSwVer[255];
|
|
4464
|
int len=strlen(g_sMetaComm.check_sw_ver);
|
3893
|
int len=strlen(g_sMetaComm.check_sw_ver);
|
|
4465
|
-
|
|
|
|
4466
|
- /* strcpy(tmp_checkSwVer,g_sMetaComm.check_sw_ver);
|
|
|
|
4467
|
-
|
|
|
|
4468
|
- tmp_checkSwVer[len]=10;
|
|
|
|
4469
|
- tmp_checkSwVer[len+1]='\0';*/
|
|
|
|
4470
|
-
|
|
|
|
4471
|
- if (strncmp(a_v2cnf.BUILD_DISP_ID,g_sMetaComm.check_sw_ver,len) != 0 )
|
3894
|
+
|
|
|
|
3895
|
+ /* strcpy(tmp_checkSwVer,g_sMetaComm.check_sw_ver);
|
|
|
|
3896
|
+
|
|
|
|
3897
|
+ tmp_checkSwVer[len]=10;
|
|
|
|
3898
|
+ tmp_checkSwVer[len+1]='\0';*/
|
|
|
|
3899
|
+
|
|
|
|
3900
|
+ if (strncmp(a_v2cnf.BUILD_DISP_ID,g_sMetaComm.check_sw_ver,len) != 0 )
|
|
4472
|
{
|
3901
|
{
|
|
4473
|
- UpdateUIMsg("Version number is wrong");
|
3902
|
+ UpdateUIMsg("Version number is wrong");
|
|
4474
|
bAnyOperationFail = true;
|
3903
|
bAnyOperationFail = true;
|
|
4475
|
}
|
3904
|
}
|
|
4476
|
else
|
3905
|
else
|
|
4477
|
{
|
3906
|
{
|
|
4478
|
- UpdateUIMsg("Version number OK!");
|
3907
|
+ UpdateUIMsg("Version number OK!");
|
|
4479
|
}
|
3908
|
}
|
|
4480
|
|
3909
|
|
|
4481
|
int testLen=strlen(a_v2cnf.BUILD_DISP_ID)-1;
|
3910
|
int testLen=strlen(a_v2cnf.BUILD_DISP_ID)-1;
|
|
4482
|
memset(tmp_checkSwVer,0x0,sizeof(tmp_checkSwVer));
|
3911
|
memset(tmp_checkSwVer,0x0,sizeof(tmp_checkSwVer));
|
|
4483
|
strncpy(tmp_checkSwVer,a_v2cnf.BUILD_DISP_ID,testLen);
|
3912
|
strncpy(tmp_checkSwVer,a_v2cnf.BUILD_DISP_ID,testLen);
|
|
4484
|
g_pMainDlg->myrslt_sw.Format(_T("%s"), tmp_checkSwVer);
|
3913
|
g_pMainDlg->myrslt_sw.Format(_T("%s"), tmp_checkSwVer);
|
|
4485
|
-
|
3914
|
+
|
|
4486
|
|
3915
|
|
|
4487
|
}
|
3916
|
}
|
|
4488
|
//if (strcmp(g_pMainDlg->myversion.GetBuffer(),a_v2cnf.))
|
3917
|
//if (strcmp(g_pMainDlg->myversion.GetBuffer(),a_v2cnf.))
|
|
4489
|
//{g_pMainDlg->myversion
|
3918
|
//{g_pMainDlg->myversion
|
|
4490
|
//}
|
3919
|
//}
|
|
4491
|
-
|
3920
|
+
|
|
4492
|
if (g_sMetaComm.bCheckQCFlag)
|
3921
|
if (g_sMetaComm.bCheckQCFlag)
|
|
4493
|
{
|
3922
|
{
|
|
4494
|
resultQC = REQ_ReadAP_NVRAM_QC();
|
3923
|
resultQC = REQ_ReadAP_NVRAM_QC();
|
|
@@ -4496,145 +3925,143 @@ void SmartPhoneSN::ThreadMainEntryPoint() |
|
@@ -4496,145 +3925,143 @@ void SmartPhoneSN::ThreadMainEntryPoint() |
|
4496
|
{
|
3925
|
{
|
|
4497
|
case 0:
|
3926
|
case 0:
|
|
4498
|
g_pMainDlg->myrslt_qc=_T("UnTested");
|
3927
|
g_pMainDlg->myrslt_qc=_T("UnTested");
|
|
4499
|
- UpdateUIMsg("QC untest");
|
3928
|
+ UpdateUIMsg("QC untest");
|
|
4500
|
bAnyOperationFail = true;
|
3929
|
bAnyOperationFail = true;
|
|
4501
|
break;
|
3930
|
break;
|
|
4502
|
case 1:
|
3931
|
case 1:
|
|
4503
|
g_pMainDlg->myrslt_qc=_T("PASS");
|
3932
|
g_pMainDlg->myrslt_qc=_T("PASS");
|
|
4504
|
- UpdateUIMsg("QC test pass");
|
3933
|
+ UpdateUIMsg("QC test pass");
|
|
4505
|
break;
|
3934
|
break;
|
|
4506
|
default:
|
3935
|
default:
|
|
4507
|
g_pMainDlg->myrslt_qc=_T("Fail");
|
3936
|
g_pMainDlg->myrslt_qc=_T("Fail");
|
|
4508
|
- UpdateUIMsg("QC test fail");
|
3937
|
+ UpdateUIMsg("QC test fail");
|
|
4509
|
bAnyOperationFail = true;
|
3938
|
bAnyOperationFail = true;
|
|
4510
|
break;
|
3939
|
break;
|
|
4511
|
}
|
3940
|
}
|
|
4512
|
|
3941
|
|
|
4513
|
}
|
3942
|
}
|
|
4514
|
- #endif
|
|
|
|
4515
|
- }
|
|
|
|
4516
|
-
|
|
|
|
4517
|
- //Special case: m_bWriteModemNvram = true && m_sMdInfo.number_of_md = 0
|
|
|
|
4518
|
- //So skip to load modem database
|
|
|
|
4519
|
- MTRACE (g_hEBOOT_DEBUG, "m_bWriteModemNvram = %d,m_sMdInfo.number_of_md = %d", m_bWriteModemNvram, m_sMdInfo.number_of_md);
|
|
|
|
4520
|
- if ((m_bWriteModemNvram == true || g_sMetaComm.bCheckCalFlag || g_sMetaComm.bCheckFtFlag) && m_sMdInfo.number_of_md >= 1)
|
|
|
|
4521
|
- {
|
|
|
|
4522
|
- UpdateUIMsg("Start switch to MD meta and init Modem database...");
|
|
|
|
4523
|
-
|
|
|
|
4524
|
-
|
|
|
|
4525
|
- if (!g_sMetaComm.sDBFileOption.bDBInitModem_1 && g_sMetaComm.sDBFileOption.bMDDBFromDUT)
|
|
|
|
4526
|
- {
|
|
|
|
4527
|
- MTRACE(g_hEBOOT_DEBUG, "SmartPhoneSN::GetMDDBFromDUT() : Get Modem DB from DUT start...");
|
|
|
|
4528
|
- SPMetaResult = GetMDDBFromDUT();
|
|
|
|
4529
|
- if (SPMetaResult != SPMETA_DLL::META_SUCCESS)
|
|
|
|
4530
|
- MTRACE(g_hEBOOT_DEBUG, "SmartPhoneSN::GetMDDBFromDUT() : fail, will try load config DB.");
|
|
|
|
4531
|
- else
|
|
|
|
4532
|
- MTRACE(g_hEBOOT_DEBUG, "SmartPhoneSN::GetMDDBFromDUT() : end.");
|
|
|
|
4533
|
- }
|
|
|
|
4534
|
-
|
|
|
|
4535
|
-
|
|
|
|
4536
|
- MTRACE(g_hEBOOT_DEBUG, "SmartPhoneSN::ApSwithToModemMeta_Ex(): Switch to MODEM meta from AP meta start...");
|
|
|
|
4537
|
- MetaResult = APSwithToModemMeta_Ex();
|
|
|
|
4538
|
- if (MetaResult != META_SUCCESS)
|
|
|
|
4539
|
- {
|
|
|
|
4540
|
- bAnyOperationFail = true;
|
|
|
|
4541
|
- MTRACE_ERR(g_hEBOOT_DEBUG, "SmartPhoneSN::ApSwithToModemMeta_Ex() : Switch to MODEM meta from AP meta fail.");
|
|
|
|
4542
|
- UpdateUIMsg("SmartPhoneSN::ApSwithToModemMeta_Ex() : Switch to MODEM meta from AP meta fail.");
|
|
|
|
4543
|
- goto End;
|
|
|
|
4544
|
- }
|
|
|
|
4545
|
- MTRACE(g_hEBOOT_DEBUG, "SmartPhoneSN::ApSwithToModemMeta_Ex(): end.");
|
|
|
|
4546
|
-
|
|
|
|
4547
|
- MTRACE(g_hEBOOT_DEBUG, "SmartPhoneSN::LoadModemDatabase(): start...");
|
|
|
|
4548
|
- MetaResult = LoadModemDatabase(0);
|
|
|
|
4549
|
- if (MetaResult != META_SUCCESS)
|
|
|
|
4550
|
- {
|
|
|
|
4551
|
- bAnyOperationFail = true;
|
|
|
|
4552
|
- MTRACE_ERR(g_hEBOOT_DEBUG, "SmartPhoneSN::LoadModemDatabase() : MetaResult = %s", ResultToString(MetaResult));
|
|
|
|
4553
|
- UpdateUIMsg("SmartPhoneSN::LoadModemDatabase() : MetaResult = %s", ResultToString(MetaResult));
|
|
|
|
4554
|
- goto End;
|
|
|
|
4555
|
- }
|
|
|
|
4556
|
- MTRACE(g_hEBOOT_DEBUG, "SmartPhoneSN::LoadModemDatabase(): end.");
|
|
|
|
4557
|
- }
|
|
|
|
4558
|
-
|
|
|
|
4559
|
- EnableStartBTN(false);
|
|
|
|
4560
|
- UpdateUIMsg("Start loop write data to nvram...");
|
|
|
|
4561
|
- MetaResult = WriteNvramLoop();
|
|
|
|
4562
|
- if (MetaResult != META_SUCCESS)
|
|
|
|
4563
|
- {
|
|
|
|
4564
|
- bAnyOperationFail = true;
|
|
|
|
4565
|
- goto End;
|
|
|
|
4566
|
- }
|
|
|
|
4567
|
-
|
|
|
|
4568
|
-End:
|
|
|
|
4569
|
- if (m_bStopBeforeUSBInsert == true)
|
|
|
|
4570
|
- {
|
|
|
|
4571
|
- UpdateUIMsg("...");
|
|
|
|
4572
|
- }
|
|
|
|
4573
|
- else
|
|
|
|
4574
|
- {
|
|
|
|
4575
|
- if (m_eMetaMode == SP_AP_META || m_eMetaMode == SP_AP2MD_FAIL)
|
|
|
|
4576
|
- {
|
|
|
|
4577
|
- ExitAPMetaMode();
|
|
|
|
4578
|
- }
|
|
|
|
4579
|
- else if (m_eMetaMode == SP_MODEM_META || m_eMetaMode == SP_MD2AP_FAIL)
|
|
|
|
4580
|
- {
|
|
|
|
4581
|
- ExitSPModemMeta();
|
|
|
|
4582
|
- }
|
|
|
|
4583
|
-
|
|
|
|
4584
|
- //The backup nvram api return success, but the operator pull up usb cable immediately before all operation successfully.
|
|
|
|
4585
|
- //This case will cause nvram data lose when firmware upgrate, so that put indicator turn green after exit meta.
|
|
|
|
4586
|
- if (g_sMetaComm.bCheckFastbootLock && m_bBackupNvramSuccess && !bAnyOperationFail)
|
|
|
|
4587
|
- {
|
|
|
|
4588
|
- if (REQ_FastbootLockOem() == -1)
|
|
|
|
4589
|
- {
|
|
|
|
4590
|
- bAnyOperationFail = true;
|
|
|
|
4591
|
- UpdateUIMsg("ERROR!! REQ_FastbootLockOem()");
|
|
|
|
4592
|
- }
|
|
|
|
4593
|
- }
|
|
|
|
4594
|
-
|
|
|
|
4595
|
- if (bAnyOperationFail)
|
|
|
|
4596
|
- {
|
|
|
|
4597
|
-// m_Process->SendMessage(PBM_SETBARCOLOR, 0, RGB(255, 0, 0));
|
|
|
|
4598
|
- UpdateUICountResult(FAIL);
|
|
|
|
4599
|
- }
|
|
|
|
4600
|
- else
|
|
|
|
4601
|
- {
|
|
|
|
4602
|
- UpdateUIMsg("All Operate successfully!!");
|
|
|
|
4603
|
- MTRACE(g_hEBOOT_DEBUG, "SmartPhoneSN::All Operate successfully!!");
|
|
|
|
4604
|
-
|
|
|
|
4605
|
-#ifdef _AUTO_GEN_FEATURE_
|
|
|
|
4606
|
- if (g_AutoGenData.bEnableAutoGen)
|
|
|
|
4607
|
- {
|
|
|
|
4608
|
- UpdateAutoGenParaToSetupFile();
|
|
|
|
4609
|
- }
|
|
|
|
4610
|
#endif
|
3943
|
#endif
|
|
4611
|
- UpdateUICountResult(PASS);
|
|
|
|
4612
|
- }
|
|
|
|
4613
|
-
|
|
|
|
4614
|
- }
|
|
|
|
4615
|
-
|
|
|
|
4616
|
- EnableStartBTN(true);
|
|
|
|
4617
|
- if (g_sMetaComm.sWriteOption.bWriteDrm)
|
|
|
|
4618
|
- {
|
|
|
|
4619
|
- *m_pMetaStopFlag = BOOT_STOP;
|
|
|
|
4620
|
- }
|
|
|
|
4621
|
- MTRACE(g_hEBOOT_DEBUG, "------------------------------------ END --------------------------------------");
|
|
|
|
4622
|
- DebugOnOff(false);
|
|
|
|
4623
|
- Sleep(1000);
|
|
|
|
4624
|
- }
|
|
|
|
4625
|
-
|
3944
|
+ }
|
|
|
|
3945
|
+
|
|
|
|
3946
|
+ //Special case: m_bWriteModemNvram = true && m_sMdInfo.number_of_md = 0
|
|
|
|
3947
|
+ //So skip to load modem database
|
|
|
|
3948
|
+ MTRACE (g_hEBOOT_DEBUG, "m_bWriteModemNvram = %d,m_sMdInfo.number_of_md = %d", m_bWriteModemNvram, m_sMdInfo.number_of_md);
|
|
|
|
3949
|
+ if ((m_bWriteModemNvram == true || g_sMetaComm.bCheckCalFlag || g_sMetaComm.bCheckFtFlag) && m_sMdInfo.number_of_md >= 1)
|
|
|
|
3950
|
+ {
|
|
|
|
3951
|
+ UpdateUIMsg("Start switch to MD meta and init Modem database...");
|
|
|
|
3952
|
+
|
|
|
|
3953
|
+
|
|
|
|
3954
|
+ if (!g_sMetaComm.sDBFileOption.bDBInitModem_1 && g_sMetaComm.sDBFileOption.bMDDBFromDUT)
|
|
|
|
3955
|
+ {
|
|
|
|
3956
|
+ MTRACE(g_hEBOOT_DEBUG, "SmartPhoneSN::GetMDDBFromDUT() : Get Modem DB from DUT start...");
|
|
|
|
3957
|
+ SPMetaResult = GetMDDBFromDUT();
|
|
|
|
3958
|
+ if (SPMetaResult != SPMETA_DLL::META_SUCCESS)
|
|
|
|
3959
|
+ MTRACE(g_hEBOOT_DEBUG, "SmartPhoneSN::GetMDDBFromDUT() : fail, will try load config DB.");
|
|
|
|
3960
|
+ else
|
|
|
|
3961
|
+ MTRACE(g_hEBOOT_DEBUG, "SmartPhoneSN::GetMDDBFromDUT() : end.");
|
|
|
|
3962
|
+ }
|
|
|
|
3963
|
+
|
|
|
|
3964
|
+
|
|
|
|
3965
|
+ MTRACE(g_hEBOOT_DEBUG, "SmartPhoneSN::ApSwithToModemMeta_Ex(): Switch to MODEM meta from AP meta start...");
|
|
|
|
3966
|
+ MetaResult = APSwithToModemMeta_Ex();
|
|
|
|
3967
|
+ if (MetaResult != META_SUCCESS)
|
|
|
|
3968
|
+ {
|
|
|
|
3969
|
+ bAnyOperationFail = true;
|
|
|
|
3970
|
+ MTRACE_ERR(g_hEBOOT_DEBUG, "SmartPhoneSN::ApSwithToModemMeta_Ex() : Switch to MODEM meta from AP meta fail.");
|
|
|
|
3971
|
+ UpdateUIMsg("SmartPhoneSN::ApSwithToModemMeta_Ex() : Switch to MODEM meta from AP meta fail.");
|
|
|
|
3972
|
+ goto End;
|
|
|
|
3973
|
+ }
|
|
|
|
3974
|
+ MTRACE(g_hEBOOT_DEBUG, "SmartPhoneSN::ApSwithToModemMeta_Ex(): end.");
|
|
|
|
3975
|
+
|
|
|
|
3976
|
+ MTRACE(g_hEBOOT_DEBUG, "SmartPhoneSN::LoadModemDatabase(): start...");
|
|
|
|
3977
|
+ MetaResult = LoadModemDatabase(0);
|
|
|
|
3978
|
+ if (MetaResult != META_SUCCESS)
|
|
|
|
3979
|
+ {
|
|
|
|
3980
|
+ bAnyOperationFail = true;
|
|
|
|
3981
|
+ MTRACE_ERR(g_hEBOOT_DEBUG, "SmartPhoneSN::LoadModemDatabase() : MetaResult = %s", ResultToString(MetaResult));
|
|
|
|
3982
|
+ UpdateUIMsg("SmartPhoneSN::LoadModemDatabase() : MetaResult = %s", ResultToString(MetaResult));
|
|
|
|
3983
|
+ goto End;
|
|
|
|
3984
|
+ }
|
|
|
|
3985
|
+ MTRACE(g_hEBOOT_DEBUG, "SmartPhoneSN::LoadModemDatabase(): end.");
|
|
|
|
3986
|
+ }
|
|
|
|
3987
|
+
|
|
|
|
3988
|
+ EnableStartBTN(false);
|
|
|
|
3989
|
+ UpdateUIMsg("Start loop write data to nvram...");
|
|
|
|
3990
|
+ MetaResult = WriteNvramLoop();
|
|
|
|
3991
|
+ if (MetaResult != META_SUCCESS)
|
|
|
|
3992
|
+ {
|
|
|
|
3993
|
+ bAnyOperationFail = true;
|
|
|
|
3994
|
+ goto End;
|
|
|
|
3995
|
+ }
|
|
|
|
3996
|
+
|
|
|
|
3997
|
+End:
|
|
|
|
3998
|
+ if (m_bStopBeforeUSBInsert == true)
|
|
|
|
3999
|
+ {
|
|
|
|
4000
|
+ UpdateUIMsg("...");
|
|
|
|
4001
|
+ }
|
|
|
|
4002
|
+ else
|
|
|
|
4003
|
+ {
|
|
|
|
4004
|
+ if (m_eMetaMode == SP_AP_META || m_eMetaMode == SP_AP2MD_FAIL)
|
|
|
|
4005
|
+ {
|
|
|
|
4006
|
+ ExitAPMetaMode();
|
|
|
|
4007
|
+ }
|
|
|
|
4008
|
+ else if (m_eMetaMode == SP_MODEM_META || m_eMetaMode == SP_MD2AP_FAIL)
|
|
|
|
4009
|
+ {
|
|
|
|
4010
|
+ ExitSPModemMeta();
|
|
|
|
4011
|
+ }
|
|
|
|
4012
|
+
|
|
|
|
4013
|
+ //The backup nvram api return success, but the operator pull up usb cable immediately before all operation successfully.
|
|
|
|
4014
|
+ //This case will cause nvram data lose when firmware upgrate, so that put indicator turn green after exit meta.
|
|
|
|
4015
|
+ if (g_sMetaComm.bCheckFastbootLock && m_bBackupNvramSuccess && !bAnyOperationFail)
|
|
|
|
4016
|
+ {
|
|
|
|
4017
|
+ if (REQ_FastbootLockOem() == -1)
|
|
|
|
4018
|
+ {
|
|
|
|
4019
|
+ bAnyOperationFail = true;
|
|
|
|
4020
|
+ UpdateUIMsg("ERROR!! REQ_FastbootLockOem()");
|
|
|
|
4021
|
+ }
|
|
|
|
4022
|
+ }
|
|
|
|
4023
|
+
|
|
|
|
4024
|
+ if (bAnyOperationFail)
|
|
|
|
4025
|
+ {
|
|
|
|
4026
|
+ // m_Process->SendMessage(PBM_SETBARCOLOR, 0, RGB(255, 0, 0));
|
|
|
|
4027
|
+ UpdateUICountResult(FAIL);
|
|
|
|
4028
|
+ }
|
|
|
|
4029
|
+ else
|
|
|
|
4030
|
+ {
|
|
|
|
4031
|
+ UpdateUIMsg("All Operate successfully!!");
|
|
|
|
4032
|
+ MTRACE(g_hEBOOT_DEBUG, "SmartPhoneSN::All Operate successfully!!");
|
|
|
|
4033
|
+
|
|
|
|
4034
|
+ #ifdef _AUTO_GEN_FEATURE_
|
|
|
|
4035
|
+ if (g_AutoGenData.bEnableAutoGen)
|
|
|
|
4036
|
+ UpdateAutoGenParaToSetupFile();
|
|
|
|
4037
|
+ #endif
|
|
|
|
4038
|
+ UpdateUICountResult(PASS);
|
|
|
|
4039
|
+ }
|
|
|
|
4040
|
+
|
|
|
|
4041
|
+ }
|
|
|
|
4042
|
+
|
|
|
|
4043
|
+ EnableStartBTN(true);
|
|
|
|
4044
|
+ if (g_sMetaComm.sWriteOption.bWriteDrm)
|
|
|
|
4045
|
+ {
|
|
|
|
4046
|
+ *m_pMetaStopFlag = BOOT_STOP;
|
|
|
|
4047
|
+ }
|
|
|
|
4048
|
+ MTRACE(g_hEBOOT_DEBUG, "------------------------------------ END --------------------------------------");
|
|
|
|
4049
|
+ DebugOnOff(false);
|
|
|
|
4050
|
+ Sleep(1000);
|
|
|
|
4051
|
+
|
|
|
|
4052
|
+
|
|
4626
|
if (g_sMetaComm.bCheckFastbootLock)
|
4053
|
if (g_sMetaComm.bCheckFastbootLock)
|
|
4627
|
{
|
4054
|
{
|
|
4628
|
Adb_Manager_Deinit();
|
4055
|
Adb_Manager_Deinit();
|
|
4629
|
}
|
4056
|
}
|
|
4630
|
g_sMetaComm.sWriteOption.bWriteBarcode = bWriteBarcode;
|
4057
|
g_sMetaComm.sWriteOption.bWriteBarcode = bWriteBarcode;
|
|
4631
|
g_sMetaComm.sWriteOption.bWriteIMEI = bWriteIMEI;
|
4058
|
g_sMetaComm.sWriteOption.bWriteIMEI = bWriteIMEI;
|
|
4632
|
-
|
4059
|
+
|
|
4633
|
if (g_sMetaComm.bSwithTool)
|
4060
|
if (g_sMetaComm.bSwithTool)
|
|
4634
|
DisableUSBSwitch();
|
4061
|
DisableUSBSwitch();
|
|
4635
|
-
|
4062
|
+
|
|
4636
|
MetaHandle_DeInit();
|
4063
|
MetaHandle_DeInit();
|
|
4637
|
- UpdateMainDlgUI(true, CANCEL);
|
4064
|
+
|
|
4638
|
}
|
4065
|
}
|
|
4639
|
|
4066
|
|
|
4640
|
bool SmartPhoneSN::Adb_Manager_Init()
|
4067
|
bool SmartPhoneSN::Adb_Manager_Init()
|