Symbian3/SDK/Source/GUID-8E25E84C-E8F3-50B2-82E5-0611A341ED27.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-8E25E84C-E8F3-50B2-82E5-0611A341ED27" xml:lang="en"><title>Starting
as Target</title><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>The Target is the device that receives commands from a controller. </p>
<p><b>Intended Audience: </b> </p>
<p>This tutorial is designed for Symbian licensees and 3rd party application
developers. </p>
<section><title>Using the target</title> <p>The following tasks will be covered
in this tutorial: </p> <ul>
<li id="GUID-B38F1581-5750-51FB-B383-55DA66F4334C"><p>Starting a target </p> </li>
<li id="GUID-6DC01733-3365-56AB-9BF6-DA5FA54BEFD5"><p>Stopping a target </p> </li>
</ul> <p><b> Basic procedure</b> </p> <p>The high level steps to start a target
are: </p> <ul>
<li id="GUID-CD03C0DC-6C7C-5E14-9967-204BC272D32C"><p>Create a target interface </p> </li>
<li id="GUID-56FB6161-7BDA-5E4F-B3B8-AA9A898D7A15"><p>Open a connectionless
session </p> </li>
</ul> </section>
<section><title>Starting a target</title> <p>The steps required to start a
device as a remote control target are given below: </p> <ol id="GUID-31A116B3-0035-539D-BED6-50D803B6025E">
<li id="GUID-C256FBD7-39F6-52E6-A9D0-CAFC2A95979E"><p>Create a target interface
by instantiating an interface selector using <xref href="GUID-81EE9382-D501-3FCE-ACD9-7BC5236FC462.dita#GUID-81EE9382-D501-3FCE-ACD9-7BC5236FC462/GUID-17C0EFFE-AEE4-31E6-97D6-701CFD3E761C"><apiname>CRemConInterfaceSelector::NewL()</apiname></xref>,
as shown here: </p> <codeblock id="GUID-F5F2E656-705F-5FE0-B8EA-43A780EA14E5" xml:space="preserve">CRemConInterfaceSelector* iInterfaceSelector;
iInterfaceSelector = CRemConInterfaceSelector::NewL();</codeblock> </li>
<li id="GUID-5CFD7F73-398B-5CFB-ABF3-2C7B047F55A3"><p>Create a core remote
control API target and add the interface selector created above as shown here: </p> <codeblock id="GUID-81C408AE-A678-5810-805B-CA082ECF6517" xml:space="preserve">CRemConCoreApiTarget* iCoreTarget;iCoreTarget = 
   CRemConCoreApiTarget::NewL(*iInterfaceSelector,*this);</codeblock> <p>The <codeph>*iInterfaceSelector</codeph> is
the <xref href="GUID-723FC8F2-DB48-3C70-976F-D027E19F480B.dita"><apiname>CRemConCoreApiTarget</apiname></xref> interface selector and <codeph>*this</codeph> is
the owning observer. The remote control framework observers are used to send
and receive commands and responses. </p> </li>
<li id="GUID-250565A9-8BA2-535E-BA34-141BAE3337B3"><p>Open the above interface
using <xref href="GUID-81EE9382-D501-3FCE-ACD9-7BC5236FC462.dita#GUID-81EE9382-D501-3FCE-ACD9-7BC5236FC462/GUID-87BDC40F-F3A9-3879-967D-38FF56E27E37"><apiname>CRemConInterfaceSelector::OpenTargetL()</apiname></xref>. </p> <codeblock id="GUID-012B8A1D-BAF9-5BC6-B102-025F8BB1013D" xml:space="preserve">iInterfaceSelector-&gt;OpenTargetL();</codeblock> </li>
</ol> <p>The above code will start a device as a remote control target that
is able to receive and handle remote control commands. </p> </section>
<section><title>Stopping a target</title> <p>To stop your target use: </p> <codeblock id="GUID-53934A6A-8E38-5591-A333-F9A5D574172E" xml:space="preserve">delete iInterfaceSelector;</codeblock> </section>
<section><title>What's next?</title> <ul>
<li id="GUID-ECB765A0-C8B6-54F3-AE04-082E15A1770A"><p> <xref href="GUID-C4A072E1-4385-5C98-98C1-56F297132F11.dita">Remote
Control Basics</xref> </p> </li>
<li id="GUID-C22F3018-EF6F-582D-BF93-94B1C4122806"><p> <xref href="GUID-E25A5C1E-83D7-51D5-8F11-9C44C6CEEDCE.dita">Starting
as Controller</xref>  </p> </li>
<li id="GUID-D399A6EB-966E-51F6-B273-E7DB5A04BCAE"><p> <b>Starting as Target</b> -
This document </p> </li>
<li id="GUID-93E9A8AE-5202-57FC-98B7-0651C301FB40"><p> <xref href="GUID-7DDF477A-1744-589A-82CB-3CB32D56D7CE.dita">Commands
and Responses</xref>  </p> </li>
</ul> </section>
</conbody></concept>