|
請問一下各位神人~
小弟有2個問題
第一:想用SimSetLockingStatus這支function,他的參數dwLockingFacility其中2個值的意義
SIM_LOCKFACILITY_PH_SIM, SIM_LOCKFACILITY_SIM差別在哪裡呢?
第二:小弟想寫一個可以輸入且驗證SIM卡的PIN1值, 前提是我有設SIM卡密碼為0000, 手機本身的密碼為1129, 並且都有enable
code如下~但是會有問題
TCHAR aaa[4] = {'0', '0', '0','0'}; // SIM PIN
TCHAR bbb[4] = {'1', '1', '2','9'}; // device PW
BOOL bActivate = TRUE;
SIMLOCKINGPWDLENGTH g_simlength;
memset(&g_simlength, 0, sizeof(SIMLOCKINGPWDLENGTH));
g_simlength.dwFacility = SIM_LOCKFACILITY_SIM;
g_simlength.dwPasswordLength = 4;
if (g_simlength.dwFacility == SIM_LOCKFACILITY_SIM)
{
SimInitialize(SIM_INIT_NONE, NULL, 0, &g_hSim);
SimSetLockingStatus(g_hSim, g_simlength.dwFacility, aaa, bActivate) ;
SimGetPhoneLockedState(g_hSim, &g_simlength.dwFacility);
SimUnlockPhone(g_hSim, aaa, NULL);
}
else if (SIM_LOCKFACILITY_PH_SIM)
{
SimInitialize(SIM_INIT_NONE, NULL, 0, &g_hSim);
SimSetLockingStatus(g_hSim, g_simlength.dwFacility, bbb, bActivate) ;
SimGetPhoneLockedState(g_hSim, &g_simlength.dwFacility);
SimUnlockPhone(g_hSim, bbb, NULL);
}
//當g_simlength.dwFacility = SIM_LOCKFACILITY_SIM時,執行到SimUnlockPhone時會回傳Unspecified error
//當g_simlength.dwFacility = SIM_LOCKFACILITY_SIM時,執行到SimSetLockingStatus與SimUnlockPhone時會回傳Unspecified error
|
|