Flight Mode Status Tutorial

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


  1. create a new instance of CTelephony

  2. use CTelephony::GetFlightMode() to get the flight mode status of the device The function returns the flight mode status in a CTelephony::TFlightModeV1 object.

  3. pass the enuemeration 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);
    }