Read-only archive of the All About Symbian forum (2001–2013) · About this archive

LogEngine + Network problem!

0 replies · 1,388 views · Started 21 January 2005

Hello there. I'm trying to run this piece of code:

TInt aMcc, aMnc, aLocation, aCellId;

TInt enumphone = 1;
RTelServer server;
RBasicGsmPhone phone;
RTelServer::TPhoneInfo info;
MBasicGsmPhoneNetwork::TCurrentNetworkInfo NetworkInfo;
TRequestStatus lStatus;
TInt32 lSignal;

User::LeaveIfError(server.Connect());
CleanupClosePushL(server);
User::LeaveIfError(server.LoadPhoneModule(_L("Phonetsy.tsy"😉));

if (enumphone < 1)
{
User::Leave(KErrNotFound);
}
User::LeaveIfError(server.GetPhoneInfo(0, info));

User::LeaveIfError(phone.Open(server, info.iName));
CleanupClosePushL(phone);

User::LeaveIfError(phone.GetCurrentNetworkInfo(NetworkInfo));

//Get network info
aMcc = NetworkInfo.iNetworkInfo.iId.iMCC;
aMnc = NetworkInfo.iNetworkInfo.iId.iMNC;
aLocation = NetworkInfo.iLocationAreaCode;
aCellId = NetworkInfo.iCellId;

phone.GetSignalStrength(lStatus, lSignal);

CleanupStack::PopAndDestroy(2);//server,phone

//Write network info into file
Log((TUint)aCellId);
Log(_L8("Mcc: "😉);Log((TUint)aMcc);
Log(_L8("\nMnc: "😉);Log((TUint)aMnc);
Log(_L8("\nLocation: "😉);Log((TUint)aLocation);

Log(_L8("\nSignal Strength: "😉);Log((TUint)lSignal);

All works correctly when I use it into:
void CHelloWorldAppUi::HandleCommandL(TInt aCommand);
but when I put it into LogEngine. - class CLogEngine : public CTimer
in method RunL();

RunL(){
....
//This code
....
iBeginTime.HomeTime();
After(iInterval);
}

It compiles and it installs. In order to capture and type networks's parameters trough a period of time, it makes only ones and turns off incorrectly.
LogEngine working, when I just write a data into file, but not when I use Network connection. :con?