esp-nimble-cpp/class_nim_b_l_e_scan_results.html

255 lines
15 KiB
HTML
Raw Normal View History

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
2022-01-15 23:23:57 +01:00
<title>esp-nimble-cpp: NimBLEScanResults Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">esp-nimble-cpp<span id="projectnumber">&#160;2.0.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('class_nim_b_l_e_scan_results.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="class_nim_b_l_e_scan_results-members.html">List of all members</a> </div>
<div class="headertitle"><div class="title">NimBLEScanResults Class Reference</div></div>
</div><!--header-->
<div class="contents">
<p>A class that contains and operates on the results of a BLE scan.
<a href="class_nim_b_l_e_scan_results.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="_nim_b_l_e_scan_8h_source.html">NimBLEScan.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:af143b1aa3bd67157dd263fcbeb4827ba" id="r_af143b1aa3bd67157dd263fcbeb4827ba"><td class="memItemLeft" align="right" valign="top"><a id="af143b1aa3bd67157dd263fcbeb4827ba" name="af143b1aa3bd67157dd263fcbeb4827ba"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>dump</b> () const</td></tr>
<tr class="memdesc:af143b1aa3bd67157dd263fcbeb4827ba"><td class="mdescLeft">&#160;</td><td class="mdescRight">Dump the scan results to the log. <br /></td></tr>
<tr class="separator:af143b1aa3bd67157dd263fcbeb4827ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a59c62c0825917ebb26bcb1efa2a98f4d" id="r_a59c62c0825917ebb26bcb1efa2a98f4d"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_scan_results.html#a59c62c0825917ebb26bcb1efa2a98f4d">getCount</a> () const</td></tr>
<tr class="memdesc:a59c62c0825917ebb26bcb1efa2a98f4d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the count of devices found in the last scan. <br /></td></tr>
<tr class="separator:a59c62c0825917ebb26bcb1efa2a98f4d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a98b106a3929919bf2c80cc0dfff59ba1" id="r_a98b106a3929919bf2c80cc0dfff59ba1"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="class_nim_b_l_e_advertised_device.html">NimBLEAdvertisedDevice</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_scan_results.html#a98b106a3929919bf2c80cc0dfff59ba1">getDevice</a> (uint32_t idx) const</td></tr>
<tr class="memdesc:a98b106a3929919bf2c80cc0dfff59ba1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the specified device at the given index. The index should be between 0 and <a class="el" href="class_nim_b_l_e_scan_results.html#a59c62c0825917ebb26bcb1efa2a98f4d" title="Get the count of devices found in the last scan.">getCount()</a>-1. <br /></td></tr>
<tr class="separator:a98b106a3929919bf2c80cc0dfff59ba1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa96e8a647f0db95e2fa8cfae44f6d92e" id="r_aa96e8a647f0db95e2fa8cfae44f6d92e"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="class_nim_b_l_e_advertised_device.html">NimBLEAdvertisedDevice</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_scan_results.html#aa96e8a647f0db95e2fa8cfae44f6d92e">getDevice</a> (const <a class="el" href="class_nim_b_l_e_address.html">NimBLEAddress</a> &amp;address) const</td></tr>
<tr class="memdesc:aa96e8a647f0db95e2fa8cfae44f6d92e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get a pointer to the specified device at the given address. If the address is not found a nullptr is returned. <br /></td></tr>
<tr class="separator:aa96e8a647f0db95e2fa8cfae44f6d92e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5a0b1dc434c4ad68ae5ce233eeacc230" id="r_a5a0b1dc434c4ad68ae5ce233eeacc230"><td class="memItemLeft" align="right" valign="top">std::vector&lt; <a class="el" href="class_nim_b_l_e_advertised_device.html">NimBLEAdvertisedDevice</a> * &gt;::const_iterator&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_scan_results.html#a5a0b1dc434c4ad68ae5ce233eeacc230">begin</a> () const</td></tr>
<tr class="memdesc:a5a0b1dc434c4ad68ae5ce233eeacc230"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get iterator to the beginning of the vector of advertised device pointers. <br /></td></tr>
<tr class="separator:a5a0b1dc434c4ad68ae5ce233eeacc230"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2547ebc0f9f0e1f48346ff0188ed6479" id="r_a2547ebc0f9f0e1f48346ff0188ed6479"><td class="memItemLeft" align="right" valign="top">std::vector&lt; <a class="el" href="class_nim_b_l_e_advertised_device.html">NimBLEAdvertisedDevice</a> * &gt;::const_iterator&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_scan_results.html#a2547ebc0f9f0e1f48346ff0188ed6479">end</a> () const</td></tr>
<tr class="memdesc:a2547ebc0f9f0e1f48346ff0188ed6479"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get iterator to the end of the vector of advertised device pointers. <br /></td></tr>
<tr class="separator:a2547ebc0f9f0e1f48346ff0188ed6479"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A class that contains and operates on the results of a BLE scan. </p>
<p>When a scan completes, we have a set of found devices. Each device is described by a <a class="el" href="class_nim_b_l_e_advertised_device.html" title="A representation of a BLE advertised device found by a scan.">NimBLEAdvertisedDevice</a> object. The number of items in the set is given by <a class="el" href="class_nim_b_l_e_scan_results.html#a59c62c0825917ebb26bcb1efa2a98f4d" title="Get the count of devices found in the last scan.">getCount()</a>. We can retrieve a device by calling <a class="el" href="class_nim_b_l_e_scan_results.html#a98b106a3929919bf2c80cc0dfff59ba1" title="Return the specified device at the given index. The index should be between 0 and getCount()-1.">getDevice()</a> passing in the index (starting at 0) of the desired device. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a5a0b1dc434c4ad68ae5ce233eeacc230" name="a5a0b1dc434c4ad68ae5ce233eeacc230"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5a0b1dc434c4ad68ae5ce233eeacc230">&#9670;&#160;</a></span>begin()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::vector&lt; <a class="el" href="class_nim_b_l_e_advertised_device.html">NimBLEAdvertisedDevice</a> * &gt;::const_iterator NimBLEScanResults::begin </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Get iterator to the beginning of the vector of advertised device pointers. </p>
<dl class="section return"><dt>Returns</dt><dd>An iterator to the beginning of the vector of advertised device pointers. </dd></dl>
</div>
</div>
<a id="a2547ebc0f9f0e1f48346ff0188ed6479" name="a2547ebc0f9f0e1f48346ff0188ed6479"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2547ebc0f9f0e1f48346ff0188ed6479">&#9670;&#160;</a></span>end()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::vector&lt; <a class="el" href="class_nim_b_l_e_advertised_device.html">NimBLEAdvertisedDevice</a> * &gt;::const_iterator NimBLEScanResults::end </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Get iterator to the end of the vector of advertised device pointers. </p>
<dl class="section return"><dt>Returns</dt><dd>An iterator to the end of the vector of advertised device pointers. </dd></dl>
</div>
</div>
<a id="a59c62c0825917ebb26bcb1efa2a98f4d" name="a59c62c0825917ebb26bcb1efa2a98f4d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a59c62c0825917ebb26bcb1efa2a98f4d">&#9670;&#160;</a></span>getCount()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int NimBLEScanResults::getCount </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the count of devices found in the last scan. </p>
<dl class="section return"><dt>Returns</dt><dd>The number of devices found in the last scan. </dd></dl>
</div>
</div>
<a id="aa96e8a647f0db95e2fa8cfae44f6d92e" name="aa96e8a647f0db95e2fa8cfae44f6d92e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa96e8a647f0db95e2fa8cfae44f6d92e">&#9670;&#160;</a></span>getDevice() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="class_nim_b_l_e_advertised_device.html">NimBLEAdvertisedDevice</a> * NimBLEScanResults::getDevice </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="class_nim_b_l_e_address.html">NimBLEAddress</a> &amp;&#160;</td>
<td class="paramname"><em>address</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Get a pointer to the specified device at the given address. If the address is not found a nullptr is returned. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">address</td><td>The address of the device. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A pointer to the device at the specified address. </dd></dl>
</div>
</div>
<a id="a98b106a3929919bf2c80cc0dfff59ba1" name="a98b106a3929919bf2c80cc0dfff59ba1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a98b106a3929919bf2c80cc0dfff59ba1">&#9670;&#160;</a></span>getDevice() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="class_nim_b_l_e_advertised_device.html">NimBLEAdvertisedDevice</a> * NimBLEScanResults::getDevice </td>
<td>(</td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>idx</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Return the specified device at the given index. The index should be between 0 and <a class="el" href="class_nim_b_l_e_scan_results.html#a59c62c0825917ebb26bcb1efa2a98f4d" title="Get the count of devices found in the last scan.">getCount()</a>-1. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">idx</td><td>The index of the device. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The device at the specified index. </dd></dl>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="class_nim_b_l_e_scan_results.html">NimBLEScanResults</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8 </li>
</ul>
</div>
</body>
</html>