diff -r 89d6a7a84779 -r 25a17d01db0c Symbian3/PDK/Source/GUID-A12C6F14-5FFC-50BE-A837-5EA569C8AB52.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/PDK/Source/GUID-A12C6F14-5FFC-50BE-A837-5EA569C8AB52.dita Fri Jan 22 18:26:19 2010 +0000 @@ -0,0 +1,80 @@ + + + + + +Telephony +Watcher Tutorial This tutorial describes how to use the telephony watchers in Symbian +platform. +

The telephony watchers +provide the signal strength and the call indicator information to all the +registered clients applications. The client application must register with +the Publish and Subscribe framework +to receive the information. The telephony watchers enable the clients to retrieve +information about network signal strength and call status.

+ +Create an instance +of watchers +If the watcher was started earlier, re-start them to reset the values. + +Create a handle +to the publish and subscribe with RProperty::Attach(). +Input the system category and the property key as the argument. The +keys are defined in the system agent header sacls.h. Use KUidCurrentCall for +call status and KUidNetworkStatus for network status information. + +Use RPropety::Subscribe() to +subscribe to the property and use RProperty::Get() to retrieve +the updated information. + +The retrieved information +can be displayed to the user. + + +Follow the steps 1 - 4 to retrieve the other value. + + +Watcher example

The +example code below describes how to retrieve the network signal status with +the telephony watcher.

+//assume that the watcher is stopped + +StartWatcher(); + +TInt state; +TRequestStatus status; +RProperty property; + + +//initial network status + +TInt ret = RProperty.Get(KUidSystemCategory, KUidChargerStatus.iUid, state); + +// display the value +... + +//attach to the network status property + +ret = property.Attach(KUidSystemCategory,KUidNetworkStatus.iUid); + + +//subscripe to the property + +property.Subscribe(status); + +User::WaitForRequest(status); + +property.Subscribe(status); +propertty.Get(state); + +//display the value +... + +
+
\ No newline at end of file