×
Namespaces

Variants
Actions
Revision as of 17:05, 30 March 2009 by savaj (Talk | contribs)

How to know Flight mode status

From Nokia Developer Wiki
Jump to: navigation, search

This is done using GetFlightMode() function from CTelephony class.

  • Asynchronous call; so to cancel it use CTelephony::EGetFlightModeCancel
  • Sometimes the phone’s software may not support this feature then the method returns KErrNotSupported.


Libraries needed:

LIBRARY Etel3rdParty.lib and euser.lib

Source:

class CClientApp : public CActive
{
 
private:
CTelephony* iTelephony;
CTelephony::TFlightModeV1 iFlightModeV1;
CTelephony::TFlightModeV1Pckg iFlightModeV1Pckg;
 
public:
CClientApp(CTelephony* aTelephony);
void FlightModeStatus();
 
private:
void RunL();
void DoCancel();
};
 
CClientApp:: CClientApp(CTelephony* aTelephony)
: CActive(EPriorityStandard),
iTelephony(aTelephony),
iFlightModeV1Pckg(iFlightModeV1)
{
//Constructor
}
 
void CClientApp::FlightModeStatus()
{
iTelephony->GetFlightMode(iStatus, iFlightModeV1Pckg);
SetActive();
}
 
void CClientApp::RunL()
{
if(iStatus==KErrNone)
{
CTelephony::TFlightModeStatus flightMode = iFlightModeV1.iFlightModeStatus;
if(flightMode == CTelephony::EFlightModeOff)
{} //If Flight mode status is off, all operations will be allowed
}
}
 
void CClientApp::DoCancel()
{
iTelephony->CancelAsync(CTelephony::EGetFlightModeCancel);
}



Wiki Internal Links

33 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×