esp-nimble-cpp/class_nim_b_l_e_advertising.html
2021-08-05 01:02:30 +00:00

729 lines
40 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">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>esp-nimble-cpp / NimBLE-Arduino: NimBLEAdvertising 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 style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">esp-nimble-cpp / NimBLE-Arduino
&#160;<span id="projectnumber">1.3.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'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:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(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:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('class_nim_b_l_e_advertising.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">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="class_nim_b_l_e_advertising-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">NimBLEAdvertising Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Perform and manage BLE advertising.
<a href="class_nim_b_l_e_advertising.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:abe6258a917243a4567c3d6eece2ddcdd"><td class="memItemLeft" align="right" valign="top"><a id="abe6258a917243a4567c3d6eece2ddcdd"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_advertising.html#abe6258a917243a4567c3d6eece2ddcdd">NimBLEAdvertising</a> ()</td></tr>
<tr class="memdesc:abe6258a917243a4567c3d6eece2ddcdd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct a default advertising object. <br /></td></tr>
<tr class="separator:abe6258a917243a4567c3d6eece2ddcdd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4f334752ea04223185292fe9ab524b69"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_advertising.html#a4f334752ea04223185292fe9ab524b69">addServiceUUID</a> (const <a class="el" href="class_nim_b_l_e_u_u_i_d.html">NimBLEUUID</a> &amp;serviceUUID)</td></tr>
<tr class="memdesc:a4f334752ea04223185292fe9ab524b69"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a service uuid to exposed list of services. <a href="class_nim_b_l_e_advertising.html#a4f334752ea04223185292fe9ab524b69">More...</a><br /></td></tr>
<tr class="separator:a4f334752ea04223185292fe9ab524b69"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5e596e8dfa9268554a5b189380405d5c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_advertising.html#a5e596e8dfa9268554a5b189380405d5c">addServiceUUID</a> (const char *serviceUUID)</td></tr>
<tr class="memdesc:a5e596e8dfa9268554a5b189380405d5c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a service uuid to exposed list of services. <a href="class_nim_b_l_e_advertising.html#a5e596e8dfa9268554a5b189380405d5c">More...</a><br /></td></tr>
<tr class="separator:a5e596e8dfa9268554a5b189380405d5c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a725437c00152ff57ef1e21bdf7be980d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_advertising.html#a725437c00152ff57ef1e21bdf7be980d">removeServiceUUID</a> (const <a class="el" href="class_nim_b_l_e_u_u_i_d.html">NimBLEUUID</a> &amp;serviceUUID)</td></tr>
<tr class="memdesc:a725437c00152ff57ef1e21bdf7be980d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a service uuid to exposed list of services. <a href="class_nim_b_l_e_advertising.html#a725437c00152ff57ef1e21bdf7be980d">More...</a><br /></td></tr>
<tr class="separator:a725437c00152ff57ef1e21bdf7be980d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeeee5a131b42a4f76010751f4c182e4f"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_advertising.html#aeeee5a131b42a4f76010751f4c182e4f">start</a> (uint32_t duration=0, void(*<a class="el" href="class_nim_b_l_e_advertising.html#a4de7bf016a086a2d3f6f14ae134678f2">advCompleteCB</a>)(<a class="el" href="class_nim_b_l_e_advertising.html">NimBLEAdvertising</a> *pAdv)=nullptr)</td></tr>
<tr class="memdesc:aeeee5a131b42a4f76010751f4c182e4f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Start advertising. <a href="class_nim_b_l_e_advertising.html#aeeee5a131b42a4f76010751f4c182e4f">More...</a><br /></td></tr>
<tr class="separator:aeeee5a131b42a4f76010751f4c182e4f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab19c9e9015e812055e3cad29d52ed2ff"><td class="memItemLeft" align="right" valign="top"><a id="ab19c9e9015e812055e3cad29d52ed2ff"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_advertising.html#ab19c9e9015e812055e3cad29d52ed2ff">stop</a> ()</td></tr>
<tr class="memdesc:ab19c9e9015e812055e3cad29d52ed2ff"><td class="mdescLeft">&#160;</td><td class="mdescRight">Stop advertising. <br /></td></tr>
<tr class="separator:ab19c9e9015e812055e3cad29d52ed2ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa0d30dfb57670cc8180e17dffddad416"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_advertising.html#aa0d30dfb57670cc8180e17dffddad416">setAppearance</a> (uint16_t appearance)</td></tr>
<tr class="memdesc:aa0d30dfb57670cc8180e17dffddad416"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the device appearance in the advertising data. The codes for distinct appearances can be found here:<br />
<a href="https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.gap.appearance.xml">https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.gap.appearance.xml</a>. <a href="class_nim_b_l_e_advertising.html#aa0d30dfb57670cc8180e17dffddad416">More...</a><br /></td></tr>
<tr class="separator:aa0d30dfb57670cc8180e17dffddad416"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:add2ecd09877d7e4548b11ec7cb8c7a47"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_advertising.html#add2ecd09877d7e4548b11ec7cb8c7a47">setName</a> (const std::string &amp;name)</td></tr>
<tr class="memdesc:add2ecd09877d7e4548b11ec7cb8c7a47"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the advertised name of the device. <a href="class_nim_b_l_e_advertising.html#add2ecd09877d7e4548b11ec7cb8c7a47">More...</a><br /></td></tr>
<tr class="separator:add2ecd09877d7e4548b11ec7cb8c7a47"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1eff592870a47b0f62b0f0894efadbd4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_advertising.html#a1eff592870a47b0f62b0f0894efadbd4">setManufacturerData</a> (const std::string &amp;data)</td></tr>
<tr class="memdesc:a1eff592870a47b0f62b0f0894efadbd4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the advertised manufacturer data. <a href="class_nim_b_l_e_advertising.html#a1eff592870a47b0f62b0f0894efadbd4">More...</a><br /></td></tr>
<tr class="separator:a1eff592870a47b0f62b0f0894efadbd4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6495d7c9ad80a8c2a5edf974705f8103"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_advertising.html#a6495d7c9ad80a8c2a5edf974705f8103">setURI</a> (const std::string &amp;uri)</td></tr>
<tr class="memdesc:a6495d7c9ad80a8c2a5edf974705f8103"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the advertised URI. <a href="class_nim_b_l_e_advertising.html#a6495d7c9ad80a8c2a5edf974705f8103">More...</a><br /></td></tr>
<tr class="separator:a6495d7c9ad80a8c2a5edf974705f8103"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a994e43e9e4ace6ce64c57e57d0575781"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_advertising.html#a994e43e9e4ace6ce64c57e57d0575781">setServiceData</a> (const <a class="el" href="class_nim_b_l_e_u_u_i_d.html">NimBLEUUID</a> &amp;uuid, const std::string &amp;data)</td></tr>
<tr class="memdesc:a994e43e9e4ace6ce64c57e57d0575781"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the service data advertised for the UUID. <a href="class_nim_b_l_e_advertising.html#a994e43e9e4ace6ce64c57e57d0575781">More...</a><br /></td></tr>
<tr class="separator:a994e43e9e4ace6ce64c57e57d0575781"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a68d54f11b47b9993322efec1d07c3519"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_advertising.html#a68d54f11b47b9993322efec1d07c3519">setAdvertisementType</a> (uint8_t adv_type)</td></tr>
<tr class="memdesc:a68d54f11b47b9993322efec1d07c3519"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the type of advertisment to use. <a href="class_nim_b_l_e_advertising.html#a68d54f11b47b9993322efec1d07c3519">More...</a><br /></td></tr>
<tr class="separator:a68d54f11b47b9993322efec1d07c3519"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aab512576d8873fbbb631bac8ada19530"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_advertising.html#aab512576d8873fbbb631bac8ada19530">setMaxInterval</a> (uint16_t maxinterval)</td></tr>
<tr class="memdesc:aab512576d8873fbbb631bac8ada19530"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the maximum advertising interval. <a href="class_nim_b_l_e_advertising.html#aab512576d8873fbbb631bac8ada19530">More...</a><br /></td></tr>
<tr class="separator:aab512576d8873fbbb631bac8ada19530"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a16bd135cab3f06bc0ba81c2aec19cbbc"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_advertising.html#a16bd135cab3f06bc0ba81c2aec19cbbc">setMinInterval</a> (uint16_t mininterval)</td></tr>
<tr class="memdesc:a16bd135cab3f06bc0ba81c2aec19cbbc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the minimum advertising interval. <a href="class_nim_b_l_e_advertising.html#a16bd135cab3f06bc0ba81c2aec19cbbc">More...</a><br /></td></tr>
<tr class="separator:a16bd135cab3f06bc0ba81c2aec19cbbc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af7083f58717b7e76d90d367f00a0ef08"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_advertising.html#af7083f58717b7e76d90d367f00a0ef08">setAdvertisementData</a> (<a class="el" href="class_nim_b_l_e_advertisement_data.html">NimBLEAdvertisementData</a> &amp;advertisementData)</td></tr>
<tr class="memdesc:af7083f58717b7e76d90d367f00a0ef08"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the advertisement data that is to be published in a regular advertisement. <a href="class_nim_b_l_e_advertising.html#af7083f58717b7e76d90d367f00a0ef08">More...</a><br /></td></tr>
<tr class="separator:af7083f58717b7e76d90d367f00a0ef08"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa3da80c7d17a7824484ee254076e4790"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_advertising.html#aa3da80c7d17a7824484ee254076e4790">setScanFilter</a> (bool scanRequestWhitelistOnly, bool connectWhitelistOnly)</td></tr>
<tr class="memdesc:aa3da80c7d17a7824484ee254076e4790"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the filtering for the scan filter. <a href="class_nim_b_l_e_advertising.html#aa3da80c7d17a7824484ee254076e4790">More...</a><br /></td></tr>
<tr class="separator:aa3da80c7d17a7824484ee254076e4790"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a04a51a0c639a70295a9b671f73b34358"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_advertising.html#a04a51a0c639a70295a9b671f73b34358">setScanResponseData</a> (<a class="el" href="class_nim_b_l_e_advertisement_data.html">NimBLEAdvertisementData</a> &amp;advertisementData)</td></tr>
<tr class="memdesc:a04a51a0c639a70295a9b671f73b34358"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the advertisement data that is to be published in a scan response. <a href="class_nim_b_l_e_advertising.html#a04a51a0c639a70295a9b671f73b34358">More...</a><br /></td></tr>
<tr class="separator:a04a51a0c639a70295a9b671f73b34358"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6fb4d9ad3949928ac83d3e74857ab91f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_advertising.html#a6fb4d9ad3949928ac83d3e74857ab91f">setScanResponse</a> (bool)</td></tr>
<tr class="memdesc:a6fb4d9ad3949928ac83d3e74857ab91f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set if scan response is available. <a href="class_nim_b_l_e_advertising.html#a6fb4d9ad3949928ac83d3e74857ab91f">More...</a><br /></td></tr>
<tr class="separator:a6fb4d9ad3949928ac83d3e74857ab91f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3bc158da1f732361df69cf16ca1cfd42"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_advertising.html#a3bc158da1f732361df69cf16ca1cfd42">setMinPreferred</a> (uint16_t)</td></tr>
<tr class="memdesc:a3bc158da1f732361df69cf16ca1cfd42"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the advertised min connection interval preferred by this device. <a href="class_nim_b_l_e_advertising.html#a3bc158da1f732361df69cf16ca1cfd42">More...</a><br /></td></tr>
<tr class="separator:a3bc158da1f732361df69cf16ca1cfd42"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3382cdf80f5ae46a52e3b9159f8e1b66"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_advertising.html#a3382cdf80f5ae46a52e3b9159f8e1b66">setMaxPreferred</a> (uint16_t)</td></tr>
<tr class="memdesc:a3382cdf80f5ae46a52e3b9159f8e1b66"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the advertised max connection interval preferred by this device. <a href="class_nim_b_l_e_advertising.html#a3382cdf80f5ae46a52e3b9159f8e1b66">More...</a><br /></td></tr>
<tr class="separator:a3382cdf80f5ae46a52e3b9159f8e1b66"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac4ff0af45d1f7ed5bc208612852bc43a"><td class="memItemLeft" align="right" valign="top"><a id="ac4ff0af45d1f7ed5bc208612852bc43a"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_advertising.html#ac4ff0af45d1f7ed5bc208612852bc43a">addTxPower</a> ()</td></tr>
<tr class="memdesc:ac4ff0af45d1f7ed5bc208612852bc43a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add the transmission power level to the advertisement packet. <br /></td></tr>
<tr class="separator:ac4ff0af45d1f7ed5bc208612852bc43a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a545b505ea76396c33133d41a78fad5b8"><td class="memItemLeft" align="right" valign="top"><a id="a545b505ea76396c33133d41a78fad5b8"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_advertising.html#a545b505ea76396c33133d41a78fad5b8">reset</a> ()</td></tr>
<tr class="memdesc:a545b505ea76396c33133d41a78fad5b8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Stops the current advertising and resets the advertising data to the default values. <br /></td></tr>
<tr class="separator:a545b505ea76396c33133d41a78fad5b8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4de7bf016a086a2d3f6f14ae134678f2"><td class="memItemLeft" align="right" valign="top"><a id="a4de7bf016a086a2d3f6f14ae134678f2"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_advertising.html#a4de7bf016a086a2d3f6f14ae134678f2">advCompleteCB</a> ()</td></tr>
<tr class="memdesc:a4de7bf016a086a2d3f6f14ae134678f2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Handles the callback when advertising stops. <br /></td></tr>
<tr class="separator:a4de7bf016a086a2d3f6f14ae134678f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac257ab68520a244cb6494d793f9b6c2a"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_advertising.html#ac257ab68520a244cb6494d793f9b6c2a">isAdvertising</a> ()</td></tr>
<tr class="memdesc:ac257ab68520a244cb6494d793f9b6c2a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if currently advertising. <a href="class_nim_b_l_e_advertising.html#ac257ab68520a244cb6494d793f9b6c2a">More...</a><br /></td></tr>
<tr class="separator:ac257ab68520a244cb6494d793f9b6c2a"><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>Perform and manage BLE advertising. </p>
<p>A BLE server will want to perform advertising in order to make itself known to BLE clients. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a5e596e8dfa9268554a5b189380405d5c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5e596e8dfa9268554a5b189380405d5c">&#9670;&nbsp;</a></span>addServiceUUID() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void NimBLEAdvertising::addServiceUUID </td>
<td>(</td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>serviceUUID</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Add a service uuid to exposed list of services. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">serviceUUID</td><td>The string representation of the service to expose. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a4f334752ea04223185292fe9ab524b69"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4f334752ea04223185292fe9ab524b69">&#9670;&nbsp;</a></span>addServiceUUID() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void NimBLEAdvertising::addServiceUUID </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="class_nim_b_l_e_u_u_i_d.html">NimBLEUUID</a> &amp;&#160;</td>
<td class="paramname"><em>serviceUUID</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Add a service uuid to exposed list of services. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">serviceUUID</td><td>The UUID of the service to expose. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ac257ab68520a244cb6494d793f9b6c2a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac257ab68520a244cb6494d793f9b6c2a">&#9670;&nbsp;</a></span>isAdvertising()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool NimBLEAdvertising::isAdvertising </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Check if currently advertising. </p>
<dl class="section return"><dt>Returns</dt><dd>true if advertising is active. </dd></dl>
</div>
</div>
<a id="a725437c00152ff57ef1e21bdf7be980d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a725437c00152ff57ef1e21bdf7be980d">&#9670;&nbsp;</a></span>removeServiceUUID()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void NimBLEAdvertising::removeServiceUUID </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="class_nim_b_l_e_u_u_i_d.html">NimBLEUUID</a> &amp;&#160;</td>
<td class="paramname"><em>serviceUUID</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Add a service uuid to exposed list of services. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">serviceUUID</td><td>The UUID of the service to expose. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="af7083f58717b7e76d90d367f00a0ef08"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af7083f58717b7e76d90d367f00a0ef08">&#9670;&nbsp;</a></span>setAdvertisementData()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void NimBLEAdvertising::setAdvertisementData </td>
<td>(</td>
<td class="paramtype"><a class="el" href="class_nim_b_l_e_advertisement_data.html">NimBLEAdvertisementData</a> &amp;&#160;</td>
<td class="paramname"><em>advertisementData</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the advertisement data that is to be published in a regular advertisement. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">advertisementData</td><td>The data to be advertised.</td></tr>
</table>
</dd>
</dl>
<p>The use of this function will replace any data set with addServiceUUID<br />
or setAppearance. If you wish for these to be advertised you must include them<br />
in the advertisementData parameter sent. </p>
</div>
</div>
<a id="a68d54f11b47b9993322efec1d07c3519"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a68d54f11b47b9993322efec1d07c3519">&#9670;&nbsp;</a></span>setAdvertisementType()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void NimBLEAdvertising::setAdvertisementType </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>adv_type</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the type of advertisment to use. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">adv_type</td><td><ul>
<li>BLE_GAP_CONN_MODE_NON (0) - not connectable advertising</li>
<li>BLE_GAP_CONN_MODE_DIR (1) - directed connectable advertising</li>
<li>BLE_GAP_CONN_MODE_UND (2) - undirected connectable advertising </li>
</ul>
</td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="aa0d30dfb57670cc8180e17dffddad416"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa0d30dfb57670cc8180e17dffddad416">&#9670;&nbsp;</a></span>setAppearance()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void NimBLEAdvertising::setAppearance </td>
<td>(</td>
<td class="paramtype">uint16_t&#160;</td>
<td class="paramname"><em>appearance</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the device appearance in the advertising data. The codes for distinct appearances can be found here:<br />
<a href="https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.gap.appearance.xml">https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.gap.appearance.xml</a>. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">appearance</td><td>The appearance of the device in the advertising data. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a1eff592870a47b0f62b0f0894efadbd4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1eff592870a47b0f62b0f0894efadbd4">&#9670;&nbsp;</a></span>setManufacturerData()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void NimBLEAdvertising::setManufacturerData </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>data</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the advertised manufacturer data. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>The data to advertise. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="aab512576d8873fbbb631bac8ada19530"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aab512576d8873fbbb631bac8ada19530">&#9670;&nbsp;</a></span>setMaxInterval()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void NimBLEAdvertising::setMaxInterval </td>
<td>(</td>
<td class="paramtype">uint16_t&#160;</td>
<td class="paramname"><em>maxinterval</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the maximum advertising interval. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">maxinterval</td><td>Maximum value for advertising interval in 0.625ms units, 0 = use default. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a3382cdf80f5ae46a52e3b9159f8e1b66"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3382cdf80f5ae46a52e3b9159f8e1b66">&#9670;&nbsp;</a></span>setMaxPreferred()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void NimBLEAdvertising::setMaxPreferred </td>
<td>(</td>
<td class="paramtype">uint16_t&#160;</td>
<td class="paramname"><em>maxinterval</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the advertised max connection interval preferred by this device. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">maxinterval</td><td>the max interval value. Range = 0x0006 to 0x0C80.</td></tr>
</table>
</dd>
</dl>
<p>Values not within the range will cancel advertising of this data.<br />
Consumes 6 bytes of advertising space (combined with min interval). </p>
</div>
</div>
<a id="a16bd135cab3f06bc0ba81c2aec19cbbc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a16bd135cab3f06bc0ba81c2aec19cbbc">&#9670;&nbsp;</a></span>setMinInterval()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void NimBLEAdvertising::setMinInterval </td>
<td>(</td>
<td class="paramtype">uint16_t&#160;</td>
<td class="paramname"><em>mininterval</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the minimum advertising interval. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">mininterval</td><td>Minimum value for advertising interval in 0.625ms units, 0 = use default. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a3bc158da1f732361df69cf16ca1cfd42"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3bc158da1f732361df69cf16ca1cfd42">&#9670;&nbsp;</a></span>setMinPreferred()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void NimBLEAdvertising::setMinPreferred </td>
<td>(</td>
<td class="paramtype">uint16_t&#160;</td>
<td class="paramname"><em>mininterval</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the advertised min connection interval preferred by this device. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">mininterval</td><td>the max interval value. Range = 0x0006 to 0x0C80.</td></tr>
</table>
</dd>
</dl>
<p>Values not within the range will cancel advertising of this data.<br />
Consumes 6 bytes of advertising space (combined with max interval). </p>
</div>
</div>
<a id="add2ecd09877d7e4548b11ec7cb8c7a47"></a>
<h2 class="memtitle"><span class="permalink"><a href="#add2ecd09877d7e4548b11ec7cb8c7a47">&#9670;&nbsp;</a></span>setName()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void NimBLEAdvertising::setName </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>name</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the advertised name of the device. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">name</td><td>The name to advertise. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="aa3da80c7d17a7824484ee254076e4790"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa3da80c7d17a7824484ee254076e4790">&#9670;&nbsp;</a></span>setScanFilter()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void NimBLEAdvertising::setScanFilter </td>
<td>(</td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>scanRequestWhitelistOnly</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>connectWhitelistOnly</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the filtering for the scan filter. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">scanRequestWhitelistOnly</td><td>If true, only allow scan requests from those on the white list. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">connectWhitelistOnly</td><td>If true, only allow connections from those on the white list. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a6fb4d9ad3949928ac83d3e74857ab91f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6fb4d9ad3949928ac83d3e74857ab91f">&#9670;&nbsp;</a></span>setScanResponse()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void NimBLEAdvertising::setScanResponse </td>
<td>(</td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>set</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set if scan response is available. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">set</td><td>true = scan response available. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a04a51a0c639a70295a9b671f73b34358"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a04a51a0c639a70295a9b671f73b34358">&#9670;&nbsp;</a></span>setScanResponseData()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void NimBLEAdvertising::setScanResponseData </td>
<td>(</td>
<td class="paramtype"><a class="el" href="class_nim_b_l_e_advertisement_data.html">NimBLEAdvertisementData</a> &amp;&#160;</td>
<td class="paramname"><em>advertisementData</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the advertisement data that is to be published in a scan response. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">advertisementData</td><td>The data to be advertised.</td></tr>
</table>
</dd>
</dl>
<p>Calling this without also using setAdvertisementData will have no effect.<br />
When using custom scan response data you must also use custom advertisement data. </p>
</div>
</div>
<a id="a994e43e9e4ace6ce64c57e57d0575781"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a994e43e9e4ace6ce64c57e57d0575781">&#9670;&nbsp;</a></span>setServiceData()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void NimBLEAdvertising::setServiceData </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="class_nim_b_l_e_u_u_i_d.html">NimBLEUUID</a> &amp;&#160;</td>
<td class="paramname"><em>uuid</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>data</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the service data advertised for the UUID. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">uuid</td><td>The UUID the service data belongs to. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>The data to advertise. </td></tr>
</table>
</dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>If data length is 0 the service data will not be advertised. </dd></dl>
</div>
</div>
<a id="a6495d7c9ad80a8c2a5edf974705f8103"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6495d7c9ad80a8c2a5edf974705f8103">&#9670;&nbsp;</a></span>setURI()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void NimBLEAdvertising::setURI </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>uri</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the advertised URI. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">uri</td><td>The URI to advertise. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="aeeee5a131b42a4f76010751f4c182e4f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aeeee5a131b42a4f76010751f4c182e4f">&#9670;&nbsp;</a></span>start()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool NimBLEAdvertising::start </td>
<td>(</td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>duration</em> = <code>0</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void(*)(<a class="el" href="class_nim_b_l_e_advertising.html">NimBLEAdvertising</a> *pAdv)&#160;</td>
<td class="paramname"><em>advCompleteCB</em> = <code>nullptr</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Start advertising. </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 seconds, to advertise, 0 == advertise forever. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">advCompleteCB</td><td>A pointer to a callback to be invoked when advertising ends. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>True if advertising started successfully. </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_advertising.html">NimBLEAdvertising</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.0 </li>
</ul>
</div>
</body>
</html>