RadioLibSmol/class_lo_ra_w_a_n_node.html
2023-07-06 11:42:43 +00:00

433 lines
21 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>RadioLib: LoRaWANNode Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">RadioLib
</div>
<div id="projectbrief">Universal wireless communication library for Arduino</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&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('class_lo_ra_w_a_n_node.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="class_lo_ra_w_a_n_node-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">LoRaWANNode Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>LoRaWAN-compatible node (class A device).
<a href="class_lo_ra_w_a_n_node.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="_lo_ra_w_a_n_8h_source.html">LoRaWAN.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:adc52e15b50e39f03c937b2289ad18463"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lo_ra_w_a_n_node.html#adc52e15b50e39f03c937b2289ad18463">LoRaWANNode</a> (<a class="el" href="class_physical_layer.html">PhysicalLayer</a> *phy, const <a class="el" href="struct_lo_ra_w_a_n_band__t.html">LoRaWANBand_t</a> *band)</td></tr>
<tr class="memdesc:adc52e15b50e39f03c937b2289ad18463"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default constructor. <a href="class_lo_ra_w_a_n_node.html#adc52e15b50e39f03c937b2289ad18463">More...</a><br /></td></tr>
<tr class="separator:adc52e15b50e39f03c937b2289ad18463"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9613998d071bcf401be9ad57ff8591ea"><td class="memItemLeft" align="right" valign="top"><a id="a9613998d071bcf401be9ad57ff8591ea"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lo_ra_w_a_n_node.html#a9613998d071bcf401be9ad57ff8591ea">wipe</a> ()</td></tr>
<tr class="memdesc:a9613998d071bcf401be9ad57ff8591ea"><td class="mdescLeft">&#160;</td><td class="mdescRight">Wipe internal persistent parameters. This will reset all counters and saved variables, so the device will have to rejoin the network. <br /></td></tr>
<tr class="separator:a9613998d071bcf401be9ad57ff8591ea"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afcc515f5c2c7853df596e9096db76d28"><td class="memItemLeft" align="right" valign="top">int16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lo_ra_w_a_n_node.html#afcc515f5c2c7853df596e9096db76d28">begin</a> ()</td></tr>
<tr class="memdesc:afcc515f5c2c7853df596e9096db76d28"><td class="mdescLeft">&#160;</td><td class="mdescRight">Join network by loading information from persistent storage. <a href="class_lo_ra_w_a_n_node.html#afcc515f5c2c7853df596e9096db76d28">More...</a><br /></td></tr>
<tr class="separator:afcc515f5c2c7853df596e9096db76d28"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a36e62e7273ad5a5c3d12c55243ed30f9"><td class="memItemLeft" align="right" valign="top">int16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lo_ra_w_a_n_node.html#a36e62e7273ad5a5c3d12c55243ed30f9">beginOTAA</a> (uint64_t appEUI, uint64_t devEUI, uint8_t *nwkKey, uint8_t *appKey, bool force=false)</td></tr>
<tr class="memdesc:a36e62e7273ad5a5c3d12c55243ed30f9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Join network by performing over-the-air activation. By this procedure, the device will perform an exchange with the network server and set all necessary configuration. <a href="class_lo_ra_w_a_n_node.html#a36e62e7273ad5a5c3d12c55243ed30f9">More...</a><br /></td></tr>
<tr class="separator:a36e62e7273ad5a5c3d12c55243ed30f9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab3d1dc19a43116c2f04bd59563b38904"><td class="memItemLeft" align="right" valign="top">int16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lo_ra_w_a_n_node.html#ab3d1dc19a43116c2f04bd59563b38904">beginAPB</a> (uint32_t addr, uint8_t net, uint8_t *nwkSKey, uint8_t *appSKey)</td></tr>
<tr class="memdesc:ab3d1dc19a43116c2f04bd59563b38904"><td class="mdescLeft">&#160;</td><td class="mdescRight">Join network by performing activation by personalization. In this procedure, all necessary configuration must be provided by the user. <a href="class_lo_ra_w_a_n_node.html#ab3d1dc19a43116c2f04bd59563b38904">More...</a><br /></td></tr>
<tr class="separator:ab3d1dc19a43116c2f04bd59563b38904"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afa61477a27d020ccdf0c7eef1c4d00a9"><td class="memItemLeft" align="right" valign="top">int16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lo_ra_w_a_n_node.html#afa61477a27d020ccdf0c7eef1c4d00a9">uplink</a> (const char *str, uint8_t port)</td></tr>
<tr class="memdesc:afa61477a27d020ccdf0c7eef1c4d00a9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send a message to the server. <a href="class_lo_ra_w_a_n_node.html#afa61477a27d020ccdf0c7eef1c4d00a9">More...</a><br /></td></tr>
<tr class="separator:afa61477a27d020ccdf0c7eef1c4d00a9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa5e6ccffe7a9d633dce21e20760cbe31"><td class="memItemLeft" align="right" valign="top">int16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lo_ra_w_a_n_node.html#aa5e6ccffe7a9d633dce21e20760cbe31">uplink</a> (uint8_t *data, size_t len, uint8_t port)</td></tr>
<tr class="memdesc:aa5e6ccffe7a9d633dce21e20760cbe31"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send a message to the server. <a href="class_lo_ra_w_a_n_node.html#aa5e6ccffe7a9d633dce21e20760cbe31">More...</a><br /></td></tr>
<tr class="separator:aa5e6ccffe7a9d633dce21e20760cbe31"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeb11880cbbe657239648e4c5c4ac5c5a"><td class="memItemLeft" align="right" valign="top">int16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lo_ra_w_a_n_node.html#aeb11880cbbe657239648e4c5c4ac5c5a">configureChannel</a> (uint8_t chan, uint8_t dr)</td></tr>
<tr class="memdesc:aeb11880cbbe657239648e4c5c4ac5c5a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Configure the radio to a given channel frequency and data rate. <a href="class_lo_ra_w_a_n_node.html#aeb11880cbbe657239648e4c5c4ac5c5a">More...</a><br /></td></tr>
<tr class="separator:aeb11880cbbe657239648e4c5c4ac5c5a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>LoRaWAN-compatible node (class A device). </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="adc52e15b50e39f03c937b2289ad18463"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adc52e15b50e39f03c937b2289ad18463">&#9670;&nbsp;</a></span>LoRaWANNode()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LoRaWANNode::LoRaWANNode </td>
<td>(</td>
<td class="paramtype"><a class="el" href="class_physical_layer.html">PhysicalLayer</a> *&#160;</td>
<td class="paramname"><em>phy</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="struct_lo_ra_w_a_n_band__t.html">LoRaWANBand_t</a> *&#160;</td>
<td class="paramname"><em>band</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Default constructor. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">phy</td><td>Pointer to the <a class="el" href="class_physical_layer.html" title="Provides common interface for protocols that run on LoRa/FSK modules, such as RTTY or LoRaWAN....">PhysicalLayer</a> radio module. </td></tr>
<tr><td class="paramname">band</td><td>Pointer to the LoRaWAN band to use. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="afcc515f5c2c7853df596e9096db76d28"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afcc515f5c2c7853df596e9096db76d28">&#9670;&nbsp;</a></span>begin()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int16_t LoRaWANNode::begin </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Join network by loading information from persistent storage. </p>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__status__codes.html">Status Codes</a> </dd></dl>
</div>
</div>
<a id="ab3d1dc19a43116c2f04bd59563b38904"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab3d1dc19a43116c2f04bd59563b38904">&#9670;&nbsp;</a></span>beginAPB()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int16_t LoRaWANNode::beginAPB </td>
<td>(</td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>addr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>net</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t *&#160;</td>
<td class="paramname"><em>nwkSKey</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t *&#160;</td>
<td class="paramname"><em>appSKey</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Join network by performing activation by personalization. In this procedure, all necessary configuration must be provided by the user. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">addr</td><td>Device address. </td></tr>
<tr><td class="paramname">net</td><td>Network ID. </td></tr>
<tr><td class="paramname">nwkSKey</td><td>Pointer to the network session AES-128 key. </td></tr>
<tr><td class="paramname">appSKey</td><td>Pointer to the application session AES-128 key. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__status__codes.html">Status Codes</a> </dd></dl>
</div>
</div>
<a id="a36e62e7273ad5a5c3d12c55243ed30f9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a36e62e7273ad5a5c3d12c55243ed30f9">&#9670;&nbsp;</a></span>beginOTAA()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int16_t LoRaWANNode::beginOTAA </td>
<td>(</td>
<td class="paramtype">uint64_t&#160;</td>
<td class="paramname"><em>appEUI</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint64_t&#160;</td>
<td class="paramname"><em>devEUI</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t *&#160;</td>
<td class="paramname"><em>nwkKey</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t *&#160;</td>
<td class="paramname"><em>appKey</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>force</em> = <code>false</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Join network by performing over-the-air activation. By this procedure, the device will perform an exchange with the network server and set all necessary configuration. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">appEUI</td><td>8-byte application identifier. </td></tr>
<tr><td class="paramname">devEUI</td><td>8-byte device identifier. </td></tr>
<tr><td class="paramname">nwkKey</td><td>Pointer to the network AES-128 key. </td></tr>
<tr><td class="paramname">appKey</td><td>Pointer to the application AES-128 key. </td></tr>
<tr><td class="paramname">force</td><td>Set to true to force joining even if previously joined. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__status__codes.html">Status Codes</a> </dd></dl>
</div>
</div>
<a id="aeb11880cbbe657239648e4c5c4ac5c5a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aeb11880cbbe657239648e4c5c4ac5c5a">&#9670;&nbsp;</a></span>configureChannel()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int16_t LoRaWANNode::configureChannel </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>chan</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>dr</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Configure the radio to a given channel frequency and data rate. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">chan</td><td>Channel ID to set. </td></tr>
<tr><td class="paramname">dr</td><td>Data rate to set, DR0 - DR15. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__status__codes.html">Status Codes</a> </dd></dl>
</div>
</div>
<a id="afa61477a27d020ccdf0c7eef1c4d00a9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afa61477a27d020ccdf0c7eef1c4d00a9">&#9670;&nbsp;</a></span>uplink() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int16_t LoRaWANNode::uplink </td>
<td>(</td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>str</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>port</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Send a message to the server. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">str</td><td>C-string that will be transmitted. </td></tr>
<tr><td class="paramname">port</td><td>Port number to send the message to. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__status__codes.html">Status Codes</a> </dd></dl>
</div>
</div>
<a id="aa5e6ccffe7a9d633dce21e20760cbe31"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa5e6ccffe7a9d633dce21e20760cbe31">&#9670;&nbsp;</a></span>uplink() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int16_t LoRaWANNode::uplink </td>
<td>(</td>
<td class="paramtype">uint8_t *&#160;</td>
<td class="paramname"><em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>len</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>port</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Send a message to the server. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">data</td><td>Data to send. </td></tr>
<tr><td class="paramname">len</td><td>Length of the data. </td></tr>
<tr><td class="paramname">port</td><td>Port number to send the message to. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__status__codes.html">Status Codes</a> </dd></dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>src/protocols/LoRaWAN/<a class="el" href="_lo_ra_w_a_n_8h_source.html">LoRaWAN.h</a></li>
<li>src/protocols/LoRaWAN/LoRaWAN.cpp</li>
</ul>
</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_lo_ra_w_a_n_node.html">LoRaWANNode</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.1 </li>
</ul>
</div>
</body>
</html>