Skip to content

Commit 672bd95

Browse files
authored
Schema transfer optimizations for remote management over LoRa (#62)
* Implemented schema hashing to support client caching * Added support for compression to Provisioning * Made heatshrink embedded rather than dependency
1 parent f5fcb09 commit 672bd95

24 files changed

Lines changed: 2600 additions & 114 deletions

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ rns_fetch(arxtypetraits RNS_ARXTYPETRAITS_SOURCE_DIR https://github.com/hideak
6767
rns_fetch(debuglog RNS_DEBUGLOG_SOURCE_DIR https://github.com/hideakitai/DebugLog.git v0.8.4)
6868
# Crypto and microStore have no upstream tags suitable for pinning, so pin commit SHAs.
6969
# Refresh by running `git ls-remote <url> HEAD` and updating the hex below.
70-
rns_fetch(crypto RNS_CRYPTO_SOURCE_DIR https://github.com/attermann/Crypto.git 984dc891330986c302a86c4e312d4f5abcc28359)
71-
rns_fetch(microstore RNS_MICROSTORE_SOURCE_DIR https://github.com/attermann/microStore.git c5fb69d68229e684c7fbd17692a67ae8193b84e2)
70+
rns_fetch(crypto RNS_CRYPTO_SOURCE_DIR https://github.com/attermann/Crypto.git)
71+
rns_fetch(microstore RNS_MICROSTORE_SOURCE_DIR https://github.com/attermann/microStore.git)
7272

7373
# -----------------------------------------------------------------------------
7474
# Third-party targets that don't ship CMakeLists.txt

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "microReticulum",
3-
"version": "0.4.1",
3+
"version": "0.4.2",
44
"description": "C++ port of the Reticulum Network Stack — a cryptographic mesh networking library that runs on both 32-bit+ microcontrollers (ESP32, nRF52, LoRa boards) and native platforms (Linux, macOS), with PlatformIO and CMake build support.",
55
"keywords": "reticulum, rns, mesh, embedded, mcu, esp32, nrf52, native",
66
"repository":

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=microReticulum
2-
version=0.4.1
2+
version=0.4.2
33
author=Chad Attermann <[email protected]>
44
maintainer=Chad Attermann <[email protected]>
55
sentence=C++ port of the Reticulum Network Stack

src/microReticulum/Provisioning/BuiltinNamespaces.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include "../Reticulum.h"
1919
#include "../Transport.h"
2020
#include "../Utilities/Memory.h"
21-
#include "../Utilities/tlsf.h"
21+
#include "../Utilities/tlsf/tlsf.h"
2222

2323
#include <set>
2424
#include <vector>

src/microReticulum/Provisioning/Ops.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ namespace RNS { namespace Provisioning {
7979
constexpr uint16_t FirmwareVersion = 1;
8080
constexpr uint16_t SchemaVersion = 2;
8181
constexpr uint16_t NeedsRebootInfo = 3;
82+
constexpr uint16_t SchemaHash = 4; // CRC32 of serialized GetSchema response bytes
8283

8384
// GetCapabilities
8485
constexpr uint16_t Namespaces = 1;
@@ -103,6 +104,18 @@ namespace RNS { namespace Provisioning {
103104
constexpr uint16_t FieldDefault = 12;
104105
constexpr uint16_t FieldElementSize = 13; // BytesList: required size per entry
105106
constexpr uint16_t FieldMaxCount = 14; // BytesList: max number of entries
107+
108+
// Per-request compression negotiation. Clients set ReqCompress=true
109+
// in the request payload map to ask the server to compress the
110+
// response. When the server complies, the response payload becomes
111+
// a single-entry map { CompressedPayload: <bin> } whose value is
112+
// heatshrink-compressed bytes that decompress to the original
113+
// MsgPack-encoded payload. Servers always pick the smaller wire
114+
// form and may send an uncompressed payload even when compression
115+
// was requested (tiny payloads where the wrapper overhead exceeds
116+
// the savings).
117+
constexpr uint16_t ReqCompress = 100;
118+
constexpr uint16_t CompressedPayload = 101;
106119
}
107120

108121
} }

0 commit comments

Comments
 (0)