API reference · Browser and Node
@toip-tools/mesh-transport
70 public exports.
import { ackMac, addressTag, AirtimeBudget } from "@toip-tools/mesh-transport";
Functions
-
ackMacAn ACK's MAC, under k(R→S).
-
addressTagThe 4-byte address tag of a packet from S to R, under k(S→R).
-
custodyMessageWhat a gateway signs in a custody receipt.
-
decodeFrame -
decodePacket -
encodeFrame -
encodePacket -
estimateFrames and airtime (frames plus one ACK) to send a packet once over `link`.
-
exportBundle -
fragmentCuts a packet into DATA frames of at most `mtu` bytes.
-
joinTsp -
keyHintH(Ed25519 key)[0..8], naming a door or gateway in its beacons and VIA packets.
-
loraAirtimeMsSemtech's time-on-air formula, explicit header, CRC on.
-
maxBytesUnderThe largest payload (up to 255 bytes) whose airtime is at most `ms`.
-
memoryContacts -
memoryGatewayStore -
memoryOutbox -
openBundleThe messages in a bundle.
-
openRoute -
openSender -
packetIdpid = H(packet)[0..4].
-
pairKeysk(me→peer) and k(peer→me), from one X25519 agreement.
-
planMtuThe MTU a plan really allows: its own, capped by the largest frame under the dwell limit.
-
postBundlePosts every message through a relay transport signed in as the courier.
-
readVidForm -
receiptMacThe MAC of a receipt with status 0 or 2, under k(R→S).
-
receiptTagA RECEIPT's tag, under k(R→S).
-
sealRouteA VIA's route block for the gateway: both VIDs, sealed to it.
-
sealSenderAn INTRO's sealed sender: HPKE base mode to R, bound to the packet's `enc`.
-
splitTspThe parts of a TSP message.
-
tspSignatureValidChecks the TSP signature, so a mesh node can drop forgeries and tag collisions before delivery.
-
vidForm`0x01 ‖ key` for an Ed25519 did:key, otherwise `0x02 ‖ length ‖ UTF-8`.
Classes
-
AirtimeBudgetA sliding-window airtime ledger.
-
ChallengeBeacon -
LinkEventsA small helper for adapters: listener sets for frames and state.
-
MeshGateway -
MeshTransport -
VirtualSchedulerVirtual time.
Interfaces
-
AirtimePolicyA link's airtime budget: a sliding window with a ceiling, and a per-frame cap (dwell time).
-
BeaconInfo -
BundleItem -
ChannelPlan -
Contact -
ContactStore -
GatewayStore -
Link -
LinkInfo -
LoRaSettingLoRa time on air, channel plans and region rules (design §12, §14.4).
-
MeshOptions -
MeshOutboxItem -
MeshOutboxStore -
MeshStats -
ReceivedFrame -
RelayLikeAnything that posts to the internet relay: a RelayTransport signed in as the gateway.
-
SchedulerWhere the mesh gets time and timers.
-
TspParts -
ViaArrivalWhat a gateway gets for each VIA packet that names it.
Types
Constants
-
FRAME_HEADER -
MAX_FRAGMENTS -
plans -
realScheduler -
regions -
US915_DOWN -
US915_UP904.6 MHz: the stock US915 gateway's 500 kHz receive channel.
Signatures and source documentation are generated from packages/mesh-transport/src/index.ts.