Hi,
I am getting null string while calling a method GetPhoneNumber().
Here is my code:
GetSimInfo(void){
result r;
int mnc;
int mcc;
bool isAvailable;
String spn;
String iccId;
String operatorName;
String phoneNumber;
SimType simType;
SimStateManager* pSimStateManager = new (std::nothrow) SimStateManager();
SimInfo simInfo;
SimState simState = SIM_STATE_UNKNOWN;
r = pSimStateManager->Construct();
r = pSimStateManager->SetSimEventListener(this);
r = pSimStateManager->GetSimInfo(simInfo);
simState = pSimStateManager->GetSimState();
AppLog("Sim State = %d",simState);
mnc = simInfo.GetMnc();
r = GetLastResult();
if(r == E_SUCCESS)
AppLog("MNC = %d", mnc);
mcc = simInfo.GetMcc();
r = GetLastResult();
if(r == E_SUCCESS)
AppLog("MCC = %d", mcc);
spn = simInfo.GetSpn();
r = GetLastResult();
if(r == E_SUCCESS)
AppLog("SPN = %S", spn.GetPointer());
iccId = simInfo.GetIccId();
r = GetLastResult();
if(r == E_SUCCESS)
AppLog("ICC Id = %S", iccId.GetPointer());
operatorName = simInfo.GetOperatorName();
r = GetLastResult();
if(r == E_SUCCESS)
AppLog("OperatorName = %S", operatorName.GetPointer());
isAvailable = simInfo.IsAvailable();
AppLog("isAvailable = %d", isAvailable);
simType = simInfo.GetSimType();
r = GetLastResult();
if(r == E_SUCCESS)
AppLog("Upendra--simType = %d", simType);
phoneNumber = simInfo.GetPhoneNumber();
r = GetLastResult();
if(r == E_SUCCESS)
AppLog("PhoneNumber = %S", phoneNumber.GetPointer());
}
Output for "OperatorName" and "PhoneNumber " is null rest all are working fine.
isAvailable = 1 and simState =3, SIM is available and state is also ready.But i do not know why OperatorName and PhoneNumber is null string. please guide me.
Thanks
Upendra