Sophie

Sophie

distrib > Mageia > 7 > aarch64 > by-pkgid > 814a2b4c48f3ef6444b2ff5bf854d05a > files > 73

qtconnectivity5-doc-5.12.6-1.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qbluetoothservicediscoveryagent.cpp -->
  <title>QBluetoothServiceDiscoveryAgent Class | Qt Bluetooth 5.12.6</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.12</td><td ><a href="qtbluetooth-index.html">Qt Bluetooth</a></td><td ><a href="qtbluetooth-module.html">C++ Classes</a></td><td >QBluetoothServiceDiscoveryAgent</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtbluetooth-index.html">Qt 5.12.6 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<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="#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="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QBluetoothServiceDiscoveryAgent Class</h1>
<!-- $$$QBluetoothServiceDiscoveryAgent-brief -->
<p>The <a href="qbluetoothservicediscoveryagent.html">QBluetoothServiceDiscoveryAgent</a> class enables you to query for Bluetooth services. <a href="#details">More...</a></p>
<!-- @@@QBluetoothServiceDiscoveryAgent -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QBluetoothServiceDiscoveryAgent&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += bluetooth</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign">  Qt 5.2</td></tr></table></div><ul>
<li><a href="qbluetoothservicediscoveryagent-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothservicediscoveryagent.html#DiscoveryMode-enum">DiscoveryMode</a></b> { MinimalDiscovery, FullDiscovery }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothservicediscoveryagent.html#Error-enum">Error</a></b> { NoError, PoweredOffError, InputOutputError, InvalidBluetoothAdapterError, UnknownError }</td></tr>
</table></div>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothservicediscoveryagent.html#QBluetoothServiceDiscoveryAgent">QBluetoothServiceDiscoveryAgent</a></b>(QObject *<i>parent</i> = nullptr)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothservicediscoveryagent.html#QBluetoothServiceDiscoveryAgent-1">QBluetoothServiceDiscoveryAgent</a></b>(const QBluetoothAddress &amp;<i>deviceAdapter</i>, QObject *<i>parent</i> = nullptr)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothservicediscoveryagent.html#dtor.QBluetoothServiceDiscoveryAgent">~QBluetoothServiceDiscoveryAgent</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QBluetoothServiceInfo&gt; </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothservicediscoveryagent.html#discoveredServices">discoveredServices</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QBluetoothServiceDiscoveryAgent::Error </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothservicediscoveryagent.html#error">error</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothservicediscoveryagent.html#errorString">errorString</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothservicediscoveryagent.html#isActive">isActive</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QBluetoothAddress </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothservicediscoveryagent.html#remoteAddress">remoteAddress</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothservicediscoveryagent.html#setRemoteAddress">setRemoteAddress</a></b>(const QBluetoothAddress &amp;<i>address</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothservicediscoveryagent.html#setUuidFilter">setUuidFilter</a></b>(const QList&lt;QBluetoothUuid&gt; &amp;<i>uuids</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothservicediscoveryagent.html#setUuidFilter-1">setUuidFilter</a></b>(const QBluetoothUuid &amp;<i>uuid</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QBluetoothUuid&gt; </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothservicediscoveryagent.html#uuidFilter">uuidFilter</a></b>() const</td></tr>
</table></div>
<a name="public-slots"></a>
<h2 id="public-slots">Public Slots</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothservicediscoveryagent.html#clear">clear</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothservicediscoveryagent.html#start">start</a></b>(QBluetoothServiceDiscoveryAgent::DiscoveryMode <i>mode</i> = MinimalDiscovery)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothservicediscoveryagent.html#stop">stop</a></b>()</td></tr>
</table></div>
<a name="signals"></a>
<h2 id="signals">Signals</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothservicediscoveryagent.html#canceled">canceled</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothservicediscoveryagent.html#error-1">error</a></b>(QBluetoothServiceDiscoveryAgent::Error <i>error</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothservicediscoveryagent.html#finished">finished</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothservicediscoveryagent.html#serviceDiscovered">serviceDiscovered</a></b>(const QBluetoothServiceInfo &amp;<i>info</i>)</td></tr>
</table></div>
<a name="static-public-members"></a>
<h2 id="static-public-members">Static Public Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> const QMetaObject </td><td class="memItemRight bottomAlign"><b><a href="qbluetoothservicediscoveryagent.html#staticMetaObject-var">staticMetaObject</a></b></td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QBluetoothServiceDiscoveryAgent-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qbluetoothservicediscoveryagent.html">QBluetoothServiceDiscoveryAgent</a> class enables you to query for Bluetooth services.</p>
<p>The discovery process relies on the Bluetooth Service Discovery Process (SDP). The following steps are required to query the services provided by all contactable Bluetooth devices:</p>
<ul>
<li>create an instance of <a href="qbluetoothservicediscoveryagent.html">QBluetoothServiceDiscoveryAgent</a>,</li>
<li>connect to either the <a href="qbluetoothservicediscoveryagent.html#serviceDiscovered">serviceDiscovered</a>() or <a href="qbluetoothservicediscoveryagent.html#finished">finished</a>() signals,</li>
<li>and call <a href="qbluetoothservicediscoveryagent.html#start">start</a>().</li>
</ul>
<pre class="cpp">

  <span class="type">void</span> MyClass<span class="operator">::</span>startServiceDiscovery()
  {

      <span class="comment">// Create a discovery agent and connect to its signals</span>
      <span class="type"><a href="qbluetoothservicediscoveryagent.html#QBluetoothServiceDiscoveryAgent">QBluetoothServiceDiscoveryAgent</a></span> <span class="operator">*</span>discoveryAgent <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qbluetoothservicediscoveryagent.html#QBluetoothServiceDiscoveryAgent">QBluetoothServiceDiscoveryAgent</a></span>(<span class="keyword">this</span>);
      connect(discoveryAgent<span class="operator">,</span> SIGNAL(serviceDiscovered(<span class="type"><a href="qbluetoothserviceinfo.html">QBluetoothServiceInfo</a></span>))<span class="operator">,</span>
              <span class="keyword">this</span><span class="operator">,</span> SLOT(serviceDiscovered(<span class="type"><a href="qbluetoothserviceinfo.html">QBluetoothServiceInfo</a></span>)));

      <span class="comment">// Start a discovery</span>
      discoveryAgent<span class="operator">-</span><span class="operator">&gt;</span>start();

      <span class="comment">//...</span>
  }

  <span class="comment">// In your local slot, read information about the found devices</span>
  <span class="type">void</span> MyClass<span class="operator">::</span>serviceDiscovered(<span class="keyword">const</span> <span class="type"><a href="qbluetoothserviceinfo.html">QBluetoothServiceInfo</a></span> <span class="operator">&amp;</span>service)
  {
      qDebug() <span class="operator">&lt;</span><span class="operator">&lt;</span> <span class="string">&quot;Found new service:&quot;</span> <span class="operator">&lt;</span><span class="operator">&lt;</span> service<span class="operator">.</span>serviceName()
               <span class="operator">&lt;</span><span class="operator">&lt;</span> <span class="char">'('</span> <span class="operator">&lt;</span><span class="operator">&lt;</span> service<span class="operator">.</span>device()<span class="operator">.</span>address()<span class="operator">.</span>toString() <span class="operator">&lt;</span><span class="operator">&lt;</span> <span class="char">')'</span>;
  }

</pre>
<p>By default a minimal service discovery is performed. In this mode, the returned <a href="qbluetoothserviceinfo.html">QBluetoothServiceInfo</a> objects are guaranteed to contain only device and service UUID information. Depending on platform and device capabilities, other service information may also be available. The minimal service discovery mode relies on cached SDP data of the platform. Therefore it is possible that this discovery does not find a device although it is physically available. In such cases a full discovery must be performed to force an update of the platform cache. However for most use cases a minimal discovery is adequate as it is much quicker and other classes which require up-to-date information such as <a href="qbluetoothsocket.html#connectToService">QBluetoothSocket::connectToService</a>() will perform additional discovery if required. If the full service information is required, pass <a href="qbluetoothservicediscoveryagent.html#DiscoveryMode-enum">FullDiscovery</a> as the discoveryMode parameter to <a href="qbluetoothservicediscoveryagent.html#start">start</a>().</p>
<p>This class may internally utilize <a href="qbluetoothdevicediscoveryagent.html">QBluetoothDeviceDiscoveryAgent</a> to find unknown devices.</p>
<p>The service discovery may find Bluetooth Low Energy services too if the target device is a combination of a classic and Low Energy device. Those devices are required to advertise their Low Energy services via SDP. If the target device only supports Bluetooth Low Energy services, it is likely to not advertise them via SDP. The <a href="qlowenergycontroller.html">QLowEnergyController</a> class should be utilized to perform the service discovery on Low Energy devices.</p>
<p>On iOS, this class cannot be used because the platform does not expose an API which may permit access to <a href="qbluetoothservicediscoveryagent.html">QBluetoothServiceDiscoveryAgent</a> related features.</p>
</div>
<p><b>See also </b><a href="qbluetoothdevicediscoveryagent.html">QBluetoothDeviceDiscoveryAgent</a> and <a href="qlowenergycontroller.html">QLowEnergyController</a>.</p>
<!-- @@@QBluetoothServiceDiscoveryAgent -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$DiscoveryMode$$$MinimalDiscovery$$$FullDiscovery -->
<h3 class="fn" id="DiscoveryMode-enum"><a name="DiscoveryMode-enum"></a>enum QBluetoothServiceDiscoveryAgent::<span class="name">DiscoveryMode</span></h3>
<p>This enum describes the service discovery mode.</p>
<div class="table"><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"><code>QBluetoothServiceDiscoveryAgent::MinimalDiscovery</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">Performs a minimal service discovery. The <a href="qbluetoothserviceinfo.html">QBluetoothServiceInfo</a> objects returned may be incomplete and are only guaranteed to contain device and service UUID information. Since a minimal discovery relies on cached SDP data it may not find a physically existing device until a <code>FullDiscovery</code> is performed.</td></tr>
<tr><td class="topAlign"><code>QBluetoothServiceDiscoveryAgent::FullDiscovery</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">Performs a full service discovery.</td></tr>
</table></div>
<!-- @@@DiscoveryMode -->
<!-- $$$Error$$$NoError$$$InputOutputError$$$PoweredOffError$$$InvalidBluetoothAdapterError$$$UnknownError -->
<h3 class="fn" id="Error-enum"><a name="Error-enum"></a>enum QBluetoothServiceDiscoveryAgent::<span class="name">Error</span></h3>
<p>This enum describes errors that can occur during service discovery.</p>
<div class="table"><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"><code>QBluetoothServiceDiscoveryAgent::NoError</code></td><td class="topAlign tblval"><code>QBluetoothDeviceDiscoveryAgent::NoError</code></td><td class="topAlign">No error has occurred.</td></tr>
<tr><td class="topAlign"><code>QBluetoothServiceDiscoveryAgent::PoweredOffError</code></td><td class="topAlign tblval"><code>QBluetoothDeviceDiscoveryAgent::PoweredOffError</code></td><td class="topAlign">The Bluetooth adaptor is powered off, power it on before doing discovery.</td></tr>
<tr><td class="topAlign"><code>QBluetoothServiceDiscoveryAgent::InputOutputError</code></td><td class="topAlign tblval"><code>QBluetoothDeviceDiscoveryAgent::InputOutputError</code></td><td class="topAlign">Writing or reading from the device resulted in an error.</td></tr>
<tr><td class="topAlign"><code>QBluetoothServiceDiscoveryAgent::InvalidBluetoothAdapterError</code></td><td class="topAlign tblval"><code>QBluetoothDeviceDiscoveryAgent::InvalidBluetoothAdapterError</code></td><td class="topAlign">The passed local adapter address does not match the physical adapter address of any local Bluetooth device. This value was introduced by Qt 5.3&#x2e;</td></tr>
<tr><td class="topAlign"><code>QBluetoothServiceDiscoveryAgent::UnknownError</code></td><td class="topAlign tblval"><code>QBluetoothDeviceDiscoveryAgent::UnknownError</code></td><td class="topAlign">An unknown error has occurred.</td></tr>
</table></div>
<!-- @@@Error -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QBluetoothServiceDiscoveryAgent[overload1]$$$QBluetoothServiceDiscoveryAgentQObject* -->
<h3 class="fn" id="QBluetoothServiceDiscoveryAgent"><a name="QBluetoothServiceDiscoveryAgent"></a>QBluetoothServiceDiscoveryAgent::<span class="name">QBluetoothServiceDiscoveryAgent</span>(<span class="type">QObject</span> *<i>parent</i> = nullptr)</h3>
<p>Constructs a new <a href="qbluetoothservicediscoveryagent.html">QBluetoothServiceDiscoveryAgent</a> with <i>parent</i>. The search is performed via the local default Bluetooth adapter.</p>
<!-- @@@QBluetoothServiceDiscoveryAgent -->
<!-- $$$QBluetoothServiceDiscoveryAgent$$$QBluetoothServiceDiscoveryAgentconstQBluetoothAddress&QObject* -->
<h3 class="fn" id="QBluetoothServiceDiscoveryAgent-1"><a name="QBluetoothServiceDiscoveryAgent-1"></a>QBluetoothServiceDiscoveryAgent::<span class="name">QBluetoothServiceDiscoveryAgent</span>(const <span class="type"><a href="qbluetoothaddress.html">QBluetoothAddress</a></span> &amp;<i>deviceAdapter</i>, <span class="type">QObject</span> *<i>parent</i> = nullptr)</h3>
<p>Constructs a new <a href="qbluetoothservicediscoveryagent.html">QBluetoothServiceDiscoveryAgent</a> for <i>deviceAdapter</i> and with <i>parent</i>.</p>
<p>It uses <i>deviceAdapter</i> for the service search. If <i>deviceAdapter</i> is default constructed the resulting <a href="qbluetoothservicediscoveryagent.html">QBluetoothServiceDiscoveryAgent</a> object will use the local default Bluetooth adapter.</p>
<p>If a <i>deviceAdapter</i> is specified that is not a local adapter <a href="qbluetoothservicediscoveryagent.html#error">error</a>() will be set to <a href="qbluetoothservicediscoveryagent.html#Error-enum">InvalidBluetoothAdapterError</a>. Therefore it is recommended to test the error flag immediately after using this constructor.</p>
<p><b>Note: </b>On WinRT the passed adapter address will be ignored.</p><p><b>Note: </b>On Android passing any <i>deviceAdapter</i> address is meaningless as Android 6.0 or later does not publish the local Bluetooth address anymore. Subsequently, the passed adapter address can never be matched against the local adapter address. Therefore the subsequent call to <a href="qbluetoothservicediscoveryagent.html#start">start</a>() will always trigger <a href="qbluetoothservicediscoveryagent.html#Error-enum">InvalidBluetoothAdapterError</a>.</p><p><b>See also </b><a href="qbluetoothservicediscoveryagent.html#error">error</a>().</p>
<!-- @@@QBluetoothServiceDiscoveryAgent -->
<!-- $$$~QBluetoothServiceDiscoveryAgent[overload1]$$$~QBluetoothServiceDiscoveryAgent -->
<h3 class="fn" id="dtor.QBluetoothServiceDiscoveryAgent"><a name="dtor.QBluetoothServiceDiscoveryAgent"></a><code>[virtual] </code>QBluetoothServiceDiscoveryAgent::<span class="name">~QBluetoothServiceDiscoveryAgent</span>()</h3>
<p>Destructor for <a href="qbluetoothservicediscoveryagent.html">QBluetoothServiceDiscoveryAgent</a></p>
<!-- @@@~QBluetoothServiceDiscoveryAgent -->
<!-- $$$canceled[overload1]$$$canceled -->
<h3 class="fn" id="canceled"><a name="canceled"></a><code>[signal] </code><span class="type">void</span> QBluetoothServiceDiscoveryAgent::<span class="name">canceled</span>()</h3>
<p>This signal is triggered when the service discovery was canceled via a call to <a href="qbluetoothservicediscoveryagent.html#stop">stop</a>().</p>
<!-- @@@canceled -->
<!-- $$$clear[overload1]$$$clear -->
<h3 class="fn" id="clear"><a name="clear"></a><code>[slot] </code><span class="type">void</span> QBluetoothServiceDiscoveryAgent::<span class="name">clear</span>()</h3>
<p>Clears the results of previous service discoveries and resets <a href="qbluetoothservicediscoveryagent.html#uuidFilter">uuidFilter</a>(). This function does nothing during an ongoing service discovery (see <a href="qbluetoothservicediscoveryagent.html#isActive">isActive</a>()).</p>
<p><b>See also </b><a href="qbluetoothservicediscoveryagent.html#discoveredServices">discoveredServices</a>().</p>
<!-- @@@clear -->
<!-- $$$discoveredServices[overload1]$$$discoveredServices -->
<h3 class="fn" id="discoveredServices"><a name="discoveredServices"></a><span class="type">QList</span>&lt;<span class="type"><a href="qbluetoothserviceinfo.html">QBluetoothServiceInfo</a></span>&gt; QBluetoothServiceDiscoveryAgent::<span class="name">discoveredServices</span>() const</h3>
<p>Returns the list of all discovered services.</p>
<p>This list of services accumulates newly discovered services from multiple calls to <a href="qbluetoothservicediscoveryagent.html#start">start</a>(). Unless <a href="qbluetoothservicediscoveryagent.html#clear">clear</a>() is called the list cannot decrease in size. This implies that if a remote Bluetooth device moves out of range in between two subsequent calls to <a href="qbluetoothservicediscoveryagent.html#start">start</a>() the list may contain stale entries.</p>
<p><b>Note: </b>The list of services should always be cleared before the discovery mode is changed.</p><p><b>See also </b><a href="qbluetoothservicediscoveryagent.html#clear">clear</a>().</p>
<!-- @@@discoveredServices -->
<!-- $$$error[overload1]$$$error -->
<h3 class="fn" id="error"><a name="error"></a><span class="type"><a href="qbluetoothservicediscoveryagent.html#Error-enum">QBluetoothServiceDiscoveryAgent::Error</a></span> QBluetoothServiceDiscoveryAgent::<span class="name">error</span>() const</h3>
<p>Returns the type of error that last occurred. If the service discovery is done for a single <a href="qbluetoothservicediscoveryagent.html#remoteAddress">remoteAddress</a>() it will return errors that occurred while trying to discover services on that device. If the <a href="qbluetoothservicediscoveryagent.html#remoteAddress">remoteAddress</a>() is not set and devices are discovered by a scan, errors during service discovery on individual devices are not saved and no signals are emitted. In this case, errors are fairly normal as some devices may not respond to discovery or may no longer be in range. Such errors are surpressed. If no services are returned, it can be assumed no services could be discovered.</p>
<!-- @@@error -->
<!-- $$$error$$$errorQBluetoothServiceDiscoveryAgent::Error -->
<h3 class="fn" id="error-1"><a name="error-1"></a><code>[signal] </code><span class="type">void</span> QBluetoothServiceDiscoveryAgent::<span class="name">error</span>(<span class="type"><a href="qbluetoothservicediscoveryagent.html#Error-enum">QBluetoothServiceDiscoveryAgent::Error</a></span> <i>error</i>)</h3>
<p>This signal is emitted when an <i>error</i> occurs. The <i>error</i> parameter describes the error that occurred.</p>
<p><b>Note:</b> Signal <i>error</i> is overloaded in this class. To connect to this signal by using the function pointer syntax, Qt provides a convenient helper for obtaining the function pointer as shown in this example:<pre class="cpp">

  connect(bluetoothServiceDiscoveryAgent<span class="operator">,</span> <span class="type">QOverload</span><span class="operator">&lt;</span><span class="type"><a href="qbluetoothservicediscoveryagent.html#QBluetoothServiceDiscoveryAgent">QBluetoothServiceDiscoveryAgent</a></span><span class="operator">::</span>Error<span class="operator">&gt;</span><span class="operator">::</span>of(<span class="operator">&amp;</span><span class="type"><a href="qbluetoothservicediscoveryagent.html#QBluetoothServiceDiscoveryAgent">QBluetoothServiceDiscoveryAgent</a></span><span class="operator">::</span>error)<span class="operator">,</span>
      <span class="operator">[</span><span class="operator">=</span><span class="operator">]</span>(<span class="type"><a href="qbluetoothservicediscoveryagent.html#QBluetoothServiceDiscoveryAgent">QBluetoothServiceDiscoveryAgent</a></span><span class="operator">::</span>Error error){ <span class="comment">/* ... */</span> });

</pre>
<!-- @@@error -->
<!-- $$$errorString[overload1]$$$errorString -->
<h3 class="fn" id="errorString"><a name="errorString"></a><span class="type">QString</span> QBluetoothServiceDiscoveryAgent::<span class="name">errorString</span>() const</h3>
<p>Returns a human-readable description of the last error that occurred during the service discovery.</p>
<!-- @@@errorString -->
<!-- $$$finished[overload1]$$$finished -->
<h3 class="fn" id="finished"><a name="finished"></a><code>[signal] </code><span class="type">void</span> QBluetoothServiceDiscoveryAgent::<span class="name">finished</span>()</h3>
<p>This signal is emitted when the Bluetooth service discovery completes.</p>
<p>Unlike the <a href="qbluetoothdevicediscoveryagent.html#finished">QBluetoothDeviceDiscoveryAgent::finished</a>() signal this signal will even be emitted when an error occurred during the service discovery. Therefore it is recommended to check the <a href="qbluetoothservicediscoveryagent.html#error">error</a>() signal to evaluate the success of the service discovery discovery.</p>
<!-- @@@finished -->
<!-- $$$isActive[overload1]$$$isActive -->
<h3 class="fn" id="isActive"><a name="isActive"></a><span class="type">bool</span> QBluetoothServiceDiscoveryAgent::<span class="name">isActive</span>() const</h3>
<p>Returns <code>true</code> if the service discovery is currently active; otherwise returns <code>false</code>. An active discovery can be stopped by calling <a href="qbluetoothservicediscoveryagent.html#stop">stop</a>().</p>
<!-- @@@isActive -->
<!-- $$$remoteAddress[overload1]$$$remoteAddress -->
<h3 class="fn" id="remoteAddress"><a name="remoteAddress"></a><span class="type"><a href="qbluetoothaddress.html">QBluetoothAddress</a></span> QBluetoothServiceDiscoveryAgent::<span class="name">remoteAddress</span>() const</h3>
<p>Returns the remote device address. If <a href="qbluetoothservicediscoveryagent.html#setRemoteAddress">setRemoteAddress</a>() is not called, the function will return a default constructed <a href="qbluetoothaddress.html">QBluetoothAddress</a>.</p>
<p><b>See also </b><a href="qbluetoothservicediscoveryagent.html#setRemoteAddress">setRemoteAddress</a>().</p>
<!-- @@@remoteAddress -->
<!-- $$$serviceDiscovered[overload1]$$$serviceDiscoveredconstQBluetoothServiceInfo& -->
<h3 class="fn" id="serviceDiscovered"><a name="serviceDiscovered"></a><code>[signal] </code><span class="type">void</span> QBluetoothServiceDiscoveryAgent::<span class="name">serviceDiscovered</span>(const <span class="type"><a href="qbluetoothserviceinfo.html">QBluetoothServiceInfo</a></span> &amp;<i>info</i>)</h3>
<p>This signal is emitted when the Bluetooth service described by <i>info</i> is discovered.</p>
<p><b>Note: </b>The passed <a href="qbluetoothserviceinfo.html">QBluetoothServiceInfo</a> parameter may contain a Bluetooth Low Energy service if the target device advertises the service via SDP. This is required from device which support both, classic Bluetooth (BaseRate) and Low Energy services.</p><p><b>See also </b><a href="qbluetoothdeviceinfo.html#coreConfigurations">QBluetoothDeviceInfo::coreConfigurations</a>().</p>
<!-- @@@serviceDiscovered -->
<!-- $$$setRemoteAddress[overload1]$$$setRemoteAddressconstQBluetoothAddress& -->
<h3 class="fn" id="setRemoteAddress"><a name="setRemoteAddress"></a><span class="type">bool</span> QBluetoothServiceDiscoveryAgent::<span class="name">setRemoteAddress</span>(const <span class="type"><a href="qbluetoothaddress.html">QBluetoothAddress</a></span> &amp;<i>address</i>)</h3>
<p>Sets the remote device address to <i>address</i>. If <i>address</i> is default constructed, services will be discovered on all contactable Bluetooth devices. A new remote address can only be set while there is no service discovery in progress; otherwise this function returns false.</p>
<p>On some platforms the service discovery might lead to pairing requests. Therefore it is not recommended to do service discoveries on all devices. This function can be used to restrict the service discovery to a particular device.</p>
<p><b>See also </b><a href="qbluetoothservicediscoveryagent.html#remoteAddress">remoteAddress</a>().</p>
<!-- @@@setRemoteAddress -->
<!-- $$$setUuidFilter[overload1]$$$setUuidFilterconstQList<QBluetoothUuid>& -->
<h3 class="fn" id="setUuidFilter"><a name="setUuidFilter"></a><span class="type">void</span> QBluetoothServiceDiscoveryAgent::<span class="name">setUuidFilter</span>(const <span class="type">QList</span>&lt;<span class="type"><a href="qbluetoothuuid.html">QBluetoothUuid</a></span>&gt; &amp;<i>uuids</i>)</h3>
<p>Sets the UUID filter to <i>uuids</i>. Only services matching the UUIDs in <i>uuids</i> will be returned. The matching applies to the service's <a href="qbluetoothserviceinfo.html#AttributeId-enum">ServiceId</a> and <a href="qbluetoothserviceinfo.html#AttributeId-enum">ServiceClassIds</a> attributes.</p>
<p>An empty UUID list is equivalent to a list containing only <a href="qbluetoothuuid.html#ServiceClassUuid-enum">QBluetoothUuid::PublicBrowseGroup</a>.</p>
<p><b>See also </b><a href="qbluetoothservicediscoveryagent.html#uuidFilter">uuidFilter</a>().</p>
<!-- @@@setUuidFilter -->
<!-- $$$setUuidFilter$$$setUuidFilterconstQBluetoothUuid& -->
<h3 class="fn" id="setUuidFilter-1"><a name="setUuidFilter-1"></a><span class="type">void</span> QBluetoothServiceDiscoveryAgent::<span class="name">setUuidFilter</span>(const <span class="type"><a href="qbluetoothuuid.html">QBluetoothUuid</a></span> &amp;<i>uuid</i>)</h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>Sets the UUID filter to a list containing the single element <i>uuid</i>. The matching applies to the service's <a href="qbluetoothserviceinfo.html#AttributeId-enum">ServiceId</a> and <a href="qbluetoothserviceinfo.html#AttributeId-enum">ServiceClassIds</a> attributes.</p>
<p><b>See also </b><a href="qbluetoothservicediscoveryagent.html#uuidFilter">uuidFilter</a>().</p>
<!-- @@@setUuidFilter -->
<!-- $$$start[overload1]$$$startQBluetoothServiceDiscoveryAgent::DiscoveryMode -->
<h3 class="fn" id="start"><a name="start"></a><code>[slot] </code><span class="type">void</span> QBluetoothServiceDiscoveryAgent::<span class="name">start</span>(<span class="type"><a href="qbluetoothservicediscoveryagent.html#DiscoveryMode-enum">QBluetoothServiceDiscoveryAgent::DiscoveryMode</a></span> <i>mode</i> = MinimalDiscovery)</h3>
<p>Starts service discovery. <i>mode</i> specifies the type of service discovery to perform.</p>
<p>On some platforms, device discovery may lead to pairing requests.</p>
<p><b>See also </b><a href="qbluetoothservicediscoveryagent.html#DiscoveryMode-enum">DiscoveryMode</a>.</p>
<!-- @@@start -->
<!-- $$$stop[overload1]$$$stop -->
<h3 class="fn" id="stop"><a name="stop"></a><code>[slot] </code><span class="type">void</span> QBluetoothServiceDiscoveryAgent::<span class="name">stop</span>()</h3>
<p>Stops the service discovery process. The <a href="qbluetoothservicediscoveryagent.html#canceled">canceled</a>() signal will be emitted once the search has stopped.</p>
<!-- @@@stop -->
<!-- $$$uuidFilter[overload1]$$$uuidFilter -->
<h3 class="fn" id="uuidFilter"><a name="uuidFilter"></a><span class="type">QList</span>&lt;<span class="type"><a href="qbluetoothuuid.html">QBluetoothUuid</a></span>&gt; QBluetoothServiceDiscoveryAgent::<span class="name">uuidFilter</span>() const</h3>
<p>Returns the UUID filter.</p>
<p><b>See also </b><a href="qbluetoothservicediscoveryagent.html#setUuidFilter">setUuidFilter</a>().</p>
<!-- @@@uuidFilter -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed 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.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>