欢迎来到Doc100.Net免费学习资源知识分享平台!
您的位置:首页 > 程序异常 >

获取基站

更新时间: 2014-01-05 02:40:57 责任编辑: Author_N1

 

获取基站求助
CTelephony GetCurrentNetworkInfo 获取基站信息,为什么除了取出aCountryCode=460外其它的值如Cellid一直不成功.能力也应该给了

代码如下:
 .h

#ifndef MYTELEPHONY_H
#define MYTELEPHONY_H

#include <e32base.h>
#include <Etel3rdParty.h>


class CMyTelephony : public CActive
{
public:
static void GetIMSIL(TDes& aIMSI);
static void GetIMEIL(TDes& aIMEI);
static void GetPhoneType(TDes& aPhoneType);

static void GetNetworkInfo(TDes& aCountryCode, TDes& aNetworkId, TUint aLocationAreaCode, TUint aCellId);
//static void GetNetworkInfo(TUint aLocationAreaCode, TUint aCellId);

static void DialPhone(const TDesC& aPhoneId);
static CMyTelephony* NewL();
protected:

void DoCancel();
void RunL();

private:

static CMyTelephony* NewLC();
~CMyTelephony();
CMyTelephony();

void ConstructL();
void GetSubscriberId();
void GetCurrentNetworkInfo();
void GetPhoneId();

private:

CTelephony* iTelephony;
CTelephony::TCancellationRequest iRequest;
CTelephony::TSubscriberIdV1 iSubscriberId;
CTelephony::TSubscriberIdV1Pckg iSubscriberIdPckg;
CTelephony::TPhoneIdV1 iPhoneId;
CTelephony::TPhoneIdV1Pckg iPhoneIdPckg;
CTelephony::TCallId iCallId;
TBuf<32> iPhoneType;

CTelephony::TNetworkInfoV1 iNetworkInfoV1;
CTelephony::TNetworkInfoV1Pckg iNetworkInfoV1Pckg;


//RTimer iTimer; // Provides async timing service

public :
void DialNewCall(const TDesC& aTelNumber);
};

#endif // MYTELEPHONY_H


.cpp:
// MyTelephony.cpp
//
#include <e32svr.h>
#include "MyTelephony.h"
#include <f32file.h>



//class CTelephony;
CMyTelephony* CMyTelephony::NewLC()
{
CMyTelephony* self = new (ELeave) CMyTelephony;
CleanupStack::PushL(self);
self->ConstructL();
return self;
}

CMyTelephony* CMyTelephony::NewL()
{
CMyTelephony* self = CMyTelephony::NewLC();
CleanupStack::Pop(self);
return self;
}
void CMyTelephony::GetIMSIL(TDes& aIMSI)
{
CMyTelephony* telephony = CMyTelephony::NewL();
telephony->GetSubscriberId();
aIMSI = telephony->iSubscriberId.iSubscriberId;
delete telephony;
}

void CMyTelephony::GetIMEIL(TDes& aIMEI)
{
CMyTelephony* telephony = CMyTelephony::NewL();
telephony->GetPhoneId();
aIMEI = telephony->iPhoneId.iSerialNumber;
delete telephony;
}

void CMyTelephony::GetPhoneType(TDes& aPhoneType)
{
CMyTelephony* telephony = CMyTelephony::NewL();
telephony->GetPhoneId();
aPhoneType.Copy(telephony->iPhoneId.iManufacturer);
aPhoneType.Append(telephony->iPhoneId.iModel);
delete telephony;
}

void CMyTelephony::GetNetworkInfo(TDes& aCountryCode, TDes& aNetworkId, TUint aLocationAreaCode, TUint aCellId)
//void CMyTelephony::GetNetworkInfo(TUint aLocationAreaCode, TUint aCellId)
{
CMyTelephony* telephony = CMyTelephony::NewL();
telephony->GetCurrentNetworkInfo();
上一篇:上一篇
下一篇:下一篇

 

随机推荐程序问答结果

 

 

如对文章有任何疑问请提交到问题反馈,或者您对内容不满意,请您反馈给我们DOC100.NET论坛发贴求解。
DOC100.NET资源网,机器学习分类整理更新日期::2014-01-05 02:40:57
如需转载,请注明文章出处和来源网址:http://www.doc100.net/bugs/t/13124/
本文WWW.DOC100.NET DOC100.NET版权所有。