Flight Mode Status Tutorial

This tutorial describes how to retrieve the flight mode status of the device.

Steps

  1. create a new instance of [[[ERROR: [NOKX000E] Unable to find definition for key reference 'CTelephony']]]CTelephony
  2. use [[[ERROR: [NOKX000E] Unable to find definition for key reference 'CTelephony']]]CTelephony::GetFlightMode() to get the flight mode status of the device The function returns the flight mode status in a [[[ERROR: [NOKX000E] Unable to find definition for key reference 'CTelephony']]]CTelephony::TFlightModeV1 object.
  3. pass the enuemeration [[[ERROR: [NOKX000E] Unable to find definition for key reference 'CTelephony']]]CTelephony::EGetFlightModeCancel to cancel the asynchronous request.

Flight mode status example

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

class CClientApp : public CActive
    { 

private:
    CTelephony* iTelephony;
    CTelephony::TSubscriberIdV1 iSubscriberIdV1;
    CTelephony::TSubscriberIdV1Pckg iSubscriberIdV1Pckg;

public:
    CClientApp(CTelephony* aTelephony);
    void SomeFunction();

private:
    /*
       These are the pure virtual methods from CActive that  
       MUST be implemented by all active objects
       */
    void RunL();
    void DoCancel();
    };

CClientApp:: CClientApp(CTelephony* aTelephony)
    : CActive(EPriorityStandard),
      iTelephony(aTelephony),
      iSubscriberIdV1Pckg(iSubscriberIdV1)
    {
    //default constructor
    }

void CClientApp::SomeFunction()
    {
    iTelephony->GetSubscriberId(iStatus, iSubscriberIdV1Pckg);
    SetActive();
    }

void CClientApp::RunL()
    {
    if(iStatus==KErrNone)
       {
       TBuf<CTelephony::KIMSISize> suscriberId = iSubscriberIdV1.iSubscriberId;
       }
    }

void CClientApp::DoCancel()
    {
    iTelephony->CancelAsync(CTelephony::EGetSubscriberIdCancel);
    }