×

Discussion Board

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

    Question code SMS to send the information of the signal strength

    Hi,

    I have a code that he catches the Signal Strength and prints it in the screen of my cellular one. Now, I want to catch the value of the Signal Strength and to send a SMS with this information for another telephone. I needed to inside include the routines of sending of the SMS of my code of Signal Strength. Below he follows the code of the Signal Strength and the place where I want to include the routine of SMS sending:

    // INCLUDE FILES
    #include "CellidAppUi.h"
    #include "CellidContainer.h"
    #include <cellid.rsg>
    #include "cellid.hrh"
    #include "etel.h"
    #include "etelbgsm.h"
    #include <avkon.hrh>

    // ================= MEMBER FUNCTIONS =======================
    //
    // ----------------------------------------------------------
    // CCellidAppUi::ConstructL()
    //
    // ----------------------------------------------------------
    //
    void CCellidAppUi::ConstructL()
    {
    BaseConstructL();

    iAppContainer = new (ELeave) CCellidContainer;
    iAppContainer->SetMopParent( this );
    iAppContainer->ConstructL( ClientRect() );
    AddToStackL( iAppContainer );
    }

    // ----------------------------------------------------
    // CCellidAppUi::~CCellidAppUi()
    // Destructor
    // Frees reserved resources
    // ----------------------------------------------------
    //
    CCellidAppUi::~CCellidAppUi()
    {
    if (iAppContainer)
    {
    RemoveFromStack( iAppContainer );
    delete iAppContainer;
    }
    }

    // ------------------------------------------------------------------------------
    // CCellidAppUi:ynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane)
    // This function is called by the EIKON framework just before it displays
    // a menu pane. Its default implementation is empty, and by overriding it,
    // the application can set the state of menu items dynamically according
    // to the state of application data.
    // ------------------------------------------------------------------------------
    //
    void CCellidAppUi:ynInitMenuPaneL(
    TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/)
    {
    }

    // ----------------------------------------------------
    // CCellidAppUi::HandleKeyEventL(
    // const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
    // takes care of key event handling
    // ----------------------------------------------------
    //
    TKeyResponse CCellidAppUi::HandleKeyEventL(
    const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/)
    {
    return EKeyWasNotConsumed;
    }

    // ----------------------------------------------------
    // CCellidAppUi::HandleCommandL(TInt aCommand)
    // takes care of command handling
    // ----------------------------------------------------
    //
    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

    //alteração by leonardo 12/12/2005
    //MBasicGsmPhoneNetwork::TNetworkInfo aNetworkInfo;

    //TInt netw = phone.GetDetectedNetworkInfo(0, aNetworkInfo);

    //MBasicGsmPhoneNetwork::TNetworkInfo aNetworkInfo;
    // fim da alteração by leonardo


    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"));
    */

    //alteração by leonardo 12/12/2005
    //iAppContainer->set(PosBuf1, PosBuf, PosBuf2, _L("numnet"), aNetworkInfo.iLongName );
    // fim da alteração by leonardo

    // iEikonEnv->InfoMsg(_L("test"));

    break;
    }
    //**********************
    //To insert code SMS here
    //**********************
    default:
    break;
    }

    }

    // End of File


    Somebody can help me

    Thanks,
    Last edited by Léo; 2005-10-29 at 23:20.
    Léo

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: code SMS to send the information of the signal strentgh

    have you checked the SMS examples that can be downloaded in this forum ? they should get you nicely started with SMS sending. Also when you ahve questions of the functions with those examples, you could do a bit of searching here before posting them, since quite many problems with SMS sending is already discussed here plenty of many times.

    yucca

Similar Threads

  1. Can't send sms 6600(wma).SymbianOs error = -2
    By cumhur in forum Mobile Java General
    Replies: 0
    Last Post: 2005-03-24, 01:17
  2. Send SMS through VB application using nokia 8210, infra-red port
    By alvinyoong in forum General Messaging
    Replies: 4
    Last Post: 2005-01-27, 11:22
  3. Replies: 0
    Last Post: 2004-10-11, 10:09
  4. how to send sms immediately
    By siemensc55 in forum Symbian
    Replies: 3
    Last Post: 2004-07-15, 12:54
  5. Track if a sms is a response to a sms I send
    By tuender in forum General Messaging
    Replies: 1
    Last Post: 2002-07-19, 07:47

Posting Permissions

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