Symbian3/SDK/Source/GUID-34614E31-45F1-5BD8-963D-9526AAD31734.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Tue, 20 Jul 2010 12:00:49 +0100
changeset 13 48780e181b38
parent 0 89d6a7a84779
permissions -rw-r--r--
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="GUID-34614E31-45F1-5BD8-963D-9526AAD31734" xml:lang="en"><title>resourcemanager: Power Resource Manager Framework example</title><shortdesc>This example demonstrates the Power Resource Manager user
side APIs. </shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
<section id="GUID-479DBACE-22C6-47B7-AA0B-06D09F7972C0"><title>Purpose</title> <p>The example shows how to use the <xref href="GUID-6E1DE1E4-1B09-541C-8708-9126E69B42CE.dita">Power Resource Manager
user side APIs</xref> provided by the <xref href="GUID-FD3DEFC1-DA39-3A1A-8E00-A46B34B78899.dita"><apiname>RBusDevResManUs</apiname></xref> class. </p> The use cases demonstrated are:<ul>
<li><p>How to get information about power resources.</p></li>
<li><p>How to get information about other clients registered with
the Power Resource Manager. </p></li>
<li><p> How to change the state of a resource.</p></li>
<li><p>How to get notification when a resource changes state.</p></li>
</ul></section>
<section id="GUID-5A18CC8E-11D7-401C-8957-7A82DA4D7C44"><title>Class summary</title><ol>
<li id="GUID-BF6BF1A4-061C-4643-95D8-C89388675B91"><p><xref href="GUID-FD3DEFC1-DA39-3A1A-8E00-A46B34B78899.dita"><apiname>RBusDevResManUs</apiname></xref></p></li>
<li id="GUID-4DD7C3AC-048E-446D-8D52-EE6CFCEB8227"><p><xref href="GUID-A1DDD3E3-C009-3C02-895B-0B2D0EE67A9D.dita"><apiname>TResourceInfo</apiname></xref></p></li>
<li id="GUID-D1CD4D8A-B58E-46DC-AB17-E19EEC0C7714"><p><xref href="GUID-3BC432D9-6C37-35C0-BE85-DA21E6E520C7.dita"><apiname>TClientInfo</apiname></xref></p></li>
</ol></section>
<section id="GUID-78393943-2E05-43C3-97E9-053D7A6F63E7"><title>Download</title> <p>Click on the following link to
download the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-bca7fbc0-b2fc-48da-adf3-3f0961ac9f88.zip" scope="external">resourcemanager.zip</xref>.</p><p>Click: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-bca7fbc0-b2fc-48da-adf3-3f0961ac9f88.html" scope="peer">browse</xref> to view the example code.</p> </section>
<section id="GUID-4AE582AE-5232-4EC1-87F3-9EC131825897"><title>Design and implementation</title> <p>This example
builds a console application called <filepath>resourcemanager.exe</filepath>. It requests user input, and prints information to the console. </p> <p>The following menu options are presented to the user: </p> <ul>
<li id="GUID-D5D0980D-140F-5142-B002-4986476AB082"><p>Get Power Resource
information. </p> </li>
<li id="GUID-90DE75D2-2F4C-5FEC-BFC0-89BC65A68EA1"><p>Change the state
of a resource. </p> </li>
<li id="GUID-AA262888-404A-58B8-85BA-EC10E523F8DD"><p>Notify a change
of resource state. </p> </li>
</ul> <p><b>Get Power Resource information</b> </p> <p>This option
gets and displays information about the clients of the Power Resource
Manager framework and about the available resources. </p> <p>The following
sub-menu options are presented: </p> <ul>
<li id="GUID-0C71EA91-4622-568F-B909-F48E453E3261"><p>1. Get the number
of available resources. </p> </li>
<li id="GUID-83B6CD7A-6830-58EE-9AC1-DD59E1320FAA"><p>2. Get information
about a particular resource. </p> </li>
<li id="GUID-85B710BA-7EA7-5A6A-8389-34115D094044"><p>3. Get information
about all the available resources. </p> </li>
<li id="GUID-D92401B4-0F81-5FF4-A413-1AB3DE0E4EAF"><p>4. Get the state
of a particular resource. </p> </li>
<li id="GUID-B7E8C908-5AF7-5C3A-9CD9-4E812BE446A1"><p>5. Get the number
of clients using a particular resource. </p> </li>
<li id="GUID-90A8D835-F4D4-5B4E-831A-F4BB6B8D36C7"><p>6. Get the number
of resources used by a particular client. </p> </li>
<li id="GUID-CF511B2E-A7A4-5435-8878-8F9332EBEF8C"><p>7. Get information
about all the resources in use by a particular client. </p> </li>
<li id="GUID-4E7F9E93-1FFF-56DD-9970-87EAF45CDB7A"><p>8. Get information
on all clients using a particular resource. </p> </li>
<li id="GUID-85D80BC5-99E1-5AA9-AE0C-573CAD798B6D"><p>9. Get the names
of all clients. </p> </li>
</ul> <p><b>Change the state of a resource</b> </p> <p>This option
allows the user to change the state of a resource. </p> <p><b>Notify
any change of resource state</b> </p> <p>This option changes the state
of a resource and notifies the user about the change. </p> </section>
<section id="GUID-6F1BD626-F15A-478B-AB59-72AF09A3C0EE"><title>Building and configuring</title> <p>To build the example: </p> <ul>
<li id="GUID-1724170B-EEB9-5899-AB43-540035CE23F4"><p>You can build
the example from your IDE or the command line. </p> <p>If you use
an IDE, import the <filepath>bld.inf</filepath> file of the example
into your IDE, and use the build command of the IDE. </p> <p>If you
use the command line, open a command prompt, and set the current directory
to the source code directory of the example. You can then build the
example with the SBSv1 build tools with the following commands: </p> <p><userinput>bldmake bldfiles</userinput> </p> <p><userinput>abld
build</userinput> </p> </li>
<li id="GUID-23AF0285-6E6B-55F4-BF08-49C6E41C1B7D"><p>For the emulator,
the example builds an executable called <filepath>resourcemanager.exe</filepath> in the <filepath>epoc32\release\winscw\&lt;udeb or             
   urel&gt;\</filepath> folder. </p> </li>
</ul> </section>
<section id="GUID-5BF499DA-9E68-4A77-AFE3-C5597FD12401"><title>Running the example</title> <p>To run the example,
launch the executable <filepath>resourcemanager.exe</filepath>, then
choose from the menu options. Press <userinput>Esc</userinput> to
quit. </p> <p>Note: this example requires an LDD, a PDD and a PSL
(platform specific layer). If these are not provided on the platform
you are using, the example will not run. </p> </section>
</conbody><related-links>
<link href="GUID-6E1DE1E4-1B09-541C-8708-9126E69B42CE.dita"><linktext>Power
Resource Manager Architecture Overview</linktext></link>
</related-links></concept>