<ahref="https://github.com/meshcore-dev/meshcore/edit/main/docs/packet_structure.md"title="Edit this page"class="md-content__button md-icon"rel="edit">
<ahref="https://github.com/meshcore-dev/meshcore/edit/main/docs/packet_format.md"title="Edit this page"class="md-content__button md-icon"rel="edit">
<li><code>path_length</code> - 1 byte - Length of the path field in bytes</li>
<li><code>path</code> - size provided by <code>path_length</code> - Path to use for Direct Routing<ul>
<li>Up to a maximum of 64 bytes, defined by <code>MAX_PATH_SIZE</code></li>
<li>v1.12.0 firmware and older drops packets with <code>path_length</code><ahref="https://github.com/meshcore-dev/MeshCore/blob/e812632235274ffd2382adf5354168aec765d416/src/Dispatcher.cpp#L144">larger than 64</a></li>
<li>Up to a maximum 184 bytes, defined by <code>MAX_PACKET_PAYLOAD</code></li>
<li>Generally this is the remainder of the raw packet data</li>
<li>The firmware parses this data based on the provided Payload Type</li>
<li>v1.12.0 firmware and older drops packets with <code>payload</code> sizes <ahref="https://github.com/meshcore-dev/MeshCore/blob/e812632235274ffd2382adf5354168aec765d416/src/Dispatcher.cpp#L152">larger than 184</a></li>
</ul>
</li>
</ul>
<h3id="packet-format_1">Packet Format</h3>
<table>
<thead>
<tr>
@ -715,7 +841,7 @@
<tr>
<td>header</td>
<td>1</td>
<td>Contains routing type, payload type, and payload version.</td>
<td>Contains routing type, payload type, and payload version</td>
</tr>
<tr>
<td>transport_codes</td>
@ -723,25 +849,27 @@
<td>2x 16-bit transport codes (if ROUTE_TYPE_TRANSPORT_*)</td>
</tr>
<tr>
<td>path_len</td>
<td>path_length</td>
<td>1</td>
<td>Length of the path field in bytes.</td>
<td>Length of the path field in bytes</td>
</tr>
<tr>
<td>path</td>
<td>up to 64 (<code>MAX_PATH_SIZE</code>)</td>
<td>Stores the routing path if applicable.</td>
<td>Stores the routing path if applicable</td>
</tr>
<tr>
<td>payload</td>
<td>up to 184 (<code>MAX_PACKET_PAYLOAD</code>)</td>
<td>The actual data being transmitted.</td>
<td>Data for the provided Payload Type</td>
</tr>
</tbody>
</table>
<p>Note: see the <ahref="../payloads/">payloads doc</a> for more information about the content of payload.</p>
<h2id="header-breakdown">Header Breakdown</h2>
<p>bit 0 means the lowest bit (1s place)</p>
<blockquote>
<p>NOTE: see the <ahref="../payloads/">Payloads</a> documentation for more information about the content of specific payload types.</p>
</blockquote>
<h3id="header-format">Header Format</h3>
<p>Bit 0 means the lowest bit (1s place)</p>
<table>
<thead>
<tr>
@ -756,23 +884,23 @@
<td>0-1</td>
<td><code>0x03</code></td>
<td>Route Type</td>
<td>Flood, Direct, Reserved - see below.</td>
<td>Flood, Direct, etc</td>
</tr>
<tr>
<td>2-5</td>
<td><code>0x3C</code></td>
<td>Payload Type</td>
<td>Request, Response, ACK, etc. - see below.</td>
<td>Request, Response, ACK, etc</td>
</tr>
<tr>
<td>6-7</td>
<td><code>0xC0</code></td>
<td>Payload Version</td>
<td>Versioning of the payload format - see below.</td>
<td>Versioning of the payload format</td>
</tr>
</tbody>
</table>
<h2id="route-type-values">Route Type Values</h2>
<h3id="route-types">Route Types</h3>
<table>
<thead>
<tr>
@ -785,26 +913,26 @@
<tr>
<td><code>0x00</code></td>
<td><code>ROUTE_TYPE_TRANSPORT_FLOOD</code></td>
<td>Flood routing mode + transport codes</td>
<td>Flood Routing + Transport Codes</td>
</tr>
<tr>
<td><code>0x01</code></td>
<td><code>ROUTE_TYPE_FLOOD</code></td>
<td>Flood routing mode (builds up path).</td>
<td>Flood Routing</td>
</tr>
<tr>
<td><code>0x02</code></td>
<td><code>ROUTE_TYPE_DIRECT</code></td>
<td>Direct route (path is supplied).</td>
<td>Direct Routing</td>
</tr>
<tr>
<td><code>0x03</code></td>
<td><code>ROUTE_TYPE_TRANSPORT_DIRECT</code></td>
<td>direct route + transport codes</td>
<td>Direct Routing + Transport Codes</td>
</tr>
</tbody>
</table>
<h2id="payload-type-values">Payload Type Values</h2>
<p>Inside of each <ahref="../packet_structure/">meshcore packet</a> is a payload, identified by the payload type in the packet header. The types of payloads are:</p>
<h1id="payload-format">Payload Format</h1>
<p>Inside each <ahref="../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>
@ -860,7 +860,7 @@
<tr>
<td>extra type</td>
<td>1</td>
<td>extra, bundled payload type, eg., acknowledgement or response. Same values as in <ahref="../packet_structure/">packet structure</a></td>
<td>extra, bundled payload type, eg., acknowledgement or response. Same values as in <ahref="../packet_format/">Packet Format</a></td>