Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-release > by-pkgid > 50facae208d4a6f280e44a513b104320 > files > 610

qt-mobility-doc-1.2.0-13.mga5.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qbluetoothdevicediscoveryagent.cpp -->
  <title>Qt Mobility 1.2: QBluetoothDeviceDiscoveryAgent Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="content"> 
    <a href="index.html" class="qtref"><span>QtMobility Reference Documentation</span></a>
  </div>
  <div class="breadcrumb toolblock">
    <ul>
      <li class="first"><a href="index.html">Home</a></li>
      <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtconnectivity.html">QtConnectivity</a></li>
<li>QBluetoothDeviceDiscoveryAgent</li>
    </ul>
  </div>
</div>
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#public-slots">Public Slots</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QBluetoothDeviceDiscoveryAgent Class Reference</h1>
<!-- $$$QBluetoothDeviceDiscoveryAgent-brief -->
<p>The QBluetoothDeviceDiscoveryAgent class provides an API for discovering nearby Bluetooth devices. <a href="#details">More...</a></p>
<!-- @@@QBluetoothDeviceDiscoveryAgent -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QBluetoothDeviceDiscoveryAgent&gt;</span></pre><p><b>Inherits: </b><a href="http://qt.nokia.com/doc/4.7/qobject.html">QObject</a>.</p>
<p>This class was introduced in Qt Mobility 1.2.</p>
<ul>
<li><a href="qbluetoothdevicediscoveryagent-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothdevicediscoveryagent.html#Error-enum">Error</a></b> { NoError, PoweredOff, IOFailure, UnknownError }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothdevicediscoveryagent.html#InquiryType-enum">InquiryType</a></b> { GeneralUnlimitedInquiry, LimitedInquiry }</td></tr>
</table>
<a name="properties"></a>
<h2>Properties</h2>
<ul>
<li class="fn"><b><a href="qbluetoothdevicediscoveryagent.html#inquiryType-prop">inquiryType</a></b> : QBluetoothDeviceDiscoveryAgent::InquiryType</li>
</ul>
<ul>
<li class="fn">1 property inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothdevicediscoveryagent.html#QBluetoothDeviceDiscoveryAgent">QBluetoothDeviceDiscoveryAgent</a></b> ( QObject * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothdevicediscoveryagent.html#dtor.QBluetoothDeviceDiscoveryAgent">~QBluetoothDeviceDiscoveryAgent</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QBluetoothDeviceInfo&gt; </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothdevicediscoveryagent.html#discoveredDevices">discoveredDevices</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Error </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothdevicediscoveryagent.html#error">error</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothdevicediscoveryagent.html#errorString">errorString</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QBluetoothDeviceDiscoveryAgent::InquiryType </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothdevicediscoveryagent.html#inquiryType-prop">inquiryType</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothdevicediscoveryagent.html#isActive">isActive</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothdevicediscoveryagent.html#inquiryType-prop">setInquiryType</a></b> ( QBluetoothDeviceDiscoveryAgent::InquiryType <i>type</i> )</td></tr>
</table>
<ul>
<li class="fn">29 public functions inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#public-functions">QObject</a></li>
</ul>
<a name="public-slots"></a>
<h2>Public Slots</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothdevicediscoveryagent.html#start">start</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothdevicediscoveryagent.html#stop">stop</a></b> ()</td></tr>
</table>
<ul>
<li class="fn">1 public slot inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#public-slots">QObject</a></li>
</ul>
<a name="signals"></a>
<h2>Signals</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothdevicediscoveryagent.html#canceled">canceled</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothdevicediscoveryagent.html#deviceDiscovered">deviceDiscovered</a></b> ( const QBluetoothDeviceInfo &amp; <i>info</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothdevicediscoveryagent.html#error-2">error</a></b> ( QBluetoothDeviceDiscoveryAgent::Error <i>error</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothdevicediscoveryagent.html#finished">finished</a></b> ()</td></tr>
</table>
<ul>
<li class="fn">1 signal inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#signals">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 public variable inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#public-variables">QObject</a></li>
<li class="fn">4 static public members inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#static-public-members">QObject</a></li>
<li class="fn">7 protected functions inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#protected-functions">QObject</a></li>
<li class="fn">2 protected variables inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#protected-variables">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QBluetoothDeviceDiscoveryAgent-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QBluetoothDeviceDiscoveryAgent class provides an API for discovering nearby Bluetooth devices.</p>
<p>To discovery nearby Bluetooth devices create an instance of QBluetoothDeviceDiscoveryAgent, connect to either the <a href="qbluetoothdevicediscoveryagent.html#deviceDiscovered">deviceDiscovered</a>() or <a href="qbluetoothdevicediscoveryagent.html#finished">finished</a>() signals and call <a href="qbluetoothdevicediscoveryagent.html#start">start</a>().</p>
<pre class="cpp">     <span class="type">QBluetoothDeviceDiscoveryAgent</span> <span class="operator">*</span>discoveryAgent <span class="operator">=</span> <span class="keyword">new</span> <span class="type">QBluetoothDeviceDiscoveryAgent</span>(<span class="keyword">this</span>);

     connect(discoveryAgent<span class="operator">,</span> SIGNAL(deviceDiscovered(<span class="keyword">const</span> <span class="type"><a href="qbluetoothdeviceinfo.html">QBluetoothDeviceInfo</a></span><span class="operator">&amp;</span>))<span class="operator">,</span>
             <span class="keyword">this</span><span class="operator">,</span> SLOT(deviceDiscovered(<span class="keyword">const</span> <span class="type"><a href="qbluetoothdeviceinfo.html">QBluetoothDeviceInfo</a></span><span class="operator">&amp;</span>)));

     <span class="comment">// Automatically delete agent when device discovery finishes.</span>
     connect(discoveryAgent<span class="operator">,</span> SIGNAL(finished())<span class="operator">,</span> <span class="keyword">this</span><span class="operator">,</span> SLOT(deleteLater()));

     discoveryAgent<span class="operator">-</span><span class="operator">&gt;</span>start();</pre>
<p>To retrieve results asynchronously connect to the <a href="qbluetoothdevicediscoveryagent.html#deviceDiscovered">deviceDiscovered</a>() signal. To get a list of all discovered devices call <a href="qbluetoothdevicediscoveryagent.html#discoveredDevices">discoveredDevices</a>() after the <a href="qbluetoothdevicediscoveryagent.html#finished">finished</a>() signal is emitted.</p>
</div>
<!-- @@@QBluetoothDeviceDiscoveryAgent -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$Error$$$NoError$$$IOFailure$$$PoweredOff$$$UnknownError -->
<h3 class="fn"><a name="Error-enum"></a>enum QBluetoothDeviceDiscoveryAgent::<span class="name">Error</span></h3>
<p>Indicates all possible error conditions found during Bluetooth device discovery.</p>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QBluetoothDeviceDiscoveryAgent::NoError</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">No error has occurred.</td></tr>
<tr><td class="topAlign"><tt>QBluetoothDeviceDiscoveryAgent::PoweredOff</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">Bluetooth adaptor is powered off, power it on before doing discovery.</td></tr>
<tr><td class="topAlign"><tt>QBluetoothDeviceDiscoveryAgent::IOFailure</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">Writing or reading from device resulted in an error.</td></tr>
<tr><td class="topAlign"><tt>QBluetoothDeviceDiscoveryAgent::UnknownError</tt></td><td class="topAlign"><tt>100</tt></td><td class="topAlign">An unknown error has occurred.</td></tr>
</table>
<!-- @@@Error -->
<!-- $$$InquiryType$$$GeneralUnlimitedInquiry$$$LimitedInquiry -->
<h3 class="fn"><a name="InquiryType-enum"></a>enum QBluetoothDeviceDiscoveryAgent::<span class="name">InquiryType</span></h3>
<p>This enum describes the inquiry type used when discovering Bluetooth devices.</p>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QBluetoothDeviceDiscoveryAgent::GeneralUnlimitedInquiry</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">A general unlimited inquiry. Discovers all visible Bluetooth devices in the local vicinity.</td></tr>
<tr><td class="topAlign"><tt>QBluetoothDeviceDiscoveryAgent::LimitedInquiry</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">A limited inquiry. Only discovers devices that are in limited inquiry mode. Not all platforms support limited inquiry. If limited inquiry is requested on a platform that does not support it general unlimited inquiry we be used instead. Setting LimitedInquiry is useful for 2 games that wish to find each other quickly. The phone scans for devices in LimitedInquiry and Service Discovery is only done on one or two devices speeding up the service scan. After the game has connected the device returns to GeneralUnilimitedInquiry</td></tr>
</table>
<!-- @@@InquiryType -->
</div>
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$inquiryType-prop$$$inquiryType$$$setInquiryTypeQBluetoothDeviceDiscoveryAgent::InquiryType -->
<h3 class="fn"><a name="inquiryType-prop"></a><span class="name">inquiryType</span> : <span class="type"><a href="qbluetoothdevicediscoveryagent.html#InquiryType-enum">QBluetoothDeviceDiscoveryAgent::InquiryType</a></span></h3>
<p>This property holds type of inquiry scan to use when discovering devices.</p>
<p>This property affects the type of inquiry scan which is performed when discovering devices.</p>
<p>By default, this property is set to <a href="qbluetoothdevicediscoveryagent.html#InquiryType-enum">GeneralUnlimitedInquiry</a>.</p>
<p>Not all platforms support <a href="qbluetoothdevicediscoveryagent.html#InquiryType-enum">LimitedInquiry</a>.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QBluetoothDeviceDiscoveryAgent::InquiryType </td><td class="memItemRight bottomAlign"><span class="name"><b>inquiryType</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setInquiryType</b></span> ( QBluetoothDeviceDiscoveryAgent::InquiryType <i>type</i> )</td></tr>
</table>
<p><b>See also </b><a href="qbluetoothdevicediscoveryagent.html#InquiryType-enum">InquiryType</a>.</p>
<!-- @@@inquiryType -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QBluetoothDeviceDiscoveryAgent[overload1]$$$QBluetoothDeviceDiscoveryAgentQObject* -->
<h3 class="fn"><a name="QBluetoothDeviceDiscoveryAgent"></a>QBluetoothDeviceDiscoveryAgent::<span class="name">QBluetoothDeviceDiscoveryAgent</span> ( <span class="type"><a href="http://qt.nokia.com/doc/4.7/qobject.html">QObject</a></span> * <i>parent</i> = 0 )</h3>
<p>Constructs a new Bluetooth device discovery agent with parent <i>parent</i>.</p>
<!-- @@@QBluetoothDeviceDiscoveryAgent -->
<!-- $$$~QBluetoothDeviceDiscoveryAgent[overload1]$$$~QBluetoothDeviceDiscoveryAgent -->
<h3 class="fn"><a name="dtor.QBluetoothDeviceDiscoveryAgent"></a>QBluetoothDeviceDiscoveryAgent::<span class="name">~QBluetoothDeviceDiscoveryAgent</span> ()</h3>
<p>Destructor for ~<a href="qbluetoothdevicediscoveryagent.html#QBluetoothDeviceDiscoveryAgent">QBluetoothDeviceDiscoveryAgent</a>()</p>
<!-- @@@~QBluetoothDeviceDiscoveryAgent -->
<!-- $$$canceled[overload1]$$$canceled -->
<h3 class="fn"><a name="canceled"></a><span class="type">void</span> QBluetoothDeviceDiscoveryAgent::<span class="name">canceled</span> ()<tt> [signal]</tt></h3>
<p>This signal is emitted when device discovery is aborted by a call to <a href="qbluetoothdevicediscoveryagent.html#stop">stop</a>().</p>
<!-- @@@canceled -->
<!-- $$$deviceDiscovered[overload1]$$$deviceDiscoveredconstQBluetoothDeviceInfo& -->
<h3 class="fn"><a name="deviceDiscovered"></a><span class="type">void</span> QBluetoothDeviceDiscoveryAgent::<span class="name">deviceDiscovered</span> ( const <span class="type"><a href="qbluetoothdeviceinfo.html">QBluetoothDeviceInfo</a></span> &amp; <i>info</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted when the Bluetooth device described by <i>info</i> is discovered.</p>
<!-- @@@deviceDiscovered -->
<!-- $$$discoveredDevices[overload1]$$$discoveredDevices -->
<h3 class="fn"><a name="discoveredDevices"></a><span class="type"><a href="http://qt.nokia.com/doc/4.7/qlist.html">QList</a></span>&lt;<span class="type"><a href="qbluetoothdeviceinfo.html">QBluetoothDeviceInfo</a></span>&gt; QBluetoothDeviceDiscoveryAgent::<span class="name">discoveredDevices</span> () const</h3>
<p>Returns a list of all discovered Bluetooth devices.</p>
<!-- @@@discoveredDevices -->
<!-- $$$error[overload1]$$$error -->
<h3 class="fn"><a name="error"></a><span class="type"><a href="qbluetoothdevicediscoveryagent.html#Error-enum">Error</a></span> QBluetoothDeviceDiscoveryAgent::<span class="name">error</span> () const</h3>
<p>Returns the last error which has occurred.</p>
<!-- @@@error -->
<!-- $$$error$$$errorQBluetoothDeviceDiscoveryAgent::Error -->
<h3 class="fn"><a name="error-2"></a><span class="type">void</span> QBluetoothDeviceDiscoveryAgent::<span class="name">error</span> ( <span class="type"><a href="qbluetoothdevicediscoveryagent.html#Error-enum">QBluetoothDeviceDiscoveryAgent::Error</a></span> <i>error</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted when an <i>error</i> occurs during Bluetooth device discovery.</p>
<p><b>See also </b><a href="qbluetoothdevicediscoveryagent.html#error">error</a>() and <a href="qbluetoothdevicediscoveryagent.html#errorString">errorString</a>().</p>
<!-- @@@error -->
<!-- $$$errorString[overload1]$$$errorString -->
<h3 class="fn"><a name="errorString"></a><span class="type"><a href="http://qt.nokia.com/doc/4.7/qstring.html">QString</a></span> QBluetoothDeviceDiscoveryAgent::<span class="name">errorString</span> () const</h3>
<p>Returns a human-readable description of the last error that occurred.</p>
<!-- @@@errorString -->
<!-- $$$finished[overload1]$$$finished -->
<h3 class="fn"><a name="finished"></a><span class="type">void</span> QBluetoothDeviceDiscoveryAgent::<span class="name">finished</span> ()<tt> [signal]</tt></h3>
<p>This signal is emitted when Bluetooth device discovery completes.</p>
<!-- @@@finished -->
<!-- $$$isActive[overload1]$$$isActive -->
<h3 class="fn"><a name="isActive"></a><span class="type">bool</span> QBluetoothDeviceDiscoveryAgent::<span class="name">isActive</span> () const</h3>
<p>Returns true if the agent is currently discovering Bluetooth devices, other returns false.</p>
<!-- @@@isActive -->
<!-- $$$start[overload1]$$$start -->
<h3 class="fn"><a name="start"></a><span class="type">void</span> QBluetoothDeviceDiscoveryAgent::<span class="name">start</span> ()<tt> [slot]</tt></h3>
<p>Starts Bluetooth device discovery, if it is not already started.</p>
<p>The <a href="qbluetoothdevicediscoveryagent.html#deviceDiscovered">deviceDiscovered</a>() signal is emitted as each device is discovered. The <a href="qbluetoothdevicediscoveryagent.html#finished">finished</a>() signal is emitted once device discovery is complete.</p>
<!-- @@@start -->
<!-- $$$stop[overload1]$$$stop -->
<h3 class="fn"><a name="stop"></a><span class="type">void</span> QBluetoothDeviceDiscoveryAgent::<span class="name">stop</span> ()<tt> [slot]</tt></h3>
<p>Stops Bluetooth device discovery. The cancel() signal is emitted once the device discovery is canceled. <a href="qbluetoothdevicediscoveryagent.html#start">start</a>() maybe called before the cancel signal is received. Once <a href="qbluetoothdevicediscoveryagent.html#start">start</a>() has been called the cancel signal from the prior discovery will be silently discarded.</p>
<!-- @@@stop -->
</div>
  <div class="ft">
    <span></span>
  </div>
</div> 
<div class="footer">
  <p>
     <acronym title="Copyright">&copy;</acronym> 2008-2011 Nokia Corporation and/or its
     subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation 
     in Finland and/or other countries worldwide.</p>
  <p>
     All other trademarks are property of their respective owners. <a title="Privacy Policy"
     href="http://qt.nokia.com/about/privacy-policy">Privacy Policy</a></p>
  <br />
  <p>
    Licensees holding valid Qt Commercial licenses may use this document in accordance with the    Qt Commercial License Agreement provided with the Software or, alternatively, in accordance    with the terms contained in a written agreement between you and Nokia.</p>
  <p>
    Alternatively, this document may be used under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU
    Free Documentation License version 1.3</a>
    as published by the Free Software Foundation.</p>
</div>
</body>
</html>