Symbian3/SDK/Source/GUID-A87610FF-2FBC-4BA3-8F6B-0BBB441F8066.dita
changeset 7 51a74ef9ed63
child 8 ae94777fff8f
equal deleted inserted replaced
6:43e37759235e 7:51a74ef9ed63
       
     1 <?xml version="1.0" encoding="utf-8"?>
       
     2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
       
     3 <!-- This component and the accompanying materials are made available under the terms of the License 
       
     4 "Eclipse Public License v1.0" which accompanies this distribution, 
       
     5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
       
     6 <!-- Initial Contributors:
       
     7     Nokia Corporation - initial contribution.
       
     8 Contributors: 
       
     9 -->
       
    10 <!DOCTYPE concept
       
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
       
    12 <concept id="GUID-A87610FF-2FBC-4BA3-8F6B-0BBB441F8066" xml:lang="en"><title>Hardware
       
    13 Resource Manager Overview</title><shortdesc>Introduction to topic for overview page or search</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    14 <p>Hardware Resource Manager (HWRM) is a client-server solution, which utilizes
       
    15 ECom plug-ins to achieve device independency. ECom plug-ins convert the client
       
    16 requests into the hardware control commands. </p>
       
    17 <section><title>Purpose</title> <p>HWRM performs the following functions: </p> <ul>
       
    18 <li id="GUID-B9558230-898F-51E8-8839-4CEB8C8D3FB4"><p>Provide client APIs
       
    19 to control lights, vibra. </p> </li>
       
    20 <li id="GUID-6CC6C834-CE06-534C-A39A-D1C617F04094"><p>Retrieve battery information
       
    21 of the device. </p> </li>
       
    22 <li id="GUID-B45D85ED-6DD6-5445-A51C-561D6C609204"><p>Publish certain power-state
       
    23 related Publish and Subscribe properties. </p> </li>
       
    24 <li id="GUID-34B70C64-2C40-55F5-9C30-6C851E1351D1"><p>Enable clients to retrieve
       
    25 status information on the hardware elements such as light, vibration, power. </p> </li>
       
    26 </ul> </section>
       
    27 <section><title>Required background</title> <p>Knowledge of the client-server
       
    28 architecture, asynchronous processing, and active objects feature of the Symbian
       
    29 system model architecture. </p> </section>
       
    30 <section><title>HWRM architecture</title> <p>HWRM is made up of the following
       
    31 components: </p> <ul>
       
    32 <li id="GUID-52035A19-05AF-5C9B-A525-9B84523EFA30"><p><b>Client APIs</b>  </p> </li>
       
    33 <li id="GUID-E833B270-2E7A-583B-9177-7F5AB0386D6E"><p><b>HWRM Server</b>  </p> </li>
       
    34 </ul> <fig id="GUID-81607D15-1867-51EF-81B8-39AC75FDD4B6">
       
    35 <title>              Hardware Resource Manager's Architectural Relationships
       
    36            </title>
       
    37 <image href="GUID-DF37DAC3-8B86-5674-B025-931F743ED888_d0e131270_href.png" placement="inline"/>
       
    38 </fig> <p><b>Client APIs </b> </p> <p>HWRM provides client APIs that can control
       
    39 various hardware elements. It also provides callback pointers, so that the
       
    40 client applications can register to receive notification on the hardware status
       
    41 changes. Refer to the <xref href="GUID-2E3BE23C-B9DC-5B5D-A56A-1DB819EFC9A6.dita">tutorials</xref> for
       
    42 information on how to use client APIs. Client APIs are useful for both application
       
    43 developers and the handset manufacturers. </p> <p><b>HWRM server</b> </p> <p>HWRM
       
    44 server uses plug-in handlers to forward the client API requests to appropriate
       
    45 plug-ins. The client application communicates with HWRM server through the
       
    46 client APIs (Light API, Vibra API, and Power API). HWRM server defines the
       
    47 observer classes, which provide the callback pointers. </p> <p>The server
       
    48 calls <xref href="GUID-4603653B-34E4-3CC5-9978-95F9532A0616.dita#GUID-4603653B-34E4-3CC5-9978-95F9532A0616/GUID-5FB0A5EF-C2BB-3D0D-ACFD-9C7EE5BF41D2"><apiname>CHWRMPluginService::ProcessCommandL()</apiname></xref> function to
       
    49 forward the client requests to plug-ins. An ongoing <xref href="GUID-DC7941A2-9310-3739-AB95-EF080EAEA042.dita"><apiname>ProcessCommandL()</apiname></xref> is
       
    50 cancelled by HWRM server using <xref href="GUID-4603653B-34E4-3CC5-9978-95F9532A0616.dita#GUID-4603653B-34E4-3CC5-9978-95F9532A0616/GUID-3BF46D44-ED10-30AC-AE0A-18776FE69A83"><apiname>CHWRMPluginService::CancelCommandL()</apiname></xref>.
       
    51 The plug-ins process the server's request and pass the response by calling <xref href="GUID-5F264EF2-6E50-34F7-96E1-99645EC86265.dita#GUID-5F264EF2-6E50-34F7-96E1-99645EC86265/GUID-6DDB5354-C3C1-35F9-B237-9ECA5018BA41"><apiname>CHWRMPluginCallback::ProcessResponseL()</apiname></xref> function.
       
    52 The <xref href="GUID-E053425D-3A2F-39A5-B18A-0E2E8883D8F6.dita#GUID-E053425D-3A2F-39A5-B18A-0E2E8883D8F6/GUID-6F02C8B1-B01F-35C5-9010-51B8A3E04FDC"><apiname>MHWRMPluginCallback::EventL()</apiname></xref> method is used to communicate
       
    53 various events that takes place in the plug-ins. </p> <p>HWRM uses the central
       
    54 repository to store the various values and settings such as the light intensity,
       
    55 duration and delays. </p> </section>
       
    56 <section><title>APIs</title> <p>The HWRM provides the following client APIs
       
    57 and plug-in APIs: </p> <table id="GUID-3EBE4E80-0F05-5BE3-BFCB-440B15246AE8">
       
    58 <tgroup cols="2">
       
    59 
       
    60 <colspec colname="col0" colwidth="0.79*"/><colspec colname="col1" colwidth="1.21*"/>
       
    61 <thead>
       
    62 <row>
       
    63 <entry><b>Class</b></entry>
       
    64 <entry><b>Description</b></entry>
       
    65 </row>
       
    66 </thead>
       
    67 <tbody>
       
    68 <row>
       
    69 <entry><p><codeph>CHWRMLight</codeph> </p> </entry>
       
    70 <entry><p>Abstract class defining Lights client API. </p> </entry>
       
    71 </row>
       
    72 <row>
       
    73 <entry><p><codeph>CHWRMExtendedLight</codeph></p></entry>
       
    74 <entry><p>Abstract class defining Extended Lights client API.</p></entry>
       
    75 </row>
       
    76 <row>
       
    77 <entry><p><codeph>CHWRMVibra</codeph> </p> </entry>
       
    78 <entry><p>Abstract class defining Vibra client API. </p> </entry>
       
    79 </row>
       
    80 <row>
       
    81 <entry><p><codeph>CHWRMPower</codeph> </p> </entry>
       
    82 <entry><p>Class defining Power client API. </p> </entry>
       
    83 </row>
       
    84 </tbody>
       
    85 </tgroup>
       
    86 </table> </section>
       
    87 <section><title>Typical use cases</title> <p>HWRM is used for the following: </p> <ul>
       
    88 <li><p>Used to configure a plug-in.</p></li>
       
    89 <li id="GUID-EC0ED774-FA8C-5795-A8B8-828915C925B0"><p>Start/stop device vibra. </p> </li>
       
    90 <li id="GUID-A7F6688C-3421-566B-96C1-FAC8A27E994E"><p>Release the reserved
       
    91 lights </p> </li>
       
    92 <li id="GUID-760C9732-6587-55BD-A8B3-C1838A668347"><p>Retrieve the supported
       
    93 light targets of the device, current light status, vibra settings and status. </p> </li>
       
    94 <li id="GUID-831C3322-D28C-507A-BB5C-EA85944D8BB7"><p>Reserve light targets,
       
    95 device vibra. </p> </li>
       
    96 <li id="GUID-83313ED4-CC3F-575D-9D5B-01485DC2B7B4"><p>Switch ON/OFF the lights. </p> </li>
       
    97 <li id="GUID-9A30DBFC-3CE4-5A85-9E7B-27178872AE5A"><p>Request for tactile
       
    98 vibration pulse. </p> </li>
       
    99 </ul> </section>
       
   100 </conbody></concept>