Symbian3/PDK/Source/GUID-EE715BD5-3DCA-58A5-8A9E-9D29046749C4.dita
author Graeme Price <GRAEME.PRICE@NOKIA.COM>
Fri, 15 Oct 2010 14:32:18 +0100
changeset 15 307f4279f433
parent 14 578be2adaf3e
permissions -rw-r--r--
Initial contribution of the Adaptation Documentation.

<?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 task
  PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task xml:lang="en" id="GUID-EE715BD5-3DCA-58A5-8A9E-9D29046749C4"><title>Retrieving the List of Devices </title><shortdesc>This topic shows you how to retrieve the list of devices. </shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody><context><p>Retrieving the list of devices returns a list of <xref href="GUID-BEC75264-9B15-3185-863B-7262ECBC56CA.dita"><apiname>TLbsBtGpsDeviceInfo</apiname></xref> objects. Each object contains information about a device in the list, for example, its Bluetooth GPS device type. A device's unique key (<xref href="GUID-4BAA1E3B-D73C-34CC-9FCA-D5D7924773DB.dita"><apiname>TLbsBtGpsEntryKey</apiname></xref>) can also be returned in this way. This key is required to identify a device when performing operations such as moving or removing. </p> </context> <steps-unordered><step id="GUID-4108783E-C610-5CB9-899D-1791E88C14EA"><cmd>Call <xref href="GUID-2D92CE4A-3784-35E6-969F-504888DFA4FF.dita#GUID-2D92CE4A-3784-35E6-969F-504888DFA4FF/GUID-B19FDD97-8883-321F-AE42-ED9CD42FD57C"><apiname>CLbsBtGpsConfig::GetDeviceListL(RPointerArray&lt;TLbsBtGpsDeviceInfo&gt;&amp;)</apiname></xref>. This function passes a reference to an empty <codeph>RPointerArray</codeph> to be populated with device entries from the list. </cmd> <stepxmp><codeblock id="GUID-1148972E-DB8D-5CB8-861D-149889599363" xml:space="preserve">// Retrieve the list of devices
iDeviceList.ResetAndDestroy();
iConfig-&gt;GetDeviceListL(iDeviceList);

// Loop through the devices
for (TInt index=0; index&lt;iDeviceList.Count(); ++index)
            {
            // Get at the device information from the list
            const TLbsBtGpsDeviceInfo* deviceInfo = iDeviceList[index];
            
            // Do something, for example, display on a GUI

            }

// Destroy the retrieved copy of the list now we have finished using it
iDeviceList.ResetAndDestroy();
}</codeblock> </stepxmp> <info>If the client does not have the required capabilities, <codeph>KErrPermissionDenied</codeph> is returned. </info> </step> </steps-unordered> <result><p>The list of devices is returned. </p> </result> </taskbody><related-links><link href="GUID-5CAF1B85-853F-5450-B79B-7E768DFA44EC.dita"><linktext>Bluetooth
                GPS PSY Configuration API Overview </linktext> </link> </related-links></task>