-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gateway_8h_source.html
162 lines (160 loc) · 19.3 KB
/
Gateway_8h_source.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<!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>MQTT-SN Gateway Library: include/cc_mqttsn_gateway/Gateway.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="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">MQTT-SN Gateway Library
</div>
<div id="projectbrief">Library that allows implementation of MQTT-SN gateway.</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>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(document).ready(function() { init_codefold(0); });
/* @license-end */
</script>
<!-- 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 id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_faed1327daf4cbffb16e0bd73b5f9463.html">cc_mqttsn_gateway</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">Gateway.h</div></div>
</div><!--header-->
<div class="contents">
<a href="Gateway_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">//</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// Copyright 2016 - 2024 (C). Alex Robenko. All rights reserved.</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">//</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// This Source Code Form is subject to the terms of the Mozilla Public</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// License, v. 2.0. If a copy of the MPL was not distributed with this</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="comment">// file, You can obtain one at http://mozilla.org/MPL/2.0/.</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span> </div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> </div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> </div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="preprocessor">#include <memory></span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#include <cstdint></span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include <functional></span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> </div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespacecc__mqttsn__gateway.html">cc_mqttsn_gateway</a></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span>{</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> </div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="keyword">class </span>GatewayImpl;</div>
<div class="foldopen" id="foldopen00026" data-start="{" data-end="};">
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"><a class="line" href="classcc__mqttsn__gateway_1_1Gateway.html"> 26</a></span><span class="keyword">class </span><a class="code hl_class" href="classcc__mqttsn__gateway_1_1Gateway.html">Gateway</a></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span>{</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"><a class="line" href="classcc__mqttsn__gateway_1_1Gateway.html#a19a4d5afa2faa5b9d6785ab7b58edb42"> 30</a></span> <a class="code hl_function" href="classcc__mqttsn__gateway_1_1Gateway.html#a19a4d5afa2faa5b9d6785ab7b58edb42">Gateway</a>();</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> </div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"><a class="line" href="classcc__mqttsn__gateway_1_1Gateway.html#abb426c1dcbd1eb7d59a45b3bf8cf315e"> 33</a></span> <a class="code hl_function" href="classcc__mqttsn__gateway_1_1Gateway.html#abb426c1dcbd1eb7d59a45b3bf8cf315e">~Gateway</a>();</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> </div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"><a class="line" href="classcc__mqttsn__gateway_1_1Gateway.html#a8a6c83ec82aa22f872b29f4d79d5713f"> 40</a></span> <span class="keyword">using </span><a class="code hl_typedef" href="classcc__mqttsn__gateway_1_1Gateway.html#a8a6c83ec82aa22f872b29f4d79d5713f">NextTickProgramReqCb</a> = std::function<void (<span class="keywordtype">unsigned</span> ms)>;</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> </div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"><a class="line" href="classcc__mqttsn__gateway_1_1Gateway.html#a574d84b0a91a0f9b4cc7b814c6d1de14"> 57</a></span> <span class="keyword">using </span><a class="code hl_typedef" href="classcc__mqttsn__gateway_1_1Gateway.html#a574d84b0a91a0f9b4cc7b814c6d1de14">SendDataReqCb</a> = std::function<void (<span class="keyword">const</span> std::uint8_t* buf, std::size_t bufSize)>;</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> </div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"><a class="line" href="classcc__mqttsn__gateway_1_1Gateway.html#a00e7d543ec8b9f1c7e356e7ec56f3ea8"> 63</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classcc__mqttsn__gateway_1_1Gateway.html#a00e7d543ec8b9f1c7e356e7ec56f3ea8">setNextTickProgramReqCb</a>(<a class="code hl_typedef" href="classcc__mqttsn__gateway_1_1Gateway.html#a8a6c83ec82aa22f872b29f4d79d5713f">NextTickProgramReqCb</a>&& func);</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> </div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"><a class="line" href="classcc__mqttsn__gateway_1_1Gateway.html#abce790ddf300647f8ff52bfc84385727"> 70</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classcc__mqttsn__gateway_1_1Gateway.html#abce790ddf300647f8ff52bfc84385727">setSendDataReqCb</a>(<a class="code hl_typedef" href="classcc__mqttsn__gateway_1_1Gateway.html#a574d84b0a91a0f9b4cc7b814c6d1de14">SendDataReqCb</a>&& func);</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> </div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"><a class="line" href="classcc__mqttsn__gateway_1_1Gateway.html#adb1827fad98031ab79d73bbc8ff08117"> 76</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classcc__mqttsn__gateway_1_1Gateway.html#adb1827fad98031ab79d73bbc8ff08117">setAdvertisePeriod</a>(std::uint16_t value);</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> </div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"><a class="line" href="classcc__mqttsn__gateway_1_1Gateway.html#af5b510419a496c8a150e3747f94edc79"> 79</a></span> std::uint16_t <a class="code hl_function" href="classcc__mqttsn__gateway_1_1Gateway.html#af5b510419a496c8a150e3747f94edc79">getAdvertisePeriod</a>() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> </div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"><a class="line" href="classcc__mqttsn__gateway_1_1Gateway.html#ae3340303dabcfd03dbb98b6a9dd68f04"> 84</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classcc__mqttsn__gateway_1_1Gateway.html#ae3340303dabcfd03dbb98b6a9dd68f04">setGatewayId</a>(std::uint8_t value);</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> </div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"><a class="line" href="classcc__mqttsn__gateway_1_1Gateway.html#ade220efe4c94dda44a5e3db214825382"> 87</a></span> std::uint8_t <a class="code hl_function" href="classcc__mqttsn__gateway_1_1Gateway.html#ade220efe4c94dda44a5e3db214825382">getGatewayId</a>() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> </div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"><a class="line" href="classcc__mqttsn__gateway_1_1Gateway.html#a12ea0af2a2065e6c311bd74aaebd4489"> 94</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classcc__mqttsn__gateway_1_1Gateway.html#a12ea0af2a2065e6c311bd74aaebd4489">start</a>();</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> </div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"><a class="line" href="classcc__mqttsn__gateway_1_1Gateway.html#a08c3c68c6928afebd06c5dd045571366"> 97</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classcc__mqttsn__gateway_1_1Gateway.html#a08c3c68c6928afebd06c5dd045571366">stop</a>();</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> </div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"><a class="line" href="classcc__mqttsn__gateway_1_1Gateway.html#a656234af2ad8d324f0d3e2595c6826fd"> 104</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classcc__mqttsn__gateway_1_1Gateway.html#a656234af2ad8d324f0d3e2595c6826fd">tick</a>();</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> </div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> std::unique_ptr<GatewayImpl> m_pImpl;</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span>};</div>
</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> </div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span>} <span class="comment">// namespace cc_mqttsn_gateway</span></div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> </div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> </div>
<div class="ttc" id="aclasscc__mqttsn__gateway_1_1Gateway_html"><div class="ttname"><a href="classcc__mqttsn__gateway_1_1Gateway.html">cc_mqttsn_gateway::Gateway</a></div><div class="ttdoc">Interface for Gateway entity.</div><div class="ttdef"><b>Definition</b> Gateway.h:27</div></div>
<div class="ttc" id="aclasscc__mqttsn__gateway_1_1Gateway_html_a00e7d543ec8b9f1c7e356e7ec56f3ea8"><div class="ttname"><a href="classcc__mqttsn__gateway_1_1Gateway.html#a00e7d543ec8b9f1c7e356e7ec56f3ea8">cc_mqttsn_gateway::Gateway::setNextTickProgramReqCb</a></div><div class="ttdeci">void setNextTickProgramReqCb(NextTickProgramReqCb &&func)</div><div class="ttdoc">Set the callback to be invoked when new time measurement is required.</div></div>
<div class="ttc" id="aclasscc__mqttsn__gateway_1_1Gateway_html_a08c3c68c6928afebd06c5dd045571366"><div class="ttname"><a href="classcc__mqttsn__gateway_1_1Gateway.html#a08c3c68c6928afebd06c5dd045571366">cc_mqttsn_gateway::Gateway::stop</a></div><div class="ttdeci">void stop()</div><div class="ttdoc">Stop the operation of the object.</div></div>
<div class="ttc" id="aclasscc__mqttsn__gateway_1_1Gateway_html_a12ea0af2a2065e6c311bd74aaebd4489"><div class="ttname"><a href="classcc__mqttsn__gateway_1_1Gateway.html#a12ea0af2a2065e6c311bd74aaebd4489">cc_mqttsn_gateway::Gateway::start</a></div><div class="ttdeci">bool start()</div><div class="ttdoc">Start the operation of the object.</div></div>
<div class="ttc" id="aclasscc__mqttsn__gateway_1_1Gateway_html_a19a4d5afa2faa5b9d6785ab7b58edb42"><div class="ttname"><a href="classcc__mqttsn__gateway_1_1Gateway.html#a19a4d5afa2faa5b9d6785ab7b58edb42">cc_mqttsn_gateway::Gateway::Gateway</a></div><div class="ttdeci">Gateway()</div><div class="ttdoc">Default constructor.</div></div>
<div class="ttc" id="aclasscc__mqttsn__gateway_1_1Gateway_html_a574d84b0a91a0f9b4cc7b814c6d1de14"><div class="ttname"><a href="classcc__mqttsn__gateway_1_1Gateway.html#a574d84b0a91a0f9b4cc7b814c6d1de14">cc_mqttsn_gateway::Gateway::SendDataReqCb</a></div><div class="ttdeci">std::function< void(const std::uint8_t *buf, std::size_t bufSize)> SendDataReqCb</div><div class="ttdoc">Type of callback used to request send the serialised ADVERTISE message.</div><div class="ttdef"><b>Definition</b> Gateway.h:57</div></div>
<div class="ttc" id="aclasscc__mqttsn__gateway_1_1Gateway_html_a656234af2ad8d324f0d3e2595c6826fd"><div class="ttname"><a href="classcc__mqttsn__gateway_1_1Gateway.html#a656234af2ad8d324f0d3e2595c6826fd">cc_mqttsn_gateway::Gateway::tick</a></div><div class="ttdeci">void tick()</div><div class="ttdoc">Notify the Gateway object about requested time period expiry.</div></div>
<div class="ttc" id="aclasscc__mqttsn__gateway_1_1Gateway_html_a8a6c83ec82aa22f872b29f4d79d5713f"><div class="ttname"><a href="classcc__mqttsn__gateway_1_1Gateway.html#a8a6c83ec82aa22f872b29f4d79d5713f">cc_mqttsn_gateway::Gateway::NextTickProgramReqCb</a></div><div class="ttdeci">std::function< void(unsigned ms)> NextTickProgramReqCb</div><div class="ttdoc">Type of the callback used to request time measurement.</div><div class="ttdef"><b>Definition</b> Gateway.h:40</div></div>
<div class="ttc" id="aclasscc__mqttsn__gateway_1_1Gateway_html_abb426c1dcbd1eb7d59a45b3bf8cf315e"><div class="ttname"><a href="classcc__mqttsn__gateway_1_1Gateway.html#abb426c1dcbd1eb7d59a45b3bf8cf315e">cc_mqttsn_gateway::Gateway::~Gateway</a></div><div class="ttdeci">~Gateway()</div><div class="ttdoc">Destructor.</div></div>
<div class="ttc" id="aclasscc__mqttsn__gateway_1_1Gateway_html_abce790ddf300647f8ff52bfc84385727"><div class="ttname"><a href="classcc__mqttsn__gateway_1_1Gateway.html#abce790ddf300647f8ff52bfc84385727">cc_mqttsn_gateway::Gateway::setSendDataReqCb</a></div><div class="ttdeci">void setSendDataReqCb(SendDataReqCb &&func)</div><div class="ttdoc">Set the callback to be invoked when new ADVERTISE message needs to be broadcasted.</div></div>
<div class="ttc" id="aclasscc__mqttsn__gateway_1_1Gateway_html_adb1827fad98031ab79d73bbc8ff08117"><div class="ttname"><a href="classcc__mqttsn__gateway_1_1Gateway.html#adb1827fad98031ab79d73bbc8ff08117">cc_mqttsn_gateway::Gateway::setAdvertisePeriod</a></div><div class="ttdeci">void setAdvertisePeriod(std::uint16_t value)</div><div class="ttdoc">Set period after which ADVERTISE message needs to be constatly sent.</div></div>
<div class="ttc" id="aclasscc__mqttsn__gateway_1_1Gateway_html_ade220efe4c94dda44a5e3db214825382"><div class="ttname"><a href="classcc__mqttsn__gateway_1_1Gateway.html#ade220efe4c94dda44a5e3db214825382">cc_mqttsn_gateway::Gateway::getGatewayId</a></div><div class="ttdeci">std::uint8_t getGatewayId() const</div><div class="ttdoc">Get current gateway numeric ID configuration.</div></div>
<div class="ttc" id="aclasscc__mqttsn__gateway_1_1Gateway_html_ae3340303dabcfd03dbb98b6a9dd68f04"><div class="ttname"><a href="classcc__mqttsn__gateway_1_1Gateway.html#ae3340303dabcfd03dbb98b6a9dd68f04">cc_mqttsn_gateway::Gateway::setGatewayId</a></div><div class="ttdeci">void setGatewayId(std::uint8_t value)</div><div class="ttdoc">Set gateway numeric ID to be advertised.</div></div>
<div class="ttc" id="aclasscc__mqttsn__gateway_1_1Gateway_html_af5b510419a496c8a150e3747f94edc79"><div class="ttname"><a href="classcc__mqttsn__gateway_1_1Gateway.html#af5b510419a496c8a150e3747f94edc79">cc_mqttsn_gateway::Gateway::getAdvertisePeriod</a></div><div class="ttdeci">std::uint16_t getAdvertisePeriod() const</div><div class="ttdoc">Get current configuration of the ADVERTISE message period.</div></div>
<div class="ttc" id="anamespacecc__mqttsn__gateway_html"><div class="ttname"><a href="namespacecc__mqttsn__gateway.html">cc_mqttsn_gateway</a></div><div class="ttdoc">Main namespace for all classes / functions of the gateway library.</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
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
</small></address>
</body>
</html>