×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Sep 2005
    Location
    Porto Alegre city, Brazil
    Posts
    13

    What´s wrong with the code - Get Cellid

    Hi,
    I want to Get Cellid. I have the code below for Get Cellid:

    #include "CellidAppUi.h"
    #include "CellidContainer.h"
    #include <cellid.rsg>
    #include "cellid.hrh"
    #include "etel.h"
    #include "etelbgsm.h"
    #include <avkon.hrh>
    void CCellidAppUi::ConstructL()
    {
    BaseConstructL();
    iAppContainer = new (ELeave) CCellidContainer;
    iAppContainer->SetMopParent( this );
    iAppContainer->ConstructL( ClientRect() );
    AddToStackL( iAppContainer );
    }
    CCellidAppUi::~CCellidAppUi()
    {
    if (iAppContainer)
    {
    RemoveFromStack( iAppContainer );
    delete iAppContainer;
    }
    }
    void CCellidAppUi:ynInitMenuPaneL(
    TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/)
    {
    }
    TKeyResponse CCellidAppUi::HandleKeyEventL(
    const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/)
    {
    return EKeyWasNotConsumed;
    }

    void CCellidAppUi::HandleCommandL(TInt aCommand)
    {
    switch ( aCommand )
    {
    case EAknSoftkeyBack:
    case EEikCmdExit:
    {
    Exit();
    break;
    }
    case EcellidCmdAppTest:
    {
    RBasicGsmPhone phone;
    RTelServer server;
    User::LeaveIfError(server.Connect());
    // load phone profile
    User::LeaveIfError(server.LoadPhoneModule(_L("phonetsy.tsy")));
    // initialize phone object
    RTelServer::TPhoneInfo info;
    User::LeaveIfError(server.GetPhoneInfo(0, info));
    User::LeaveIfError(phone.Open(server, info.iName));
    MBasicGsmPhoneNetwork::TCurrentNetworkInfo ni;
    User::LeaveIfError(phone.GetCurrentNetworkInfo(ni));

    TInt in = ni.iCellId;
    TInt lac = ni.iLocationAreaCode;
    /// sinal
    TInt32 st;
    TInt strengh;
    phone.GetSignalStrength(st);
    strengh = st;
    /// numero de redes
    TInt numnet = 0;
    numnet = phone.EnumerateDetectedNetworks(numnet);
    /// nome da operadora
    MBasicGsmPhoneNetwork::TNetworkInfo aNetworkInfo;
    TInt netw = phone.GetDetectedNetworkInfo(0, aNetworkInfo);
    MBasicGsmPhoneNetwork::TNetworkInfo aNetworkInfo;
    TBuf<16> PosBuf1;
    PosBuf1.Num (in);
    TBuf<16> PosBuf;
    PosBuf.Num (lac);

    TBuf<16> PosBuf2;
    PosBuf2.Num (strengh);
    /*
    TBuf<16> PosBuf3;
    PosBuf3.Num (_L("numnet"));
    */

    iAppContainer->set(PosBuf1, PosBuf, PosBuf2, _L("numnet"), aNetworkInfo.iLongName );

    // iEikonEnv->InfoMsg(_L("test"));
    break;
    }
    // TODO: Add Your command handling code here

    default:
    break;
    }
    }

    // End of File


    However, The code above when compiled show the following Error menssage:

    Warning : tool exit status == 1

    Error : redeclaration of `class MBasicGsmPhoneNetwork::TNetworkInfo aNetworkInfo'
    CELLIDAPPUI.cpp line 134

    Error : `class MBasicGsmPhoneNetwork::TNetworkInfo aNetworkInfo' previously declared here
    CELLIDAPPUI.cpp line 130

    Warning : unused variable `TInt netw'
    CELLIDAPPUI.cpp line 131

    Error : Compile failed

    Could not find or load the file "GSMBAS.LIB" for target "THUMB UDEB" for project "cellid.mcp".
    ---------------------------------
    I don´t get understand these menssages.

    I use:

    IDE - CodeWarrior
    SDK - series60 S60_2nd_FP3
    Plataform Selection - THUMB

    Can you help me?

    Thanks,
    Léo

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    393

    Re: What´s wrong with the code - Get Cellid

    Hi,

    Use CTelephony for network information that is supported partially some Series 60 2nd FP2 devices and most Series 60 2nd FP3 devices and definitely on the upcoming Series 60 3rd Ed. devices.

    The class you are using is an internal Symbian class.

    Regards,
    Nitin

  3. #3
    Registered User
    Join Date
    Jun 2005
    Posts
    1

    Re: What´s wrong with the code - Get Cellid

    Hi Leo

    What is our target device? If Symbian 7.0 or earlier version device read this:
    http://www.cs.helsinki.fi/u/mraento/symbian/cellid.html

Similar Threads

  1. Operator logo doesn't get saved. Wrong operator code?
    By Nokia_Archive in forum Smart Messaging
    Replies: 3
    Last Post: 2006-10-05, 11:30
  2. Replies: 0
    Last Post: 2003-08-20, 13:13
  3. 3650 Security Code
    By JMNiemi in forum Symbian
    Replies: 0
    Last Post: 2003-06-25, 16:45
  4. Progress bars: what's wrong with my code?
    By bobline in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2003-05-29, 18:10
  5. Replies: 0
    Last Post: 2003-02-24, 04:00

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×