mirror of
https://github.com/ratspeak/microReticulum
synced 2026-11-22 23:10:38 +00:00
Complete rewrite of Resource.h/cpp with full protocol implementation: ResourceAdvertisement: msgpack map pack/unpack with 11 string keys (t,d,n,h,r,o,i,l,q,f,m) matching Python/Rust wire format. OutboundResource (sender): compress → encrypt → chunk → hashmap → advertise. Splits encrypted blob into SDU-sized parts (263 bytes), computes SHA256(chunk||random_hash)[:4] map hashes, handles receiver requests. InboundResource (receiver): accept advertisement → receive parts by map hash → assemble → decrypt → decompress. Sends initial request, generates proof. Helper functions: get_map_hash(), compute_resource_hash(), compute_expected_proof() — all match Python/Rust implementations. 8 new tests (test_resource_transfer): advertisement roundtrip, map hash, resource hash, proof, flag encoding, nil/non-nil request_id. Legacy Resource class preserved for Link.cpp compatibility.
This directory is intended for PlatformIO Test Runner and project tests. Unit Testing is a software testing method by which individual units of source code, sets of one or more MCU program modules together with associated control data, usage procedures, and operating procedures, are tested to determine whether they are fit for use. Unit testing finds problems early in the development cycle. More information about PlatformIO Unit Testing: - https://docs.platformio.org/en/latest/advanced/unit-testing/index.html