Adaptation/GUID-9597DB22-D932-5A58-9C3C-4E5FCA244253.dita
author Graeme Price <GRAEME.PRICE@NOKIA.COM>
Fri, 15 Oct 2010 14:32:18 +0100
changeset 15 307f4279f433
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 concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept xml:lang="en" id="GUID-9597DB22-D932-5A58-9C3C-4E5FCA244253"><title>Re-Enumerate </title><shortdesc>A short description of how to perform a Re-Enumeration. </shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody><section id="GUID-04B32E9C-A11A-5F6B-B5B6-E346C9CD333D"><title>Introduction</title> <p>If any interface settings have been changed then a re-enumeration must be forced by calling <xref href="GUID-4D1AE286-41EE-3361-948A-3E8634D81DBA.dita#GUID-4D1AE286-41EE-3361-948A-3E8634D81DBA/GUID-C0D95A6D-350E-3569-BBA1-074CC2D027AA"><apiname>RDevUsbcScClient::ReEnumerate()</apiname></xref>. A re-enumeration involves the device initiating a bus disconnection and re-connection. </p> </section> <section><title>Re-enumerate</title> <p> <codeph>ReEnumerate()</codeph> is an asynchronous operation that completes when the controller is successfully configured by the host. Because it is not known if the operation has failed, set up a timer to complete after approximately 5 seconds. It can be assumed that if the operation has not completed in this time then it will not complete. When the request is completed <codeph>status</codeph> contains the result of the re-enumeration. See <xref href="GUID-E0B34F3E-D4C4-3232-B8B1-7DB35B454646.dita"><apiname>TRequestStatus</apiname></xref>. </p> <codeblock id="GUID-E040F056-770F-5925-94E2-07FC6C4BEAB9" xml:space="preserve">TRequestStatus status;
gPort.ReEnumerate(status);
User::WaitForRequest(status);</codeblock> <p>If the re-enumeration has not completed within the expected time period then use <xref href="GUID-B1E32178-3B7C-3B00-A0AF-62ECE40E8598.dita#GUID-B1E32178-3B7C-3B00-A0AF-62ECE40E8598/GUID-1B12CD44-4ABA-323B-AA85-5B30A02AFB57"><apiname>RDevUsbcClient::ReEnumerateCancel()</apiname></xref> to cancel the request. <b>Note</b>: this function does not undo the re-enumeration. </p> <p>If alternate interface settings have been set up enquire which interface has been selected following a re-enumeration by using <xref href="GUID-4D1AE286-41EE-3361-948A-3E8634D81DBA.dita#GUID-4D1AE286-41EE-3361-948A-3E8634D81DBA/GUID-B641E598-3F10-3376-B14C-87E0718F8687"><apiname>RDevUsbcScClient::GetAlternateSetting()</apiname></xref>. </p> </section> <section><p>After you have forced a re-enumeration you can use your USB class driver to <xref href="GUID-4C4515EA-A5DD-56B4-94B0-EE48D66013F7.dita">Read Data from USB using Shared Chunks</xref> or <xref href="GUID-0C80F447-B82E-5586-9B02-4BC0D365FFD6.dita">Write Data to USB using Shared Chunks</xref> or if you wish to use the Buffer Interface Layer (recommended) then go to <xref href="GUID-6E89E787-749D-5AC5-957D-967B4B9ACD74.dita">Using the BIL Interface</xref>. </p> </section> </conbody></concept>