Showing
1 changed file
with
24 additions
and
22 deletions
| ... | ... | @@ -219,24 +219,35 @@ META_RESULT SmartPhoneSN::WriteNvramLoop() |
| 219 | 219 | int a_imei_ary2[16]; |
| 220 | 220 | char tmpBuf1[20] = {0}; |
| 221 | 221 | char tmpBuf2[20] = {0}; |
| 222 | + | |
| 222 | 223 | iRet = REQ_ReadModem_NVRAM_Start(WRITE_IMEI, tmpBuf1, 1); |
| 223 | 224 | iRet2 = REQ_ReadModem_NVRAM_Start(WRITE_IMEI, tmpBuf2, 2); |
| 224 | 225 | |
| 225 | - | |
| 226 | + if(tmpBuf1[0]== -1) | |
| 227 | + { | |
| 228 | + iRet = META_FAILED; | |
| 229 | + | |
| 230 | + } | |
| 231 | + | |
| 232 | + if(tmpBuf2[0]== -1) | |
| 233 | + { | |
| 234 | + iRet2 =META_FAILED; | |
| 235 | + } | |
| 236 | + | |
| 237 | + if (iRet == META_SUCCESS || iRet2 == META_SUCCESS) | |
| 238 | + { | |
| 239 | + UpdateUIMsg("IMEI read successfully "+str_imei); | |
| 240 | + } | |
| 241 | + else | |
| 242 | + { | |
| 243 | + UpdateUIMsg("IMEI failed to read"); | |
| 244 | + } | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 226 | 248 | if (iRet == META_SUCCESS || iRet2 == META_SUCCESS) |
| 227 | 249 | { |
| 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 | - | |
| 250 | + | |
| 240 | 251 | memset(a_imei_ary,0,sizeof(int)*16); |
| 241 | 252 | memset(a_imei_ary2,0,sizeof(int)*16); |
| 242 | 253 | |
| ... | ... | @@ -287,15 +298,6 @@ META_RESULT SmartPhoneSN::WriteNvramLoop() |
| 287 | 298 | }*/ |
| 288 | 299 | |
| 289 | 300 | //g_pMainDlg->myrslt_imei= _T("PASS"); |
| 290 | - | |
| 291 | - if (iRet == META_SUCCESS || iRet2 == META_SUCCESS) | |
| 292 | - { | |
| 293 | - UpdateUIMsg("IMEI read successfully "+str_imei); | |
| 294 | - } | |
| 295 | - else | |
| 296 | - { | |
| 297 | - UpdateUIMsg("IMEI failed to read"); | |
| 298 | - } | |
| 299 | 301 | |
| 300 | 302 | spNextStage = SP_END_STAGE; |
| 301 | 303 | } | ... | ... |
Please
register
or
login
to post a comment