mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2024-12-26 04:30:46 +01:00
1388 lines
75 KiB
HTML
1388 lines
75 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: NimBLEClient 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.1</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_client.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_client-members.html">List of all members</a> </div>
|
|
<div class="headertitle"><div class="title">NimBLEClient Class Reference</div></div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
|
|
<p>A model of a BLE client.
|
|
<a href="class_nim_b_l_e_client.html#details">More...</a></p>
|
|
|
|
<p><code>#include <<a class="el" href="_nim_b_l_e_client_8h_source.html">NimBLEClient.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:a2b49bc73802bf716cf3df3b5a93f0543" id="r_a2b49bc73802bf716cf3df3b5a93f0543"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#a2b49bc73802bf716cf3df3b5a93f0543">connect</a> (const <a class="el" href="class_nim_b_l_e_advertised_device.html">NimBLEAdvertisedDevice</a> *device, bool deleteAttributes=true, bool asyncConnect=false, bool <a class="el" href="class_nim_b_l_e_client.html#a19d97b47f01f0862e04f3011752b2f2f">exchangeMTU</a>=true)</td></tr>
|
|
<tr class="memdesc:a2b49bc73802bf716cf3df3b5a93f0543"><td class="mdescLeft"> </td><td class="mdescRight">Connect to an advertising device. <br /></td></tr>
|
|
<tr class="separator:a2b49bc73802bf716cf3df3b5a93f0543"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a27e53c3746bc2d20ea7cfcea1a123cbf" id="r_a27e53c3746bc2d20ea7cfcea1a123cbf"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#a27e53c3746bc2d20ea7cfcea1a123cbf">connect</a> (const <a class="el" href="class_nim_b_l_e_address.html">NimBLEAddress</a> &address, bool deleteAttributes=true, bool asyncConnect=false, bool <a class="el" href="class_nim_b_l_e_client.html#a19d97b47f01f0862e04f3011752b2f2f">exchangeMTU</a>=true)</td></tr>
|
|
<tr class="memdesc:a27e53c3746bc2d20ea7cfcea1a123cbf"><td class="mdescLeft"> </td><td class="mdescRight">Connect to a BLE Server by address. <br /></td></tr>
|
|
<tr class="separator:a27e53c3746bc2d20ea7cfcea1a123cbf"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a26c8117d56d8b637780390a6506716be" id="r_a26c8117d56d8b637780390a6506716be"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#a26c8117d56d8b637780390a6506716be">connect</a> (bool deleteAttributes=true, bool asyncConnect=false, bool <a class="el" href="class_nim_b_l_e_client.html#a19d97b47f01f0862e04f3011752b2f2f">exchangeMTU</a>=true)</td></tr>
|
|
<tr class="memdesc:a26c8117d56d8b637780390a6506716be"><td class="mdescLeft"> </td><td class="mdescRight">Connect to the BLE Server using the address of the last connected device, or the address<br />
|
|
passed to the constructor. <br /></td></tr>
|
|
<tr class="separator:a26c8117d56d8b637780390a6506716be"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a36b298b70a42d32b8d578869b0763140" id="r_a36b298b70a42d32b8d578869b0763140"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#a36b298b70a42d32b8d578869b0763140">disconnect</a> (uint8_t reason=BLE_ERR_REM_USER_CONN_TERM)</td></tr>
|
|
<tr class="memdesc:a36b298b70a42d32b8d578869b0763140"><td class="mdescLeft"> </td><td class="mdescRight">Disconnect from the peer. <br /></td></tr>
|
|
<tr class="separator:a36b298b70a42d32b8d578869b0763140"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:af77b2a5390ea811e9405ff81dba8ecac" id="r_af77b2a5390ea811e9405ff81dba8ecac"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#af77b2a5390ea811e9405ff81dba8ecac">cancelConnect</a> () const</td></tr>
|
|
<tr class="memdesc:af77b2a5390ea811e9405ff81dba8ecac"><td class="mdescLeft"> </td><td class="mdescRight">Cancel an ongoing connection attempt. <br /></td></tr>
|
|
<tr class="separator:af77b2a5390ea811e9405ff81dba8ecac"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a665a5ef97b3ab0307bccc54872d3c218" id="r_a665a5ef97b3ab0307bccc54872d3c218"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#a665a5ef97b3ab0307bccc54872d3c218">setSelfDelete</a> (bool deleteOnDisconnect, bool deleteOnConnectFail)</td></tr>
|
|
<tr class="memdesc:a665a5ef97b3ab0307bccc54872d3c218"><td class="mdescLeft"> </td><td class="mdescRight">Set or unset a flag to delete this client when disconnected or connection failed. <br /></td></tr>
|
|
<tr class="separator:a665a5ef97b3ab0307bccc54872d3c218"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a44a6f7f9379e2fc129c37915636db61f" id="r_a44a6f7f9379e2fc129c37915636db61f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_nim_b_l_e_address.html">NimBLEAddress</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#a44a6f7f9379e2fc129c37915636db61f">getPeerAddress</a> () const</td></tr>
|
|
<tr class="memdesc:a44a6f7f9379e2fc129c37915636db61f"><td class="mdescLeft"> </td><td class="mdescRight">Retrieve the address of the peer. <br /></td></tr>
|
|
<tr class="separator:a44a6f7f9379e2fc129c37915636db61f"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a89d5aee4deaba953b8f77af75e3ee910" id="r_a89d5aee4deaba953b8f77af75e3ee910"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#a89d5aee4deaba953b8f77af75e3ee910">setPeerAddress</a> (const <a class="el" href="class_nim_b_l_e_address.html">NimBLEAddress</a> &address)</td></tr>
|
|
<tr class="memdesc:a89d5aee4deaba953b8f77af75e3ee910"><td class="mdescLeft"> </td><td class="mdescRight">Set the peer address. <br /></td></tr>
|
|
<tr class="separator:a89d5aee4deaba953b8f77af75e3ee910"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a2645d4a2f8e381bf9bbffdfca846ae17" id="r_a2645d4a2f8e381bf9bbffdfca846ae17"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#a2645d4a2f8e381bf9bbffdfca846ae17">getRssi</a> () const</td></tr>
|
|
<tr class="memdesc:a2645d4a2f8e381bf9bbffdfca846ae17"><td class="mdescLeft"> </td><td class="mdescRight">Ask the BLE server for the RSSI value. <br /></td></tr>
|
|
<tr class="separator:a2645d4a2f8e381bf9bbffdfca846ae17"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a0bdaf55b06367d1abd6f59bfbe1e8689" id="r_a0bdaf55b06367d1abd6f59bfbe1e8689"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#a0bdaf55b06367d1abd6f59bfbe1e8689">isConnected</a> () const</td></tr>
|
|
<tr class="memdesc:a0bdaf55b06367d1abd6f59bfbe1e8689"><td class="mdescLeft"> </td><td class="mdescRight">Are we connected to a server? <br /></td></tr>
|
|
<tr class="separator:a0bdaf55b06367d1abd6f59bfbe1e8689"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aeede4deef7421b9121387a786c07820c" id="r_aeede4deef7421b9121387a786c07820c"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#aeede4deef7421b9121387a786c07820c">setClientCallbacks</a> (<a class="el" href="class_nim_b_l_e_client_callbacks.html">NimBLEClientCallbacks</a> *pClientCallbacks, bool deleteCallbacks=true)</td></tr>
|
|
<tr class="memdesc:aeede4deef7421b9121387a786c07820c"><td class="mdescLeft"> </td><td class="mdescRight">Set the callbacks that will be invoked when events are received. <br /></td></tr>
|
|
<tr class="separator:aeede4deef7421b9121387a786c07820c"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a8ead2efdfdf23db4f7847a133939cd75" id="r_a8ead2efdfdf23db4f7847a133939cd75"><td class="memItemLeft" align="right" valign="top">std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#a8ead2efdfdf23db4f7847a133939cd75">toString</a> () const</td></tr>
|
|
<tr class="memdesc:a8ead2efdfdf23db4f7847a133939cd75"><td class="mdescLeft"> </td><td class="mdescRight">Return a string representation of this client. <br /></td></tr>
|
|
<tr class="separator:a8ead2efdfdf23db4f7847a133939cd75"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ac1e517e5a57b0bd05d4bafa66a17f1bd" id="r_ac1e517e5a57b0bd05d4bafa66a17f1bd"><td class="memItemLeft" align="right" valign="top">uint16_t </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#ac1e517e5a57b0bd05d4bafa66a17f1bd">getConnHandle</a> () const</td></tr>
|
|
<tr class="memdesc:ac1e517e5a57b0bd05d4bafa66a17f1bd"><td class="mdescLeft"> </td><td class="mdescRight">Get the connection handle for this client. <br /></td></tr>
|
|
<tr class="separator:ac1e517e5a57b0bd05d4bafa66a17f1bd"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a7f3230e45ac77bd4cb50b5c270f9c74c" id="r_a7f3230e45ac77bd4cb50b5c270f9c74c"><td class="memItemLeft" align="right" valign="top">uint16_t </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#a7f3230e45ac77bd4cb50b5c270f9c74c">getMTU</a> () const</td></tr>
|
|
<tr class="memdesc:a7f3230e45ac77bd4cb50b5c270f9c74c"><td class="mdescLeft"> </td><td class="mdescRight">Get the current mtu of this connection. <br /></td></tr>
|
|
<tr class="separator:a7f3230e45ac77bd4cb50b5c270f9c74c"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a19d97b47f01f0862e04f3011752b2f2f" id="r_a19d97b47f01f0862e04f3011752b2f2f"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#a19d97b47f01f0862e04f3011752b2f2f">exchangeMTU</a> ()</td></tr>
|
|
<tr class="memdesc:a19d97b47f01f0862e04f3011752b2f2f"><td class="mdescLeft"> </td><td class="mdescRight">Begin the MTU exchange process with the server. <br /></td></tr>
|
|
<tr class="separator:a19d97b47f01f0862e04f3011752b2f2f"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a2dac3bd373134ae6d22e3b5c96ed65ef" id="r_a2dac3bd373134ae6d22e3b5c96ed65ef"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#a2dac3bd373134ae6d22e3b5c96ed65ef">secureConnection</a> (bool async=false) const</td></tr>
|
|
<tr class="memdesc:a2dac3bd373134ae6d22e3b5c96ed65ef"><td class="mdescLeft"> </td><td class="mdescRight">Initiate a secure connection (pair/bond) with the server.<br />
|
|
Called automatically when a characteristic or descriptor requires encryption or authentication to access it. <br /></td></tr>
|
|
<tr class="separator:a2dac3bd373134ae6d22e3b5c96ed65ef"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aeb3675ab243ae6f0e4e7165cd07f7b80" id="r_aeb3675ab243ae6f0e4e7165cd07f7b80"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#aeb3675ab243ae6f0e4e7165cd07f7b80">setConnectTimeout</a> (uint32_t timeout)</td></tr>
|
|
<tr class="memdesc:aeb3675ab243ae6f0e4e7165cd07f7b80"><td class="mdescLeft"> </td><td class="mdescRight">Set the timeout to wait for connection attempt to complete. <br /></td></tr>
|
|
<tr class="separator:aeb3675ab243ae6f0e4e7165cd07f7b80"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a4e8b16bb2c8ba3534bbd04803a411911" id="r_a4e8b16bb2c8ba3534bbd04803a411911"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#a4e8b16bb2c8ba3534bbd04803a411911">setDataLen</a> (uint16_t txOctets)</td></tr>
|
|
<tr class="memdesc:a4e8b16bb2c8ba3534bbd04803a411911"><td class="mdescLeft"> </td><td class="mdescRight">Request an update of the data packet length. <br /></td></tr>
|
|
<tr class="separator:a4e8b16bb2c8ba3534bbd04803a411911"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a1019178a12799ca2c3a84f523b3a7db9" id="r_a1019178a12799ca2c3a84f523b3a7db9"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#a1019178a12799ca2c3a84f523b3a7db9">discoverAttributes</a> ()</td></tr>
|
|
<tr class="memdesc:a1019178a12799ca2c3a84f523b3a7db9"><td class="mdescLeft"> </td><td class="mdescRight">Retrieves the full database of attributes that the peripheral has available. <br /></td></tr>
|
|
<tr class="separator:a1019178a12799ca2c3a84f523b3a7db9"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a50b691f395c4dcf4b633efede0783805" id="r_a50b691f395c4dcf4b633efede0783805"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_nim_b_l_e_conn_info.html">NimBLEConnInfo</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#a50b691f395c4dcf4b633efede0783805">getConnInfo</a> () const</td></tr>
|
|
<tr class="memdesc:a50b691f395c4dcf4b633efede0783805"><td class="mdescLeft"> </td><td class="mdescRight">Get detailed information about the current peer connection. <br /></td></tr>
|
|
<tr class="separator:a50b691f395c4dcf4b633efede0783805"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aeb0593ebffa7e8833e5854480e41cce5" id="r_aeb0593ebffa7e8833e5854480e41cce5"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#aeb0593ebffa7e8833e5854480e41cce5">getLastError</a> () const</td></tr>
|
|
<tr class="memdesc:aeb0593ebffa7e8833e5854480e41cce5"><td class="mdescLeft"> </td><td class="mdescRight">Get the last error code reported by the NimBLE host. <br /></td></tr>
|
|
<tr class="separator:aeb0593ebffa7e8833e5854480e41cce5"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ad168d34de0f57f91824a78688b88b2b8" id="r_ad168d34de0f57f91824a78688b88b2b8"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#ad168d34de0f57f91824a78688b88b2b8">updateConnParams</a> (uint16_t minInterval, uint16_t maxInterval, uint16_t latency, uint16_t timeout)</td></tr>
|
|
<tr class="memdesc:ad168d34de0f57f91824a78688b88b2b8"><td class="mdescLeft"> </td><td class="mdescRight">Update the connection parameters: <br /></td></tr>
|
|
<tr class="separator:ad168d34de0f57f91824a78688b88b2b8"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a17718339f76eb621db0d7919c73b9267" id="r_a17718339f76eb621db0d7919c73b9267"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#a17718339f76eb621db0d7919c73b9267">setConnectionParams</a> (uint16_t minInterval, uint16_t maxInterval, uint16_t latency, uint16_t timeout, uint16_t scanInterval=16, uint16_t scanWindow=16)</td></tr>
|
|
<tr class="memdesc:a17718339f76eb621db0d7919c73b9267"><td class="mdescLeft"> </td><td class="mdescRight">Set the connection parameters to use when connecting to a server. <br /></td></tr>
|
|
<tr class="separator:a17718339f76eb621db0d7919c73b9267"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:adefe48b87e8a814e1643cdb8c3759298" id="r_adefe48b87e8a814e1643cdb8c3759298"><td class="memItemLeft" align="right" valign="top">const std::vector< <a class="el" href="class_nim_b_l_e_remote_service.html">NimBLERemoteService</a> * > & </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#adefe48b87e8a814e1643cdb8c3759298">getServices</a> (bool refresh=false)</td></tr>
|
|
<tr class="memdesc:adefe48b87e8a814e1643cdb8c3759298"><td class="mdescLeft"> </td><td class="mdescRight">Get a pointer to the vector of found services. <br /></td></tr>
|
|
<tr class="separator:adefe48b87e8a814e1643cdb8c3759298"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ab09639b499fdcd0021a2432b2b8203f5" id="r_ab09639b499fdcd0021a2432b2b8203f5"><td class="memItemLeft" align="right" valign="top">std::vector< <a class="el" href="class_nim_b_l_e_remote_service.html">NimBLERemoteService</a> * >::iterator </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#ab09639b499fdcd0021a2432b2b8203f5">begin</a> ()</td></tr>
|
|
<tr class="memdesc:ab09639b499fdcd0021a2432b2b8203f5"><td class="mdescLeft"> </td><td class="mdescRight">Get iterator to the beginning of the vector of remote service pointers. <br /></td></tr>
|
|
<tr class="separator:ab09639b499fdcd0021a2432b2b8203f5"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a0accd665926ea77d85ecb483b2b853fe" id="r_a0accd665926ea77d85ecb483b2b853fe"><td class="memItemLeft" align="right" valign="top">std::vector< <a class="el" href="class_nim_b_l_e_remote_service.html">NimBLERemoteService</a> * >::iterator </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#a0accd665926ea77d85ecb483b2b853fe">end</a> ()</td></tr>
|
|
<tr class="memdesc:a0accd665926ea77d85ecb483b2b853fe"><td class="mdescLeft"> </td><td class="mdescRight">Get iterator to the end of the vector of remote service pointers. <br /></td></tr>
|
|
<tr class="separator:a0accd665926ea77d85ecb483b2b853fe"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a6b801e91a37745445499dadfb4c38597" id="r_a6b801e91a37745445499dadfb4c38597"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_nim_b_l_e_remote_characteristic.html">NimBLERemoteCharacteristic</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#a6b801e91a37745445499dadfb4c38597">getCharacteristic</a> (uint16_t handle)</td></tr>
|
|
<tr class="memdesc:a6b801e91a37745445499dadfb4c38597"><td class="mdescLeft"> </td><td class="mdescRight">Get the remote characteristic with the specified handle. <br /></td></tr>
|
|
<tr class="separator:a6b801e91a37745445499dadfb4c38597"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ae22379ab10bd82932d2303fb3753c366" id="r_ae22379ab10bd82932d2303fb3753c366"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_nim_b_l_e_remote_service.html">NimBLERemoteService</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#ae22379ab10bd82932d2303fb3753c366">getService</a> (const char *uuid)</td></tr>
|
|
<tr class="memdesc:ae22379ab10bd82932d2303fb3753c366"><td class="mdescLeft"> </td><td class="mdescRight">Get the service BLE Remote Service instance corresponding to the uuid. <br /></td></tr>
|
|
<tr class="separator:ae22379ab10bd82932d2303fb3753c366"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ad8ba10522d79af1136019606802f0978" id="r_ad8ba10522d79af1136019606802f0978"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_nim_b_l_e_remote_service.html">NimBLERemoteService</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#ad8ba10522d79af1136019606802f0978">getService</a> (const <a class="el" href="class_nim_b_l_e_u_u_i_d.html">NimBLEUUID</a> &uuid)</td></tr>
|
|
<tr class="memdesc:ad8ba10522d79af1136019606802f0978"><td class="mdescLeft"> </td><td class="mdescRight">Get the service object corresponding to the uuid. <br /></td></tr>
|
|
<tr class="separator:ad8ba10522d79af1136019606802f0978"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a668d476de250055a106a9f46bb7719f3" id="r_a668d476de250055a106a9f46bb7719f3"><td class="memItemLeft" align="right" valign="top"><a id="a668d476de250055a106a9f46bb7719f3" name="a668d476de250055a106a9f46bb7719f3"></a>
|
|
void </td><td class="memItemRight" valign="bottom"><b>deleteServices</b> ()</td></tr>
|
|
<tr class="memdesc:a668d476de250055a106a9f46bb7719f3"><td class="mdescLeft"> </td><td class="mdescRight">Delete all service objects created by this client and clear the vector. <br /></td></tr>
|
|
<tr class="separator:a668d476de250055a106a9f46bb7719f3"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a0f940c51807469db1f1802b742180beb" id="r_a0f940c51807469db1f1802b742180beb"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#a0f940c51807469db1f1802b742180beb">deleteService</a> (const <a class="el" href="class_nim_b_l_e_u_u_i_d.html">NimBLEUUID</a> &uuid)</td></tr>
|
|
<tr class="memdesc:a0f940c51807469db1f1802b742180beb"><td class="mdescLeft"> </td><td class="mdescRight">Delete a service by UUID from the local database to free resources. <br /></td></tr>
|
|
<tr class="separator:a0f940c51807469db1f1802b742180beb"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a3903fb7589e2b8b781f8f81f9e0f2a83" id="r_a3903fb7589e2b8b781f8f81f9e0f2a83"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_nim_b_l_e_att_value.html">NimBLEAttValue</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#a3903fb7589e2b8b781f8f81f9e0f2a83">getValue</a> (const <a class="el" href="class_nim_b_l_e_u_u_i_d.html">NimBLEUUID</a> &serviceUUID, const <a class="el" href="class_nim_b_l_e_u_u_i_d.html">NimBLEUUID</a> &characteristicUUID)</td></tr>
|
|
<tr class="memdesc:a3903fb7589e2b8b781f8f81f9e0f2a83"><td class="mdescLeft"> </td><td class="mdescRight">Get the value of a specific characteristic associated with a specific service. <br /></td></tr>
|
|
<tr class="separator:a3903fb7589e2b8b781f8f81f9e0f2a83"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a967d0c75083706f336f2283eac6d0de2" id="r_a967d0c75083706f336f2283eac6d0de2"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#a967d0c75083706f336f2283eac6d0de2">setValue</a> (const <a class="el" href="class_nim_b_l_e_u_u_i_d.html">NimBLEUUID</a> &serviceUUID, const <a class="el" href="class_nim_b_l_e_u_u_i_d.html">NimBLEUUID</a> &characteristicUUID, const <a class="el" href="class_nim_b_l_e_att_value.html">NimBLEAttValue</a> &value, bool response=false)</td></tr>
|
|
<tr class="memdesc:a967d0c75083706f336f2283eac6d0de2"><td class="mdescLeft"> </td><td class="mdescRight">Set the value of a specific characteristic associated with a specific service. <br /></td></tr>
|
|
<tr class="separator:a967d0c75083706f336f2283eac6d0de2"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a004a85999b1ee4283e1e8e1e31090cca" id="r_a004a85999b1ee4283e1e8e1e31090cca"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#a004a85999b1ee4283e1e8e1e31090cca">setConnectPhy</a> (uint8_t phyMask)</td></tr>
|
|
<tr class="memdesc:a004a85999b1ee4283e1e8e1e31090cca"><td class="mdescLeft"> </td><td class="mdescRight">Set the PHY types to use when connecting to a server. <br /></td></tr>
|
|
<tr class="separator:a004a85999b1ee4283e1e8e1e31090cca"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a165957953c2773dacc6a203c969f6069" id="r_a165957953c2773dacc6a203c969f6069"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#a165957953c2773dacc6a203c969f6069">updatePhy</a> (uint8_t txPhysMask, uint8_t rxPhysMask, uint16_t phyOptions=0)</td></tr>
|
|
<tr class="memdesc:a165957953c2773dacc6a203c969f6069"><td class="mdescLeft"> </td><td class="mdescRight">Request a change to the PHY used for this peer connection. <br /></td></tr>
|
|
<tr class="separator:a165957953c2773dacc6a203c969f6069"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a6ca4e212d5b69d4759bd695def020525" id="r_a6ca4e212d5b69d4759bd695def020525"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#a6ca4e212d5b69d4759bd695def020525">getPhy</a> (uint8_t *txPhy, uint8_t *rxPhy)</td></tr>
|
|
<tr class="memdesc:a6ca4e212d5b69d4759bd695def020525"><td class="mdescLeft"> </td><td class="mdescRight">Get the PHY used for this peer connection. <br /></td></tr>
|
|
<tr class="separator:a6ca4e212d5b69d4759bd695def020525"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ac053fba7c84201dc6e7455231cf99f4a" id="r_ac053fba7c84201dc6e7455231cf99f4a"><td class="memItemLeft" align="right" valign="top">Config </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#ac053fba7c84201dc6e7455231cf99f4a">getConfig</a> () const</td></tr>
|
|
<tr class="memdesc:ac053fba7c84201dc6e7455231cf99f4a"><td class="mdescLeft"> </td><td class="mdescRight">Get a copy of the clients configuration. <br /></td></tr>
|
|
<tr class="separator:ac053fba7c84201dc6e7455231cf99f4a"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ad89d8202400ecb573ce0e2ec5fc801dc" id="r_ad89d8202400ecb573ce0e2ec5fc801dc"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_nim_b_l_e_client.html#ad89d8202400ecb573ce0e2ec5fc801dc">setConfig</a> (Config config)</td></tr>
|
|
<tr class="memdesc:ad89d8202400ecb573ce0e2ec5fc801dc"><td class="mdescLeft"> </td><td class="mdescRight">Set the client configuration options. <br /></td></tr>
|
|
<tr class="separator:ad89d8202400ecb573ce0e2ec5fc801dc"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<div class="textblock"><p>A model of a BLE client. </p>
|
|
</div><h2 class="groupheader">Member Function Documentation</h2>
|
|
<a id="ab09639b499fdcd0021a2432b2b8203f5" name="ab09639b499fdcd0021a2432b2b8203f5"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ab09639b499fdcd0021a2432b2b8203f5">◆ </a></span>begin()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">std::vector< <a class="el" href="class_nim_b_l_e_remote_service.html">NimBLERemoteService</a> * >::iterator NimBLEClient::begin </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get iterator to the beginning of the vector of remote service pointers. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>An iterator to the beginning of the vector of remote service pointers. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="af77b2a5390ea811e9405ff81dba8ecac" name="af77b2a5390ea811e9405ff81dba8ecac"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#af77b2a5390ea811e9405ff81dba8ecac">◆ </a></span>cancelConnect()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool NimBLEClient::cancelConnect </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Cancel an ongoing connection attempt. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>True if the command was successfully sent. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a26c8117d56d8b637780390a6506716be" name="a26c8117d56d8b637780390a6506716be"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a26c8117d56d8b637780390a6506716be">◆ </a></span>connect() <span class="overload">[1/3]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool NimBLEClient::connect </td>
|
|
<td>(</td>
|
|
<td class="paramtype">bool </td>
|
|
<td class="paramname"><em>deleteAttributes</em> = <code>true</code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">bool </td>
|
|
<td class="paramname"><em>asyncConnect</em> = <code>false</code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">bool </td>
|
|
<td class="paramname"><em>exchangeMTU</em> = <code>true</code> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Connect to the BLE Server using the address of the last connected device, or the address<br />
|
|
passed to the constructor. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">deleteAttributes</td><td>If true this will delete any attribute objects this client may already<br />
|
|
have created when last connected. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">asyncConnect</td><td>If true, the connection will be made asynchronously and this function will return immediately.<br />
|
|
If false, this function will block until the connection is established or the connection attempt times out. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">exchangeMTU</td><td>If true, the client will attempt to exchange MTU with the server after connection.<br />
|
|
If false, the client will use the default MTU size and the application will need to call <a class="el" href="class_nim_b_l_e_client.html#a19d97b47f01f0862e04f3011752b2f2f" title="Begin the MTU exchange process with the server.">exchangeMTU()</a> later. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>true on success. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a27e53c3746bc2d20ea7cfcea1a123cbf" name="a27e53c3746bc2d20ea7cfcea1a123cbf"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a27e53c3746bc2d20ea7cfcea1a123cbf">◆ </a></span>connect() <span class="overload">[2/3]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool NimBLEClient::connect </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>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">bool </td>
|
|
<td class="paramname"><em>deleteAttributes</em> = <code>true</code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">bool </td>
|
|
<td class="paramname"><em>asyncConnect</em> = <code>false</code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">bool </td>
|
|
<td class="paramname"><em>exchangeMTU</em> = <code>true</code> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Connect to a BLE Server by address. </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 server. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">deleteAttributes</td><td>If true this will delete any attribute objects this client may already<br />
|
|
have created when last connected. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">asyncConnect</td><td>If true, the connection will be made asynchronously and this function will return immediately.<br />
|
|
If false, this function will block until the connection is established or the connection attempt times out. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">exchangeMTU</td><td>If true, the client will attempt to exchange MTU with the server after connection.<br />
|
|
If false, the client will use the default MTU size and the application will need to call <a class="el" href="class_nim_b_l_e_client.html#a19d97b47f01f0862e04f3011752b2f2f" title="Begin the MTU exchange process with the server.">exchangeMTU()</a> later. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>true on success. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a2b49bc73802bf716cf3df3b5a93f0543" name="a2b49bc73802bf716cf3df3b5a93f0543"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a2b49bc73802bf716cf3df3b5a93f0543">◆ </a></span>connect() <span class="overload">[3/3]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool NimBLEClient::connect </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>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">bool </td>
|
|
<td class="paramname"><em>deleteAttributes</em> = <code>true</code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">bool </td>
|
|
<td class="paramname"><em>asyncConnect</em> = <code>false</code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">bool </td>
|
|
<td class="paramname"><em>exchangeMTU</em> = <code>true</code> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Connect to an advertising device. </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 connect to. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">deleteAttributes</td><td>If true this will delete any attribute objects this client may already<br />
|
|
have created when last connected. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">asyncConnect</td><td>If true, the connection will be made asynchronously and this function will return immediately.<br />
|
|
If false, this function will block until the connection is established or the connection attempt times out. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">exchangeMTU</td><td>If true, the client will attempt to exchange MTU with the server after connection.<br />
|
|
If false, the client will use the default MTU size and the application will need to call <a class="el" href="class_nim_b_l_e_client.html#a19d97b47f01f0862e04f3011752b2f2f" title="Begin the MTU exchange process with the server.">exchangeMTU()</a> later. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>true on success. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a0f940c51807469db1f1802b742180beb" name="a0f940c51807469db1f1802b742180beb"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a0f940c51807469db1f1802b742180beb">◆ </a></span>deleteService()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">size_t NimBLEClient::deleteService </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="class_nim_b_l_e_u_u_i_d.html">NimBLEUUID</a> & </td>
|
|
<td class="paramname"><em>uuid</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Delete a service by UUID from the local database to free resources. </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 of the service to be deleted. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>Number of services left. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a36b298b70a42d32b8d578869b0763140" name="a36b298b70a42d32b8d578869b0763140"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a36b298b70a42d32b8d578869b0763140">◆ </a></span>disconnect()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool NimBLEClient::disconnect </td>
|
|
<td>(</td>
|
|
<td class="paramtype">uint8_t </td>
|
|
<td class="paramname"><em>reason</em> = <code>BLE_ERR_REM_USER_CONN_TERM</code></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Disconnect from the peer. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>True if the command was successfully sent. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a1019178a12799ca2c3a84f523b3a7db9" name="a1019178a12799ca2c3a84f523b3a7db9"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a1019178a12799ca2c3a84f523b3a7db9">◆ </a></span>discoverAttributes()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool NimBLEClient::discoverAttributes </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Retrieves the full database of attributes that the peripheral has available. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>True if successful. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a0accd665926ea77d85ecb483b2b853fe" name="a0accd665926ea77d85ecb483b2b853fe"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a0accd665926ea77d85ecb483b2b853fe">◆ </a></span>end()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">std::vector< <a class="el" href="class_nim_b_l_e_remote_service.html">NimBLERemoteService</a> * >::iterator NimBLEClient::end </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get iterator to the end of the vector of remote service pointers. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>An iterator to the end of the vector of remote service pointers. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a19d97b47f01f0862e04f3011752b2f2f" name="a19d97b47f01f0862e04f3011752b2f2f"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a19d97b47f01f0862e04f3011752b2f2f">◆ </a></span>exchangeMTU()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool NimBLEClient::exchangeMTU </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Begin the MTU exchange process with the server. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>true if the request was sent successfully. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a6b801e91a37745445499dadfb4c38597" name="a6b801e91a37745445499dadfb4c38597"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a6b801e91a37745445499dadfb4c38597">◆ </a></span>getCharacteristic()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="class_nim_b_l_e_remote_characteristic.html">NimBLERemoteCharacteristic</a> * NimBLEClient::getCharacteristic </td>
|
|
<td>(</td>
|
|
<td class="paramtype">uint16_t </td>
|
|
<td class="paramname"><em>handle</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get the remote characteristic with the specified handle. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">handle</td><td>The handle of the desired characteristic. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>The matching remote characteristic, nullptr otherwise. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ac053fba7c84201dc6e7455231cf99f4a" name="ac053fba7c84201dc6e7455231cf99f4a"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ac053fba7c84201dc6e7455231cf99f4a">◆ </a></span>getConfig()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">NimBLEClient::Config NimBLEClient::getConfig </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get a copy of the clients configuration. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>A copy of the clients configuration. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ac1e517e5a57b0bd05d4bafa66a17f1bd" name="ac1e517e5a57b0bd05d4bafa66a17f1bd"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ac1e517e5a57b0bd05d4bafa66a17f1bd">◆ </a></span>getConnHandle()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">uint16_t NimBLEClient::getConnHandle </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get the connection handle for this client. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>The connection handle. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a50b691f395c4dcf4b633efede0783805" name="a50b691f395c4dcf4b633efede0783805"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a50b691f395c4dcf4b633efede0783805">◆ </a></span>getConnInfo()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="class_nim_b_l_e_conn_info.html">NimBLEConnInfo</a> NimBLEClient::getConnInfo </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get detailed information about the current peer connection. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>A <a class="el" href="class_nim_b_l_e_conn_info.html" title="Connection information.">NimBLEConnInfo</a> instance with the data, or a NULL instance if not found. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aeb0593ebffa7e8833e5854480e41cce5" name="aeb0593ebffa7e8833e5854480e41cce5"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aeb0593ebffa7e8833e5854480e41cce5">◆ </a></span>getLastError()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">int NimBLEClient::getLastError </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get the last error code reported by the NimBLE host. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>int, the NimBLE error code. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a7f3230e45ac77bd4cb50b5c270f9c74c" name="a7f3230e45ac77bd4cb50b5c270f9c74c"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a7f3230e45ac77bd4cb50b5c270f9c74c">◆ </a></span>getMTU()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">uint16_t NimBLEClient::getMTU </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get the current mtu of this connection. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>The MTU value. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a44a6f7f9379e2fc129c37915636db61f" name="a44a6f7f9379e2fc129c37915636db61f"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a44a6f7f9379e2fc129c37915636db61f">◆ </a></span>getPeerAddress()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="class_nim_b_l_e_address.html">NimBLEAddress</a> NimBLEClient::getPeerAddress </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Retrieve the address of the peer. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>A <a class="el" href="class_nim_b_l_e_address.html" title="A BLE device address.">NimBLEAddress</a> instance with the peer address data. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a6ca4e212d5b69d4759bd695def020525" name="a6ca4e212d5b69d4759bd695def020525"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a6ca4e212d5b69d4759bd695def020525">◆ </a></span>getPhy()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool NimBLEClient::getPhy </td>
|
|
<td>(</td>
|
|
<td class="paramtype">uint8_t * </td>
|
|
<td class="paramname"><em>txPhy</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint8_t * </td>
|
|
<td class="paramname"><em>rxPhy</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get the PHY used for this peer connection. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[out]</td><td class="paramname">txPhy</td><td>The TX PHY. </td></tr>
|
|
<tr><td class="paramdir">[out]</td><td class="paramname">rxPhy</td><td>The RX PHY. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>True if successful. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a2645d4a2f8e381bf9bbffdfca846ae17" name="a2645d4a2f8e381bf9bbffdfca846ae17"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a2645d4a2f8e381bf9bbffdfca846ae17">◆ </a></span>getRssi()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">int NimBLEClient::getRssi </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Ask the BLE server for the RSSI value. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>The RSSI value or 0 if there was an error. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ae22379ab10bd82932d2303fb3753c366" name="ae22379ab10bd82932d2303fb3753c366"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ae22379ab10bd82932d2303fb3753c366">◆ </a></span>getService() <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_remote_service.html">NimBLERemoteService</a> * NimBLEClient::getService </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"><em>uuid</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get the service BLE Remote Service instance corresponding to 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 of the service being sought. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>A pointer to the service or nullptr if not found. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ad8ba10522d79af1136019606802f0978" name="ad8ba10522d79af1136019606802f0978"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ad8ba10522d79af1136019606802f0978">◆ </a></span>getService() <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_remote_service.html">NimBLERemoteService</a> * NimBLEClient::getService </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="class_nim_b_l_e_u_u_i_d.html">NimBLEUUID</a> & </td>
|
|
<td class="paramname"><em>uuid</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get the service object corresponding to 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 of the service being sought. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>A pointer to the service or nullptr if not found. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="adefe48b87e8a814e1643cdb8c3759298" name="adefe48b87e8a814e1643cdb8c3759298"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#adefe48b87e8a814e1643cdb8c3759298">◆ </a></span>getServices()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">const std::vector< <a class="el" href="class_nim_b_l_e_remote_service.html">NimBLERemoteService</a> * > & NimBLEClient::getServices </td>
|
|
<td>(</td>
|
|
<td class="paramtype">bool </td>
|
|
<td class="paramname"><em>refresh</em> = <code>false</code></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get a pointer to the vector of found services. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">refresh</td><td>If true the current services vector will be cleared and<br />
|
|
all services will be retrieved from the peripheral.<br />
|
|
If false the vector will be returned with the currently stored services. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>A pointer to the vector of available services. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a3903fb7589e2b8b781f8f81f9e0f2a83" name="a3903fb7589e2b8b781f8f81f9e0f2a83"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a3903fb7589e2b8b781f8f81f9e0f2a83">◆ </a></span>getValue()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="class_nim_b_l_e_att_value.html">NimBLEAttValue</a> NimBLEClient::getValue </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="class_nim_b_l_e_u_u_i_d.html">NimBLEUUID</a> & </td>
|
|
<td class="paramname"><em>serviceUUID</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const <a class="el" href="class_nim_b_l_e_u_u_i_d.html">NimBLEUUID</a> & </td>
|
|
<td class="paramname"><em>characteristicUUID</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get the value of a specific characteristic associated with a specific service. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">serviceUUID</td><td>The service that owns the characteristic. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">characteristicUUID</td><td>The characteristic whose value we wish to read. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>characteristic value or an empty value if not found. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a0bdaf55b06367d1abd6f59bfbe1e8689" name="a0bdaf55b06367d1abd6f59bfbe1e8689"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a0bdaf55b06367d1abd6f59bfbe1e8689">◆ </a></span>isConnected()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool NimBLEClient::isConnected </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Are we connected to a server? </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>True if we are connected and false if we are not connected. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a2dac3bd373134ae6d22e3b5c96ed65ef" name="a2dac3bd373134ae6d22e3b5c96ed65ef"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a2dac3bd373134ae6d22e3b5c96ed65ef">◆ </a></span>secureConnection()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool NimBLEClient::secureConnection </td>
|
|
<td>(</td>
|
|
<td class="paramtype">bool </td>
|
|
<td class="paramname"><em>async</em> = <code>false</code></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Initiate a secure connection (pair/bond) with the server.<br />
|
|
Called automatically when a characteristic or descriptor requires encryption or authentication to access it. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">async</td><td>If true, the connection will be secured asynchronously and this function will return immediately.<br />
|
|
If false, this function will block until the connection is secured or the client disconnects. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>True on success.</dd></dl>
|
|
<p>If async=false, this function will block and should not be used in a callback. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aeede4deef7421b9121387a786c07820c" name="aeede4deef7421b9121387a786c07820c"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aeede4deef7421b9121387a786c07820c">◆ </a></span>setClientCallbacks()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void NimBLEClient::setClientCallbacks </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="class_nim_b_l_e_client_callbacks.html">NimBLEClientCallbacks</a> * </td>
|
|
<td class="paramname"><em>pClientCallbacks</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">bool </td>
|
|
<td class="paramname"><em>deleteCallbacks</em> = <code>true</code> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Set the callbacks that will be invoked when events are received. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">pClientCallbacks</td><td>A pointer to a class to receive the event callbacks. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">deleteCallbacks</td><td>If true this will delete the callback class sent when the client is destructed. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ad89d8202400ecb573ce0e2ec5fc801dc" name="ad89d8202400ecb573ce0e2ec5fc801dc"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ad89d8202400ecb573ce0e2ec5fc801dc">◆ </a></span>setConfig()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void NimBLEClient::setConfig </td>
|
|
<td>(</td>
|
|
<td class="paramtype">NimBLEClient::Config </td>
|
|
<td class="paramname"><em>config</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Set the client configuration options. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">config</td><td>The config options instance to set the client configuration to. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a17718339f76eb621db0d7919c73b9267" name="a17718339f76eb621db0d7919c73b9267"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a17718339f76eb621db0d7919c73b9267">◆ </a></span>setConnectionParams()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void NimBLEClient::setConnectionParams </td>
|
|
<td>(</td>
|
|
<td class="paramtype">uint16_t </td>
|
|
<td class="paramname"><em>minInterval</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint16_t </td>
|
|
<td class="paramname"><em>maxInterval</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint16_t </td>
|
|
<td class="paramname"><em>latency</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint16_t </td>
|
|
<td class="paramname"><em>timeout</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint16_t </td>
|
|
<td class="paramname"><em>scanInterval</em> = <code>16</code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint16_t </td>
|
|
<td class="paramname"><em>scanWindow</em> = <code>16</code> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Set the connection parameters to use when connecting to a server. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">minInterval</td><td>The minimum connection interval in 1.25ms units. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">maxInterval</td><td>The maximum connection interval in 1.25ms units. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">latency</td><td>The number of packets allowed to skip (extends max interval). </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">timeout</td><td>The timeout time in 10ms units before disconnecting. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">scanInterval</td><td>The scan interval to use when attempting to connect in 0.625ms units. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">scanWindow</td><td>The scan window to use when attempting to connect in 0.625ms units. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a004a85999b1ee4283e1e8e1e31090cca" name="a004a85999b1ee4283e1e8e1e31090cca"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a004a85999b1ee4283e1e8e1e31090cca">◆ </a></span>setConnectPhy()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void NimBLEClient::setConnectPhy </td>
|
|
<td>(</td>
|
|
<td class="paramtype">uint8_t </td>
|
|
<td class="paramname"><em>mask</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Set the PHY types to use when connecting to a server. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">mask</td><td>A bitmask indicating what PHYS to connect with.<br />
|
|
The available bits are:<ul>
|
|
<li>0x01 BLE_GAP_LE_PHY_1M_MASK</li>
|
|
<li>0x02 BLE_GAP_LE_PHY_2M_MASK</li>
|
|
<li>0x04 BLE_GAP_LE_PHY_CODED_MASK </li>
|
|
</ul>
|
|
</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aeb3675ab243ae6f0e4e7165cd07f7b80" name="aeb3675ab243ae6f0e4e7165cd07f7b80"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aeb3675ab243ae6f0e4e7165cd07f7b80">◆ </a></span>setConnectTimeout()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void NimBLEClient::setConnectTimeout </td>
|
|
<td>(</td>
|
|
<td class="paramtype">uint32_t </td>
|
|
<td class="paramname"><em>time</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Set the timeout to wait for connection attempt to complete. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">time</td><td>The number of milliseconds before timeout, default is 30 seconds. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a4e8b16bb2c8ba3534bbd04803a411911" name="a4e8b16bb2c8ba3534bbd04803a411911"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a4e8b16bb2c8ba3534bbd04803a411911">◆ </a></span>setDataLen()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool NimBLEClient::setDataLen </td>
|
|
<td>(</td>
|
|
<td class="paramtype">uint16_t </td>
|
|
<td class="paramname"><em>txOctets</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Request an update of the data packet length. </p>
|
|
<ul>
|
|
<li><p class="startli">Can only be used after a connection has been established.</p>
|
|
<p class="startli">Sends a data length update request to the server the client is connected to. The Data Length Extension (DLE) allows to increase the Data Channel Payload from 27 bytes to up to 251 bytes. The server needs to support the Bluetooth 4.2 specifications, to be capable of DLE. </p><dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">txOctets</td><td>The preferred number of payload octets to use (Range 0x001B-0x00FB). </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a89d5aee4deaba953b8f77af75e3ee910" name="a89d5aee4deaba953b8f77af75e3ee910"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a89d5aee4deaba953b8f77af75e3ee910">◆ </a></span>setPeerAddress()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool NimBLEClient::setPeerAddress </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>Set the peer address. </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 peer that this client is connected or should connect to. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>True if successful. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a665a5ef97b3ab0307bccc54872d3c218" name="a665a5ef97b3ab0307bccc54872d3c218"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a665a5ef97b3ab0307bccc54872d3c218">◆ </a></span>setSelfDelete()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void NimBLEClient::setSelfDelete </td>
|
|
<td>(</td>
|
|
<td class="paramtype">bool </td>
|
|
<td class="paramname"><em>deleteOnDisconnect</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">bool </td>
|
|
<td class="paramname"><em>deleteOnConnectFail</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Set or unset a flag to delete this client when disconnected or connection failed. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">deleteOnDisconnect</td><td>Set the client to self delete when disconnected. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">deleteOnConnectFail</td><td>Set the client to self delete when a connection attempt fails. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a967d0c75083706f336f2283eac6d0de2" name="a967d0c75083706f336f2283eac6d0de2"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a967d0c75083706f336f2283eac6d0de2">◆ </a></span>setValue()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool NimBLEClient::setValue </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="class_nim_b_l_e_u_u_i_d.html">NimBLEUUID</a> & </td>
|
|
<td class="paramname"><em>serviceUUID</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const <a class="el" href="class_nim_b_l_e_u_u_i_d.html">NimBLEUUID</a> & </td>
|
|
<td class="paramname"><em>characteristicUUID</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const <a class="el" href="class_nim_b_l_e_att_value.html">NimBLEAttValue</a> & </td>
|
|
<td class="paramname"><em>value</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">bool </td>
|
|
<td class="paramname"><em>response</em> = <code>false</code> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Set the value of a specific characteristic associated with a specific service. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">serviceUUID</td><td>The service that owns the characteristic. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">characteristicUUID</td><td>The characteristic whose value we wish to write. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">value</td><td>The value to write to the characteristic. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">response</td><td>If true, uses write with response operation. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>true if successful otherwise false </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a8ead2efdfdf23db4f7847a133939cd75" name="a8ead2efdfdf23db4f7847a133939cd75"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a8ead2efdfdf23db4f7847a133939cd75">◆ </a></span>toString()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">std::string NimBLEClient::toString </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Return a string representation of this client. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>A string representation of this client. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ad168d34de0f57f91824a78688b88b2b8" name="ad168d34de0f57f91824a78688b88b2b8"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ad168d34de0f57f91824a78688b88b2b8">◆ </a></span>updateConnParams()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool NimBLEClient::updateConnParams </td>
|
|
<td>(</td>
|
|
<td class="paramtype">uint16_t </td>
|
|
<td class="paramname"><em>minInterval</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint16_t </td>
|
|
<td class="paramname"><em>maxInterval</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint16_t </td>
|
|
<td class="paramname"><em>latency</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint16_t </td>
|
|
<td class="paramname"><em>timeout</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Update the connection parameters: </p>
|
|
<ul>
|
|
<li>Can only be used after a connection has been established. <dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">minInterval</td><td>The minimum connection interval in 1.25ms units. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">maxInterval</td><td>The maximum connection interval in 1.25ms units. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">latency</td><td>The number of packets allowed to skip (extends max interval). </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">timeout</td><td>The timeout time in 10ms units before disconnecting. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a165957953c2773dacc6a203c969f6069" name="a165957953c2773dacc6a203c969f6069"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a165957953c2773dacc6a203c969f6069">◆ </a></span>updatePhy()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool NimBLEClient::updatePhy </td>
|
|
<td>(</td>
|
|
<td class="paramtype">uint8_t </td>
|
|
<td class="paramname"><em>txPhyMask</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint8_t </td>
|
|
<td class="paramname"><em>rxPhyMask</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint16_t </td>
|
|
<td class="paramname"><em>phyOptions</em> = <code>0</code> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Request a change to the PHY used for this peer connection. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">txPhyMask</td><td>TX PHY. Can be mask of following:<ul>
|
|
<li>BLE_GAP_LE_PHY_1M_MASK</li>
|
|
<li>BLE_GAP_LE_PHY_2M_MASK</li>
|
|
<li>BLE_GAP_LE_PHY_CODED_MASK</li>
|
|
<li>BLE_GAP_LE_PHY_ANY_MASK </li>
|
|
</ul>
|
|
</td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">rxPhyMask</td><td>RX PHY. Can be mask of following:<ul>
|
|
<li>BLE_GAP_LE_PHY_1M_MASK</li>
|
|
<li>BLE_GAP_LE_PHY_2M_MASK</li>
|
|
<li>BLE_GAP_LE_PHY_CODED_MASK</li>
|
|
<li>BLE_GAP_LE_PHY_ANY_MASK </li>
|
|
</ul>
|
|
</td></tr>
|
|
<tr><td class="paramdir"></td><td class="paramname">phyOptions</td><td>Additional PHY options. Valid values are:<ul>
|
|
<li>BLE_GAP_LE_PHY_CODED_ANY (default)</li>
|
|
<li>BLE_GAP_LE_PHY_CODED_S2</li>
|
|
<li>BLE_GAP_LE_PHY_CODED_S8 </li>
|
|
</ul>
|
|
</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<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_client.html">NimBLEClient</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>
|