Symbian
Symbian OS Library

FAQ-0995 How can I detect what signal strength is available on a phone?

[Index][spacer] [Previous] [Next]



 

Classification: C++ Category: Base
Created: 03/04/2004 Modified: 03/18/2004
Number: FAQ-0995
Platform: Symbian OS v6.1, Symbian OS v7.0, Symbian OS v7.0s

Question:
How can I write some code to detect what signal strength is available on a phone?

Answer:
You can detect the signal strength using the System Agent API or the RMobillePhone class. Bear in mind however that on real devices the manufacturer may have a different API that is used and these APIs will not be functional but will return a default value.

1) RSystemAgent iSystemAgent;
User::LeaveIfError(iSystemAgent.Connect());
TInt strength = iSystemAgent.GetState(KUidNetworkStrength);

** Note: the RMobilePhone class is only available for Symbian OS DevKit licensees
2) Until v6.1: RMobilePhone::GetSignalStrength(TInt32& aSignalStrength, TInt8& aBar)
From v7.0: MobilePhone::GetSignalStrength(TRequestStatus& aReqStatus, TInt32& aSignalStrength, TInt8& aBar)`