1501 lines
32 KiB
HTML
1501 lines
32 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
<meta name="generator" content="mkdocs-1.6.1, mkdocs-terminal-4.8.0">
|
|
|
|
<meta name="description" content="MeshCore fork meshcore-tth -- repeater antispam, diagnostics, OTA, Czech mesh defaults">
|
|
|
|
|
|
<link rel="canonical" href="https://tth-pub.pages.rfa.cz/meshcore-tth/payloads/"><link rel="icon" type="image/png" sizes="192x192" href="../img/android-chrome-192x192.png" />
|
|
<link rel="icon" type="image/png" sizes="512x512" href="../img/android-chrome-512x512.png" />
|
|
<link rel="apple-touch-icon" sizes="180x180" href="../img/apple-touch-icon.png" />
|
|
<link rel="shortcut icon" type="image/png" sizes="48x48" href="../img/favicon.ico" />
|
|
<link rel="icon" type="image/png" sizes="16x16" href="../img/favicon-16x16.png" />
|
|
<link rel="icon" type="image/png" sizes="32x32" href="../img/favicon-32x32.png" />
|
|
|
|
|
|
|
|
|
|
<title>Payloads - MeshCore TTH</title>
|
|
|
|
|
|
<link href="../css/fontawesome/css/fontawesome.min.css" rel="stylesheet">
|
|
<link href="../css/fontawesome/css/solid.min.css" rel="stylesheet">
|
|
<link href="../css/normalize.css" rel="stylesheet">
|
|
<link href="../css/terminal.css" rel="stylesheet">
|
|
<link href="../css/theme.css" rel="stylesheet">
|
|
<link href="../css/theme.tile_grid.css" rel="stylesheet">
|
|
<link href="../css/theme.footer.css" rel="stylesheet">
|
|
<!-- dark color palette -->
|
|
<link href="../css/palettes/dark.css" rel="stylesheet">
|
|
|
|
<!-- page layout -->
|
|
<style>
|
|
/* initially set page layout to a one column grid */
|
|
.terminal-mkdocs-main-grid {
|
|
display: grid;
|
|
grid-column-gap: 1.4em;
|
|
grid-template-columns: auto;
|
|
grid-template-rows: auto;
|
|
}
|
|
|
|
/*
|
|
* when side navigation is not hidden, use a two column grid.
|
|
* if the screen is too narrow, fall back to the initial one column grid layout.
|
|
* in this case the main content will be placed under the navigation panel.
|
|
*/
|
|
@media only screen and (min-width: 70em) {
|
|
.terminal-mkdocs-main-grid {
|
|
grid-template-columns: 4fr 9fr;
|
|
}
|
|
}</style>
|
|
|
|
<!-- cursor_animation override -->
|
|
<style>
|
|
#mkdocs-terminal-site-name.terminal-prompt::after {
|
|
display: none;
|
|
}
|
|
</style>
|
|
|
|
|
|
<link href="../_stylesheets/tth.css" rel="stylesheet">
|
|
|
|
|
|
|
|
|
|
<!-- search css support -->
|
|
<link href="../css/search/bootstrap-modal.css" rel="stylesheet">
|
|
<!-- search scripts -->
|
|
<script>
|
|
var base_url = "..",
|
|
shortcuts = "{}";
|
|
</script>
|
|
<script src="../js/jquery/jquery-1.10.1.min.js" defer></script>
|
|
<script src="../js/bootstrap/bootstrap.min.js" defer></script>
|
|
<script src="../js/mkdocs/base.js" defer></script>
|
|
|
|
|
|
|
|
|
|
<script src="../search/main.js"></script>
|
|
|
|
|
|
|
|
</head>
|
|
|
|
<body class="terminal"><div class="container">
|
|
<div class="terminal-nav">
|
|
<header class="terminal-logo">
|
|
<div id="mkdocs-terminal-site-name" class="logo terminal-prompt"><a href="https://tth-pub.pages.rfa.cz/meshcore-tth/" class="no-style">MeshCore TTH</a></div>
|
|
</header>
|
|
|
|
<nav class="terminal-menu">
|
|
|
|
<ul vocab="https://schema.org/" typeof="BreadcrumbList">
|
|
|
|
|
|
<li property="itemListElement" typeof="ListItem">
|
|
<a href=".." class="menu-item " property="item" typeof="WebPage">
|
|
<span property="name">O forku</span>
|
|
</a>
|
|
<meta property="position" content="0">
|
|
</li>
|
|
|
|
|
|
<li property="itemListElement" typeof="ListItem">
|
|
<a href="../en/" class="menu-item " property="item" typeof="WebPage">
|
|
<span property="name">English</span>
|
|
</a>
|
|
<meta property="position" content="1">
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li property="itemListElement" typeof="ListItem">
|
|
<a href="#" class="menu-item" data-toggle="modal" data-target="#mkdocs_search_modal" property="item" typeof="SearchAction">
|
|
<i aria-hidden="true" class="fa fa-search"></i> <span property="name">Search</span>
|
|
</a>
|
|
<meta property="position" content="2">
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="container">
|
|
<div class="terminal-mkdocs-main-grid"><aside id="terminal-mkdocs-side-panel"><nav>
|
|
<ul class="terminal-mkdocs-side-nav-items">
|
|
|
|
<li class="terminal-mkdocs-side-nav-li">
|
|
|
|
|
|
|
|
|
|
|
|
<a class="terminal-mkdocs-side-nav-item" href="..">O forku</a>
|
|
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li class="terminal-mkdocs-side-nav-li">
|
|
|
|
|
|
|
|
|
|
|
|
<a class="terminal-mkdocs-side-nav-item" href="../en/">English</a>
|
|
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li class="terminal-mkdocs-side-nav-li">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="
|
|
|
|
|
|
|
|
terminal-mkdocs-side-nav-item terminal-mkdocs-side-nav-section-no-index">Fork meshcore-tth</span>
|
|
|
|
|
|
|
|
|
|
|
|
<ul class="terminal-mkdocs-side-nav-li-ul">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="terminal-mkdocs-side-nav-li-ul-li">
|
|
|
|
|
|
|
|
<a class="terminal-mkdocs-side-nav-item" href="../tth-commands/">Příkazy konzole · console commands</a>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="terminal-mkdocs-side-nav-li-ul-li">
|
|
|
|
|
|
|
|
<a class="terminal-mkdocs-side-nav-item" href="../ota/">Aktualizace od admina · OTA</a>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="terminal-mkdocs-side-nav-li-ul-li">
|
|
|
|
|
|
|
|
<a class="terminal-mkdocs-side-nav-item" href="../power/">Napájení · power</a>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="terminal-mkdocs-side-nav-li-ul-li">
|
|
|
|
|
|
|
|
<a class="terminal-mkdocs-side-nav-item" href="../budka-sensor/">Budka jako senzor · Budka sensor</a>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="terminal-mkdocs-side-nav-li-ul-li">
|
|
|
|
|
|
|
|
<a class="terminal-mkdocs-side-nav-item" href="../ble-lora-coexistence/">Koexistence BLE/LoRa</a>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
</li>
|
|
|
|
<li class="terminal-mkdocs-side-nav-li">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="
|
|
|
|
|
|
|
|
terminal-mkdocs-side-nav-item--active terminal-mkdocs-side-nav-section-no-index">MeshCore (upstream)</span>
|
|
|
|
|
|
|
|
|
|
<ul class="terminal-mkdocs-side-nav-li-ul">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="terminal-mkdocs-side-nav-li-ul-li">
|
|
|
|
|
|
|
|
<a class="terminal-mkdocs-side-nav-item" href="../meshcore/">Introduction</a>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="terminal-mkdocs-side-nav-li-ul-li">
|
|
|
|
|
|
|
|
<a class="terminal-mkdocs-side-nav-item" href="../faq/">FAQ</a>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="terminal-mkdocs-side-nav-li-ul-li">
|
|
|
|
|
|
|
|
<a class="terminal-mkdocs-side-nav-item" href="../cli_commands/">CLI commands</a>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="terminal-mkdocs-side-nav-li-ul-li">
|
|
|
|
|
|
|
|
<a class="terminal-mkdocs-side-nav-item" href="../companion_cli/">Companion CLI</a>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="terminal-mkdocs-side-nav-li-ul-li">
|
|
|
|
|
|
|
|
<a class="terminal-mkdocs-side-nav-item" href="../companion_protocol/">Companion protocol</a>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="terminal-mkdocs-side-nav-li-ul-li">
|
|
|
|
|
|
|
|
<a class="terminal-mkdocs-side-nav-item" href="../terminal_chat_cli/">Terminal chat CLI</a>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="terminal-mkdocs-side-nav-li-ul-li">
|
|
|
|
|
|
|
|
<a class="terminal-mkdocs-side-nav-item" href="../kiss_modem_protocol/">KISS modem protocol</a>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="terminal-mkdocs-side-nav-li-ul-li">
|
|
|
|
|
|
|
|
<a class="terminal-mkdocs-side-nav-item" href="../packet_format/">Packet format</a>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="terminal-mkdocs-side-nav-li-ul-li">
|
|
|
|
|
|
<span class="terminal-mkdocs-side-nav-item--active">Payloads</span>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="terminal-mkdocs-side-nav-li-ul-li">
|
|
|
|
|
|
|
|
<a class="terminal-mkdocs-side-nav-item" href="../stats_binary_frames/">Stats binary frames</a>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="terminal-mkdocs-side-nav-li-ul-li">
|
|
|
|
|
|
|
|
<a class="terminal-mkdocs-side-nav-item" href="../number_allocations/">Number allocations</a>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="terminal-mkdocs-side-nav-li-ul-li">
|
|
|
|
|
|
|
|
<a class="terminal-mkdocs-side-nav-item" href="../qr_codes/">QR codes</a>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="terminal-mkdocs-side-nav-li-ul-li">
|
|
|
|
|
|
|
|
<a class="terminal-mkdocs-side-nav-item" href="../radio_presets/">Radio presets</a>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="terminal-mkdocs-side-nav-li-ul-li">
|
|
|
|
|
|
|
|
<a class="terminal-mkdocs-side-nav-item" href="../nrf52_power_management/">nRF52 power management</a>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</nav><hr>
|
|
<nav>
|
|
<ul>
|
|
<li><a href="#payload-format">Payload Format</a></li>
|
|
<li><a href="#important-concepts">Important concepts:</a></li><li><a href="#node-advertisement">Node advertisement</a></li><li><a href="#acknowledgement">Acknowledgement</a></li><li><a href="#returned-path-request-response-and-plain-text-message">Returned path, request, response, and plain text message</a></li><li><a href="#anonymous-request">Anonymous request</a></li><li><a href="#group-text-message">Group text message</a></li><li><a href="#group-datagram">Group datagram</a></li><li><a href="#control-data">Control data</a></li><li><a href="#custom-packet">Custom packet</a></li>
|
|
</ul>
|
|
</nav>
|
|
</aside>
|
|
<main id="terminal-mkdocs-main-content">
|
|
<section id="mkdocs-terminal-content">
|
|
<h1 id="payload-format">Payload Format</h1>
|
|
<p>Inside each <a href="../packet_format/">MeshCore Packet</a> is a payload, identified by the payload type in the packet header. The types of payloads are:</p>
|
|
<ul>
|
|
<li>Node advertisement.</li>
|
|
<li>Acknowledgment.</li>
|
|
<li>Returned path.</li>
|
|
<li>Request (destination/source hashes + MAC).</li>
|
|
<li>Response to REQ or ANON_REQ.</li>
|
|
<li>Plain text message.</li>
|
|
<li>Anonymous request.</li>
|
|
<li>Group text message (unverified).</li>
|
|
<li>Group datagram (unverified).</li>
|
|
<li>Multi-part packet</li>
|
|
<li>Control data packet</li>
|
|
<li>Custom packet (raw bytes, custom encryption).</li>
|
|
</ul>
|
|
<p>This document defines the structure of each of these payload types.</p>
|
|
<p>NOTE: all 16 and 32-bit integer fields are Little Endian.</p>
|
|
<h2 id="important-concepts">Important concepts:</h2>
|
|
<ul>
|
|
<li>Node hash: the first byte of the node's public key</li>
|
|
</ul>
|
|
<h2 id="node-advertisement">Node advertisement</h2>
|
|
<p>This kind of payload notifies receivers that a node exists, and gives information about the node</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Size (bytes)</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>public key</td>
|
|
<td>32</td>
|
|
<td>Ed25519 public key of the node</td>
|
|
</tr>
|
|
<tr>
|
|
<td>timestamp</td>
|
|
<td>4</td>
|
|
<td>unix timestamp of advertisement</td>
|
|
</tr>
|
|
<tr>
|
|
<td>signature</td>
|
|
<td>64</td>
|
|
<td>Ed25519 signature of public key, timestamp, and app data</td>
|
|
</tr>
|
|
<tr>
|
|
<td>appdata</td>
|
|
<td>rest of payload</td>
|
|
<td>optional, see below</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Appdata</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Size (bytes)</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>flags</td>
|
|
<td>1</td>
|
|
<td>specifies which of the fields are present, see below</td>
|
|
</tr>
|
|
<tr>
|
|
<td>latitude</td>
|
|
<td>4 (optional)</td>
|
|
<td>decimal latitude multiplied by 1000000, integer</td>
|
|
</tr>
|
|
<tr>
|
|
<td>longitude</td>
|
|
<td>4 (optional)</td>
|
|
<td>decimal longitude multiplied by 1000000, integer</td>
|
|
</tr>
|
|
<tr>
|
|
<td>feature 1</td>
|
|
<td>2 (optional)</td>
|
|
<td>reserved for future use</td>
|
|
</tr>
|
|
<tr>
|
|
<td>feature 2</td>
|
|
<td>2 (optional)</td>
|
|
<td>reserved for future use</td>
|
|
</tr>
|
|
<tr>
|
|
<td>name</td>
|
|
<td>rest of appdata</td>
|
|
<td>name of the node</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Appdata Flags</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Value</th>
|
|
<th>Name</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>0x01</code></td>
|
|
<td>is chat node</td>
|
|
<td>advert is for a chat node</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>0x02</code></td>
|
|
<td>is repeater</td>
|
|
<td>advert is for a repeater</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>0x03</code></td>
|
|
<td>is room server</td>
|
|
<td>advert is for a room server</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>0x04</code></td>
|
|
<td>is sensor</td>
|
|
<td>advert is for a sensor server</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>0x10</code></td>
|
|
<td>has location</td>
|
|
<td>appdata contains lat/long information</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>0x20</code></td>
|
|
<td>has feature 1</td>
|
|
<td>Reserved for future use.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>0x40</code></td>
|
|
<td>has feature 2</td>
|
|
<td>Reserved for future use.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>0x80</code></td>
|
|
<td>has name</td>
|
|
<td>appdata contains a node name</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h2 id="acknowledgement">Acknowledgement</h2>
|
|
<p>An acknowledgement that a message was received. Note that for returned path messages, an acknowledgement can be sent in the "extra" payload (see <a href="#returned-path">Returned Path</a>) instead of as a separate acknowledgement packet. CLI commands do not cause acknowledgement responses, neither discrete nor extra.</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Size (bytes)</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>checksum</td>
|
|
<td>4</td>
|
|
<td>CRC checksum of message timestamp, text, and sender pubkey</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h2 id="returned-path-request-response-and-plain-text-message">Returned path, request, response, and plain text message</h2>
|
|
<p>Returned path, request, response, and plain text messages are all formatted in the same way. See the subsection for more details about the ciphertext's associated plaintext representation.</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Size (bytes)</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>destination hash</td>
|
|
<td>1</td>
|
|
<td>first byte of destination node public key</td>
|
|
</tr>
|
|
<tr>
|
|
<td>source hash</td>
|
|
<td>1</td>
|
|
<td>first byte of source node public key</td>
|
|
</tr>
|
|
<tr>
|
|
<td>cipher MAC</td>
|
|
<td>2</td>
|
|
<td>MAC for encrypted data in next field</td>
|
|
</tr>
|
|
<tr>
|
|
<td>ciphertext</td>
|
|
<td>rest of payload</td>
|
|
<td>encrypted message, see subsections below for details</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3 id="returned-path">Returned path</h3>
|
|
<p>Returned path messages provide a description of the route a packet took from the original author. Receivers will send returned path messages to the author of the original message.</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Size (bytes)</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>path length</td>
|
|
<td>1</td>
|
|
<td>length of next field</td>
|
|
</tr>
|
|
<tr>
|
|
<td>path</td>
|
|
<td>see above</td>
|
|
<td>a list of node hashes (one byte each)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>extra type</td>
|
|
<td>1</td>
|
|
<td>extra, bundled payload type, eg., acknowledgement or response. Same values as in <a href="../packet_format/">Packet Format</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>extra</td>
|
|
<td>rest of data</td>
|
|
<td>extra, bundled payload content, follows same format as main content defined by this document</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3 id="request">Request</h3>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Size (bytes)</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>timestamp</td>
|
|
<td>4</td>
|
|
<td>sender time (unix timestamp)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>req type</td>
|
|
<td>1</td>
|
|
<td>request sub type</td>
|
|
</tr>
|
|
<tr>
|
|
<td>request data</td>
|
|
<td>rest of payload</td>
|
|
<td>application-defined request payload body</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>For the common chat/server helpers in <code>BaseChatMesh</code>, the current request type values are:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Value</th>
|
|
<th>Name</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>0x01</code></td>
|
|
<td>get stats</td>
|
|
<td>get stats of repeater or room server</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>0x02</code></td>
|
|
<td>keepalive</td>
|
|
<td>(deprecated)</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>0x03</code></td>
|
|
<td>get telemetry</td>
|
|
<td>request node telemetry</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>0x04</code></td>
|
|
<td>get min/max/avg</td>
|
|
<td>get sensor node stats on time series data</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>0x05</code></td>
|
|
<td>get acl</td>
|
|
<td>node ACL query</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>0x06</code></td>
|
|
<td>get neighbors</td>
|
|
<td>node neighbors query</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>0x08</code></td>
|
|
<td>subscribe</td>
|
|
<td>subscribe to telemetry push</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>0x09</code></td>
|
|
<td>ubsubscribe</td>
|
|
<td>unsubscribe from telemetry push</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="get-stats">Get stats</h4>
|
|
<p>Gets information about the node, possibly including the following:</p>
|
|
<ul>
|
|
<li>Battery level (millivolts)</li>
|
|
<li>Current transmit queue length</li>
|
|
<li>Current free queue length</li>
|
|
<li>Last RSSI value</li>
|
|
<li>Number of received packets</li>
|
|
<li>Number of sent packets</li>
|
|
<li>Total airtime (seconds)</li>
|
|
<li>Total uptime (seconds)</li>
|
|
<li>Number of packets sent as flood</li>
|
|
<li>Number of packets sent directly</li>
|
|
<li>Number of packets received as flood</li>
|
|
<li>Number of packets received directly</li>
|
|
<li>Error flags</li>
|
|
<li>Last SNR value</li>
|
|
<li>Number of direct route duplicates</li>
|
|
<li>Number of flood route duplicates</li>
|
|
<li>Number posted (?)</li>
|
|
<li>Number of post pushes (?)</li>
|
|
</ul>
|
|
<h4 id="get-telemetry">Get Telemetry</h4>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Size (bytes)</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>timestamp</td>
|
|
<td>4</td>
|
|
<td>sender time (unix timestamp)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>req type</td>
|
|
<td>1</td>
|
|
<td>0x03 (request sub type)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>permission mask</td>
|
|
<td>1</td>
|
|
<td>bitwise inverse mask to AND to permissions (0 = get ALL telem values)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="get-minmaxave-sensor-nodes">Get Min/Max/Ave (Sensor nodes)</h4>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Size (bytes)</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>timestamp</td>
|
|
<td>4</td>
|
|
<td>sender time (unix timestamp)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>req type</td>
|
|
<td>1</td>
|
|
<td>0x04 (request sub type)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>start</td>
|
|
<td>4</td>
|
|
<td>starting time, seconds ago</td>
|
|
</tr>
|
|
<tr>
|
|
<td>end</td>
|
|
<td>4</td>
|
|
<td>ending time, seconds ago</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reserved</td>
|
|
<td>2</td>
|
|
<td>should be zeroes</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="subscribe-to-telemetry-push-sensor-nodes">Subscribe to Telemetry push - (Sensor nodes)</h4>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Size (bytes)</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>timestamp</td>
|
|
<td>4</td>
|
|
<td>sender time (unix timestamp)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>req type</td>
|
|
<td>1</td>
|
|
<td>0x08 (request sub type)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>push tag</td>
|
|
<td>4</td>
|
|
<td>32-bit tag to be used in telemetry push _REPLY payloads</td>
|
|
</tr>
|
|
<tr>
|
|
<td>timeout secs</td>
|
|
<td>2</td>
|
|
<td>subscription timeout (seconds)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reserved</td>
|
|
<td>1</td>
|
|
<td>should be zero</td>
|
|
</tr>
|
|
<tr>
|
|
<td>min deltas len</td>
|
|
<td>1</td>
|
|
<td>byte length of LPP encoded min_deltas</td>
|
|
</tr>
|
|
<tr>
|
|
<td>min deltas</td>
|
|
<td>(variable)</td>
|
|
<td>LPP encoded min_deltas</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="unsubscribe-from-telemetry-push-sensor-nodes">Unsubscribe from Telemetry push - (Sensor nodes)</h4>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Size (bytes)</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>timestamp</td>
|
|
<td>4</td>
|
|
<td>sender time (unix timestamp)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>req type</td>
|
|
<td>1</td>
|
|
<td>0x09 (request sub type)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="get-access-list">Get Access List</h4>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Size (bytes)</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>timestamp</td>
|
|
<td>4</td>
|
|
<td>sender time (unix timestamp)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>req type</td>
|
|
<td>1</td>
|
|
<td>0x05 (request sub type)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reserved</td>
|
|
<td>2</td>
|
|
<td>should be zeroes</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4 id="get-neighbors">Get Neighbors</h4>
|
|
<p>Not defined in <code>BaseChatMesh</code>.</p>
|
|
<h4 id="get-owner-info">Get Owner Info</h4>
|
|
<p>Not defined in <code>BaseChatMesh</code>.</p>
|
|
<h3 id="response">Response</h3>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Size (bytes)</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>content</td>
|
|
<td>rest of payload</td>
|
|
<td>application-defined response body</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Response contents are opaque application data. There is no single generic response envelope beyond the encrypted payload wrapper shown above.</p>
|
|
<h3 id="plain-text-message">Plain text message</h3>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Size (bytes)</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>timestamp</td>
|
|
<td>4</td>
|
|
<td>send time (unix timestamp)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>txt_type + attempt</td>
|
|
<td>1</td>
|
|
<td>upper six bits are txt_type (see below), lower two bits are attempt number (0..3)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message</td>
|
|
<td>rest of payload</td>
|
|
<td>the message content, see next table</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>txt_type</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Value</th>
|
|
<th>Description</th>
|
|
<th>Message content</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>0x00</code></td>
|
|
<td>plain text message</td>
|
|
<td>the plain text of the message</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>0x01</code></td>
|
|
<td>CLI data</td>
|
|
<td>CLI command OR reply text</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>0x02</code></td>
|
|
<td>signed plain text message</td>
|
|
<td>first four bytes is sender pubkey prefix, followed by plain text message</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>0x03</code></td>
|
|
<td>CLI command</td>
|
|
<td>(since v1.18+) CLI command text (explicit)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h2 id="anonymous-request">Anonymous request</h2>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Size (bytes)</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>destination hash</td>
|
|
<td>1</td>
|
|
<td>first byte of destination node public key</td>
|
|
</tr>
|
|
<tr>
|
|
<td>public key</td>
|
|
<td>32</td>
|
|
<td>sender's Ed25519 public key</td>
|
|
</tr>
|
|
<tr>
|
|
<td>cipher MAC</td>
|
|
<td>2</td>
|
|
<td>MAC for encrypted data in next field</td>
|
|
</tr>
|
|
<tr>
|
|
<td>ciphertext</td>
|
|
<td>rest of payload</td>
|
|
<td>encrypted message, see below for details</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3 id="room-server-login">Room server login</h3>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Size (bytes)</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>timestamp</td>
|
|
<td>4</td>
|
|
<td>sender time (unix timestamp)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>sync timestamp</td>
|
|
<td>4</td>
|
|
<td>sender's "sync messages SINCE x" timestamp</td>
|
|
</tr>
|
|
<tr>
|
|
<td>password</td>
|
|
<td>rest of message</td>
|
|
<td>password for room</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3 id="repeatersensor-login">Repeater/Sensor login</h3>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Size (bytes)</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>timestamp</td>
|
|
<td>4</td>
|
|
<td>sender time (unix timestamp)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>password</td>
|
|
<td>rest of message</td>
|
|
<td>password for repeater/sensor</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3 id="repeater-regions-request">Repeater - Regions request</h3>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Size (bytes)</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>timestamp</td>
|
|
<td>4</td>
|
|
<td>sender time (unix timestamp)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>req type</td>
|
|
<td>1</td>
|
|
<td>0x01 (request sub type)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply path len</td>
|
|
<td>1</td>
|
|
<td>path len for reply</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply path</td>
|
|
<td>(variable)</td>
|
|
<td>reply path</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3 id="repeater-owner-info-request">Repeater - Owner info request</h3>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Size (bytes)</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>timestamp</td>
|
|
<td>4</td>
|
|
<td>sender time (unix timestamp)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>req type</td>
|
|
<td>1</td>
|
|
<td>0x02 (request sub type)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply path len</td>
|
|
<td>1</td>
|
|
<td>path len for reply</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply path</td>
|
|
<td>(variable)</td>
|
|
<td>reply path</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3 id="repeater-clock-and-status-request">Repeater - Clock and status request</h3>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Size (bytes)</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>timestamp</td>
|
|
<td>4</td>
|
|
<td>sender time (unix timestamp)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>req type</td>
|
|
<td>1</td>
|
|
<td>0x03 (request sub type)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply path len</td>
|
|
<td>1</td>
|
|
<td>path len for reply</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply path</td>
|
|
<td>(variable)</td>
|
|
<td>reply path</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h2 id="group-text-message">Group text message</h2>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Size (bytes)</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>channel hash</td>
|
|
<td>1</td>
|
|
<td>first byte of SHA256 of channel's shared key</td>
|
|
</tr>
|
|
<tr>
|
|
<td>cipher MAC</td>
|
|
<td>2</td>
|
|
<td>MAC for encrypted data in next field</td>
|
|
</tr>
|
|
<tr>
|
|
<td>ciphertext</td>
|
|
<td>rest of payload</td>
|
|
<td>encrypted message, see below for details</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>The plaintext contained in the ciphertext matches the format described in <a href="#plain-text-message">plain text message</a>. Specifically, it consists of a four byte timestamp, a flags byte, and the message. The flags byte will generally be <code>0x00</code> because it is a "plain text message". The message will be of the form <code><sender name>: <message body></code> (eg., <code>user123: I'm on my way</code>).</p>
|
|
<p>The sender name is unverified message text. Group messages contain no sender
|
|
signature, so any channel-key holder can choose any sender name.</p>
|
|
<h2 id="group-datagram">Group datagram</h2>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Size (bytes)</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>channel hash</td>
|
|
<td>1</td>
|
|
<td>first byte of SHA256 of channel's shared key</td>
|
|
</tr>
|
|
<tr>
|
|
<td>cipher MAC</td>
|
|
<td>2</td>
|
|
<td>MAC for encrypted data in next field</td>
|
|
</tr>
|
|
<tr>
|
|
<td>ciphertext</td>
|
|
<td>rest of payload</td>
|
|
<td>encrypted data, see below for details</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>The data contained in the ciphertext uses the format below:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Size (bytes)</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>data type</td>
|
|
<td>2</td>
|
|
<td>Identifier for type of data. (See number_allocations.md)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>data len</td>
|
|
<td>1</td>
|
|
<td>byte length of data</td>
|
|
</tr>
|
|
<tr>
|
|
<td>data</td>
|
|
<td>rest of payload</td>
|
|
<td>(depends on data type)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h2 id="control-data">Control data</h2>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Size (bytes)</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>flags</td>
|
|
<td>1</td>
|
|
<td>upper 4 bits is sub_type</td>
|
|
</tr>
|
|
<tr>
|
|
<td>data</td>
|
|
<td>rest of payload</td>
|
|
<td>typically unencrypted data</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3 id="discover_req-sub_type">DISCOVER_REQ (sub_type)</h3>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Size (bytes)</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>flags</td>
|
|
<td>1</td>
|
|
<td>0x8 (upper 4 bits), prefix_only (lowest bit)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>type_filter</td>
|
|
<td>1</td>
|
|
<td>bit for each ADV_TYPE_*</td>
|
|
</tr>
|
|
<tr>
|
|
<td>tag</td>
|
|
<td>4</td>
|
|
<td>randomly generate by sender</td>
|
|
</tr>
|
|
<tr>
|
|
<td>since</td>
|
|
<td>4</td>
|
|
<td>(optional) epoch timestamp (0 by default)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3 id="discover_resp-sub_type">DISCOVER_RESP (sub_type)</h3>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Size (bytes)</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>flags</td>
|
|
<td>1</td>
|
|
<td>0x9 (upper 4 bits), node_type (lower 4)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>snr</td>
|
|
<td>1</td>
|
|
<td>signed, SNR*4</td>
|
|
</tr>
|
|
<tr>
|
|
<td>tag</td>
|
|
<td>4</td>
|
|
<td>reflected back from DISCOVER_REQ</td>
|
|
</tr>
|
|
<tr>
|
|
<td>pubkey</td>
|
|
<td>8 or 32</td>
|
|
<td>node's ID (or prefix)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h2 id="custom-packet">Custom packet</h2>
|
|
<p>Custom packets have no defined format.</p>
|
|
</section>
|
|
|
|
</main>
|
|
</div>
|
|
<hr><footer>
|
|
<div class="terminal-mkdocs-footer-grid">
|
|
<div id="terminal-mkdocs-footer-copyright-info">
|
|
Site built with <a href="http://www.mkdocs.org">MkDocs</a> and <a href="https://github.com/ntno/mkdocs-terminal">Terminal for MkDocs</a>.
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
</div>
|
|
|
|
|
|
<div class="modal" id="mkdocs_search_modal" tabindex="-1" role="alertdialog" aria-modal="true" aria-labelledby="searchModalLabel">
|
|
<div class="modal-dialog modal-lg" role="search">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="searchModalLabel">Search</h5>
|
|
<button type="button" class="close btn btn-default btn-ghost" data-dismiss="modal" aria-label="Close">x</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<p id="searchInputLabel">Type to start searching</p>
|
|
<form>
|
|
<div class="form-group">
|
|
<input type="search" class="form-control" aria-labelledby="searchInputLabel" placeholder="" id="mkdocs-search-query" title="Please enter search terms here">
|
|
</div>
|
|
</form>
|
|
<div id="mkdocs-search-results" data-no-results-text="No document matches found"></div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</body>
|
|
|
|
</html> |