Showing
1 changed file
with
32 additions
and
3 deletions
| ... | ... | @@ -221,10 +221,25 @@ META_RESULT SmartPhoneSN::WriteNvramLoop() |
| 221 | 221 | char tmpBuf2[20] = {0}; |
| 222 | 222 | iRet = REQ_ReadModem_NVRAM_Start(WRITE_IMEI, tmpBuf1, 1); |
| 223 | 223 | iRet2 = REQ_ReadModem_NVRAM_Start(WRITE_IMEI, tmpBuf2, 2); |
| 224 | + | |
| 225 | + | |
| 224 | 226 | if (iRet == META_SUCCESS || iRet2 == META_SUCCESS) |
| 225 | 227 | { |
| 226 | - memset(a_imei_ary,0,sizeof(int)*16); | |
| 227 | 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 | + | |
| 228 | 243 | a_imei_ary[0] = (byte)(tmpBuf1[0])%16; |
| 229 | 244 | a_imei_ary[1] = (byte)(tmpBuf1[0])/16; |
| 230 | 245 | a_imei_ary[2] = (byte)(tmpBuf1[1])%16; |
| ... | ... | @@ -265,9 +280,23 @@ META_RESULT SmartPhoneSN::WriteNvramLoop() |
| 265 | 280 | a_imei_ary2[5],a_imei_ary2[6],a_imei_ary2[7],a_imei_ary2[8],a_imei_ary2[9], |
| 266 | 281 | a_imei_ary2[10],a_imei_ary2[11],a_imei_ary2[12],a_imei_ary2[13],a_imei_ary2[14] |
| 267 | 282 | ); |
| 283 | + /* for(int i=0;i<14;i++) | |
| 284 | + { | |
| 285 | + | |
| 286 | + | |
| 287 | + }*/ | |
| 288 | + | |
| 289 | + //g_pMainDlg->myrslt_imei= _T("PASS"); | |
| 268 | 290 | |
| 269 | - //g_pMainDlg->myrslt_imei= _T("PASS"); | |
| 270 | - UpdateUIMsg("IMEI read successfully "+str_imei); | |
| 291 | + if(iRet ||iRet2) | |
| 292 | + { | |
| 293 | + UpdateUIMsg("IMEI read successfully "+str_imei); | |
| 294 | + } | |
| 295 | + else | |
| 296 | + { | |
| 297 | + UpdateUIMsg("IMEI failed to read"); | |
| 298 | + } | |
| 299 | + | |
| 271 | 300 | spNextStage = SP_END_STAGE; |
| 272 | 301 | } |
| 273 | 302 | else | ... | ... |
Please
register
or
login
to post a comment