mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2024-12-25 04:00:46 +01:00
660 lines
34 KiB
HTML
660 lines
34 KiB
HTML
<!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"/>
|
|
<title>esp-nimble-cpp: NimBLEScan 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"> 2.0.2</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&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&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&dn=expat.txt MIT */
|
|
$(document).ready(function(){initNavTree('class_nim_b_l_e_scan.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> |
|
|
<a href="class_nim_b_l_e_scan-members.html">List of all members</a> </div>
|
|
<div class="headertitle"><div class="title">NimBLEScan Class Reference</div></div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
|
|
<p>Perform and manage BLE scans.
|
|
<a href="class_nim_b_l_e_scan.html#details">More...</a></p>
|
|
|
|
<p><code>#include <<a class="el" href="_nim_b_l_e_scan_8h_source.html">NimBLEScan.h</a>></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:ac1307f30a881688d3a4d57bac7abe02c" id="r_ac1307f30a881688d3a4d57bac7abe02c"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_scan.html#ac1307f30a881688d3a4d57bac7abe02c">start</a> (uint32_t duration, bool isContinue=false, bool restart=true)</td></tr>
|
|
<tr class="memdesc:ac1307f30a881688d3a4d57bac7abe02c"><td class="mdescLeft"> </td><td class="mdescRight">Start scanning. <br /></td></tr>
|
|
<tr class="separator:ac1307f30a881688d3a4d57bac7abe02c"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ab788ad282fdbf4467302f6ad2d4d6016" id="r_ab788ad282fdbf4467302f6ad2d4d6016"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_scan.html#ab788ad282fdbf4467302f6ad2d4d6016">isScanning</a> ()</td></tr>
|
|
<tr class="memdesc:ab788ad282fdbf4467302f6ad2d4d6016"><td class="mdescLeft"> </td><td class="mdescRight">Get the status of the scanner. <br /></td></tr>
|
|
<tr class="separator:ab788ad282fdbf4467302f6ad2d4d6016"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a3b0d41fc5d9113a02357c1b2a43c5d1d" id="r_a3b0d41fc5d9113a02357c1b2a43c5d1d"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_scan.html#a3b0d41fc5d9113a02357c1b2a43c5d1d">setScanCallbacks</a> (<a class="el" href="class_nim_b_l_e_scan_callbacks.html">NimBLEScanCallbacks</a> *pScanCallbacks, bool wantDuplicates=false)</td></tr>
|
|
<tr class="memdesc:a3b0d41fc5d9113a02357c1b2a43c5d1d"><td class="mdescLeft"> </td><td class="mdescRight">Set the call backs to be invoked. <br /></td></tr>
|
|
<tr class="separator:a3b0d41fc5d9113a02357c1b2a43c5d1d"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a7d24e77d6b339552b6ac16effdb54910" id="r_a7d24e77d6b339552b6ac16effdb54910"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_scan.html#a7d24e77d6b339552b6ac16effdb54910">setActiveScan</a> (bool active)</td></tr>
|
|
<tr class="memdesc:a7d24e77d6b339552b6ac16effdb54910"><td class="mdescLeft"> </td><td class="mdescRight">Should we perform an active or passive scan? The default is a passive scan. An active scan means that we will request a scan response. <br /></td></tr>
|
|
<tr class="separator:a7d24e77d6b339552b6ac16effdb54910"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a4c3e1794c3e56acba76ee269ffb1393e" id="r_a4c3e1794c3e56acba76ee269ffb1393e"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_scan.html#a4c3e1794c3e56acba76ee269ffb1393e">setInterval</a> (uint16_t intervalMs)</td></tr>
|
|
<tr class="memdesc:a4c3e1794c3e56acba76ee269ffb1393e"><td class="mdescLeft"> </td><td class="mdescRight">Set the interval to scan. <br /></td></tr>
|
|
<tr class="separator:a4c3e1794c3e56acba76ee269ffb1393e"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a0fec97ad0f4ff191bb853138c30d5316" id="r_a0fec97ad0f4ff191bb853138c30d5316"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_scan.html#a0fec97ad0f4ff191bb853138c30d5316">setWindow</a> (uint16_t windowMs)</td></tr>
|
|
<tr class="memdesc:a0fec97ad0f4ff191bb853138c30d5316"><td class="mdescLeft"> </td><td class="mdescRight">Set the window to actively scan. <br /></td></tr>
|
|
<tr class="separator:a0fec97ad0f4ff191bb853138c30d5316"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aabbf3f1804a844a7db0284ecc2b78408" id="r_aabbf3f1804a844a7db0284ecc2b78408"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_scan.html#aabbf3f1804a844a7db0284ecc2b78408">setDuplicateFilter</a> (uint8_t enabled)</td></tr>
|
|
<tr class="memdesc:aabbf3f1804a844a7db0284ecc2b78408"><td class="mdescLeft"> </td><td class="mdescRight">Set whether or not the BLE controller should only report results from devices it has not already seen. <br /></td></tr>
|
|
<tr class="separator:aabbf3f1804a844a7db0284ecc2b78408"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a77483be2bd9dad08322cc64f4e7012c1" id="r_a77483be2bd9dad08322cc64f4e7012c1"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_scan.html#a77483be2bd9dad08322cc64f4e7012c1">setLimitedOnly</a> (bool enabled)</td></tr>
|
|
<tr class="memdesc:a77483be2bd9dad08322cc64f4e7012c1"><td class="mdescLeft"> </td><td class="mdescRight">Set whether or not the BLE controller only reports scan results from devices advertising in limited discovery mode. <br /></td></tr>
|
|
<tr class="separator:a77483be2bd9dad08322cc64f4e7012c1"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a4248aabb5da67953eadab2a6f834d967" id="r_a4248aabb5da67953eadab2a6f834d967"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_scan.html#a4248aabb5da67953eadab2a6f834d967">setFilterPolicy</a> (uint8_t filter)</td></tr>
|
|
<tr class="memdesc:a4248aabb5da67953eadab2a6f834d967"><td class="mdescLeft"> </td><td class="mdescRight">Sets the scan filter policy. <br /></td></tr>
|
|
<tr class="separator:a4248aabb5da67953eadab2a6f834d967"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a68fa5cc715f62a9a97ac0dccfb8557c1" id="r_a68fa5cc715f62a9a97ac0dccfb8557c1"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_scan.html#a68fa5cc715f62a9a97ac0dccfb8557c1">stop</a> ()</td></tr>
|
|
<tr class="memdesc:a68fa5cc715f62a9a97ac0dccfb8557c1"><td class="mdescLeft"> </td><td class="mdescRight">Stop an in progress scan. <br /></td></tr>
|
|
<tr class="separator:a68fa5cc715f62a9a97ac0dccfb8557c1"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ad421a09eeb021755b193a7a5e01f183b" id="r_ad421a09eeb021755b193a7a5e01f183b"><td class="memItemLeft" align="right" valign="top"><a id="ad421a09eeb021755b193a7a5e01f183b" name="ad421a09eeb021755b193a7a5e01f183b"></a>
|
|
void </td><td class="memItemRight" valign="bottom"><b>clearResults</b> ()</td></tr>
|
|
<tr class="memdesc:ad421a09eeb021755b193a7a5e01f183b"><td class="mdescLeft"> </td><td class="mdescRight">Clear the stored results of the scan. <br /></td></tr>
|
|
<tr class="separator:ad421a09eeb021755b193a7a5e01f183b"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a2ae53719546e2d410c816e12c56aad61" id="r_a2ae53719546e2d410c816e12c56aad61"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_nim_b_l_e_scan_results.html">NimBLEScanResults</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_scan.html#a2ae53719546e2d410c816e12c56aad61">getResults</a> ()</td></tr>
|
|
<tr class="memdesc:a2ae53719546e2d410c816e12c56aad61"><td class="mdescLeft"> </td><td class="mdescRight">Get the results of the scan. <br /></td></tr>
|
|
<tr class="separator:a2ae53719546e2d410c816e12c56aad61"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ade1492b5d1b5d97efa76cd41583bfc96" id="r_ade1492b5d1b5d97efa76cd41583bfc96"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_nim_b_l_e_scan_results.html">NimBLEScanResults</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_scan.html#ade1492b5d1b5d97efa76cd41583bfc96">getResults</a> (uint32_t duration, bool is_continue=false)</td></tr>
|
|
<tr class="memdesc:ade1492b5d1b5d97efa76cd41583bfc96"><td class="mdescLeft"> </td><td class="mdescRight">Start scanning and block until scanning has been completed. <br /></td></tr>
|
|
<tr class="separator:ade1492b5d1b5d97efa76cd41583bfc96"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aad9cd2462d00d7c0fa39d095aa2d8e81" id="r_aad9cd2462d00d7c0fa39d095aa2d8e81"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_scan.html#aad9cd2462d00d7c0fa39d095aa2d8e81">setMaxResults</a> (uint8_t maxResults)</td></tr>
|
|
<tr class="memdesc:aad9cd2462d00d7c0fa39d095aa2d8e81"><td class="mdescLeft"> </td><td class="mdescRight">Sets the max number of results to store. <br /></td></tr>
|
|
<tr class="separator:aad9cd2462d00d7c0fa39d095aa2d8e81"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a566a9ef25b04e946ac23402bb760cda1" id="r_a566a9ef25b04e946ac23402bb760cda1"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_scan.html#a566a9ef25b04e946ac23402bb760cda1">erase</a> (const <a class="el" href="class_nim_b_l_e_address.html">NimBLEAddress</a> &address)</td></tr>
|
|
<tr class="memdesc:a566a9ef25b04e946ac23402bb760cda1"><td class="mdescLeft"> </td><td class="mdescRight">Delete peer device from the scan results vector. <br /></td></tr>
|
|
<tr class="separator:a566a9ef25b04e946ac23402bb760cda1"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:acaa40328d16e040e9f92cba4819cb045" id="r_acaa40328d16e040e9f92cba4819cb045"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_scan.html#acaa40328d16e040e9f92cba4819cb045">erase</a> (const <a class="el" href="class_nim_b_l_e_advertised_device.html">NimBLEAdvertisedDevice</a> *device)</td></tr>
|
|
<tr class="memdesc:acaa40328d16e040e9f92cba4819cb045"><td class="mdescLeft"> </td><td class="mdescRight">Delete peer device from the scan results vector. <br /></td></tr>
|
|
<tr class="separator:acaa40328d16e040e9f92cba4819cb045"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a17f2f775b5e6793f06a412f840d5dceb" id="r_a17f2f775b5e6793f06a412f840d5dceb"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_scan.html#a17f2f775b5e6793f06a412f840d5dceb">setPhy</a> (Phy phyMask)</td></tr>
|
|
<tr class="memdesc:a17f2f775b5e6793f06a412f840d5dceb"><td class="mdescLeft"> </td><td class="mdescRight">Set the PHYs to scan. <br /></td></tr>
|
|
<tr class="separator:a17f2f775b5e6793f06a412f840d5dceb"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aaace4d0b128b6294276347f6790f3f8b" id="r_aaace4d0b128b6294276347f6790f3f8b"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_scan.html#aaace4d0b128b6294276347f6790f3f8b">setPeriod</a> (uint32_t periodMs)</td></tr>
|
|
<tr class="memdesc:aaace4d0b128b6294276347f6790f3f8b"><td class="mdescLeft"> </td><td class="mdescRight">Set the extended scanning period. <br /></td></tr>
|
|
<tr class="separator:aaace4d0b128b6294276347f6790f3f8b"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<div class="textblock"><p>Perform and manage BLE scans. </p>
|
|
<p>Scanning is associated with a BLE client that is attempting to locate BLE servers. </p>
|
|
</div><h2 class="groupheader">Member Function Documentation</h2>
|
|
<a id="a566a9ef25b04e946ac23402bb760cda1" name="a566a9ef25b04e946ac23402bb760cda1"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a566a9ef25b04e946ac23402bb760cda1">◆ </a></span>erase() <span class="overload">[1/2]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void NimBLEScan::erase </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="class_nim_b_l_e_address.html">NimBLEAddress</a> & </td>
|
|
<td class="paramname"><em>address</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Delete peer device from the scan results vector. </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 to delete from the results. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="acaa40328d16e040e9f92cba4819cb045" name="acaa40328d16e040e9f92cba4819cb045"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#acaa40328d16e040e9f92cba4819cb045">◆ </a></span>erase() <span class="overload">[2/2]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void NimBLEScan::erase </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="class_nim_b_l_e_advertised_device.html">NimBLEAdvertisedDevice</a> * </td>
|
|
<td class="paramname"><em>device</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Delete peer device from the scan results vector. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">device</td><td>The device to delete from the results. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a2ae53719546e2d410c816e12c56aad61" name="a2ae53719546e2d410c816e12c56aad61"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a2ae53719546e2d410c816e12c56aad61">◆ </a></span>getResults() <span class="overload">[1/2]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="class_nim_b_l_e_scan_results.html">NimBLEScanResults</a> NimBLEScan::getResults </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get the results of the scan. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="class_nim_b_l_e_scan_results.html" title="A class that contains and operates on the results of a BLE scan.">NimBLEScanResults</a> object. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ade1492b5d1b5d97efa76cd41583bfc96" name="ade1492b5d1b5d97efa76cd41583bfc96"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ade1492b5d1b5d97efa76cd41583bfc96">◆ </a></span>getResults() <span class="overload">[2/2]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="class_nim_b_l_e_scan_results.html">NimBLEScanResults</a> NimBLEScan::getResults </td>
|
|
<td>(</td>
|
|
<td class="paramtype">uint32_t </td>
|
|
<td class="paramname"><em>duration</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">bool </td>
|
|
<td class="paramname"><em>is_continue</em> = <code>false</code> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Start scanning and block until scanning has been completed. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">duration</td><td>The duration in milliseconds for which to scan. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">is_continue</td><td>Set to true to save previous scan results, false to clear them. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>The scan results. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ab788ad282fdbf4467302f6ad2d4d6016" name="ab788ad282fdbf4467302f6ad2d4d6016"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ab788ad282fdbf4467302f6ad2d4d6016">◆ </a></span>isScanning()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool NimBLEScan::isScanning </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get the status of the scanner. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>true if scanning or scan starting. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a7d24e77d6b339552b6ac16effdb54910" name="a7d24e77d6b339552b6ac16effdb54910"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a7d24e77d6b339552b6ac16effdb54910">◆ </a></span>setActiveScan()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void NimBLEScan::setActiveScan </td>
|
|
<td>(</td>
|
|
<td class="paramtype">bool </td>
|
|
<td class="paramname"><em>active</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Should we perform an active or passive scan? The default is a passive scan. An active scan means that we will request a scan response. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">active</td><td>If true, we perform an active scan otherwise a passive scan. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aabbf3f1804a844a7db0284ecc2b78408" name="aabbf3f1804a844a7db0284ecc2b78408"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aabbf3f1804a844a7db0284ecc2b78408">◆ </a></span>setDuplicateFilter()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void NimBLEScan::setDuplicateFilter </td>
|
|
<td>(</td>
|
|
<td class="paramtype">uint8_t </td>
|
|
<td class="paramname"><em>enabled</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Set whether or not the BLE controller should only report results from devices it has not already seen. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">enabled</td><td>If set to 1 (true), scanned devices will only be reported once. If set to 0 duplicates will be reported each time they are seen. If using extended scanning this can be set to 2 which will reset the duplicate filter at the end of each scan period if the scan period is set. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section note"><dt>Note</dt><dd>The controller has a limited buffer and will start reporting duplicate devices once the limit is reached. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a4248aabb5da67953eadab2a6f834d967" name="a4248aabb5da67953eadab2a6f834d967"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a4248aabb5da67953eadab2a6f834d967">◆ </a></span>setFilterPolicy()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void NimBLEScan::setFilterPolicy </td>
|
|
<td>(</td>
|
|
<td class="paramtype">uint8_t </td>
|
|
<td class="paramname"><em>filter</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Sets the scan filter policy. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">filter</td><td>Can be one of:<ul>
|
|
<li>BLE_HCI_SCAN_FILT_NO_WL (0) Scanner processes all advertising packets (white list not used) except<br />
|
|
directed, connectable advertising packets not sent to the scanner.</li>
|
|
<li>BLE_HCI_SCAN_FILT_USE_WL (1) Scanner processes advertisements from white list only. A connectable,<br />
|
|
directed advertisement is ignored unless it contains scanners address.</li>
|
|
<li>BLE_HCI_SCAN_FILT_NO_WL_INITA (2) Scanner process all advertising packets (white list not used). A<br />
|
|
connectable, directed advertisement shall not be ignored if the InitA is a resolvable private address.</li>
|
|
<li>BLE_HCI_SCAN_FILT_USE_WL_INITA (3) Scanner process advertisements from white list only. A connectable,<br />
|
|
directed advertisement shall not be ignored if the InitA is a resolvable private address. </li>
|
|
</ul>
|
|
</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a4c3e1794c3e56acba76ee269ffb1393e" name="a4c3e1794c3e56acba76ee269ffb1393e"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a4c3e1794c3e56acba76ee269ffb1393e">◆ </a></span>setInterval()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void NimBLEScan::setInterval </td>
|
|
<td>(</td>
|
|
<td class="paramtype">uint16_t </td>
|
|
<td class="paramname"><em>intervalMs</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Set the interval to scan. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">intervalMs</td><td>The scan interval in milliseconds.</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<p>The interval is the time between the start of two consecutive scan windows. When a new interval starts the controller changes the channel it's scanning on. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a77483be2bd9dad08322cc64f4e7012c1" name="a77483be2bd9dad08322cc64f4e7012c1"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a77483be2bd9dad08322cc64f4e7012c1">◆ </a></span>setLimitedOnly()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void NimBLEScan::setLimitedOnly </td>
|
|
<td>(</td>
|
|
<td class="paramtype">bool </td>
|
|
<td class="paramname"><em>enabled</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Set whether or not the BLE controller only reports scan results from devices advertising in limited discovery mode. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">enabled</td><td>If true, only limited discovery devices will be in scan results. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aad9cd2462d00d7c0fa39d095aa2d8e81" name="aad9cd2462d00d7c0fa39d095aa2d8e81"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aad9cd2462d00d7c0fa39d095aa2d8e81">◆ </a></span>setMaxResults()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void NimBLEScan::setMaxResults </td>
|
|
<td>(</td>
|
|
<td class="paramtype">uint8_t </td>
|
|
<td class="paramname"><em>maxResults</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Sets the max number of results to store. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">maxResults</td><td>The number of results to limit storage to<br />
|
|
0 == none (callbacks only) 0xFF == unlimited, any other value is the limit. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aaace4d0b128b6294276347f6790f3f8b" name="aaace4d0b128b6294276347f6790f3f8b"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aaace4d0b128b6294276347f6790f3f8b">◆ </a></span>setPeriod()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void NimBLEScan::setPeriod </td>
|
|
<td>(</td>
|
|
<td class="paramtype">uint32_t </td>
|
|
<td class="paramname"><em>periodMs</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Set the extended scanning period. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">periodMs</td><td>The scan period in milliseconds</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<p>The period is the time between the start of two consecutive scan periods. This works as a timer to restart scanning at the specified amount of time in periodMs. </p><dl class="section note"><dt>Note</dt><dd>The duration used when this is set must be less than period. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a17f2f775b5e6793f06a412f840d5dceb" name="a17f2f775b5e6793f06a412f840d5dceb"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a17f2f775b5e6793f06a412f840d5dceb">◆ </a></span>setPhy()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void NimBLEScan::setPhy </td>
|
|
<td>(</td>
|
|
<td class="paramtype">Phy </td>
|
|
<td class="paramname"><em>phyMask</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Set the PHYs to scan. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">phyMask</td><td>The PHYs to scan, a bit mask of:<ul>
|
|
<li>NIMBLE_CPP_SCAN_1M</li>
|
|
<li>NIMBLE_CPP_SCAN_CODED </li>
|
|
</ul>
|
|
</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a3b0d41fc5d9113a02357c1b2a43c5d1d" name="a3b0d41fc5d9113a02357c1b2a43c5d1d"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a3b0d41fc5d9113a02357c1b2a43c5d1d">◆ </a></span>setScanCallbacks()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void NimBLEScan::setScanCallbacks </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="class_nim_b_l_e_scan_callbacks.html">NimBLEScanCallbacks</a> * </td>
|
|
<td class="paramname"><em>pScanCallbacks</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">bool </td>
|
|
<td class="paramname"><em>wantDuplicates</em> = <code>false</code> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Set the call backs to be invoked. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">pScanCallbacks</td><td>Call backs to be invoked. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">wantDuplicates</td><td>True if we wish to be called back with duplicates, default: false. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a0fec97ad0f4ff191bb853138c30d5316" name="a0fec97ad0f4ff191bb853138c30d5316"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a0fec97ad0f4ff191bb853138c30d5316">◆ </a></span>setWindow()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void NimBLEScan::setWindow </td>
|
|
<td>(</td>
|
|
<td class="paramtype">uint16_t </td>
|
|
<td class="paramname"><em>windowMs</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Set the window to actively scan. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">windowMs</td><td>How long during the interval to actively scan in milliseconds. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ac1307f30a881688d3a4d57bac7abe02c" name="ac1307f30a881688d3a4d57bac7abe02c"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ac1307f30a881688d3a4d57bac7abe02c">◆ </a></span>start()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool NimBLEScan::start </td>
|
|
<td>(</td>
|
|
<td class="paramtype">uint32_t </td>
|
|
<td class="paramname"><em>duration</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">bool </td>
|
|
<td class="paramname"><em>isContinue</em> = <code>false</code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">bool </td>
|
|
<td class="paramname"><em>restart</em> = <code>true</code> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Start scanning. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">duration</td><td>The duration in milliseconds for which to scan. 0 == scan forever. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">isContinue</td><td>Set to true to save previous scan results, false to clear them. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">restart</td><td>Set to true to restart the scan if already in progress. this is useful to clear the duplicate filter so all devices are reported again. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>True if scan started or false if there was an error. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a68fa5cc715f62a9a97ac0dccfb8557c1" name="a68fa5cc715f62a9a97ac0dccfb8557c1"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a68fa5cc715f62a9a97ac0dccfb8557c1">◆ </a></span>stop()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool NimBLEScan::stop </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Stop an in progress scan. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>True if successful. </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.html">NimBLEScan</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>
|