mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2024-12-26 04:30:46 +01:00
465 lines
72 KiB
HTML
465 lines
72 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.1"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>esp-nimble-cpp: K:/Users/Ryan/Desktop/test_idf/components/esp-nimble-cpp/src/NimBLEAttValue.h Source File</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
|
|
 <span id="projectnumber">1.4.0</span>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.9.1 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&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&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&dn=gpl-2.0.txt GPL-v2 */
|
|
$(document).ready(function(){initNavTree('_nim_b_l_e_att_value_8h_source.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="headertitle">
|
|
<div class="title">NimBLEAttValue.h</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div>
|
|
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"> * NimBLEAttValue.h</span></div>
|
|
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> *</span></div>
|
|
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> * Created: on March 18, 2021</span></div>
|
|
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> * Author H2zero</span></div>
|
|
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> *</span></div>
|
|
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> */</span></div>
|
|
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>  </div>
|
|
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="preprocessor">#ifndef MAIN_NIMBLEATTVALUE_H_</span></div>
|
|
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="preprocessor">#define MAIN_NIMBLEATTVALUE_H_</span></div>
|
|
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="preprocessor">#include "<a class="code" href="nimconfig_8h.html">nimconfig.h</a>"</span></div>
|
|
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="preprocessor">#if defined(CONFIG_BT_ENABLED)</span></div>
|
|
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>  </div>
|
|
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="preprocessor">#ifdef NIMBLE_CPP_ARDUINO_STRING_AVAILABLE</span></div>
|
|
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="preprocessor">#include <Arduino.h></span></div>
|
|
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="preprocessor">#endif</span></div>
|
|
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>  </div>
|
|
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#include "NimBLELog.h"</span></div>
|
|
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>  </div>
|
|
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="comment">/**** FIX COMPILATION ****/</span></div>
|
|
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#undef min</span></div>
|
|
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#undef max</span></div>
|
|
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="comment">/**************************/</span></div>
|
|
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>  </div>
|
|
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#include <string></span></div>
|
|
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#include <vector></span></div>
|
|
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>  </div>
|
|
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="preprocessor">#ifndef CONFIG_NIMBLE_CPP_ATT_VALUE_TIMESTAMP_ENABLED</span></div>
|
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor"># define CONFIG_NIMBLE_CPP_ATT_VALUE_TIMESTAMP_ENABLED 0</span></div>
|
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="preprocessor">#endif</span></div>
|
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  </div>
|
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="preprocessor">#if CONFIG_NIMBLE_CPP_ATT_VALUE_TIMESTAMP_ENABLED</span></div>
|
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="preprocessor"># include <time.h></span></div>
|
|
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="preprocessor">#endif</span></div>
|
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  </div>
|
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="preprocessor">#if !defined(CONFIG_NIMBLE_CPP_ATT_VALUE_INIT_LENGTH)</span></div>
|
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="preprocessor"># define CONFIG_NIMBLE_CPP_ATT_VALUE_INIT_LENGTH 20</span></div>
|
|
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="preprocessor">#elif CONFIG_NIMBLE_CPP_ATT_VALUE_INIT_LENGTH > BLE_ATT_ATTR_MAX_LEN</span></div>
|
|
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="preprocessor"># error CONFIG_NIMBLE_CPP_ATT_VALUE_INIT_LENGTH cannot be larger than 512 (BLE_ATT_ATTR_MAX_LEN)</span></div>
|
|
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="preprocessor">#elif CONFIG_NIMBLE_CPP_ATT_VALUE_INIT_LENGTH < 1</span></div>
|
|
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="preprocessor"># error CONFIG_NIMBLE_CPP_ATT_VALUE_INIT_LENGTH cannot be less than 1; Range = 1 : 512</span></div>
|
|
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <span class="preprocessor">#endif</span></div>
|
|
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  </div>
|
|
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  </div>
|
|
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span> <span class="comment">/* Used to determine if the type passed to a template has a c_str() and length() method. */</span></div>
|
|
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span> <span class="keyword">template</span> <<span class="keyword">typename</span> T, <span class="keyword">typename</span> = <span class="keywordtype">void</span>, <span class="keyword">typename</span> = <span class="keywordtype">void</span>></div>
|
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span> <span class="keyword">struct </span>Has_c_str_len : std::false_type {};</div>
|
|
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  </div>
|
|
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span> <span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
|
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span> <span class="keyword">struct </span>Has_c_str_len<T, decltype(void(std::declval<T &>().c_str())),</div>
|
|
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  decltype(void(std::declval<T &>().length()))> : std::true_type {};</div>
|
|
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  </div>
|
|
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  </div>
|
|
<div class="line"><a name="l00060"></a><span class="lineno"><a class="line" href="class_nim_b_l_e_att_value.html"> 60</a></span> <span class="keyword">class </span><a class="code" href="class_nim_b_l_e_att_value.html">NimBLEAttValue</a></div>
|
|
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span> {</div>
|
|
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  uint8_t* m_attr_value = <span class="keyword">nullptr</span>;</div>
|
|
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  uint16_t m_attr_max_len = 0;</div>
|
|
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  uint16_t m_attr_len = 0;</div>
|
|
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  uint16_t m_capacity = 0;</div>
|
|
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span> <span class="preprocessor">#if CONFIG_NIMBLE_CPP_ATT_VALUE_TIMESTAMP_ENABLED</span></div>
|
|
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  time_t m_timestamp = 0;</div>
|
|
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span> <span class="preprocessor">#endif</span></div>
|
|
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  <span class="keywordtype">void</span> deepCopy(<span class="keyword">const</span> <a class="code" href="class_nim_b_l_e_att_value.html">NimBLEAttValue</a> & source);</div>
|
|
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  </div>
|
|
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span> <span class="keyword">public</span>:</div>
|
|
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  <a class="code" href="class_nim_b_l_e_att_value.html#aa801ed93f65e8cbc507c6ea6f4f49294">NimBLEAttValue</a>(uint16_t init_len = <a class="code" href="nimconfig_8h.html#a4d4ea715325f75455b43c7dbaa69d7a0">CONFIG_NIMBLE_CPP_ATT_VALUE_INIT_LENGTH</a>,</div>
|
|
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  uint16_t max_len = BLE_ATT_ATTR_MAX_LEN);</div>
|
|
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  </div>
|
|
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  <a class="code" href="class_nim_b_l_e_att_value.html#aa801ed93f65e8cbc507c6ea6f4f49294">NimBLEAttValue</a>(<span class="keyword">const</span> uint8_t *value, uint16_t len,</div>
|
|
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  uint16_t max_len = BLE_ATT_ATTR_MAX_LEN);</div>
|
|
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  </div>
|
|
<div class="line"><a name="l00094"></a><span class="lineno"><a class="line" href="class_nim_b_l_e_att_value.html#a61813a898f1bfb1b00e670a7fbb413df"> 94</a></span>  <a class="code" href="class_nim_b_l_e_att_value.html#a61813a898f1bfb1b00e670a7fbb413df">NimBLEAttValue</a>(std::initializer_list<uint8_t> list,</div>
|
|
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  uint16_t max_len = BLE_ATT_ATTR_MAX_LEN)</div>
|
|
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  :<a class="code" href="class_nim_b_l_e_att_value.html">NimBLEAttValue</a>(list.<a class="code" href="class_nim_b_l_e_att_value.html#a6167f1cbc50a81a4ca0708e273bbb63e">begin</a>(), (uint16_t)list.<a class="code" href="class_nim_b_l_e_att_value.html#aa8c75101d9898c3ff4646d84521ed61c">size</a>(), max_len){}</div>
|
|
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  </div>
|
|
<div class="line"><a name="l00103"></a><span class="lineno"><a class="line" href="class_nim_b_l_e_att_value.html#a4322572d778438318f5750f6df5fdb35"> 103</a></span>  <a class="code" href="class_nim_b_l_e_att_value.html#a4322572d778438318f5750f6df5fdb35">NimBLEAttValue</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *value, uint16_t max_len = BLE_ATT_ATTR_MAX_LEN)</div>
|
|
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  :<a class="code" href="class_nim_b_l_e_att_value.html">NimBLEAttValue</a>((uint8_t*)value, (uint16_t)strlen(value), max_len){}</div>
|
|
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  </div>
|
|
<div class="line"><a name="l00111"></a><span class="lineno"><a class="line" href="class_nim_b_l_e_att_value.html#a584cac329cd5d3c0a14aa855e6e6143e"> 111</a></span>  <a class="code" href="class_nim_b_l_e_att_value.html#a584cac329cd5d3c0a14aa855e6e6143e">NimBLEAttValue</a>(<span class="keyword">const</span> std::string str, uint16_t max_len = BLE_ATT_ATTR_MAX_LEN)</div>
|
|
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  :<a class="code" href="class_nim_b_l_e_att_value.html">NimBLEAttValue</a>((uint8_t*)str.<a class="code" href="class_nim_b_l_e_att_value.html#a9e595630f7959b4002f6fb64c69ae123">data</a>(), (uint16_t)str.<a class="code" href="class_nim_b_l_e_att_value.html#a35df29c514613b1d00841abd6fffa320">length</a>(), max_len){}</div>
|
|
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  </div>
|
|
<div class="line"><a name="l00119"></a><span class="lineno"><a class="line" href="class_nim_b_l_e_att_value.html#a03347eab1f3df449762902a4256d2b1c"> 119</a></span>  <a class="code" href="class_nim_b_l_e_att_value.html#a03347eab1f3df449762902a4256d2b1c">NimBLEAttValue</a>(<span class="keyword">const</span> std::vector<uint8_t> vec, uint16_t max_len = BLE_ATT_ATTR_MAX_LEN)</div>
|
|
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  :<a class="code" href="class_nim_b_l_e_att_value.html">NimBLEAttValue</a>(&vec[0], (uint16_t)vec.<a class="code" href="class_nim_b_l_e_att_value.html#aa8c75101d9898c3ff4646d84521ed61c">size</a>(), max_len){}</div>
|
|
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  </div>
|
|
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span> <span class="preprocessor">#ifdef NIMBLE_CPP_ARDUINO_STRING_AVAILABLE</span></div>
|
|
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  <a class="code" href="class_nim_b_l_e_att_value.html#aa801ed93f65e8cbc507c6ea6f4f49294">NimBLEAttValue</a>(<span class="keyword">const</span> String str, uint16_t max_len = BLE_ATT_ATTR_MAX_LEN)</div>
|
|
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  :<a class="code" href="class_nim_b_l_e_att_value.html">NimBLEAttValue</a>((uint8_t*)str.<a class="code" href="class_nim_b_l_e_att_value.html#aa2c18949ffc2e7d2d2f288c1b2b2f0ed">c_str</a>(), str.<a class="code" href="class_nim_b_l_e_att_value.html#a35df29c514613b1d00841abd6fffa320">length</a>(), max_len){}</div>
|
|
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span> <span class="preprocessor">#endif</span></div>
|
|
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  </div>
|
|
<div class="line"><a name="l00133"></a><span class="lineno"><a class="line" href="class_nim_b_l_e_att_value.html#a7473ad95c2240e0d1ce5c2d57f8914c2"> 133</a></span>  <a class="code" href="class_nim_b_l_e_att_value.html#a7473ad95c2240e0d1ce5c2d57f8914c2">NimBLEAttValue</a>(<span class="keyword">const</span> <a class="code" href="class_nim_b_l_e_att_value.html">NimBLEAttValue</a> & source) { deepCopy(source); }</div>
|
|
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  </div>
|
|
<div class="line"><a name="l00136"></a><span class="lineno"><a class="line" href="class_nim_b_l_e_att_value.html#a778d1da5334049292fdfba221bcd5772"> 136</a></span>  <a class="code" href="class_nim_b_l_e_att_value.html#a778d1da5334049292fdfba221bcd5772">NimBLEAttValue</a>(<a class="code" href="class_nim_b_l_e_att_value.html">NimBLEAttValue</a> && source) { *<span class="keyword">this</span> = std::move(source); }</div>
|
|
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  </div>
|
|
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  <a class="code" href="class_nim_b_l_e_att_value.html#a08f3b04d05cf0c2b76a24cc37cd1f8ab">~NimBLEAttValue</a>();</div>
|
|
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  </div>
|
|
<div class="line"><a name="l00142"></a><span class="lineno"><a class="line" href="class_nim_b_l_e_att_value.html#ac7abc6cd08adb0b654e051d62af725d5"> 142</a></span>  uint16_t <a class="code" href="class_nim_b_l_e_att_value.html#ac7abc6cd08adb0b654e051d62af725d5">max_size</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_attr_max_len; }</div>
|
|
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  </div>
|
|
<div class="line"><a name="l00145"></a><span class="lineno"><a class="line" href="class_nim_b_l_e_att_value.html#a49a8a126d0b534c999c4a341cdcf7ba2"> 145</a></span>  uint16_t <a class="code" href="class_nim_b_l_e_att_value.html#a49a8a126d0b534c999c4a341cdcf7ba2">capacity</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_capacity; }</div>
|
|
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  </div>
|
|
<div class="line"><a name="l00148"></a><span class="lineno"><a class="line" href="class_nim_b_l_e_att_value.html#a35df29c514613b1d00841abd6fffa320"> 148</a></span>  uint16_t <a class="code" href="class_nim_b_l_e_att_value.html#a35df29c514613b1d00841abd6fffa320">length</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_attr_len; }</div>
|
|
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  </div>
|
|
<div class="line"><a name="l00151"></a><span class="lineno"><a class="line" href="class_nim_b_l_e_att_value.html#aa8c75101d9898c3ff4646d84521ed61c"> 151</a></span>  uint16_t <a class="code" href="class_nim_b_l_e_att_value.html#aa8c75101d9898c3ff4646d84521ed61c">size</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_attr_len; }</div>
|
|
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  </div>
|
|
<div class="line"><a name="l00154"></a><span class="lineno"><a class="line" href="class_nim_b_l_e_att_value.html#a9e595630f7959b4002f6fb64c69ae123"> 154</a></span>  <span class="keyword">const</span> uint8_t* <a class="code" href="class_nim_b_l_e_att_value.html#a9e595630f7959b4002f6fb64c69ae123">data</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_attr_value; }</div>
|
|
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  </div>
|
|
<div class="line"><a name="l00157"></a><span class="lineno"><a class="line" href="class_nim_b_l_e_att_value.html#aa2c18949ffc2e7d2d2f288c1b2b2f0ed"> 157</a></span>  <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="class_nim_b_l_e_att_value.html#aa2c18949ffc2e7d2d2f288c1b2b2f0ed">c_str</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> (<span class="keyword">const</span> <span class="keywordtype">char</span>*)m_attr_value; }</div>
|
|
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  </div>
|
|
<div class="line"><a name="l00160"></a><span class="lineno"><a class="line" href="class_nim_b_l_e_att_value.html#a6167f1cbc50a81a4ca0708e273bbb63e"> 160</a></span>  <span class="keyword">const</span> uint8_t* <a class="code" href="class_nim_b_l_e_att_value.html#a6167f1cbc50a81a4ca0708e273bbb63e">begin</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_attr_value; }</div>
|
|
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  </div>
|
|
<div class="line"><a name="l00163"></a><span class="lineno"><a class="line" href="class_nim_b_l_e_att_value.html#a4f797f89e9c2d55dc7bee7ec8993952e"> 163</a></span>  <span class="keyword">const</span> uint8_t* <a class="code" href="class_nim_b_l_e_att_value.html#a4f797f89e9c2d55dc7bee7ec8993952e">end</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_attr_value + m_attr_len; }</div>
|
|
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  </div>
|
|
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span> <span class="preprocessor">#if CONFIG_NIMBLE_CPP_ATT_VALUE_TIMESTAMP_ENABLED</span></div>
|
|
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  time_t getTimeStamp()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_timestamp; }</div>
|
|
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  </div>
|
|
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  <span class="keywordtype">void</span> setTimeStamp() { m_timestamp = time(<span class="keyword">nullptr</span>); }</div>
|
|
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  </div>
|
|
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  <span class="keywordtype">void</span> setTimeStamp(time_t t) { m_timestamp = t; }</div>
|
|
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span> <span class="preprocessor">#else</span></div>
|
|
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  time_t getTimeStamp()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> 0; }</div>
|
|
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>  <span class="keywordtype">void</span> setTimeStamp() { }</div>
|
|
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  <span class="keywordtype">void</span> setTimeStamp(time_t t) { }</div>
|
|
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span> <span class="preprocessor">#endif</span></div>
|
|
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  </div>
|
|
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  <span class="keywordtype">bool</span> <a class="code" href="class_nim_b_l_e_att_value.html#a5c8c5ecfa3864d45ea5b155385e3f9fa">setValue</a>(<span class="keyword">const</span> uint8_t *value, uint16_t len);</div>
|
|
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  </div>
|
|
<div class="line"><a name="l00195"></a><span class="lineno"><a class="line" href="class_nim_b_l_e_att_value.html#a9c0f67d150d198c5bcad6eafafee21b6"> 195</a></span>  <span class="keywordtype">bool</span> <a class="code" href="class_nim_b_l_e_att_value.html#a9c0f67d150d198c5bcad6eafafee21b6">setValue</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* s) {</div>
|
|
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  <span class="keywordflow">return</span> <a class="code" href="class_nim_b_l_e_att_value.html#a5c8c5ecfa3864d45ea5b155385e3f9fa">setValue</a>((uint8_t*)s, (uint16_t)strlen(s)); }</div>
|
|
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  </div>
|
|
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  <span class="keyword">const</span> uint8_t* <a class="code" href="class_nim_b_l_e_att_value.html#a60fb3dc7057d4ec800c3ef6fd2480a69">getValue</a>(time_t *timestamp);</div>
|
|
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  </div>
|
|
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  <a class="code" href="class_nim_b_l_e_att_value.html">NimBLEAttValue</a>& <a class="code" href="class_nim_b_l_e_att_value.html#aa217dfc649daed50eb75c7168442f86e">append</a>(<span class="keyword">const</span> uint8_t *value, uint16_t len);</div>
|
|
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  </div>
|
|
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>  </div>
|
|
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span> <span class="comment"> /*********************** Template Functions ************************/</span></div>
|
|
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  </div>
|
|
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  <span class="keyword">template</span><<span class="keyword">typename</span> T></div>
|
|
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span> <span class="preprocessor">#ifdef _DOXYGEN_</span></div>
|
|
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>  <span class="keywordtype">bool</span></div>
|
|
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span> <span class="preprocessor">#else</span></div>
|
|
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  <span class="keyword">typename</span> std::enable_if<!Has_c_str_len<T>::value, <span class="keywordtype">bool</span>>::type</div>
|
|
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span> <span class="preprocessor">#endif</span></div>
|
|
<div class="line"><a name="l00227"></a><span class="lineno"><a class="line" href="class_nim_b_l_e_att_value.html#ac94a41f0c0d42d48b29d5b18d7ad7bd8"> 227</a></span>  <a class="code" href="class_nim_b_l_e_att_value.html#ac94a41f0c0d42d48b29d5b18d7ad7bd8">setValue</a>(<span class="keyword">const</span> T &s) {</div>
|
|
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>  <span class="keywordflow">return</span> <a class="code" href="class_nim_b_l_e_att_value.html#a5c8c5ecfa3864d45ea5b155385e3f9fa">setValue</a>((uint8_t*)&s, <span class="keyword">sizeof</span>(T));</div>
|
|
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>  }</div>
|
|
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>  </div>
|
|
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  <span class="keyword">template</span><<span class="keyword">typename</span> T></div>
|
|
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span> <span class="preprocessor">#ifdef _DOXYGEN_</span></div>
|
|
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>  <span class="keywordtype">bool</span></div>
|
|
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span> <span class="preprocessor">#else</span></div>
|
|
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>  <span class="keyword">typename</span> std::enable_if<Has_c_str_len<T>::value, <span class="keywordtype">bool</span>>::type</div>
|
|
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span> <span class="preprocessor">#endif</span></div>
|
|
<div class="line"><a name="l00242"></a><span class="lineno"><a class="line" href="class_nim_b_l_e_att_value.html#ac94a41f0c0d42d48b29d5b18d7ad7bd8"> 242</a></span>  <a class="code" href="class_nim_b_l_e_att_value.html#ac94a41f0c0d42d48b29d5b18d7ad7bd8">setValue</a>(<span class="keyword">const</span> T & s) {</div>
|
|
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  <span class="keywordflow">return</span> <a class="code" href="class_nim_b_l_e_att_value.html#a5c8c5ecfa3864d45ea5b155385e3f9fa">setValue</a>((uint8_t*)s.c_str(), (uint16_t)s.length());</div>
|
|
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>  }</div>
|
|
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>  </div>
|
|
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>  <span class="keyword">template</span><<span class="keyword">typename</span> T></div>
|
|
<div class="line"><a name="l00257"></a><span class="lineno"><a class="line" href="class_nim_b_l_e_att_value.html#a1aca76279ea3f0d8cb06ff5540a326e3"> 257</a></span>  T <a class="code" href="class_nim_b_l_e_att_value.html#a1aca76279ea3f0d8cb06ff5540a326e3">getValue</a>(time_t *timestamp = <span class="keyword">nullptr</span>, <span class="keywordtype">bool</span> skipSizeCheck = <span class="keyword">false</span>) {</div>
|
|
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>  <span class="keywordflow">if</span>(!skipSizeCheck && <a class="code" href="class_nim_b_l_e_att_value.html#aa8c75101d9898c3ff4646d84521ed61c">size</a>() < <span class="keyword">sizeof</span>(T)) {</div>
|
|
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>  <span class="keywordflow">return</span> T();</div>
|
|
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>  }</div>
|
|
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>  <span class="keywordflow">return</span> *((T *)<a class="code" href="class_nim_b_l_e_att_value.html#a60fb3dc7057d4ec800c3ef6fd2480a69">getValue</a>(timestamp));</div>
|
|
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>  }</div>
|
|
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>  </div>
|
|
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>  </div>
|
|
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span> <span class="comment"> /*********************** Operators ************************/</span></div>
|
|
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>  </div>
|
|
<div class="line"><a name="l00268"></a><span class="lineno"><a class="line" href="class_nim_b_l_e_att_value.html#a8ca8d07c06a79e30bf6279e6817e4881"> 268</a></span>  uint8_t <a class="code" href="class_nim_b_l_e_att_value.html#a8ca8d07c06a79e30bf6279e6817e4881">operator []</a>(<span class="keywordtype">int</span> pos)<span class="keyword"> const </span>{</div>
|
|
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>  assert(pos < m_attr_len && <span class="stringliteral">"out of range"</span>); <span class="keywordflow">return</span> m_attr_value[pos]; }</div>
|
|
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>  </div>
|
|
<div class="line"><a name="l00272"></a><span class="lineno"><a class="line" href="class_nim_b_l_e_att_value.html#a3af3b6efb528b1063df2de409c64a0d6"> 272</a></span>  <span class="keyword">operator</span> std::vector<uint8_t>()<span class="keyword"> const </span>{</div>
|
|
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>  <span class="keywordflow">return</span> std::vector<uint8_t>(m_attr_value, m_attr_value + m_attr_len); }</div>
|
|
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>  </div>
|
|
<div class="line"><a name="l00276"></a><span class="lineno"><a class="line" href="class_nim_b_l_e_att_value.html#a5edd484c83c5efa62916add8927a6371"> 276</a></span>  <span class="keyword">operator</span> std::string()<span class="keyword"> const </span>{</div>
|
|
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>  <span class="keywordflow">return</span> std::string((<span class="keywordtype">char</span>*)m_attr_value, m_attr_len); }</div>
|
|
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>  </div>
|
|
<div class="line"><a name="l00280"></a><span class="lineno"><a class="line" href="class_nim_b_l_e_att_value.html#a3aa926c56cd58146a5b1c6e02c97894b"> 280</a></span>  <span class="keyword">operator</span> <span class="keyword">const</span> uint8_t*() <span class="keyword">const</span> { <span class="keywordflow">return</span> m_attr_value; }</div>
|
|
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>  </div>
|
|
<div class="line"><a name="l00283"></a><span class="lineno"><a class="line" href="class_nim_b_l_e_att_value.html#a0e6691f9660a2b78e038e87e99914696"> 283</a></span>  <a class="code" href="class_nim_b_l_e_att_value.html">NimBLEAttValue</a>& <a class="code" href="class_nim_b_l_e_att_value.html#a0e6691f9660a2b78e038e87e99914696">operator +=</a>(<span class="keyword">const</span> <a class="code" href="class_nim_b_l_e_att_value.html">NimBLEAttValue</a> & source) {</div>
|
|
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>  <span class="keywordflow">return</span> <a class="code" href="class_nim_b_l_e_att_value.html#aa217dfc649daed50eb75c7168442f86e">append</a>(source.<a class="code" href="class_nim_b_l_e_att_value.html#a9e595630f7959b4002f6fb64c69ae123">data</a>(), source.<a class="code" href="class_nim_b_l_e_att_value.html#aa8c75101d9898c3ff4646d84521ed61c">size</a>()); }</div>
|
|
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>  </div>
|
|
<div class="line"><a name="l00287"></a><span class="lineno"><a class="line" href="class_nim_b_l_e_att_value.html#aa0545edd766dc4ca6e3ebfac5efa384e"> 287</a></span>  <a class="code" href="class_nim_b_l_e_att_value.html">NimBLEAttValue</a>& <a class="code" href="class_nim_b_l_e_att_value.html#aa0545edd766dc4ca6e3ebfac5efa384e">operator =</a>(<span class="keyword">const</span> std::string & source) {</div>
|
|
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>  <a class="code" href="class_nim_b_l_e_att_value.html#a5c8c5ecfa3864d45ea5b155385e3f9fa">setValue</a>((uint8_t*)source.data(), (uint16_t)source.size()); <span class="keywordflow">return</span> *<span class="keyword">this</span>; }</div>
|
|
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>  </div>
|
|
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>  <a class="code" href="class_nim_b_l_e_att_value.html">NimBLEAttValue</a>& <a class="code" href="class_nim_b_l_e_att_value.html#aa0545edd766dc4ca6e3ebfac5efa384e">operator =</a>(<a class="code" href="class_nim_b_l_e_att_value.html">NimBLEAttValue</a> && source);</div>
|
|
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>  </div>
|
|
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>  <a class="code" href="class_nim_b_l_e_att_value.html">NimBLEAttValue</a>& <a class="code" href="class_nim_b_l_e_att_value.html#aa0545edd766dc4ca6e3ebfac5efa384e">operator =</a>(<span class="keyword">const</span> <a class="code" href="class_nim_b_l_e_att_value.html">NimBLEAttValue</a> & source);</div>
|
|
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span>  </div>
|
|
<div class="line"><a name="l00297"></a><span class="lineno"><a class="line" href="class_nim_b_l_e_att_value.html#a9634dd47ea705ec8d10f29482e572bbf"> 297</a></span>  <span class="keywordtype">bool</span> <a class="code" href="class_nim_b_l_e_att_value.html#a9634dd47ea705ec8d10f29482e572bbf">operator ==</a>(<span class="keyword">const</span> <a class="code" href="class_nim_b_l_e_att_value.html">NimBLEAttValue</a> & source) {</div>
|
|
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span>  <span class="keywordflow">return</span> (m_attr_len == source.<a class="code" href="class_nim_b_l_e_att_value.html#aa8c75101d9898c3ff4646d84521ed61c">size</a>()) ?</div>
|
|
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>  memcmp(m_attr_value, source.<a class="code" href="class_nim_b_l_e_att_value.html#a9e595630f7959b4002f6fb64c69ae123">data</a>(), m_attr_len) == 0 : <span class="keyword">false</span>; }</div>
|
|
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>  </div>
|
|
<div class="line"><a name="l00302"></a><span class="lineno"><a class="line" href="class_nim_b_l_e_att_value.html#a9dc3bc75c3a0cedf76bed59ef2d0d289"> 302</a></span>  <span class="keywordtype">bool</span> <a class="code" href="class_nim_b_l_e_att_value.html#a9dc3bc75c3a0cedf76bed59ef2d0d289">operator !=</a>(<span class="keyword">const</span> <a class="code" href="class_nim_b_l_e_att_value.html">NimBLEAttValue</a> & source){ <span class="keywordflow">return</span> !(*<span class="keyword">this</span> == source); }</div>
|
|
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span>  </div>
|
|
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span> <span class="preprocessor">#ifdef NIMBLE_CPP_ARDUINO_STRING_AVAILABLE</span></div>
|
|
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>  <span class="keyword">operator</span> String()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> String((<span class="keywordtype">char</span>*)m_attr_value); }</div>
|
|
<div class="line"><a name="l00307"></a><span class="lineno"> 307</span> <span class="preprocessor">#endif</span></div>
|
|
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span>  </div>
|
|
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span> };</div>
|
|
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span>  </div>
|
|
<div class="line"><a name="l00311"></a><span class="lineno"> 311</span>  </div>
|
|
<div class="line"><a name="l00312"></a><span class="lineno"><a class="line" href="class_nim_b_l_e_att_value.html#aa801ed93f65e8cbc507c6ea6f4f49294"> 312</a></span> <span class="keyword">inline</span> <a class="code" href="class_nim_b_l_e_att_value.html#aa801ed93f65e8cbc507c6ea6f4f49294">NimBLEAttValue::NimBLEAttValue</a>(uint16_t init_len, uint16_t max_len) {</div>
|
|
<div class="line"><a name="l00313"></a><span class="lineno"> 313</span>  m_attr_value = (uint8_t*)calloc(init_len + 1, 1);</div>
|
|
<div class="line"><a name="l00314"></a><span class="lineno"> 314</span>  assert(m_attr_value && <span class="stringliteral">"No Mem"</span>);</div>
|
|
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>  m_attr_max_len = std::min(BLE_ATT_ATTR_MAX_LEN, (<span class="keywordtype">int</span>)max_len);</div>
|
|
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>  m_attr_len = 0;</div>
|
|
<div class="line"><a name="l00317"></a><span class="lineno"> 317</span>  m_capacity = init_len;</div>
|
|
<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>  setTimeStamp(0);</div>
|
|
<div class="line"><a name="l00319"></a><span class="lineno"> 319</span> }</div>
|
|
<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>  </div>
|
|
<div class="line"><a name="l00321"></a><span class="lineno"><a class="line" href="class_nim_b_l_e_att_value.html#ad0bbdf17e7861cbb4bb2cadae9cbe32c"> 321</a></span> <span class="keyword">inline</span> <a class="code" href="class_nim_b_l_e_att_value.html#aa801ed93f65e8cbc507c6ea6f4f49294">NimBLEAttValue::NimBLEAttValue</a>(<span class="keyword">const</span> uint8_t *value, uint16_t len, uint16_t max_len)</div>
|
|
<div class="line"><a name="l00322"></a><span class="lineno"> 322</span> : <a class="code" href="class_nim_b_l_e_att_value.html">NimBLEAttValue</a>(len, max_len) {</div>
|
|
<div class="line"><a name="l00323"></a><span class="lineno"> 323</span>  memcpy(m_attr_value, value, len);</div>
|
|
<div class="line"><a name="l00324"></a><span class="lineno"> 324</span>  m_attr_value[len] = <span class="charliteral">'\0'</span>;</div>
|
|
<div class="line"><a name="l00325"></a><span class="lineno"> 325</span>  m_attr_len = len;</div>
|
|
<div class="line"><a name="l00326"></a><span class="lineno"> 326</span> }</div>
|
|
<div class="line"><a name="l00327"></a><span class="lineno"> 327</span>  </div>
|
|
<div class="line"><a name="l00328"></a><span class="lineno"><a class="line" href="class_nim_b_l_e_att_value.html#a08f3b04d05cf0c2b76a24cc37cd1f8ab"> 328</a></span> <span class="keyword">inline</span> <a class="code" href="class_nim_b_l_e_att_value.html#a08f3b04d05cf0c2b76a24cc37cd1f8ab">NimBLEAttValue::~NimBLEAttValue</a>() {</div>
|
|
<div class="line"><a name="l00329"></a><span class="lineno"> 329</span>  <span class="keywordflow">if</span>(m_attr_value != <span class="keyword">nullptr</span>) {</div>
|
|
<div class="line"><a name="l00330"></a><span class="lineno"> 330</span>  free(m_attr_value);</div>
|
|
<div class="line"><a name="l00331"></a><span class="lineno"> 331</span>  }</div>
|
|
<div class="line"><a name="l00332"></a><span class="lineno"> 332</span> }</div>
|
|
<div class="line"><a name="l00333"></a><span class="lineno"> 333</span>  </div>
|
|
<div class="line"><a name="l00334"></a><span class="lineno"><a class="line" href="class_nim_b_l_e_att_value.html#a47d30a61ba65f5d9a21fa593cf15d4b9"> 334</a></span> <span class="keyword">inline</span> <a class="code" href="class_nim_b_l_e_att_value.html">NimBLEAttValue</a>& <a class="code" href="class_nim_b_l_e_att_value.html#aa0545edd766dc4ca6e3ebfac5efa384e">NimBLEAttValue::operator =</a>(<a class="code" href="class_nim_b_l_e_att_value.html">NimBLEAttValue</a> && source) {</div>
|
|
<div class="line"><a name="l00335"></a><span class="lineno"> 335</span>  <span class="keywordflow">if</span> (<span class="keyword">this</span> != &source){</div>
|
|
<div class="line"><a name="l00336"></a><span class="lineno"> 336</span>  free(m_attr_value);</div>
|
|
<div class="line"><a name="l00337"></a><span class="lineno"> 337</span>  </div>
|
|
<div class="line"><a name="l00338"></a><span class="lineno"> 338</span>  m_attr_value = source.m_attr_value;</div>
|
|
<div class="line"><a name="l00339"></a><span class="lineno"> 339</span>  m_attr_max_len = source.m_attr_max_len;</div>
|
|
<div class="line"><a name="l00340"></a><span class="lineno"> 340</span>  m_attr_len = source.m_attr_len;</div>
|
|
<div class="line"><a name="l00341"></a><span class="lineno"> 341</span>  m_capacity = source.m_capacity;</div>
|
|
<div class="line"><a name="l00342"></a><span class="lineno"> 342</span>  setTimeStamp(source.getTimeStamp());</div>
|
|
<div class="line"><a name="l00343"></a><span class="lineno"> 343</span>  source.m_attr_value = <span class="keyword">nullptr</span>;</div>
|
|
<div class="line"><a name="l00344"></a><span class="lineno"> 344</span>  }</div>
|
|
<div class="line"><a name="l00345"></a><span class="lineno"> 345</span>  <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
|
|
<div class="line"><a name="l00346"></a><span class="lineno"> 346</span> }</div>
|
|
<div class="line"><a name="l00347"></a><span class="lineno"> 347</span>  </div>
|
|
<div class="line"><a name="l00348"></a><span class="lineno"><a class="line" href="class_nim_b_l_e_att_value.html#aa53ee00be956c25596cf7cce71b502ba"> 348</a></span> <span class="keyword">inline</span> <a class="code" href="class_nim_b_l_e_att_value.html">NimBLEAttValue</a>& <a class="code" href="class_nim_b_l_e_att_value.html#aa0545edd766dc4ca6e3ebfac5efa384e">NimBLEAttValue::operator =</a>(<span class="keyword">const</span> <a class="code" href="class_nim_b_l_e_att_value.html">NimBLEAttValue</a> & source) {</div>
|
|
<div class="line"><a name="l00349"></a><span class="lineno"> 349</span>  <span class="keywordflow">if</span> (<span class="keyword">this</span> != &source) {</div>
|
|
<div class="line"><a name="l00350"></a><span class="lineno"> 350</span>  deepCopy(source);</div>
|
|
<div class="line"><a name="l00351"></a><span class="lineno"> 351</span>  }</div>
|
|
<div class="line"><a name="l00352"></a><span class="lineno"> 352</span>  <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
|
|
<div class="line"><a name="l00353"></a><span class="lineno"> 353</span> }</div>
|
|
<div class="line"><a name="l00354"></a><span class="lineno"> 354</span>  </div>
|
|
<div class="line"><a name="l00355"></a><span class="lineno"> 355</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> NimBLEAttValue::deepCopy(<span class="keyword">const</span> <a class="code" href="class_nim_b_l_e_att_value.html">NimBLEAttValue</a> & source) {</div>
|
|
<div class="line"><a name="l00356"></a><span class="lineno"> 356</span>  uint8_t* res = (uint8_t*)realloc( m_attr_value, source.m_capacity + 1);</div>
|
|
<div class="line"><a name="l00357"></a><span class="lineno"> 357</span>  assert(res && <span class="stringliteral">"deepCopy: realloc failed"</span>);</div>
|
|
<div class="line"><a name="l00358"></a><span class="lineno"> 358</span>  </div>
|
|
<div class="line"><a name="l00359"></a><span class="lineno"> 359</span>  ble_npl_hw_enter_critical();</div>
|
|
<div class="line"><a name="l00360"></a><span class="lineno"> 360</span>  m_attr_value = res;</div>
|
|
<div class="line"><a name="l00361"></a><span class="lineno"> 361</span>  m_attr_max_len = source.m_attr_max_len;</div>
|
|
<div class="line"><a name="l00362"></a><span class="lineno"> 362</span>  m_attr_len = source.m_attr_len;</div>
|
|
<div class="line"><a name="l00363"></a><span class="lineno"> 363</span>  m_capacity = source.m_capacity;</div>
|
|
<div class="line"><a name="l00364"></a><span class="lineno"> 364</span>  setTimeStamp(source.getTimeStamp());</div>
|
|
<div class="line"><a name="l00365"></a><span class="lineno"> 365</span>  memcpy(m_attr_value, source.m_attr_value, m_attr_len + 1);</div>
|
|
<div class="line"><a name="l00366"></a><span class="lineno"> 366</span>  ble_npl_hw_exit_critical(0);</div>
|
|
<div class="line"><a name="l00367"></a><span class="lineno"> 367</span> }</div>
|
|
<div class="line"><a name="l00368"></a><span class="lineno"> 368</span>  </div>
|
|
<div class="line"><a name="l00369"></a><span class="lineno"><a class="line" href="class_nim_b_l_e_att_value.html#a60fb3dc7057d4ec800c3ef6fd2480a69"> 369</a></span> <span class="keyword">inline</span> <span class="keyword">const</span> uint8_t* <a class="code" href="class_nim_b_l_e_att_value.html#a60fb3dc7057d4ec800c3ef6fd2480a69">NimBLEAttValue::getValue</a>(time_t *timestamp) {</div>
|
|
<div class="line"><a name="l00370"></a><span class="lineno"> 370</span>  <span class="keywordflow">if</span>(timestamp != <span class="keyword">nullptr</span>) {</div>
|
|
<div class="line"><a name="l00371"></a><span class="lineno"> 371</span> <span class="preprocessor">#if CONFIG_NIMBLE_CPP_ATT_VALUE_TIMESTAMP_ENABLED</span></div>
|
|
<div class="line"><a name="l00372"></a><span class="lineno"> 372</span>  *timestamp = m_timestamp;</div>
|
|
<div class="line"><a name="l00373"></a><span class="lineno"> 373</span> <span class="preprocessor">#else</span></div>
|
|
<div class="line"><a name="l00374"></a><span class="lineno"> 374</span>  *timestamp = 0;</div>
|
|
<div class="line"><a name="l00375"></a><span class="lineno"> 375</span> <span class="preprocessor">#endif</span></div>
|
|
<div class="line"><a name="l00376"></a><span class="lineno"> 376</span>  }</div>
|
|
<div class="line"><a name="l00377"></a><span class="lineno"> 377</span>  <span class="keywordflow">return</span> m_attr_value;</div>
|
|
<div class="line"><a name="l00378"></a><span class="lineno"> 378</span> }</div>
|
|
<div class="line"><a name="l00379"></a><span class="lineno"> 379</span>  </div>
|
|
<div class="line"><a name="l00380"></a><span class="lineno"><a class="line" href="class_nim_b_l_e_att_value.html#a5c8c5ecfa3864d45ea5b155385e3f9fa"> 380</a></span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="class_nim_b_l_e_att_value.html#a5c8c5ecfa3864d45ea5b155385e3f9fa">NimBLEAttValue::setValue</a>(<span class="keyword">const</span> uint8_t *value, uint16_t len) {</div>
|
|
<div class="line"><a name="l00381"></a><span class="lineno"> 381</span>  <span class="keywordflow">if</span> (len > m_attr_max_len) {</div>
|
|
<div class="line"><a name="l00382"></a><span class="lineno"> 382</span>  NIMBLE_LOGE(<span class="stringliteral">"NimBLEAttValue"</span>, <span class="stringliteral">"value exceeds max, len=%u, max=%u"</span>,</div>
|
|
<div class="line"><a name="l00383"></a><span class="lineno"> 383</span>  len, m_attr_max_len);</div>
|
|
<div class="line"><a name="l00384"></a><span class="lineno"> 384</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
|
<div class="line"><a name="l00385"></a><span class="lineno"> 385</span>  }</div>
|
|
<div class="line"><a name="l00386"></a><span class="lineno"> 386</span>  </div>
|
|
<div class="line"><a name="l00387"></a><span class="lineno"> 387</span>  uint8_t *res = m_attr_value;</div>
|
|
<div class="line"><a name="l00388"></a><span class="lineno"> 388</span>  <span class="keywordflow">if</span> (len > m_capacity) {</div>
|
|
<div class="line"><a name="l00389"></a><span class="lineno"> 389</span>  res = (uint8_t*)realloc(m_attr_value, (len + 1));</div>
|
|
<div class="line"><a name="l00390"></a><span class="lineno"> 390</span>  m_capacity = len;</div>
|
|
<div class="line"><a name="l00391"></a><span class="lineno"> 391</span>  }</div>
|
|
<div class="line"><a name="l00392"></a><span class="lineno"> 392</span>  assert(res && <span class="stringliteral">"setValue: realloc failed"</span>);</div>
|
|
<div class="line"><a name="l00393"></a><span class="lineno"> 393</span>  </div>
|
|
<div class="line"><a name="l00394"></a><span class="lineno"> 394</span> <span class="preprocessor">#if CONFIG_NIMBLE_CPP_ATT_VALUE_TIMESTAMP_ENABLED</span></div>
|
|
<div class="line"><a name="l00395"></a><span class="lineno"> 395</span>  time_t t = time(<span class="keyword">nullptr</span>);</div>
|
|
<div class="line"><a name="l00396"></a><span class="lineno"> 396</span> <span class="preprocessor">#else</span></div>
|
|
<div class="line"><a name="l00397"></a><span class="lineno"> 397</span>  time_t t = 0;</div>
|
|
<div class="line"><a name="l00398"></a><span class="lineno"> 398</span> <span class="preprocessor">#endif</span></div>
|
|
<div class="line"><a name="l00399"></a><span class="lineno"> 399</span>  </div>
|
|
<div class="line"><a name="l00400"></a><span class="lineno"> 400</span>  ble_npl_hw_enter_critical();</div>
|
|
<div class="line"><a name="l00401"></a><span class="lineno"> 401</span>  m_attr_value = res;</div>
|
|
<div class="line"><a name="l00402"></a><span class="lineno"> 402</span>  memcpy(m_attr_value, value, len);</div>
|
|
<div class="line"><a name="l00403"></a><span class="lineno"> 403</span>  m_attr_value[len] = <span class="charliteral">'\0'</span>;</div>
|
|
<div class="line"><a name="l00404"></a><span class="lineno"> 404</span>  m_attr_len = len;</div>
|
|
<div class="line"><a name="l00405"></a><span class="lineno"> 405</span>  setTimeStamp(t);</div>
|
|
<div class="line"><a name="l00406"></a><span class="lineno"> 406</span>  ble_npl_hw_exit_critical(0);</div>
|
|
<div class="line"><a name="l00407"></a><span class="lineno"> 407</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
|
<div class="line"><a name="l00408"></a><span class="lineno"> 408</span> }</div>
|
|
<div class="line"><a name="l00409"></a><span class="lineno"> 409</span>  </div>
|
|
<div class="line"><a name="l00410"></a><span class="lineno"><a class="line" href="class_nim_b_l_e_att_value.html#aa217dfc649daed50eb75c7168442f86e"> 410</a></span> <span class="keyword">inline</span> <a class="code" href="class_nim_b_l_e_att_value.html">NimBLEAttValue</a>& <a class="code" href="class_nim_b_l_e_att_value.html#aa217dfc649daed50eb75c7168442f86e">NimBLEAttValue::append</a>(<span class="keyword">const</span> uint8_t *value, uint16_t len) {</div>
|
|
<div class="line"><a name="l00411"></a><span class="lineno"> 411</span>  <span class="keywordflow">if</span> (len < 1) {</div>
|
|
<div class="line"><a name="l00412"></a><span class="lineno"> 412</span>  <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
|
|
<div class="line"><a name="l00413"></a><span class="lineno"> 413</span>  }</div>
|
|
<div class="line"><a name="l00414"></a><span class="lineno"> 414</span>  </div>
|
|
<div class="line"><a name="l00415"></a><span class="lineno"> 415</span>  <span class="keywordflow">if</span> ((m_attr_len + len) > m_attr_max_len) {</div>
|
|
<div class="line"><a name="l00416"></a><span class="lineno"> 416</span>  NIMBLE_LOGE(<span class="stringliteral">"NimBLEAttValue"</span>, <span class="stringliteral">"val > max, len=%u, max=%u"</span>,</div>
|
|
<div class="line"><a name="l00417"></a><span class="lineno"> 417</span>  len, m_attr_max_len);</div>
|
|
<div class="line"><a name="l00418"></a><span class="lineno"> 418</span>  <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
|
|
<div class="line"><a name="l00419"></a><span class="lineno"> 419</span>  }</div>
|
|
<div class="line"><a name="l00420"></a><span class="lineno"> 420</span>  </div>
|
|
<div class="line"><a name="l00421"></a><span class="lineno"> 421</span>  uint8_t* res = m_attr_value;</div>
|
|
<div class="line"><a name="l00422"></a><span class="lineno"> 422</span>  uint16_t new_len = m_attr_len + len;</div>
|
|
<div class="line"><a name="l00423"></a><span class="lineno"> 423</span>  <span class="keywordflow">if</span> (new_len > m_capacity) {</div>
|
|
<div class="line"><a name="l00424"></a><span class="lineno"> 424</span>  res = (uint8_t*)realloc(m_attr_value, (new_len + 1));</div>
|
|
<div class="line"><a name="l00425"></a><span class="lineno"> 425</span>  m_capacity = new_len;</div>
|
|
<div class="line"><a name="l00426"></a><span class="lineno"> 426</span>  }</div>
|
|
<div class="line"><a name="l00427"></a><span class="lineno"> 427</span>  assert(res && <span class="stringliteral">"append: realloc failed"</span>);</div>
|
|
<div class="line"><a name="l00428"></a><span class="lineno"> 428</span>  </div>
|
|
<div class="line"><a name="l00429"></a><span class="lineno"> 429</span> <span class="preprocessor">#if CONFIG_NIMBLE_CPP_ATT_VALUE_TIMESTAMP_ENABLED</span></div>
|
|
<div class="line"><a name="l00430"></a><span class="lineno"> 430</span>  time_t t = time(<span class="keyword">nullptr</span>);</div>
|
|
<div class="line"><a name="l00431"></a><span class="lineno"> 431</span> <span class="preprocessor">#else</span></div>
|
|
<div class="line"><a name="l00432"></a><span class="lineno"> 432</span>  time_t t = 0;</div>
|
|
<div class="line"><a name="l00433"></a><span class="lineno"> 433</span> <span class="preprocessor">#endif</span></div>
|
|
<div class="line"><a name="l00434"></a><span class="lineno"> 434</span>  </div>
|
|
<div class="line"><a name="l00435"></a><span class="lineno"> 435</span>  ble_npl_hw_enter_critical();</div>
|
|
<div class="line"><a name="l00436"></a><span class="lineno"> 436</span>  m_attr_value = res;</div>
|
|
<div class="line"><a name="l00437"></a><span class="lineno"> 437</span>  memcpy(m_attr_value + m_attr_len, value, len);</div>
|
|
<div class="line"><a name="l00438"></a><span class="lineno"> 438</span>  m_attr_len = new_len;</div>
|
|
<div class="line"><a name="l00439"></a><span class="lineno"> 439</span>  m_attr_value[m_attr_len] = <span class="charliteral">'\0'</span>;</div>
|
|
<div class="line"><a name="l00440"></a><span class="lineno"> 440</span>  setTimeStamp(t);</div>
|
|
<div class="line"><a name="l00441"></a><span class="lineno"> 441</span>  ble_npl_hw_exit_critical(0);</div>
|
|
<div class="line"><a name="l00442"></a><span class="lineno"> 442</span>  </div>
|
|
<div class="line"><a name="l00443"></a><span class="lineno"> 443</span>  <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
|
|
<div class="line"><a name="l00444"></a><span class="lineno"> 444</span> }</div>
|
|
<div class="line"><a name="l00445"></a><span class="lineno"> 445</span>  </div>
|
|
<div class="line"><a name="l00446"></a><span class="lineno"> 446</span> <span class="preprocessor">#endif </span><span class="comment">/*(CONFIG_BT_ENABLED) */</span><span class="preprocessor"></span></div>
|
|
<div class="line"><a name="l00447"></a><span class="lineno"> 447</span> <span class="preprocessor">#endif </span><span class="comment">/* MAIN_NIMBLEATTVALUE_H_ */</span><span class="preprocessor"></span></div>
|
|
<div class="ttc" id="aclass_nim_b_l_e_att_value_html"><div class="ttname"><a href="class_nim_b_l_e_att_value.html">NimBLEAttValue</a></div><div class="ttdoc">A specialized container class to hold BLE attribute values.</div><div class="ttdef"><b>Definition:</b> NimBLEAttValue.h:61</div></div>
|
|
<div class="ttc" id="aclass_nim_b_l_e_att_value_html_a03347eab1f3df449762902a4256d2b1c"><div class="ttname"><a href="class_nim_b_l_e_att_value.html#a03347eab1f3df449762902a4256d2b1c">NimBLEAttValue::NimBLEAttValue</a></div><div class="ttdeci">NimBLEAttValue(const std::vector< uint8_t > vec, uint16_t max_len=BLE_ATT_ATTR_MAX_LEN)</div><div class="ttdoc">Construct with an initial value from a std::vector<uint8_t>.</div><div class="ttdef"><b>Definition:</b> NimBLEAttValue.h:119</div></div>
|
|
<div class="ttc" id="aclass_nim_b_l_e_att_value_html_a08f3b04d05cf0c2b76a24cc37cd1f8ab"><div class="ttname"><a href="class_nim_b_l_e_att_value.html#a08f3b04d05cf0c2b76a24cc37cd1f8ab">NimBLEAttValue::~NimBLEAttValue</a></div><div class="ttdeci">~NimBLEAttValue()</div><div class="ttdoc">Destructor.</div><div class="ttdef"><b>Definition:</b> NimBLEAttValue.h:328</div></div>
|
|
<div class="ttc" id="aclass_nim_b_l_e_att_value_html_a0e6691f9660a2b78e038e87e99914696"><div class="ttname"><a href="class_nim_b_l_e_att_value.html#a0e6691f9660a2b78e038e87e99914696">NimBLEAttValue::operator+=</a></div><div class="ttdeci">NimBLEAttValue & operator+=(const NimBLEAttValue &source)</div><div class="ttdoc">Operator; Append another NimBLEAttValue.</div><div class="ttdef"><b>Definition:</b> NimBLEAttValue.h:283</div></div>
|
|
<div class="ttc" id="aclass_nim_b_l_e_att_value_html_a1aca76279ea3f0d8cb06ff5540a326e3"><div class="ttname"><a href="class_nim_b_l_e_att_value.html#a1aca76279ea3f0d8cb06ff5540a326e3">NimBLEAttValue::getValue</a></div><div class="ttdeci">T getValue(time_t *timestamp=nullptr, bool skipSizeCheck=false)</div><div class="ttdoc">Template to return the value as a <type>.</div><div class="ttdef"><b>Definition:</b> NimBLEAttValue.h:257</div></div>
|
|
<div class="ttc" id="aclass_nim_b_l_e_att_value_html_a35df29c514613b1d00841abd6fffa320"><div class="ttname"><a href="class_nim_b_l_e_att_value.html#a35df29c514613b1d00841abd6fffa320">NimBLEAttValue::length</a></div><div class="ttdeci">uint16_t length() const</div><div class="ttdoc">Returns the current length of the value in bytes.</div><div class="ttdef"><b>Definition:</b> NimBLEAttValue.h:148</div></div>
|
|
<div class="ttc" id="aclass_nim_b_l_e_att_value_html_a4322572d778438318f5750f6df5fdb35"><div class="ttname"><a href="class_nim_b_l_e_att_value.html#a4322572d778438318f5750f6df5fdb35">NimBLEAttValue::NimBLEAttValue</a></div><div class="ttdeci">NimBLEAttValue(const char *value, uint16_t max_len=BLE_ATT_ATTR_MAX_LEN)</div><div class="ttdoc">Construct with an initial value from a const char string.</div><div class="ttdef"><b>Definition:</b> NimBLEAttValue.h:103</div></div>
|
|
<div class="ttc" id="aclass_nim_b_l_e_att_value_html_a49a8a126d0b534c999c4a341cdcf7ba2"><div class="ttname"><a href="class_nim_b_l_e_att_value.html#a49a8a126d0b534c999c4a341cdcf7ba2">NimBLEAttValue::capacity</a></div><div class="ttdeci">uint16_t capacity() const</div><div class="ttdoc">Returns the currently allocated capacity in bytes.</div><div class="ttdef"><b>Definition:</b> NimBLEAttValue.h:145</div></div>
|
|
<div class="ttc" id="aclass_nim_b_l_e_att_value_html_a4f797f89e9c2d55dc7bee7ec8993952e"><div class="ttname"><a href="class_nim_b_l_e_att_value.html#a4f797f89e9c2d55dc7bee7ec8993952e">NimBLEAttValue::end</a></div><div class="ttdeci">const uint8_t * end() const</div><div class="ttdoc">Iterator end.</div><div class="ttdef"><b>Definition:</b> NimBLEAttValue.h:163</div></div>
|
|
<div class="ttc" id="aclass_nim_b_l_e_att_value_html_a584cac329cd5d3c0a14aa855e6e6143e"><div class="ttname"><a href="class_nim_b_l_e_att_value.html#a584cac329cd5d3c0a14aa855e6e6143e">NimBLEAttValue::NimBLEAttValue</a></div><div class="ttdeci">NimBLEAttValue(const std::string str, uint16_t max_len=BLE_ATT_ATTR_MAX_LEN)</div><div class="ttdoc">Construct with an initial value from a std::string.</div><div class="ttdef"><b>Definition:</b> NimBLEAttValue.h:111</div></div>
|
|
<div class="ttc" id="aclass_nim_b_l_e_att_value_html_a5c8c5ecfa3864d45ea5b155385e3f9fa"><div class="ttname"><a href="class_nim_b_l_e_att_value.html#a5c8c5ecfa3864d45ea5b155385e3f9fa">NimBLEAttValue::setValue</a></div><div class="ttdeci">bool setValue(const uint8_t *value, uint16_t len)</div><div class="ttdoc">Set the value from a buffer.</div><div class="ttdef"><b>Definition:</b> NimBLEAttValue.h:380</div></div>
|
|
<div class="ttc" id="aclass_nim_b_l_e_att_value_html_a60fb3dc7057d4ec800c3ef6fd2480a69"><div class="ttname"><a href="class_nim_b_l_e_att_value.html#a60fb3dc7057d4ec800c3ef6fd2480a69">NimBLEAttValue::getValue</a></div><div class="ttdeci">const uint8_t * getValue(time_t *timestamp)</div><div class="ttdoc">Get a pointer to the value buffer with timestamp.</div><div class="ttdef"><b>Definition:</b> NimBLEAttValue.h:369</div></div>
|
|
<div class="ttc" id="aclass_nim_b_l_e_att_value_html_a6167f1cbc50a81a4ca0708e273bbb63e"><div class="ttname"><a href="class_nim_b_l_e_att_value.html#a6167f1cbc50a81a4ca0708e273bbb63e">NimBLEAttValue::begin</a></div><div class="ttdeci">const uint8_t * begin() const</div><div class="ttdoc">Iterator begin.</div><div class="ttdef"><b>Definition:</b> NimBLEAttValue.h:160</div></div>
|
|
<div class="ttc" id="aclass_nim_b_l_e_att_value_html_a61813a898f1bfb1b00e670a7fbb413df"><div class="ttname"><a href="class_nim_b_l_e_att_value.html#a61813a898f1bfb1b00e670a7fbb413df">NimBLEAttValue::NimBLEAttValue</a></div><div class="ttdeci">NimBLEAttValue(std::initializer_list< uint8_t > list, uint16_t max_len=BLE_ATT_ATTR_MAX_LEN)</div><div class="ttdoc">Construct with an initializer list.</div><div class="ttdef"><b>Definition:</b> NimBLEAttValue.h:94</div></div>
|
|
<div class="ttc" id="aclass_nim_b_l_e_att_value_html_a7473ad95c2240e0d1ce5c2d57f8914c2"><div class="ttname"><a href="class_nim_b_l_e_att_value.html#a7473ad95c2240e0d1ce5c2d57f8914c2">NimBLEAttValue::NimBLEAttValue</a></div><div class="ttdeci">NimBLEAttValue(const NimBLEAttValue &source)</div><div class="ttdoc">Copy constructor.</div><div class="ttdef"><b>Definition:</b> NimBLEAttValue.h:133</div></div>
|
|
<div class="ttc" id="aclass_nim_b_l_e_att_value_html_a778d1da5334049292fdfba221bcd5772"><div class="ttname"><a href="class_nim_b_l_e_att_value.html#a778d1da5334049292fdfba221bcd5772">NimBLEAttValue::NimBLEAttValue</a></div><div class="ttdeci">NimBLEAttValue(NimBLEAttValue &&source)</div><div class="ttdoc">Move constructor.</div><div class="ttdef"><b>Definition:</b> NimBLEAttValue.h:136</div></div>
|
|
<div class="ttc" id="aclass_nim_b_l_e_att_value_html_a8ca8d07c06a79e30bf6279e6817e4881"><div class="ttname"><a href="class_nim_b_l_e_att_value.html#a8ca8d07c06a79e30bf6279e6817e4881">NimBLEAttValue::operator[]</a></div><div class="ttdeci">uint8_t operator[](int pos) const</div><div class="ttdoc">Subscript operator.</div><div class="ttdef"><b>Definition:</b> NimBLEAttValue.h:268</div></div>
|
|
<div class="ttc" id="aclass_nim_b_l_e_att_value_html_a9634dd47ea705ec8d10f29482e572bbf"><div class="ttname"><a href="class_nim_b_l_e_att_value.html#a9634dd47ea705ec8d10f29482e572bbf">NimBLEAttValue::operator==</a></div><div class="ttdeci">bool operator==(const NimBLEAttValue &source)</div><div class="ttdoc">Equality operator.</div><div class="ttdef"><b>Definition:</b> NimBLEAttValue.h:297</div></div>
|
|
<div class="ttc" id="aclass_nim_b_l_e_att_value_html_a9c0f67d150d198c5bcad6eafafee21b6"><div class="ttname"><a href="class_nim_b_l_e_att_value.html#a9c0f67d150d198c5bcad6eafafee21b6">NimBLEAttValue::setValue</a></div><div class="ttdeci">bool setValue(const char *s)</div><div class="ttdoc">Set value to the value of const char*.</div><div class="ttdef"><b>Definition:</b> NimBLEAttValue.h:195</div></div>
|
|
<div class="ttc" id="aclass_nim_b_l_e_att_value_html_a9dc3bc75c3a0cedf76bed59ef2d0d289"><div class="ttname"><a href="class_nim_b_l_e_att_value.html#a9dc3bc75c3a0cedf76bed59ef2d0d289">NimBLEAttValue::operator!=</a></div><div class="ttdeci">bool operator!=(const NimBLEAttValue &source)</div><div class="ttdoc">Inequality operator.</div><div class="ttdef"><b>Definition:</b> NimBLEAttValue.h:302</div></div>
|
|
<div class="ttc" id="aclass_nim_b_l_e_att_value_html_a9e595630f7959b4002f6fb64c69ae123"><div class="ttname"><a href="class_nim_b_l_e_att_value.html#a9e595630f7959b4002f6fb64c69ae123">NimBLEAttValue::data</a></div><div class="ttdeci">const uint8_t * data() const</div><div class="ttdoc">Returns a pointer to the internal buffer of the value.</div><div class="ttdef"><b>Definition:</b> NimBLEAttValue.h:154</div></div>
|
|
<div class="ttc" id="aclass_nim_b_l_e_att_value_html_aa0545edd766dc4ca6e3ebfac5efa384e"><div class="ttname"><a href="class_nim_b_l_e_att_value.html#aa0545edd766dc4ca6e3ebfac5efa384e">NimBLEAttValue::operator=</a></div><div class="ttdeci">NimBLEAttValue & operator=(const std::string &source)</div><div class="ttdoc">Operator; Set the value from a std::string source.</div><div class="ttdef"><b>Definition:</b> NimBLEAttValue.h:287</div></div>
|
|
<div class="ttc" id="aclass_nim_b_l_e_att_value_html_aa217dfc649daed50eb75c7168442f86e"><div class="ttname"><a href="class_nim_b_l_e_att_value.html#aa217dfc649daed50eb75c7168442f86e">NimBLEAttValue::append</a></div><div class="ttdeci">NimBLEAttValue & append(const uint8_t *value, uint16_t len)</div><div class="ttdoc">Append data to the value.</div><div class="ttdef"><b>Definition:</b> NimBLEAttValue.h:410</div></div>
|
|
<div class="ttc" id="aclass_nim_b_l_e_att_value_html_aa2c18949ffc2e7d2d2f288c1b2b2f0ed"><div class="ttname"><a href="class_nim_b_l_e_att_value.html#aa2c18949ffc2e7d2d2f288c1b2b2f0ed">NimBLEAttValue::c_str</a></div><div class="ttdeci">const char * c_str() const</div><div class="ttdoc">Returns a pointer to the internal buffer of the value as a const char*.</div><div class="ttdef"><b>Definition:</b> NimBLEAttValue.h:157</div></div>
|
|
<div class="ttc" id="aclass_nim_b_l_e_att_value_html_aa801ed93f65e8cbc507c6ea6f4f49294"><div class="ttname"><a href="class_nim_b_l_e_att_value.html#aa801ed93f65e8cbc507c6ea6f4f49294">NimBLEAttValue::NimBLEAttValue</a></div><div class="ttdeci">NimBLEAttValue(uint16_t init_len=CONFIG_NIMBLE_CPP_ATT_VALUE_INIT_LENGTH, uint16_t max_len=BLE_ATT_ATTR_MAX_LEN)</div><div class="ttdoc">Default constructor.</div><div class="ttdef"><b>Definition:</b> NimBLEAttValue.h:312</div></div>
|
|
<div class="ttc" id="aclass_nim_b_l_e_att_value_html_aa8c75101d9898c3ff4646d84521ed61c"><div class="ttname"><a href="class_nim_b_l_e_att_value.html#aa8c75101d9898c3ff4646d84521ed61c">NimBLEAttValue::size</a></div><div class="ttdeci">uint16_t size() const</div><div class="ttdoc">Returns the current size of the value in bytes.</div><div class="ttdef"><b>Definition:</b> NimBLEAttValue.h:151</div></div>
|
|
<div class="ttc" id="aclass_nim_b_l_e_att_value_html_ac7abc6cd08adb0b654e051d62af725d5"><div class="ttname"><a href="class_nim_b_l_e_att_value.html#ac7abc6cd08adb0b654e051d62af725d5">NimBLEAttValue::max_size</a></div><div class="ttdeci">uint16_t max_size() const</div><div class="ttdoc">Returns the max size in bytes.</div><div class="ttdef"><b>Definition:</b> NimBLEAttValue.h:142</div></div>
|
|
<div class="ttc" id="aclass_nim_b_l_e_att_value_html_ac94a41f0c0d42d48b29d5b18d7ad7bd8"><div class="ttname"><a href="class_nim_b_l_e_att_value.html#ac94a41f0c0d42d48b29d5b18d7ad7bd8">NimBLEAttValue::setValue</a></div><div class="ttdeci">bool setValue(const T &s)</div><div class="ttdoc">Template to set value to the value of <type>val.</div><div class="ttdef"><b>Definition:</b> NimBLEAttValue.h:227</div></div>
|
|
<div class="ttc" id="animconfig_8h_html"><div class="ttname"><a href="nimconfig_8h.html">nimconfig.h</a></div></div>
|
|
<div class="ttc" id="animconfig_8h_html_a4d4ea715325f75455b43c7dbaa69d7a0"><div class="ttname"><a href="nimconfig_8h.html#a4d4ea715325f75455b43c7dbaa69d7a0">CONFIG_NIMBLE_CPP_ATT_VALUE_INIT_LENGTH</a></div><div class="ttdeci">#define CONFIG_NIMBLE_CPP_ATT_VALUE_INIT_LENGTH</div><div class="ttdoc">Uncomment to set the default allocation size (bytes) for each attribute if not specified when the con...</div><div class="ttdef"><b>Definition:</b> nimconfig.h:56</div></div>
|
|
</div><!-- fragment --></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="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><b>NimBLEAttValue.h</b></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.1 </li>
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|