請問一下各位神人~
小弟有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
1 代码中的问题:
aaa bbb 的长度不够 应该是5,因为SimSetLockingStatus需要的参数是LPTSTR 应该是以\0结尾的字符串;
TCHAR *aaa = L"0000";TCHAR *bbb = L"1129";
2 我觉得 SIM_LOCKFACILITY_PH_SIM 要用的并不是设备的密码,应为设备的密码是独立也SIM的。因为设备的LAP可以扩展,系统的其他部分并不能取得这个密码。
3. SIM_LOCKFACILITY_PH_SIM 和 SIM_LOCKFACILITY_SIM的差异我也不明白,下面是我的理解
SIM_LOCKFACILITY_PH_SIM 是Lock phone to SIM card,不是将SIM锁定到这个设备呀。
SIM_LOCKFACILITY_SIM 是 Lock SIM card,是设置SIM锁。
要不你到Windows Mobile版在问问
SIM_LOCKFACILITY_PH_SIM 是Lock phone to SIM card,是不是将SIM锁定到这个设备呀。