Packages

@paramira/broadcast-medium

In-process simulated physical-radio broadcast medium (BLE/LoRa/WiFi Direct) with optional DTN epidemic-buffering, for testing transports that assume one.

License: AGPL-3.0-or-later

Source: packages/broadcast-medium

What it does

An in-process simulated physical-radio broadcast medium (BLE/LoRa/WiFi Direct) for testing transports that assume one — a transmitted frame reaches every registered node in range, exactly like real radio.

Open mesh by default (everyone reaches everyone); setReachable()/ setFullMesh() impose a partial topology modeling range limits or obstructions, openMesh() lifts it again.

createDtnBroadcastMedium(ttlMs) adds delay-tolerant store-and-forward: every broadcast is buffered too, and bringIntoRange(a, b) flushes still-live buffered frames to both — simulating two devices moving close enough for contact after being apart. Since a real payload is end-to-end encrypted before it reaches this layer, an intermediate carrier forwards blobs it can't decrypt — mirroring how real LoRa/BLE DTN networks work.

Used by

Nothing uses it yet: it was extracted from an earlier prototype and is kept for later.

Uses

No dependencies.