mirror of
https://github.com/meshtastic/python.git
synced 2025-12-27 01:47:50 -05:00
Merge pull request #183 from mkinney/more_doc
regen doc with overriding the pdoc _is_public()
This commit is contained in:
1865
docs/meshtastic/__main__.html
Normal file
1865
docs/meshtastic/__main__.html
Normal file
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.admin_pb2 API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -326,7 +326,7 @@ DESCRIPTOR._options = None
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.apponly_pb2 API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -164,7 +164,7 @@ DESCRIPTOR._options = None
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.ble API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -47,7 +47,7 @@
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.ble_interface API documentation</title>
|
||||
<meta name="description" content="Bluetooth interface" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -161,10 +161,49 @@ link - just be a dumb serial client.</p></div>
|
||||
<ul class="hlist">
|
||||
<li><a title="meshtastic.mesh_interface.MeshInterface" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface">MeshInterface</a></li>
|
||||
</ul>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="meshtastic.ble_interface.BLEInterface._readFromRadio"><code class="name flex">
|
||||
<span>def <span class="ident">_readFromRadio</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _readFromRadio(self):
|
||||
if not self.noProto:
|
||||
wasEmpty = False
|
||||
while not wasEmpty:
|
||||
if self.device:
|
||||
b = self.device.char_read(FROMRADIO_UUID)
|
||||
wasEmpty = len(b) == 0
|
||||
if not wasEmpty:
|
||||
self._handleFromRadio(b)</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
</dl>
|
||||
<h3>Inherited members</h3>
|
||||
<ul class="hlist">
|
||||
<li><code><b><a title="meshtastic.mesh_interface.MeshInterface" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface">MeshInterface</a></b></code>:
|
||||
<ul class="hlist">
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._connected" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._connected">_connected</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._disconnected" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._disconnected">_disconnected</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._fixupPosition" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._fixupPosition">_fixupPosition</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._generatePacketId" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._generatePacketId">_generatePacketId</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._getOrCreateByNum" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._getOrCreateByNum">_getOrCreateByNum</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._handleConfigComplete" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._handleConfigComplete">_handleConfigComplete</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._handleFromRadio" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._handleFromRadio">_handleFromRadio</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._handlePacketFromRadio" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._handlePacketFromRadio">_handlePacketFromRadio</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._nodeNumToId" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._nodeNumToId">_nodeNumToId</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._sendDisconnect" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._sendDisconnect">_sendDisconnect</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._sendPacket" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._sendPacket">_sendPacket</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._sendToRadio" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._sendToRadio">_sendToRadio</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._sendToRadioImpl" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._sendToRadioImpl">_sendToRadioImpl</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._startConfig" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._startConfig">_startConfig</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._startHeartbeat" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._startHeartbeat">_startHeartbeat</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._waitConnected" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._waitConnected">_waitConnected</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface.close" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface.close">close</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface.getLongName" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface.getLongName">getLongName</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface.getMyNodeInfo" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface.getMyNodeInfo">getMyNodeInfo</a></code></li>
|
||||
@@ -199,6 +238,9 @@ link - just be a dumb serial client.</p></div>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="meshtastic.ble_interface.BLEInterface" href="#meshtastic.ble_interface.BLEInterface">BLEInterface</a></code></h4>
|
||||
<ul class="">
|
||||
<li><code><a title="meshtastic.ble_interface.BLEInterface._readFromRadio" href="#meshtastic.ble_interface.BLEInterface._readFromRadio">_readFromRadio</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -206,7 +248,7 @@ link - just be a dumb serial client.</p></div>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.channel_pb2 API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -503,7 +503,7 @@ DESCRIPTOR._options = None
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.deviceonly_pb2 API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -458,7 +458,7 @@ DESCRIPTOR._options = None
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.environmental_measurement_pb2 API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -185,7 +185,7 @@ DESCRIPTOR._options = None
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.globals API documentation</title>
|
||||
<meta name="description" content="Globals singleton class …" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -184,6 +184,13 @@ class Globals:
|
||||
"""Get channel_index"""
|
||||
return self.channel_index</code></pre>
|
||||
</details>
|
||||
<h3>Class variables</h3>
|
||||
<dl>
|
||||
<dt id="meshtastic.globals.Globals._Globals__instance"><code class="name">var <span class="ident">_Globals__instance</span></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
</dl>
|
||||
<h3>Static methods</h3>
|
||||
<dl>
|
||||
<dt id="meshtastic.globals.Globals.getInstance"><code class="name flex">
|
||||
@@ -356,6 +363,7 @@ def getInstance():
|
||||
<li>
|
||||
<h4><code><a title="meshtastic.globals.Globals" href="#meshtastic.globals.Globals">Globals</a></code></h4>
|
||||
<ul class="two-column">
|
||||
<li><code><a title="meshtastic.globals.Globals._Globals__instance" href="#meshtastic.globals.Globals._Globals__instance">_Globals__instance</a></code></li>
|
||||
<li><code><a title="meshtastic.globals.Globals.getInstance" href="#meshtastic.globals.Globals.getInstance">getInstance</a></code></li>
|
||||
<li><code><a title="meshtastic.globals.Globals.get_args" href="#meshtastic.globals.Globals.get_args">get_args</a></code></li>
|
||||
<li><code><a title="meshtastic.globals.Globals.get_channel_index" href="#meshtastic.globals.Globals.get_channel_index">get_channel_index</a></code></li>
|
||||
@@ -374,7 +382,7 @@ def getInstance():
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic API documentation</title>
|
||||
<meta name="description" content="an API for Meshtastic devices …" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -390,6 +390,89 @@ level of device code we are guaranteed to understand</p>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-functions">Functions</h2>
|
||||
<dl>
|
||||
<dt id="meshtastic._onNodeInfoReceive"><code class="name flex">
|
||||
<span>def <span class="ident">_onNodeInfoReceive</span></span>(<span>iface, asDict)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Special auto parsing for received messages</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _onNodeInfoReceive(iface, asDict):
|
||||
"""Special auto parsing for received messages"""
|
||||
p = asDict["decoded"]["user"]
|
||||
# decode user protobufs and update nodedb, provide decoded version as "position" in the published msg
|
||||
# update node DB as needed
|
||||
n = iface._getOrCreateByNum(asDict["from"])
|
||||
n["user"] = p
|
||||
# We now have a node ID, make sure it is uptodate in that table
|
||||
iface.nodes[p["id"]] = n
|
||||
_receiveInfoUpdate(iface, asDict)</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic._onPositionReceive"><code class="name flex">
|
||||
<span>def <span class="ident">_onPositionReceive</span></span>(<span>iface, asDict)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Special auto parsing for received messages</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _onPositionReceive(iface, asDict):
|
||||
"""Special auto parsing for received messages"""
|
||||
p = asDict["decoded"]["position"]
|
||||
iface._fixupPosition(p)
|
||||
# update node DB as needed
|
||||
iface._getOrCreateByNum(asDict["from"])["position"] = p</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic._onTextReceive"><code class="name flex">
|
||||
<span>def <span class="ident">_onTextReceive</span></span>(<span>iface, asDict)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Special text auto parsing for received messages</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _onTextReceive(iface, asDict):
|
||||
"""Special text auto parsing for received messages"""
|
||||
# We don't throw if the utf8 is invalid in the text message. Instead we just don't populate
|
||||
# the decoded.data.text and we log an error message. This at least allows some delivery to
|
||||
# the app and the app can deal with the missing decoded representation.
|
||||
#
|
||||
# Usually btw this problem is caused by apps sending binary data but setting the payload type to
|
||||
# text.
|
||||
try:
|
||||
asBytes = asDict["decoded"]["payload"]
|
||||
asDict["decoded"]["text"] = asBytes.decode("utf-8")
|
||||
except Exception as ex:
|
||||
logging.error(f"Malformatted utf8 in text message: {ex}")
|
||||
_receiveInfoUpdate(iface, asDict)</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic._receiveInfoUpdate"><code class="name flex">
|
||||
<span>def <span class="ident">_receiveInfoUpdate</span></span>(<span>iface, asDict)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _receiveInfoUpdate(iface, asDict):
|
||||
if "from" in asDict:
|
||||
iface._getOrCreateByNum(asDict["from"])["lastReceived"] = asDict
|
||||
iface._getOrCreateByNum(asDict["from"])["lastHeard"] = asDict.get("rxTime")
|
||||
iface._getOrCreateByNum(asDict["from"])["snr"] = asDict.get("rxSnr")
|
||||
iface._getOrCreateByNum(asDict["from"])["hopLimit"] = asDict.get("hopLimit")</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
@@ -417,6 +500,37 @@ level of device code we are guaranteed to understand</p>
|
||||
<ul class="hlist">
|
||||
<li>builtins.tuple</li>
|
||||
</ul>
|
||||
<h3>Class variables</h3>
|
||||
<dl>
|
||||
<dt id="meshtastic.KnownProtocol._field_defaults"><code class="name">var <span class="ident">_field_defaults</span></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="meshtastic.KnownProtocol._fields"><code class="name">var <span class="ident">_fields</span></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
</dl>
|
||||
<h3>Static methods</h3>
|
||||
<dl>
|
||||
<dt id="meshtastic.KnownProtocol._make"><code class="name flex">
|
||||
<span>def <span class="ident">_make</span></span>(<span>iterable)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Make a new KnownProtocol object from a sequence or iterable</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">@classmethod
|
||||
def _make(cls, iterable):
|
||||
result = tuple_new(cls, iterable)
|
||||
if _len(result) != num_fields:
|
||||
raise TypeError(f'Expected {num_fields} arguments, got {len(result)}')
|
||||
return result</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
</dl>
|
||||
<h3>Instance variables</h3>
|
||||
<dl>
|
||||
<dt id="meshtastic.KnownProtocol.name"><code class="name">var <span class="ident">name</span> : str</code></dt>
|
||||
@@ -432,6 +546,39 @@ level of device code we are guaranteed to understand</p>
|
||||
<div class="desc"><p>Alias for field number 1</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="meshtastic.KnownProtocol._asdict"><code class="name flex">
|
||||
<span>def <span class="ident">_asdict</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Return a new dict which maps field names to their values.</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _asdict(self):
|
||||
'Return a new dict which maps field names to their values.'
|
||||
return _dict(_zip(self._fields, self))</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.KnownProtocol._replace"><code class="name flex">
|
||||
<span>def <span class="ident">_replace</span></span>(<span>self, /, **kwds)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Return a new KnownProtocol object replacing specified fields with new values</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _replace(self, /, **kwds):
|
||||
result = self._make(_map(kwds.pop, field_names, self))
|
||||
if kwds:
|
||||
raise ValueError(f'Got unexpected field names: {list(kwds)!r}')
|
||||
return result</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
<dt id="meshtastic.ResponseHandler"><code class="flex name class">
|
||||
<span>class <span class="ident">ResponseHandler</span></span>
|
||||
@@ -453,6 +600,37 @@ level of device code we are guaranteed to understand</p>
|
||||
<ul class="hlist">
|
||||
<li>builtins.tuple</li>
|
||||
</ul>
|
||||
<h3>Class variables</h3>
|
||||
<dl>
|
||||
<dt id="meshtastic.ResponseHandler._field_defaults"><code class="name">var <span class="ident">_field_defaults</span></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="meshtastic.ResponseHandler._fields"><code class="name">var <span class="ident">_fields</span></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
</dl>
|
||||
<h3>Static methods</h3>
|
||||
<dl>
|
||||
<dt id="meshtastic.ResponseHandler._make"><code class="name flex">
|
||||
<span>def <span class="ident">_make</span></span>(<span>iterable)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Make a new ResponseHandler object from a sequence or iterable</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">@classmethod
|
||||
def _make(cls, iterable):
|
||||
result = tuple_new(cls, iterable)
|
||||
if _len(result) != num_fields:
|
||||
raise TypeError(f'Expected {num_fields} arguments, got {len(result)}')
|
||||
return result</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
</dl>
|
||||
<h3>Instance variables</h3>
|
||||
<dl>
|
||||
<dt id="meshtastic.ResponseHandler.callback"><code class="name">var <span class="ident">callback</span> : Callable</code></dt>
|
||||
@@ -460,6 +638,39 @@ level of device code we are guaranteed to understand</p>
|
||||
<div class="desc"><p>Alias for field number 0</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="meshtastic.ResponseHandler._asdict"><code class="name flex">
|
||||
<span>def <span class="ident">_asdict</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Return a new dict which maps field names to their values.</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _asdict(self):
|
||||
'Return a new dict which maps field names to their values.'
|
||||
return _dict(_zip(self._fields, self))</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.ResponseHandler._replace"><code class="name flex">
|
||||
<span>def <span class="ident">_replace</span></span>(<span>self, /, **kwds)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Return a new ResponseHandler object replacing specified fields with new values</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _replace(self, /, **kwds):
|
||||
result = self._make(_map(kwds.pop, field_names, self))
|
||||
if kwds:
|
||||
raise ValueError(f'Got unexpected field names: {list(kwds)!r}')
|
||||
return result</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
@@ -510,11 +721,24 @@ level of device code we are guaranteed to understand</p>
|
||||
<li><code><a title="meshtastic.OUR_APP_VERSION" href="#meshtastic.OUR_APP_VERSION">OUR_APP_VERSION</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-functions">Functions</a></h3>
|
||||
<ul class="">
|
||||
<li><code><a title="meshtastic._onNodeInfoReceive" href="#meshtastic._onNodeInfoReceive">_onNodeInfoReceive</a></code></li>
|
||||
<li><code><a title="meshtastic._onPositionReceive" href="#meshtastic._onPositionReceive">_onPositionReceive</a></code></li>
|
||||
<li><code><a title="meshtastic._onTextReceive" href="#meshtastic._onTextReceive">_onTextReceive</a></code></li>
|
||||
<li><code><a title="meshtastic._receiveInfoUpdate" href="#meshtastic._receiveInfoUpdate">_receiveInfoUpdate</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="meshtastic.KnownProtocol" href="#meshtastic.KnownProtocol">KnownProtocol</a></code></h4>
|
||||
<ul class="">
|
||||
<ul class="two-column">
|
||||
<li><code><a title="meshtastic.KnownProtocol._asdict" href="#meshtastic.KnownProtocol._asdict">_asdict</a></code></li>
|
||||
<li><code><a title="meshtastic.KnownProtocol._field_defaults" href="#meshtastic.KnownProtocol._field_defaults">_field_defaults</a></code></li>
|
||||
<li><code><a title="meshtastic.KnownProtocol._fields" href="#meshtastic.KnownProtocol._fields">_fields</a></code></li>
|
||||
<li><code><a title="meshtastic.KnownProtocol._make" href="#meshtastic.KnownProtocol._make">_make</a></code></li>
|
||||
<li><code><a title="meshtastic.KnownProtocol._replace" href="#meshtastic.KnownProtocol._replace">_replace</a></code></li>
|
||||
<li><code><a title="meshtastic.KnownProtocol.name" href="#meshtastic.KnownProtocol.name">name</a></code></li>
|
||||
<li><code><a title="meshtastic.KnownProtocol.onReceive" href="#meshtastic.KnownProtocol.onReceive">onReceive</a></code></li>
|
||||
<li><code><a title="meshtastic.KnownProtocol.protobufFactory" href="#meshtastic.KnownProtocol.protobufFactory">protobufFactory</a></code></li>
|
||||
@@ -522,7 +746,12 @@ level of device code we are guaranteed to understand</p>
|
||||
</li>
|
||||
<li>
|
||||
<h4><code><a title="meshtastic.ResponseHandler" href="#meshtastic.ResponseHandler">ResponseHandler</a></code></h4>
|
||||
<ul class="">
|
||||
<ul class="two-column">
|
||||
<li><code><a title="meshtastic.ResponseHandler._asdict" href="#meshtastic.ResponseHandler._asdict">_asdict</a></code></li>
|
||||
<li><code><a title="meshtastic.ResponseHandler._field_defaults" href="#meshtastic.ResponseHandler._field_defaults">_field_defaults</a></code></li>
|
||||
<li><code><a title="meshtastic.ResponseHandler._fields" href="#meshtastic.ResponseHandler._fields">_fields</a></code></li>
|
||||
<li><code><a title="meshtastic.ResponseHandler._make" href="#meshtastic.ResponseHandler._make">_make</a></code></li>
|
||||
<li><code><a title="meshtastic.ResponseHandler._replace" href="#meshtastic.ResponseHandler._replace">_replace</a></code></li>
|
||||
<li><code><a title="meshtastic.ResponseHandler.callback" href="#meshtastic.ResponseHandler.callback">callback</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -532,7 +761,7 @@ level of device code we are guaranteed to understand</p>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.mesh_interface API documentation</title>
|
||||
<meta name="description" content="Mesh Interface class" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -1395,6 +1395,555 @@ link - just be a dumb serial client.</p></div>
|
||||
</ul>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="meshtastic.mesh_interface.MeshInterface._addResponseHandler"><code class="name flex">
|
||||
<span>def <span class="ident">_addResponseHandler</span></span>(<span>self, requestId, callback)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _addResponseHandler(self, requestId, callback):
|
||||
self.responseHandlers[requestId] = ResponseHandler(callback)</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.mesh_interface.MeshInterface._connected"><code class="name flex">
|
||||
<span>def <span class="ident">_connected</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Called by this class to tell clients we are now fully connected to a node</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _connected(self):
|
||||
"""Called by this class to tell clients we are now fully connected to a node
|
||||
"""
|
||||
# (because I'm lazy) _connected might be called when remote Node
|
||||
# objects complete their config reads, don't generate redundant isConnected
|
||||
# for the local interface
|
||||
if not self.isConnected.is_set():
|
||||
self.isConnected.set()
|
||||
self._startHeartbeat()
|
||||
publishingThread.queueWork(lambda: pub.sendMessage(
|
||||
"meshtastic.connection.established", interface=self))</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.mesh_interface.MeshInterface._disconnected"><code class="name flex">
|
||||
<span>def <span class="ident">_disconnected</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Called by subclasses to tell clients this interface has disconnected</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _disconnected(self):
|
||||
"""Called by subclasses to tell clients this interface has disconnected"""
|
||||
self.isConnected.clear()
|
||||
publishingThread.queueWork(lambda: pub.sendMessage(
|
||||
"meshtastic.connection.lost", interface=self))</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.mesh_interface.MeshInterface._fixupPosition"><code class="name flex">
|
||||
<span>def <span class="ident">_fixupPosition</span></span>(<span>self, position)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Convert integer lat/lon into floats</p>
|
||||
<h2 id="arguments">Arguments</h2>
|
||||
<p>position {Position dictionary} – object ot fix up</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _fixupPosition(self, position):
|
||||
"""Convert integer lat/lon into floats
|
||||
|
||||
Arguments:
|
||||
position {Position dictionary} -- object ot fix up
|
||||
"""
|
||||
if "latitudeI" in position:
|
||||
position["latitude"] = position["latitudeI"] * 1e-7
|
||||
if "longitudeI" in position:
|
||||
position["longitude"] = position["longitudeI"] * 1e-7</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.mesh_interface.MeshInterface._generatePacketId"><code class="name flex">
|
||||
<span>def <span class="ident">_generatePacketId</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Get a new unique packet ID</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _generatePacketId(self):
|
||||
"""Get a new unique packet ID"""
|
||||
if self.currentPacketId is None:
|
||||
raise Exception("Not connected yet, can not generate packet")
|
||||
else:
|
||||
self.currentPacketId = (self.currentPacketId + 1) & 0xffffffff
|
||||
return self.currentPacketId</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.mesh_interface.MeshInterface._getOrCreateByNum"><code class="name flex">
|
||||
<span>def <span class="ident">_getOrCreateByNum</span></span>(<span>self, nodeNum)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Given a nodenum find the NodeInfo in the DB (or create if necessary)</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _getOrCreateByNum(self, nodeNum):
|
||||
"""Given a nodenum find the NodeInfo in the DB (or create if necessary)"""
|
||||
if nodeNum == BROADCAST_NUM:
|
||||
raise Exception("Can not create/find nodenum by the broadcast num")
|
||||
|
||||
if nodeNum in self.nodesByNum:
|
||||
return self.nodesByNum[nodeNum]
|
||||
else:
|
||||
n = {"num": nodeNum} # Create a minimial node db entry
|
||||
self.nodesByNum[nodeNum] = n
|
||||
return n</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.mesh_interface.MeshInterface._handleConfigComplete"><code class="name flex">
|
||||
<span>def <span class="ident">_handleConfigComplete</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Done with initial config messages, now send regular MeshPackets
|
||||
to ask for settings and channels</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _handleConfigComplete(self):
|
||||
"""
|
||||
Done with initial config messages, now send regular MeshPackets
|
||||
to ask for settings and channels
|
||||
"""
|
||||
self.localNode.requestConfig()</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.mesh_interface.MeshInterface._handleFromRadio"><code class="name flex">
|
||||
<span>def <span class="ident">_handleFromRadio</span></span>(<span>self, fromRadioBytes)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Handle a packet that arrived from the radio(update model and publish events)</p>
|
||||
<p>Called by subclasses.</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _handleFromRadio(self, fromRadioBytes):
|
||||
"""
|
||||
Handle a packet that arrived from the radio(update model and publish events)
|
||||
|
||||
Called by subclasses."""
|
||||
fromRadio = mesh_pb2.FromRadio()
|
||||
fromRadio.ParseFromString(fromRadioBytes)
|
||||
logging.debug(f"in mesh_interface.py _handleFromRadio() fromRadioBytes: {fromRadioBytes}")
|
||||
asDict = google.protobuf.json_format.MessageToDict(fromRadio)
|
||||
logging.debug(f"Received from radio: {fromRadio}")
|
||||
if fromRadio.HasField("my_info"):
|
||||
self.myInfo = fromRadio.my_info
|
||||
self.localNode.nodeNum = self.myInfo.my_node_num
|
||||
logging.debug(f"Received myinfo: {stripnl(fromRadio.my_info)}")
|
||||
|
||||
failmsg = None
|
||||
# Check for app too old
|
||||
if self.myInfo.min_app_version > OUR_APP_VERSION:
|
||||
failmsg = "This device needs a newer python client, run 'pip install --upgrade meshtastic'."\
|
||||
"For more information see https://tinyurl.com/5bjsxu32"
|
||||
|
||||
# check for firmware too old
|
||||
if self.myInfo.max_channels == 0:
|
||||
failmsg = "This version of meshtastic-python requires device firmware version 1.2 or later. "\
|
||||
"For more information see https://tinyurl.com/5bjsxu32"
|
||||
|
||||
if failmsg:
|
||||
self.failure = Exception(failmsg)
|
||||
self.isConnected.set() # let waitConnected return this exception
|
||||
self.close()
|
||||
|
||||
elif fromRadio.HasField("node_info"):
|
||||
node = asDict["nodeInfo"]
|
||||
try:
|
||||
self._fixupPosition(node["position"])
|
||||
except:
|
||||
logging.debug("Node without position")
|
||||
|
||||
logging.debug(f"Received nodeinfo: {node}")
|
||||
|
||||
self.nodesByNum[node["num"]] = node
|
||||
if "user" in node: # Some nodes might not have user/ids assigned yet
|
||||
if "id" in node["user"]:
|
||||
self.nodes[node["user"]["id"]] = node
|
||||
publishingThread.queueWork(lambda: pub.sendMessage("meshtastic.node.updated",
|
||||
node=node, interface=self))
|
||||
elif fromRadio.config_complete_id == self.configId:
|
||||
# we ignore the config_complete_id, it is unneeded for our
|
||||
# stream API fromRadio.config_complete_id
|
||||
logging.debug(f"Config complete ID {self.configId}")
|
||||
self._handleConfigComplete()
|
||||
elif fromRadio.HasField("packet"):
|
||||
self._handlePacketFromRadio(fromRadio.packet)
|
||||
elif fromRadio.rebooted:
|
||||
# Tell clients the device went away. Careful not to call the overridden
|
||||
# subclass version that closes the serial port
|
||||
MeshInterface._disconnected(self)
|
||||
|
||||
self._startConfig() # redownload the node db etc...
|
||||
else:
|
||||
logging.debug("Unexpected FromRadio payload")</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.mesh_interface.MeshInterface._handlePacketFromRadio"><code class="name flex">
|
||||
<span>def <span class="ident">_handlePacketFromRadio</span></span>(<span>self, meshPacket, hack=False)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Handle a MeshPacket that just arrived from the radio</p>
|
||||
<p>hack - well, since we used 'from', which is a python keyword,
|
||||
as an attribute to MeshPacket in protobufs,
|
||||
there really is no way to do something like this:
|
||||
meshPacket = mesh_pb2.MeshPacket()
|
||||
meshPacket.from = 123
|
||||
If hack is True, we can unit test this code.</p>
|
||||
<p>Will publish one of the following events:
|
||||
- meshtastic.receive.text(packet = MeshPacket dictionary)
|
||||
- meshtastic.receive.position(packet = MeshPacket dictionary)
|
||||
- meshtastic.receive.user(packet = MeshPacket dictionary)
|
||||
- meshtastic.receive.data(packet = MeshPacket dictionary)</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _handlePacketFromRadio(self, meshPacket, hack=False):
|
||||
"""Handle a MeshPacket that just arrived from the radio
|
||||
|
||||
hack - well, since we used 'from', which is a python keyword,
|
||||
as an attribute to MeshPacket in protobufs,
|
||||
there really is no way to do something like this:
|
||||
meshPacket = mesh_pb2.MeshPacket()
|
||||
meshPacket.from = 123
|
||||
If hack is True, we can unit test this code.
|
||||
|
||||
Will publish one of the following events:
|
||||
- meshtastic.receive.text(packet = MeshPacket dictionary)
|
||||
- meshtastic.receive.position(packet = MeshPacket dictionary)
|
||||
- meshtastic.receive.user(packet = MeshPacket dictionary)
|
||||
- meshtastic.receive.data(packet = MeshPacket dictionary)
|
||||
"""
|
||||
asDict = google.protobuf.json_format.MessageToDict(meshPacket)
|
||||
|
||||
# We normally decompose the payload into a dictionary so that the client
|
||||
# doesn't need to understand protobufs. But advanced clients might
|
||||
# want the raw protobuf, so we provide it in "raw"
|
||||
asDict["raw"] = meshPacket
|
||||
|
||||
# from might be missing if the nodenum was zero.
|
||||
if not hack and "from" not in asDict:
|
||||
asDict["from"] = 0
|
||||
logging.error(f"Device returned a packet we sent, ignoring: {stripnl(asDict)}")
|
||||
print(f"Error: Device returned a packet we sent, ignoring: {stripnl(asDict)}")
|
||||
return
|
||||
if "to" not in asDict:
|
||||
asDict["to"] = 0
|
||||
|
||||
# /add fromId and toId fields based on the node ID
|
||||
try:
|
||||
asDict["fromId"] = self._nodeNumToId(asDict["from"])
|
||||
except Exception as ex:
|
||||
logging.warning(f"Not populating fromId {ex}")
|
||||
try:
|
||||
asDict["toId"] = self._nodeNumToId(asDict["to"])
|
||||
except Exception as ex:
|
||||
logging.warning(f"Not populating toId {ex}")
|
||||
|
||||
# We could provide our objects as DotMaps - which work with . notation or as dictionaries
|
||||
# asObj = DotMap(asDict)
|
||||
topic = "meshtastic.receive" # Generic unknown packet type
|
||||
|
||||
decoded = asDict["decoded"]
|
||||
# The default MessageToDict converts byte arrays into base64 strings.
|
||||
# We don't want that - it messes up data payload. So slam in the correct
|
||||
# byte array.
|
||||
decoded["payload"] = meshPacket.decoded.payload
|
||||
|
||||
# UNKNOWN_APP is the default protobuf portnum value, and therefore if not
|
||||
# set it will not be populated at all to make API usage easier, set
|
||||
# it to prevent confusion
|
||||
if "portnum" not in decoded:
|
||||
new_portnum = portnums_pb2.PortNum.Name(portnums_pb2.PortNum.UNKNOWN_APP)
|
||||
decoded["portnum"] = new_portnum
|
||||
logging.warning(f"portnum was not in decoded. Setting to:{new_portnum}")
|
||||
|
||||
portnum = decoded["portnum"]
|
||||
|
||||
topic = f"meshtastic.receive.data.{portnum}"
|
||||
|
||||
# decode position protobufs and update nodedb, provide decoded version
|
||||
# as "position" in the published msg move the following into a 'decoders'
|
||||
# API that clients could register?
|
||||
portNumInt = meshPacket.decoded.portnum # we want portnum as an int
|
||||
handler = protocols.get(portNumInt)
|
||||
# The decoded protobuf as a dictionary (if we understand this message)
|
||||
p = None
|
||||
if handler is not None:
|
||||
topic = f"meshtastic.receive.{handler.name}"
|
||||
|
||||
# Convert to protobuf if possible
|
||||
if handler.protobufFactory is not None:
|
||||
pb = handler.protobufFactory()
|
||||
pb.ParseFromString(meshPacket.decoded.payload)
|
||||
p = google.protobuf.json_format.MessageToDict(pb)
|
||||
asDict["decoded"][handler.name] = p
|
||||
# Also provide the protobuf raw
|
||||
asDict["decoded"][handler.name]["raw"] = pb
|
||||
|
||||
# Call specialized onReceive if necessary
|
||||
if handler.onReceive is not None:
|
||||
handler.onReceive(self, asDict)
|
||||
|
||||
# Is this message in response to a request, if so, look for a handler
|
||||
requestId = decoded.get("requestId")
|
||||
if requestId is not None:
|
||||
# We ignore ACK packets, but send NAKs and data responses to the handlers
|
||||
routing = decoded.get("routing")
|
||||
isAck = routing is not None and ("errorReason" not in routing)
|
||||
if not isAck:
|
||||
# we keep the responseHandler in dict until we get a non ack
|
||||
handler = self.responseHandlers.pop(requestId, None)
|
||||
if handler is not None:
|
||||
handler.callback(asDict)
|
||||
|
||||
logging.debug(f"Publishing {topic}: packet={stripnl(asDict)} ")
|
||||
publishingThread.queueWork(lambda: pub.sendMessage(
|
||||
topic, packet=asDict, interface=self))</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.mesh_interface.MeshInterface._nodeNumToId"><code class="name flex">
|
||||
<span>def <span class="ident">_nodeNumToId</span></span>(<span>self, num)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Map a node node number to a node ID</p>
|
||||
<h2 id="arguments">Arguments</h2>
|
||||
<p>num {int} – Node number</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<p>string – Node ID</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _nodeNumToId(self, num):
|
||||
"""Map a node node number to a node ID
|
||||
|
||||
Arguments:
|
||||
num {int} -- Node number
|
||||
|
||||
Returns:
|
||||
string -- Node ID
|
||||
"""
|
||||
if num == BROADCAST_NUM:
|
||||
return BROADCAST_ADDR
|
||||
|
||||
try:
|
||||
return self.nodesByNum[num]["user"]["id"]
|
||||
except:
|
||||
logging.debug(f"Node {num} not found for fromId")
|
||||
return None</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.mesh_interface.MeshInterface._sendDisconnect"><code class="name flex">
|
||||
<span>def <span class="ident">_sendDisconnect</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Tell device we are done using it</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _sendDisconnect(self):
|
||||
"""Tell device we are done using it"""
|
||||
m = mesh_pb2.ToRadio()
|
||||
m.disconnect = True
|
||||
self._sendToRadio(m)</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.mesh_interface.MeshInterface._sendPacket"><code class="name flex">
|
||||
<span>def <span class="ident">_sendPacket</span></span>(<span>self, meshPacket, destinationId='^all', wantAck=False, hopLimit=None)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Send a MeshPacket to the specified node (or if unspecified, broadcast).
|
||||
You probably don't want this - use sendData instead.</p>
|
||||
<p>Returns the sent packet. The id field will be populated in this packet and
|
||||
can be used to track future message acks/naks.</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _sendPacket(self, meshPacket,
|
||||
destinationId=BROADCAST_ADDR,
|
||||
wantAck=False, hopLimit=None):
|
||||
"""Send a MeshPacket to the specified node (or if unspecified, broadcast).
|
||||
You probably don't want this - use sendData instead.
|
||||
|
||||
Returns the sent packet. The id field will be populated in this packet and
|
||||
can be used to track future message acks/naks.
|
||||
"""
|
||||
if hopLimit is None:
|
||||
hopLimit = self.defaultHopLimit
|
||||
|
||||
# We allow users to talk to the local node before we've completed the full connection flow...
|
||||
if(self.myInfo is not None and destinationId != self.myInfo.my_node_num):
|
||||
self._waitConnected()
|
||||
|
||||
toRadio = mesh_pb2.ToRadio()
|
||||
|
||||
nodeNum = 0
|
||||
if destinationId is None:
|
||||
our_exit("Warning: destinationId must not be None")
|
||||
elif isinstance(destinationId, int):
|
||||
nodeNum = destinationId
|
||||
elif destinationId == BROADCAST_ADDR:
|
||||
nodeNum = BROADCAST_NUM
|
||||
elif destinationId == LOCAL_ADDR:
|
||||
if self.myInfo:
|
||||
nodeNum = self.myInfo.my_node_num
|
||||
else:
|
||||
our_exit("Warning: No myInfo found.")
|
||||
# A simple hex style nodeid - we can parse this without needing the DB
|
||||
elif destinationId.startswith("!"):
|
||||
nodeNum = int(destinationId[1:], 16)
|
||||
else:
|
||||
if self.nodes:
|
||||
node = self.nodes.get(destinationId)
|
||||
if not node:
|
||||
our_exit(f"Warning: NodeId {destinationId} not found in DB")
|
||||
nodeNum = node['num']
|
||||
else:
|
||||
logging.warning("Warning: There were no self.nodes.")
|
||||
|
||||
meshPacket.to = nodeNum
|
||||
meshPacket.want_ack = wantAck
|
||||
meshPacket.hop_limit = hopLimit
|
||||
|
||||
# if the user hasn't set an ID for this packet (likely and recommended),
|
||||
# we should pick a new unique ID so the message can be tracked.
|
||||
if meshPacket.id == 0:
|
||||
meshPacket.id = self._generatePacketId()
|
||||
|
||||
toRadio.packet.CopyFrom(meshPacket)
|
||||
if self.noProto:
|
||||
logging.warning(f"Not sending packet because protocol use is disabled by noProto")
|
||||
else:
|
||||
logging.debug(f"Sending packet: {stripnl(meshPacket)}")
|
||||
self._sendToRadio(toRadio)
|
||||
return meshPacket</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.mesh_interface.MeshInterface._sendToRadio"><code class="name flex">
|
||||
<span>def <span class="ident">_sendToRadio</span></span>(<span>self, toRadio)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Send a ToRadio protobuf to the device</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _sendToRadio(self, toRadio):
|
||||
"""Send a ToRadio protobuf to the device"""
|
||||
if self.noProto:
|
||||
logging.warning(f"Not sending packet because protocol use is disabled by noProto")
|
||||
else:
|
||||
#logging.debug(f"Sending toRadio: {stripnl(toRadio)}")
|
||||
self._sendToRadioImpl(toRadio)</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.mesh_interface.MeshInterface._sendToRadioImpl"><code class="name flex">
|
||||
<span>def <span class="ident">_sendToRadioImpl</span></span>(<span>self, toRadio)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Send a ToRadio protobuf to the device</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _sendToRadioImpl(self, toRadio):
|
||||
"""Send a ToRadio protobuf to the device"""
|
||||
logging.error(f"Subclass must provide toradio: {toRadio}")</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.mesh_interface.MeshInterface._startConfig"><code class="name flex">
|
||||
<span>def <span class="ident">_startConfig</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Start device packets flowing</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _startConfig(self):
|
||||
"""Start device packets flowing"""
|
||||
self.myInfo = None
|
||||
self.nodes = {} # nodes keyed by ID
|
||||
self.nodesByNum = {} # nodes keyed by nodenum
|
||||
|
||||
startConfig = mesh_pb2.ToRadio()
|
||||
self.configId = random.randint(0, 0xffffffff)
|
||||
startConfig.want_config_id = self.configId
|
||||
self._sendToRadio(startConfig)</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.mesh_interface.MeshInterface._startHeartbeat"><code class="name flex">
|
||||
<span>def <span class="ident">_startHeartbeat</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>We need to send a heartbeat message to the device every X seconds</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _startHeartbeat(self):
|
||||
"""We need to send a heartbeat message to the device every X seconds"""
|
||||
def callback():
|
||||
self.heartbeatTimer = None
|
||||
prefs = self.localNode.radioConfig.preferences
|
||||
i = prefs.phone_timeout_secs / 2
|
||||
logging.debug(f"Sending heartbeat, interval {i}")
|
||||
if i != 0:
|
||||
self.heartbeatTimer = threading.Timer(i, callback)
|
||||
self.heartbeatTimer.start()
|
||||
p = mesh_pb2.ToRadio()
|
||||
self._sendToRadio(p)
|
||||
|
||||
callback() # run our periodic callback now, it will make another timer if necessary</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.mesh_interface.MeshInterface._waitConnected"><code class="name flex">
|
||||
<span>def <span class="ident">_waitConnected</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Block until the initial node db download is complete, or timeout
|
||||
and raise an exception</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _waitConnected(self):
|
||||
"""Block until the initial node db download is complete, or timeout
|
||||
and raise an exception"""
|
||||
if not self.noProto:
|
||||
if not self.isConnected.wait(15.0): # timeout after x seconds
|
||||
raise Exception("Timed out waiting for connection completion")
|
||||
|
||||
# If we failed while connecting, raise the connection to the client
|
||||
if self.failure:
|
||||
raise self.failure</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.mesh_interface.MeshInterface.close"><code class="name flex">
|
||||
<span>def <span class="ident">close</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
@@ -1824,7 +2373,24 @@ and can be used to track future message acks/naks.</p></div>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="meshtastic.mesh_interface.MeshInterface" href="#meshtastic.mesh_interface.MeshInterface">MeshInterface</a></code></h4>
|
||||
<ul class="two-column">
|
||||
<ul class="">
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._addResponseHandler" href="#meshtastic.mesh_interface.MeshInterface._addResponseHandler">_addResponseHandler</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._connected" href="#meshtastic.mesh_interface.MeshInterface._connected">_connected</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._disconnected" href="#meshtastic.mesh_interface.MeshInterface._disconnected">_disconnected</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._fixupPosition" href="#meshtastic.mesh_interface.MeshInterface._fixupPosition">_fixupPosition</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._generatePacketId" href="#meshtastic.mesh_interface.MeshInterface._generatePacketId">_generatePacketId</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._getOrCreateByNum" href="#meshtastic.mesh_interface.MeshInterface._getOrCreateByNum">_getOrCreateByNum</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._handleConfigComplete" href="#meshtastic.mesh_interface.MeshInterface._handleConfigComplete">_handleConfigComplete</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._handleFromRadio" href="#meshtastic.mesh_interface.MeshInterface._handleFromRadio">_handleFromRadio</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._handlePacketFromRadio" href="#meshtastic.mesh_interface.MeshInterface._handlePacketFromRadio">_handlePacketFromRadio</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._nodeNumToId" href="#meshtastic.mesh_interface.MeshInterface._nodeNumToId">_nodeNumToId</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._sendDisconnect" href="#meshtastic.mesh_interface.MeshInterface._sendDisconnect">_sendDisconnect</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._sendPacket" href="#meshtastic.mesh_interface.MeshInterface._sendPacket">_sendPacket</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._sendToRadio" href="#meshtastic.mesh_interface.MeshInterface._sendToRadio">_sendToRadio</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._sendToRadioImpl" href="#meshtastic.mesh_interface.MeshInterface._sendToRadioImpl">_sendToRadioImpl</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._startConfig" href="#meshtastic.mesh_interface.MeshInterface._startConfig">_startConfig</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._startHeartbeat" href="#meshtastic.mesh_interface.MeshInterface._startHeartbeat">_startHeartbeat</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._waitConnected" href="#meshtastic.mesh_interface.MeshInterface._waitConnected">_waitConnected</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface.close" href="#meshtastic.mesh_interface.MeshInterface.close">close</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface.getLongName" href="#meshtastic.mesh_interface.MeshInterface.getLongName">getLongName</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface.getMyNodeInfo" href="#meshtastic.mesh_interface.MeshInterface.getMyNodeInfo">getMyNodeInfo</a></code></li>
|
||||
@@ -1845,7 +2411,7 @@ and can be used to track future message acks/naks.</p></div>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.mesh_pb2 API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -2689,7 +2689,7 @@ _MYNODEINFO.fields_by_name['hw_model_deprecated']._options = None
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.mqtt_pb2 API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -188,7 +188,7 @@ DESCRIPTOR._options = None
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.node API documentation</title>
|
||||
<meta name="description" content="Node class" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -785,6 +785,149 @@ class Node:
|
||||
</details>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="meshtastic.node.Node._fillChannels"><code class="name flex">
|
||||
<span>def <span class="ident">_fillChannels</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Mark unused channels as disabled</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _fillChannels(self):
|
||||
"""Mark unused channels as disabled"""
|
||||
|
||||
# Add extra disabled channels as needed
|
||||
index = len(self.channels)
|
||||
while index < self.iface.myInfo.max_channels:
|
||||
ch = channel_pb2.Channel()
|
||||
ch.role = channel_pb2.Channel.Role.DISABLED
|
||||
ch.index = index
|
||||
self.channels.append(ch)
|
||||
index += 1</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.node.Node._fixupChannels"><code class="name flex">
|
||||
<span>def <span class="ident">_fixupChannels</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Fixup indexes and add disabled channels as needed</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _fixupChannels(self):
|
||||
"""Fixup indexes and add disabled channels as needed"""
|
||||
|
||||
# Add extra disabled channels as needed
|
||||
# TODO: These 2 lines seem to not do anything.
|
||||
for index, ch in enumerate(self.channels):
|
||||
ch.index = index # fixup indexes
|
||||
|
||||
self._fillChannels()</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.node.Node._getAdminChannelIndex"><code class="name flex">
|
||||
<span>def <span class="ident">_getAdminChannelIndex</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Return the channel number of the admin channel, or 0 if no reserved channel</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _getAdminChannelIndex(self):
|
||||
"""Return the channel number of the admin channel, or 0 if no reserved channel"""
|
||||
c = self.getChannelByName("admin")
|
||||
if c:
|
||||
return c.index
|
||||
else:
|
||||
return 0</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.node.Node._requestChannel"><code class="name flex">
|
||||
<span>def <span class="ident">_requestChannel</span></span>(<span>self, channelNum: int)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Done with initial config messages, now send regular
|
||||
MeshPackets to ask for settings</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _requestChannel(self, channelNum: int):
|
||||
"""Done with initial config messages, now send regular
|
||||
MeshPackets to ask for settings"""
|
||||
p = admin_pb2.AdminMessage()
|
||||
p.get_channel_request = channelNum + 1
|
||||
|
||||
# Show progress message for super slow operations
|
||||
if self != self.iface.localNode:
|
||||
print(f"Requesting channel {channelNum} info from remote node (this could take a while)")
|
||||
logging.debug(f"Requesting channel {channelNum} info from remote node (this could take a while)")
|
||||
else:
|
||||
logging.debug(f"Requesting channel {channelNum}")
|
||||
|
||||
return self._sendAdmin(p, wantResponse=True, onResponse=self.onResponseRequestChannel)</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.node.Node._requestSettings"><code class="name flex">
|
||||
<span>def <span class="ident">_requestSettings</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Done with initial config messages, now send regular
|
||||
MeshPackets to ask for settings.</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _requestSettings(self):
|
||||
"""Done with initial config messages, now send regular
|
||||
MeshPackets to ask for settings."""
|
||||
p = admin_pb2.AdminMessage()
|
||||
p.get_radio_request = True
|
||||
|
||||
# Show progress message for super slow operations
|
||||
if self != self.iface.localNode:
|
||||
print("Requesting preferences from remote node.")
|
||||
print("Be sure:")
|
||||
print(" 1. There is a SECONDARY channel named 'admin'.")
|
||||
print(" 2. The '--seturl' was used to configure.")
|
||||
print(" 3. All devices have the same modem config. (i.e., '--ch-longfast')")
|
||||
print(" 4. All devices have been rebooted after all of the above. (optional, but recommended)")
|
||||
print("Note: This could take a while (it requests remote channel configs, then writes config)")
|
||||
|
||||
return self._sendAdmin(p, wantResponse=True, onResponse=self.onResponseRequestSettings)</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.node.Node._sendAdmin"><code class="name flex">
|
||||
<span>def <span class="ident">_sendAdmin</span></span>(<span>self, p: admin_pb2.AdminMessage, wantResponse=False, onResponse=None, adminIndex=0)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Send an admin message to the specified node (or the local node if destNodeNum is zero)</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _sendAdmin(self, p: admin_pb2.AdminMessage, wantResponse=False,
|
||||
onResponse=None, adminIndex=0):
|
||||
"""Send an admin message to the specified node (or the local node if destNodeNum is zero)"""
|
||||
|
||||
if self.noProto:
|
||||
logging.warning(f"Not sending packet because protocol use is disabled by noProto")
|
||||
else:
|
||||
if adminIndex == 0: # unless a special channel index was used, we want to use the admin index
|
||||
adminIndex = self.iface.localNode._getAdminChannelIndex()
|
||||
logging.debug(f'adminIndex:{adminIndex}')
|
||||
|
||||
return self.iface.sendData(p, self.nodeNum,
|
||||
portNum=portnums_pb2.PortNum.ADMIN_APP,
|
||||
wantAck=True,
|
||||
wantResponse=wantResponse,
|
||||
onResponse=onResponse,
|
||||
channelIndex=adminIndex)</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.node.Node.deleteChannel"><code class="name flex">
|
||||
<span>def <span class="ident">deleteChannel</span></span>(<span>self, channelIndex)</span>
|
||||
</code></dt>
|
||||
@@ -1248,6 +1391,12 @@ returns: None if there is no channel found</p></div>
|
||||
<li>
|
||||
<h4><code><a title="meshtastic.node.Node" href="#meshtastic.node.Node">Node</a></code></h4>
|
||||
<ul class="">
|
||||
<li><code><a title="meshtastic.node.Node._fillChannels" href="#meshtastic.node.Node._fillChannels">_fillChannels</a></code></li>
|
||||
<li><code><a title="meshtastic.node.Node._fixupChannels" href="#meshtastic.node.Node._fixupChannels">_fixupChannels</a></code></li>
|
||||
<li><code><a title="meshtastic.node.Node._getAdminChannelIndex" href="#meshtastic.node.Node._getAdminChannelIndex">_getAdminChannelIndex</a></code></li>
|
||||
<li><code><a title="meshtastic.node.Node._requestChannel" href="#meshtastic.node.Node._requestChannel">_requestChannel</a></code></li>
|
||||
<li><code><a title="meshtastic.node.Node._requestSettings" href="#meshtastic.node.Node._requestSettings">_requestSettings</a></code></li>
|
||||
<li><code><a title="meshtastic.node.Node._sendAdmin" href="#meshtastic.node.Node._sendAdmin">_sendAdmin</a></code></li>
|
||||
<li><code><a title="meshtastic.node.Node.deleteChannel" href="#meshtastic.node.Node.deleteChannel">deleteChannel</a></code></li>
|
||||
<li><code><a title="meshtastic.node.Node.exitSimulator" href="#meshtastic.node.Node.exitSimulator">exitSimulator</a></code></li>
|
||||
<li><code><a title="meshtastic.node.Node.getChannelByChannelIndex" href="#meshtastic.node.Node.getChannelByChannelIndex">getChannelByChannelIndex</a></code></li>
|
||||
@@ -1274,7 +1423,7 @@ returns: None if there is no channel found</p></div>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.portnums_pb2 API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -184,7 +184,7 @@ DESCRIPTOR._options = None
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.radioconfig_pb2 API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -1036,7 +1036,7 @@ DESCRIPTOR._options = None
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.remote_hardware API documentation</title>
|
||||
<meta name="description" content="Remote hardware" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -220,6 +220,23 @@ code for how you can connect to your own custom meshtastic services</p>
|
||||
</details>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="meshtastic.remote_hardware.RemoteHardwareClient._sendHardware"><code class="name flex">
|
||||
<span>def <span class="ident">_sendHardware</span></span>(<span>self, nodeid, r, wantResponse=False, onResponse=None)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _sendHardware(self, nodeid, r, wantResponse=False, onResponse=None):
|
||||
if not nodeid:
|
||||
our_exit(r"Warning: Must use a destination node ID for this operation (use --dest \!xxxxxxxxx)")
|
||||
return self.iface.sendData(r, nodeid, portnums_pb2.REMOTE_HARDWARE_APP,
|
||||
wantAck=True, channelIndex=self.channelIndex,
|
||||
wantResponse=wantResponse, onResponse=onResponse)</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.remote_hardware.RemoteHardwareClient.readGPIOs"><code class="name flex">
|
||||
<span>def <span class="ident">readGPIOs</span></span>(<span>self, nodeid, mask, onResponse=None)</span>
|
||||
</code></dt>
|
||||
@@ -307,6 +324,7 @@ are 1 will be changed</p></div>
|
||||
<li>
|
||||
<h4><code><a title="meshtastic.remote_hardware.RemoteHardwareClient" href="#meshtastic.remote_hardware.RemoteHardwareClient">RemoteHardwareClient</a></code></h4>
|
||||
<ul class="">
|
||||
<li><code><a title="meshtastic.remote_hardware.RemoteHardwareClient._sendHardware" href="#meshtastic.remote_hardware.RemoteHardwareClient._sendHardware">_sendHardware</a></code></li>
|
||||
<li><code><a title="meshtastic.remote_hardware.RemoteHardwareClient.readGPIOs" href="#meshtastic.remote_hardware.RemoteHardwareClient.readGPIOs">readGPIOs</a></code></li>
|
||||
<li><code><a title="meshtastic.remote_hardware.RemoteHardwareClient.watchGPIOs" href="#meshtastic.remote_hardware.RemoteHardwareClient.watchGPIOs">watchGPIOs</a></code></li>
|
||||
<li><code><a title="meshtastic.remote_hardware.RemoteHardwareClient.writeGPIOs" href="#meshtastic.remote_hardware.RemoteHardwareClient.writeGPIOs">writeGPIOs</a></code></li>
|
||||
@@ -318,7 +336,7 @@ are 1 will be changed</p></div>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.remote_hardware_pb2 API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -261,7 +261,7 @@ DESCRIPTOR._options = None
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.serial_interface API documentation</title>
|
||||
<meta name="description" content="Serial interface class" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -202,10 +202,75 @@ debugOut {stream} – If a stream is provided, any debug serial output from
|
||||
<li><a title="meshtastic.stream_interface.StreamInterface" href="stream_interface.html#meshtastic.stream_interface.StreamInterface">StreamInterface</a></li>
|
||||
<li><a title="meshtastic.mesh_interface.MeshInterface" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface">MeshInterface</a></li>
|
||||
</ul>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="meshtastic.serial_interface.SerialInterface._hostPlatformAlwaysDrivesUartRts"><code class="name flex">
|
||||
<span>def <span class="ident">_hostPlatformAlwaysDrivesUartRts</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _hostPlatformAlwaysDrivesUartRts(self):
|
||||
# OS-X/Windows seems to have a bug in its CP21xx serial drivers. It ignores that we asked for no RTSCTS
|
||||
# control and will always drive RTS either high or low (rather than letting the CP102 leave
|
||||
# it as an open-collector floating pin).
|
||||
# TODO: When WSL2 supports USB passthrough, this will get messier. If/when WSL2 gets virtual serial
|
||||
# ports that "share" the Windows serial port (and thus the Windows drivers), this code will need to be
|
||||
# updated to reflect that as well -- or if T-Beams get made with an alternate USB to UART bridge that has
|
||||
# a less buggy driver.
|
||||
return platform.system() != 'Linux' or self._isWsl1()</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.serial_interface.SerialInterface._isWsl1"><code class="name flex">
|
||||
<span>def <span class="ident">_isWsl1</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _isWsl1(self):
|
||||
# WSL1 identifies itself as Linux, but has a special char device at /dev/lxss for use with session control,
|
||||
# e.g. /init. We should treat WSL1 as Windows for the RTS-driving hack because the underlying platfrom
|
||||
# serial driver for the CP21xx still exhibits the buggy behavior.
|
||||
# WSL2 is not covered here, as it does not (as of 2021-May-25) support the appropriate functionality to
|
||||
# share or pass-through serial ports.
|
||||
try:
|
||||
# Claims to be Linux, but has /dev/lxss; must be WSL 1
|
||||
return platform.system() == 'Linux' and stat.S_ISCHR(os.stat('/dev/lxss').st_mode)
|
||||
except:
|
||||
# Couldn't stat /dev/lxss special device; not WSL1
|
||||
return False</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
</dl>
|
||||
<h3>Inherited members</h3>
|
||||
<ul class="hlist">
|
||||
<li><code><b><a title="meshtastic.stream_interface.StreamInterface" href="stream_interface.html#meshtastic.stream_interface.StreamInterface">StreamInterface</a></b></code>:
|
||||
<ul class="hlist">
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._StreamInterface__reader" href="stream_interface.html#meshtastic.stream_interface.StreamInterface._StreamInterface__reader">_StreamInterface__reader</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._connected" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._connected">_connected</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._disconnected" href="stream_interface.html#meshtastic.stream_interface.StreamInterface._disconnected">_disconnected</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._fixupPosition" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._fixupPosition">_fixupPosition</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._generatePacketId" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._generatePacketId">_generatePacketId</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._getOrCreateByNum" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._getOrCreateByNum">_getOrCreateByNum</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._handleConfigComplete" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._handleConfigComplete">_handleConfigComplete</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._handleFromRadio" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._handleFromRadio">_handleFromRadio</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._handlePacketFromRadio" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._handlePacketFromRadio">_handlePacketFromRadio</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._nodeNumToId" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._nodeNumToId">_nodeNumToId</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._readBytes" href="stream_interface.html#meshtastic.stream_interface.StreamInterface._readBytes">_readBytes</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._sendDisconnect" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._sendDisconnect">_sendDisconnect</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._sendPacket" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._sendPacket">_sendPacket</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._sendToRadio" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._sendToRadio">_sendToRadio</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._sendToRadioImpl" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._sendToRadioImpl">_sendToRadioImpl</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._startConfig" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._startConfig">_startConfig</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._startHeartbeat" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._startHeartbeat">_startHeartbeat</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._waitConnected" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._waitConnected">_waitConnected</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._writeBytes" href="stream_interface.html#meshtastic.stream_interface.StreamInterface._writeBytes">_writeBytes</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface.close" href="stream_interface.html#meshtastic.stream_interface.StreamInterface.close">close</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface.connect" href="stream_interface.html#meshtastic.stream_interface.StreamInterface.connect">connect</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface.getLongName" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface.getLongName">getLongName</a></code></li>
|
||||
@@ -241,6 +306,10 @@ debugOut {stream} – If a stream is provided, any debug serial output from
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="meshtastic.serial_interface.SerialInterface" href="#meshtastic.serial_interface.SerialInterface">SerialInterface</a></code></h4>
|
||||
<ul class="">
|
||||
<li><code><a title="meshtastic.serial_interface.SerialInterface._hostPlatformAlwaysDrivesUartRts" href="#meshtastic.serial_interface.SerialInterface._hostPlatformAlwaysDrivesUartRts">_hostPlatformAlwaysDrivesUartRts</a></code></li>
|
||||
<li><code><a title="meshtastic.serial_interface.SerialInterface._isWsl1" href="#meshtastic.serial_interface.SerialInterface._isWsl1">_isWsl1</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -248,7 +317,7 @@ debugOut {stream} – If a stream is provided, any debug serial output from
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.storeforward_pb2 API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -459,7 +459,7 @@ DESCRIPTOR._options = None
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.stream_interface API documentation</title>
|
||||
<meta name="description" content="Stream Interface base class" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -410,6 +410,133 @@ device will be emitted to that stream. (default: {None})</p>
|
||||
</ul>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="meshtastic.stream_interface.StreamInterface._StreamInterface__reader"><code class="name flex">
|
||||
<span>def <span class="ident">_StreamInterface__reader</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>The reader thread that reads bytes from our stream</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def __reader(self):
|
||||
"""The reader thread that reads bytes from our stream"""
|
||||
logging.debug('in __reader()')
|
||||
empty = bytes()
|
||||
|
||||
try:
|
||||
while not self._wantExit:
|
||||
logging.debug("reading character")
|
||||
b = self._readBytes(1)
|
||||
logging.debug("In reader loop")
|
||||
#logging.debug(f"read returned {b}")
|
||||
if len(b) > 0:
|
||||
c = b[0]
|
||||
#logging.debug(f'c:{c}')
|
||||
ptr = len(self._rxBuf)
|
||||
|
||||
# Assume we want to append this byte, fixme use bytearray instead
|
||||
self._rxBuf = self._rxBuf + b
|
||||
|
||||
if ptr == 0: # looking for START1
|
||||
if c != START1:
|
||||
self._rxBuf = empty # failed to find start
|
||||
if self.debugOut is not None:
|
||||
try:
|
||||
self.debugOut.write(b.decode("utf-8"))
|
||||
except:
|
||||
self.debugOut.write('?')
|
||||
|
||||
elif ptr == 1: # looking for START2
|
||||
if c != START2:
|
||||
self._rxBuf = empty # failed to find start2
|
||||
elif ptr >= HEADER_LEN - 1: # we've at least got a header
|
||||
#logging.debug('at least we received a header')
|
||||
# big endian length follows header
|
||||
packetlen = (self._rxBuf[2] << 8) + self._rxBuf[3]
|
||||
|
||||
if ptr == HEADER_LEN - 1: # we _just_ finished reading the header, validate length
|
||||
if packetlen > MAX_TO_FROM_RADIO_SIZE:
|
||||
self._rxBuf = empty # length was out out bounds, restart
|
||||
|
||||
if len(self._rxBuf) != 0 and ptr + 1 >= packetlen + HEADER_LEN:
|
||||
try:
|
||||
self._handleFromRadio(self._rxBuf[HEADER_LEN:])
|
||||
except Exception as ex:
|
||||
logging.error(f"Error while handling message from radio {ex}")
|
||||
traceback.print_exc()
|
||||
self._rxBuf = empty
|
||||
else:
|
||||
# logging.debug(f"timeout")
|
||||
pass
|
||||
except serial.SerialException as ex:
|
||||
if not self._wantExit: # We might intentionally get an exception during shutdown
|
||||
logging.warning(f"Meshtastic serial port disconnected, disconnecting... {ex}")
|
||||
except OSError as ex:
|
||||
if not self._wantExit: # We might intentionally get an exception during shutdown
|
||||
logging.error(f"Unexpected OSError, terminating meshtastic reader... {ex}")
|
||||
except Exception as ex:
|
||||
logging.error(f"Unexpected exception, terminating meshtastic reader... {ex}")
|
||||
finally:
|
||||
logging.debug("reader is exiting")
|
||||
self._disconnected()</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.stream_interface.StreamInterface._disconnected"><code class="name flex">
|
||||
<span>def <span class="ident">_disconnected</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>We override the superclass implementation to close our port</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _disconnected(self):
|
||||
"""We override the superclass implementation to close our port"""
|
||||
MeshInterface._disconnected(self)
|
||||
|
||||
logging.debug("Closing our port")
|
||||
# pylint: disable=E0203
|
||||
if not self.stream is None:
|
||||
# pylint: disable=E0203
|
||||
self.stream.close()
|
||||
# pylint: disable=W0201
|
||||
self.stream = None</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.stream_interface.StreamInterface._readBytes"><code class="name flex">
|
||||
<span>def <span class="ident">_readBytes</span></span>(<span>self, length)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Read an array of bytes from our stream</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _readBytes(self, length):
|
||||
"""Read an array of bytes from our stream"""
|
||||
if self.stream:
|
||||
return self.stream.read(length)
|
||||
else:
|
||||
return None</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.stream_interface.StreamInterface._writeBytes"><code class="name flex">
|
||||
<span>def <span class="ident">_writeBytes</span></span>(<span>self, b)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Write an array of bytes to our stream and flush</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _writeBytes(self, b):
|
||||
"""Write an array of bytes to our stream and flush"""
|
||||
if self.stream: # ignore writes when stream is closed
|
||||
self.stream.write(b)
|
||||
self.stream.flush()</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.stream_interface.StreamInterface.close"><code class="name flex">
|
||||
<span>def <span class="ident">close</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
@@ -469,6 +596,21 @@ passed in connectNow=False you can manually start the reading thread later.</p><
|
||||
<ul class="hlist">
|
||||
<li><code><b><a title="meshtastic.mesh_interface.MeshInterface" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface">MeshInterface</a></b></code>:
|
||||
<ul class="hlist">
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._connected" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._connected">_connected</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._fixupPosition" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._fixupPosition">_fixupPosition</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._generatePacketId" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._generatePacketId">_generatePacketId</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._getOrCreateByNum" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._getOrCreateByNum">_getOrCreateByNum</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._handleConfigComplete" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._handleConfigComplete">_handleConfigComplete</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._handleFromRadio" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._handleFromRadio">_handleFromRadio</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._handlePacketFromRadio" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._handlePacketFromRadio">_handlePacketFromRadio</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._nodeNumToId" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._nodeNumToId">_nodeNumToId</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._sendDisconnect" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._sendDisconnect">_sendDisconnect</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._sendPacket" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._sendPacket">_sendPacket</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._sendToRadio" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._sendToRadio">_sendToRadio</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._sendToRadioImpl" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._sendToRadioImpl">_sendToRadioImpl</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._startConfig" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._startConfig">_startConfig</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._startHeartbeat" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._startHeartbeat">_startHeartbeat</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface._waitConnected" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._waitConnected">_waitConnected</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface.getLongName" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface.getLongName">getLongName</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface.getMyNodeInfo" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface.getMyNodeInfo">getMyNodeInfo</a></code></li>
|
||||
<li><code><a title="meshtastic.mesh_interface.MeshInterface.getMyUser" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface.getMyUser">getMyUser</a></code></li>
|
||||
@@ -503,6 +645,10 @@ passed in connectNow=False you can manually start the reading thread later.</p><
|
||||
<li>
|
||||
<h4><code><a title="meshtastic.stream_interface.StreamInterface" href="#meshtastic.stream_interface.StreamInterface">StreamInterface</a></code></h4>
|
||||
<ul class="">
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._StreamInterface__reader" href="#meshtastic.stream_interface.StreamInterface._StreamInterface__reader">_StreamInterface__reader</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._disconnected" href="#meshtastic.stream_interface.StreamInterface._disconnected">_disconnected</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._readBytes" href="#meshtastic.stream_interface.StreamInterface._readBytes">_readBytes</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._writeBytes" href="#meshtastic.stream_interface.StreamInterface._writeBytes">_writeBytes</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface.close" href="#meshtastic.stream_interface.StreamInterface.close">close</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface.connect" href="#meshtastic.stream_interface.StreamInterface.connect">connect</a></code></li>
|
||||
</ul>
|
||||
@@ -513,7 +659,7 @@ passed in connectNow=False you can manually start the reading thread later.</p><
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.tcp_interface API documentation</title>
|
||||
<meta name="description" content="TCPInterface class for interfacing with http endpoint" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -200,6 +200,25 @@ hostname {string} – Hostname/IP address of the device to connect to</p></d
|
||||
<ul class="hlist">
|
||||
<li><code><b><a title="meshtastic.stream_interface.StreamInterface" href="stream_interface.html#meshtastic.stream_interface.StreamInterface">StreamInterface</a></b></code>:
|
||||
<ul class="hlist">
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._StreamInterface__reader" href="stream_interface.html#meshtastic.stream_interface.StreamInterface._StreamInterface__reader">_StreamInterface__reader</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._connected" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._connected">_connected</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._disconnected" href="stream_interface.html#meshtastic.stream_interface.StreamInterface._disconnected">_disconnected</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._fixupPosition" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._fixupPosition">_fixupPosition</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._generatePacketId" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._generatePacketId">_generatePacketId</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._getOrCreateByNum" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._getOrCreateByNum">_getOrCreateByNum</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._handleConfigComplete" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._handleConfigComplete">_handleConfigComplete</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._handleFromRadio" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._handleFromRadio">_handleFromRadio</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._handlePacketFromRadio" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._handlePacketFromRadio">_handlePacketFromRadio</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._nodeNumToId" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._nodeNumToId">_nodeNumToId</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._readBytes" href="stream_interface.html#meshtastic.stream_interface.StreamInterface._readBytes">_readBytes</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._sendDisconnect" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._sendDisconnect">_sendDisconnect</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._sendPacket" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._sendPacket">_sendPacket</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._sendToRadio" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._sendToRadio">_sendToRadio</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._sendToRadioImpl" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._sendToRadioImpl">_sendToRadioImpl</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._startConfig" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._startConfig">_startConfig</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._startHeartbeat" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._startHeartbeat">_startHeartbeat</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._waitConnected" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface._waitConnected">_waitConnected</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface._writeBytes" href="stream_interface.html#meshtastic.stream_interface.StreamInterface._writeBytes">_writeBytes</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface.close" href="stream_interface.html#meshtastic.stream_interface.StreamInterface.close">close</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface.connect" href="stream_interface.html#meshtastic.stream_interface.StreamInterface.connect">connect</a></code></li>
|
||||
<li><code><a title="meshtastic.stream_interface.StreamInterface.getLongName" href="mesh_interface.html#meshtastic.mesh_interface.MeshInterface.getLongName">getLongName</a></code></li>
|
||||
@@ -245,7 +264,7 @@ hostname {string} – Hostname/IP address of the device to connect to</p></d
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.test API documentation</title>
|
||||
<meta name="description" content="With two radios connected serially, send and receive test
|
||||
messages and report back if successful." />
|
||||
@@ -538,7 +538,7 @@ python3 -c 'from meshtastic.test import testSimulator; testSimulator()'</p></div
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.tests.conftest API documentation</title>
|
||||
<meta name="description" content="Common pytest code (place for fixtures)." />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -193,7 +193,7 @@ def reset_globals():
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.tests API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -136,7 +136,7 @@ If not, you need to run: …</p></div>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.tests.test_ble_interface API documentation</title>
|
||||
<meta name="description" content="Meshtastic unit tests for ble_interface.py" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -89,7 +89,7 @@ def test_BLEInterface():
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.tests.test_examples API documentation</title>
|
||||
<meta name="description" content="Meshtastic test that the examples run as expected.
|
||||
We assume you have a python virtual environment in current directory.
|
||||
@@ -126,7 +126,7 @@ def test_examples_hello_world_serial_with_arg(capsys):
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.tests.test_globals API documentation</title>
|
||||
<meta name="description" content="Meshtastic unit tests for globals.py" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -124,7 +124,7 @@ def test_globals_there_can_be_only_one():
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.tests.test_int API documentation</title>
|
||||
<meta name="description" content="Meshtastic integration tests" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -171,7 +171,7 @@ def test_int_version():
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.tests.test_main API documentation</title>
|
||||
<meta name="description" content="Meshtastic unit tests for __main__.py" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -3981,7 +3981,7 @@ def test_main_test_two_ports_success(patched_find_ports, patched_test_all, reset
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.tests.test_mesh_interface API documentation</title>
|
||||
<meta name="description" content="Meshtastic unit tests for mesh_interface.py" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -1284,7 +1284,7 @@ def test_sendPosition_with_a_position(caplog, reset_globals):
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.tests.test_node API documentation</title>
|
||||
<meta name="description" content="Meshtastic unit tests for node.py" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -2266,7 +2266,7 @@ def test_writeConfig_with_no_radioConfig(capsys):
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.tests.test_remote_hardware API documentation</title>
|
||||
<meta name="description" content="Meshtastic unit tests for remote_hardware.py" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -298,7 +298,7 @@ def test_writeGPIOs(caplog):
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.tests.test_serial_interface API documentation</title>
|
||||
<meta name="description" content="Meshtastic unit tests for serial_interface.py" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -180,7 +180,7 @@ def test_SerialInterface_single_port(mocked_findPorts, mocked_serial):
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.tests.test_smoke1 API documentation</title>
|
||||
<meta name="description" content="Meshtastic smoke tests with a single device via USB" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -1816,7 +1816,7 @@ def test_smoke1_test_with_arg_but_no_hardware():
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.tests.test_smoke2 API documentation</title>
|
||||
<meta name="description" content="Meshtastic smoke tests with 2 devices connected via USB" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -121,7 +121,7 @@ def test_smoke2_test():
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.tests.test_smoke_wifi API documentation</title>
|
||||
<meta name="description" content="Meshtastic smoke tests a device setup with wifi …" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -109,7 +109,7 @@ def test_smokewifi_info():
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.tests.test_stream_interface API documentation</title>
|
||||
<meta name="description" content="Meshtastic unit tests for stream_interface.py" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -240,7 +240,7 @@ def test_sendToRadioImpl(caplog, reset_globals):
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.tests.test_tcp_interface API documentation</title>
|
||||
<meta name="description" content="Meshtastic unit tests for tcp_interface.py" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -114,7 +114,7 @@ def test_TCPInterface(capsys):
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.tests.test_util API documentation</title>
|
||||
<meta name="description" content="Meshtastic unit tests for util.py" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -513,7 +513,7 @@ def test_support_info(capsys):
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.tunnel API documentation</title>
|
||||
<meta name="description" content="Code for IP tunnel over a mesh …" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -492,6 +492,118 @@ subnet is used to construct our network number (normally 10.115.x.x)</p></div>
|
||||
</details>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="meshtastic.tunnel.Tunnel._Tunnel__tunReader"><code class="name flex">
|
||||
<span>def <span class="ident">_Tunnel__tunReader</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def __tunReader(self):
|
||||
tap = self.tun
|
||||
logging.debug("TUN reader running")
|
||||
while True:
|
||||
p = tap.read()
|
||||
#logging.debug(f"IP packet received on TUN interface, type={type(p)}")
|
||||
destAddr = p[16:20]
|
||||
|
||||
if not self._shouldFilterPacket(p):
|
||||
self.sendPacket(destAddr, p)</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.tunnel.Tunnel._ipToNodeId"><code class="name flex">
|
||||
<span>def <span class="ident">_ipToNodeId</span></span>(<span>self, ipAddr)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _ipToNodeId(self, ipAddr):
|
||||
# We only consider the last 16 bits of the nodenum for IP address matching
|
||||
ipBits = ipAddr[2] * 256 + ipAddr[3]
|
||||
|
||||
if ipBits == 0xffff:
|
||||
return "^all"
|
||||
|
||||
for node in self.iface.nodes.values():
|
||||
nodeNum = node["num"] & 0xffff
|
||||
# logging.debug(f"Considering nodenum 0x{nodeNum:x} for ipBits 0x{ipBits:x}")
|
||||
if (nodeNum) == ipBits:
|
||||
return node["user"]["id"]
|
||||
return None</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.tunnel.Tunnel._nodeNumToIp"><code class="name flex">
|
||||
<span>def <span class="ident">_nodeNumToIp</span></span>(<span>self, nodeNum)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _nodeNumToIp(self, nodeNum):
|
||||
return f"{self.subnetPrefix}.{(nodeNum >> 8) & 0xff}.{nodeNum & 0xff}"</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.tunnel.Tunnel._shouldFilterPacket"><code class="name flex">
|
||||
<span>def <span class="ident">_shouldFilterPacket</span></span>(<span>self, p)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Given a packet, decode it and return true if it should be ignored</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _shouldFilterPacket(self, p):
|
||||
"""Given a packet, decode it and return true if it should be ignored"""
|
||||
protocol = p[8 + 1]
|
||||
srcaddr = p[12:16]
|
||||
destAddr = p[16:20]
|
||||
subheader = 20
|
||||
ignore = False # Assume we will be forwarding the packet
|
||||
if protocol in protocolBlacklist:
|
||||
ignore = True
|
||||
logging.log(
|
||||
LOG_TRACE, f"Ignoring blacklisted protocol 0x{protocol:02x}")
|
||||
elif protocol == 0x01: # ICMP
|
||||
icmpType = p[20]
|
||||
icmpCode = p[21]
|
||||
checksum = p[22:24]
|
||||
# pylint: disable=line-too-long
|
||||
logging.debug(f"forwarding ICMP message src={ipstr(srcaddr)}, dest={ipstr(destAddr)}, type={icmpType}, code={icmpCode}, checksum={checksum}")
|
||||
# reply to pings (swap src and dest but keep rest of packet unchanged)
|
||||
#pingback = p[:12]+p[16:20]+p[12:16]+p[20:]
|
||||
# tap.write(pingback)
|
||||
elif protocol == 0x11: # UDP
|
||||
srcport = readnet_u16(p, subheader)
|
||||
destport = readnet_u16(p, subheader + 2)
|
||||
if destport in udpBlacklist:
|
||||
ignore = True
|
||||
logging.log(
|
||||
LOG_TRACE, f"ignoring blacklisted UDP port {destport}")
|
||||
else:
|
||||
logging.debug(
|
||||
f"forwarding udp srcport={srcport}, destport={destport}")
|
||||
elif protocol == 0x06: # TCP
|
||||
srcport = readnet_u16(p, subheader)
|
||||
destport = readnet_u16(p, subheader + 2)
|
||||
if destport in tcpBlacklist:
|
||||
ignore = True
|
||||
logging.log(LOG_TRACE, f"ignoring blacklisted TCP port {destport}")
|
||||
else:
|
||||
logging.debug(f"forwarding tcp srcport={srcport}, destport={destport}")
|
||||
else:
|
||||
logging.warning(f"forwarding unexpected protocol 0x{protocol:02x}, "\
|
||||
"src={ipstr(srcaddr)}, dest={ipstr(destAddr)}")
|
||||
|
||||
return ignore</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.tunnel.Tunnel.close"><code class="name flex">
|
||||
<span>def <span class="ident">close</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
@@ -597,7 +709,11 @@ subnet is used to construct our network number (normally 10.115.x.x)</p></div>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="meshtastic.tunnel.Tunnel" href="#meshtastic.tunnel.Tunnel">Tunnel</a></code></h4>
|
||||
<ul class="">
|
||||
<ul class="two-column">
|
||||
<li><code><a title="meshtastic.tunnel.Tunnel._Tunnel__tunReader" href="#meshtastic.tunnel.Tunnel._Tunnel__tunReader">_Tunnel__tunReader</a></code></li>
|
||||
<li><code><a title="meshtastic.tunnel.Tunnel._ipToNodeId" href="#meshtastic.tunnel.Tunnel._ipToNodeId">_ipToNodeId</a></code></li>
|
||||
<li><code><a title="meshtastic.tunnel.Tunnel._nodeNumToIp" href="#meshtastic.tunnel.Tunnel._nodeNumToIp">_nodeNumToIp</a></code></li>
|
||||
<li><code><a title="meshtastic.tunnel.Tunnel._shouldFilterPacket" href="#meshtastic.tunnel.Tunnel._shouldFilterPacket">_shouldFilterPacket</a></code></li>
|
||||
<li><code><a title="meshtastic.tunnel.Tunnel.close" href="#meshtastic.tunnel.Tunnel.close">close</a></code></li>
|
||||
<li><code><a title="meshtastic.tunnel.Tunnel.onReceive" href="#meshtastic.tunnel.Tunnel.onReceive">onReceive</a></code></li>
|
||||
<li><code><a title="meshtastic.tunnel.Tunnel.sendPacket" href="#meshtastic.tunnel.Tunnel.sendPacket">sendPacket</a></code></li>
|
||||
@@ -609,7 +725,7 @@ subnet is used to construct our network number (normally 10.115.x.x)</p></div>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<meta name="generator" content="pdoc 0.10.1.dev1+g4aa70de.d20211229" />
|
||||
<title>meshtastic.util API documentation</title>
|
||||
<meta name="description" content="Utility functions." />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
@@ -525,6 +525,26 @@ given a string that contains ": true", replace with ": 'true'" (or false)</p></d
|
||||
</details>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="meshtastic.util.DeferredExecution._run"><code class="name flex">
|
||||
<span>def <span class="ident">_run</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def _run(self):
|
||||
while True:
|
||||
try:
|
||||
o = self.queue.get()
|
||||
o()
|
||||
except:
|
||||
logging.error(
|
||||
f"Unexpected error in deferred execution {sys.exc_info()[0]}")
|
||||
print(traceback.format_exc())</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="meshtastic.util.DeferredExecution.queueWork"><code class="name flex">
|
||||
<span>def <span class="ident">queueWork</span></span>(<span>self, runnable)</span>
|
||||
</code></dt>
|
||||
@@ -663,6 +683,7 @@ given a string that contains ": true", replace with ": 'true'" (or false)</p></d
|
||||
<li>
|
||||
<h4><code><a title="meshtastic.util.DeferredExecution" href="#meshtastic.util.DeferredExecution">DeferredExecution</a></code></h4>
|
||||
<ul class="">
|
||||
<li><code><a title="meshtastic.util.DeferredExecution._run" href="#meshtastic.util.DeferredExecution._run">_run</a></code></li>
|
||||
<li><code><a title="meshtastic.util.DeferredExecution.queueWork" href="#meshtastic.util.DeferredExecution.queueWork">queueWork</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -682,7 +703,7 @@ given a string that contains ": true", replace with ": 'true'" (or false)</p></d
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.1.dev1+g4aa70de.d20211229</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user