Symbian3/PDK/Source/GUID-D987BEC9-B976-5A65-B6B3-D44BC8A96430.dita
changeset 1 25a17d01db0c
child 3 46218c8b8afa
equal deleted inserted replaced
0:89d6a7a84779 1:25a17d01db0c
       
     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-D987BEC9-B976-5A65-B6B3-D44BC8A96430" xml:lang="en"><title>Hardware
       
    13 Resource Manager Overview</title><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 <li><p><b>HWRM Plug-ins</b></p></li>
       
    35 </ul> <fig id="GUID-F4261959-A2C5-445F-BA71-D84D8CBA9050">
       
    36 <title>              Hardware Resource Manager's Architectural Relationships
       
    37            </title>
       
    38 <image href="GUID-0211CAA4-32FF-52F2-81DA-78C52C412AED_d0e135000_href.png" placement="inline"/>
       
    39 </fig> <p><b>Client APIs </b> </p> <p>HWRM provides client APIs that can control
       
    40 various hardware elements. It also provides callback pointers, so that the
       
    41 client applications can register to receive notification on the hardware status
       
    42 changes. Refer to the <xref href="GUID-2E3BE23C-B9DC-5B5D-A56A-1DB819EFC9A6.dita">tutorials</xref> for
       
    43 information on how to use client APIs. Client APIs are useful for both application
       
    44 developers and the handset manufacturers. </p> <p><b>HWRM server</b> </p> <p>HWRM
       
    45 server uses plug-in handlers to forward the client API requests to appropriate
       
    46 plug-ins. The client application communicates with HWRM server through the
       
    47 client APIs (Light API, Vibra API, and Power API). HWRM server defines the
       
    48 observer classes, which provide the callback pointers. </p> <p>The server
       
    49 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
       
    50 forward the client requests to plug-ins. An ongoing <xref href="GUID-DC7941A2-9310-3739-AB95-EF080EAEA042.dita"><apiname>ProcessCommandL()</apiname></xref> is
       
    51 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>.
       
    52 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.
       
    53 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
       
    54 various events that takes place in the plug-ins. </p> <p>HWRM uses the central
       
    55 repository to store the various values and settings such as the light intensity,
       
    56 duration and delays. </p> <p><b>HWRM plug-ins</b></p><p>HWRM
       
    57 plug-ins convert client requests to hardware control commands.</p><p>HWRM
       
    58 forwards the client requests to the plug-ins through the plug-in APIs. All
       
    59 events are notified to HWRM server using <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.
       
    60 After executing each command, the server is notified. The notification is
       
    61 accompanied by an error code. HWRM server passes these error codes to the
       
    62 clients. When the request is completed successfully, <codeph>KErrNone</codeph> is
       
    63 returned. If an error occurs while executing a command, such as target hardware
       
    64 not implemented or not ready, the corresponding error code is returned. Refer
       
    65 to the <xref href="GUID-62F3CC35-F992-5099-BDC2-BA0117C79631.dita">Hardware Resource
       
    66 Manager Plug-ins</xref> section for more details.</p></section>
       
    67 <section><title>APIs</title> <p>The HWRM provides the following client APIs
       
    68 and plug-in APIs: </p> <table id="GUID-3EBE4E80-0F05-5BE3-BFCB-440B15246AE8">
       
    69 <tgroup cols="2">
       
    70 
       
    71 <colspec colname="col0" colwidth="0.79*"/><colspec colname="col1" colwidth="1.21*"/>
       
    72 <thead>
       
    73 <row>
       
    74 <entry><b>Class</b></entry>
       
    75 <entry><b>Description</b></entry>
       
    76 </row>
       
    77 </thead>
       
    78 <tbody>
       
    79 <row>
       
    80 <entry><p><codeph>CHWRMLight</codeph> </p> </entry>
       
    81 <entry><p>Abstract class defining Lights client API. </p> </entry>
       
    82 </row>
       
    83 <row>
       
    84 <entry><p><codeph>CHWRMExtendedLight</codeph></p></entry>
       
    85 <entry><p>Abstract class defining Extended Lights client API.</p></entry>
       
    86 </row>
       
    87 <row>
       
    88 <entry><p><codeph>CHWRMVibra</codeph> </p> </entry>
       
    89 <entry><p>Abstract class defining Vibra client API. </p> </entry>
       
    90 </row>
       
    91 <row>
       
    92 <entry><p><codeph>CHWRMPower</codeph> </p> </entry>
       
    93 <entry><p>Class defining Power client API. </p> </entry>
       
    94 </row>
       
    95 </tbody>
       
    96 </tgroup>
       
    97 </table> </section>
       
    98 <section><title>Typical use cases</title> <p>HWRM is used for the following: </p> <ul>
       
    99 <li><p>Used to configure a plug-in.</p></li>
       
   100 <li id="GUID-EC0ED774-FA8C-5795-A8B8-828915C925B0"><p>Start/stop device vibra. </p> </li>
       
   101 <li id="GUID-A7F6688C-3421-566B-96C1-FAC8A27E994E"><p>Release the reserved
       
   102 lights </p> </li>
       
   103 <li id="GUID-760C9732-6587-55BD-A8B3-C1838A668347"><p>Retrieve the supported
       
   104 light targets of the device, current light status, vibra settings and status. </p> </li>
       
   105 <li id="GUID-831C3322-D28C-507A-BB5C-EA85944D8BB7"><p>Reserve light targets,
       
   106 device vibra. </p> </li>
       
   107 <li id="GUID-83313ED4-CC3F-575D-9D5B-01485DC2B7B4"><p>Switch ON/OFF the lights. </p> </li>
       
   108 <li id="GUID-9A30DBFC-3CE4-5A85-9E7B-27178872AE5A"><p>Request for tactile
       
   109 vibration pulse. </p> </li>
       
   110 </ul> </section>
       
   111 </conbody><related-links>
       
   112 <link href="GUID-25A005BF-731B-58DB-8EF7-AB7840DA563F.dita"><linktext>HWRM Concepts</linktext>
       
   113 </link>
       
   114 <link href="GUID-2E3BE23C-B9DC-5B5D-A56A-1DB819EFC9A6.dita"><linktext>HWRM Tutorials</linktext>
       
   115 </link>
       
   116 </related-links></concept>