Network info from 9500 (Series 80)
| Fri, 2005-08-12 09:50 | |
|
Has anyone solved how to get Network operator's name out from Series 80? CTelephony::GetCurrentNetworkInfo() totaly freezes my phone (although I can get IMSI value with CTelephony). RBasicGsmPhone that I use for Series 60 doesn't work in Series 80 ![]() "I only know that I know nothing." (Socrates) |
|







Forum posts: 37
I'm also working on the same program... I need to retrieve the IMSI number... U said that u've done it using the CTelephony API.
Can u please post a code snippet to tell me how u did this???
This would be a lot of help to us!!!
Thanks...
Ashwin...
The Cruise is on...
Forum posts: 214
class CIMSI : public CActive
{
public:
CIMSI();
// Construction
void ConstructL();
// Destruction
~CIMSI();
static CIMSI* NewL();
// Issue request: retrieve IMSI
void GetIMSI(TRequestStatus &aStatus); // MOD: now passes a request object
// Cancel request
void DoCancel();
// Service completed request
void RunL();
// MOD: IsRetrieved() is no longer needed
//TBool IsRetrieved() { return iRetrieved;}
private:
CTelephony* iTelephony; // telephony object we own
CTelephony::TSubscriberIdV1 iV1;
CTelephony::TSubscriberIdV1Pckg * iPkg;
//MOD: Removed iRetrieved member, added pointer to request status object
//TBool iRetrieved;
TRequestStatus *iIMSIStatus;
public:
TBuf<30> retrievedIMSI;
};
//code
CIMSI::CIMSI() : CActive(EPriorityStandard)
{
// iRetrieved = EFalse; // MOD: No longer needed
}
CIMSI* CIMSI::NewL()
{
CIMSI* self =new(ELeave) CIMSI();
CleanupStack::PushL(self);
self->ConstructL();
CleanupStack::Pop(self);
return self;
}
void CIMSI::ConstructL()
{
iPkg = new (ELeave) CTelephony::TSubscriberIdV1Pckg(iV1);
iTelephony = CTelephony::NewL();
CActiveScheduler::Add(this);
}
CIMSI::~CIMSI()
{
Cancel(); // if any request outstanding, calls DoCancel() to cleanup
delete iTelephony;
delete iPkg;
}
void CIMSI::GetIMSI(TRequestStatus& aStatus)
{
aStatus=KRequestPending; // MOD: Set status to pending
iIMSIStatus = &aStatus; // MOD: Save pointer to requeststatus object
iTelephony->GetSubscriberId(iStatus, *iPkg );
//iTelephony->GetPhoneId( iStatus, *iPkg );
SetActive();
CActiveScheduler::Start();
}
void CIMSI::RunL()
{
if ( (iStatus == KErrNone) )
{
retrievedIMSI = (*iPkg)().iSubscriberId; // Read IMSI from package buffer
}
CActiveScheduler::Stop();
User::RequestComplete(iIMSIStatus,iStatus.Int());
}
void CIMSI::DoCancel()
{
Cancel();
}
//implement
CIMSI* IMSI = CIMSI::NewL();
TRequestStatus status;
IMSI->GetIMSI(status);
User::WaitForRequest(status);
if (status==KErrNone)
aIMSI.Copy(IMSI->retrievedIMSI);
delete IMSI;
"I only know that I know nothing." (Socrates)
Forum posts: 25
how did u solve it?
any clue..
regards,
-Rx-lee
Forum posts: 214
"I only know that I know nothing." (Socrates)
Forum posts: 25
i use CTelephony
- GetCurrentNetworkName --> return blank
- GetOperatorName --> return blank
- GetCurrentNetworkInfo --> my phone freeze
can u post me snippet of ur codes?
Thanks,
Rx-lee
Forum posts: 214
"I only know that I know nothing." (Socrates)
Forum posts: 25
what i ask is have you solved to get network operator's name (coz i still get my phone freeze)? and if you have, how? can u post some snippet of ur codes?