Expand description
The C ABI for mesh packet framing.
These functions wrap [pamoja_mesh] for callers that reach the SDK through the
flat C boundary: an addressed packet that hops node to node across a radio mesh,
and the duplicate suppressor that stops a flood from circulating forever.
A frame carries a payload, so it crosses as an opaque handle like every other
payload-bearing type here. The duplicate cache is sized when it is built rather
than by the const generic the Rust crate uses, since a const generic cannot
cross a C ABI at all; PAMOJA_MESH_SEEN_DEFAULT_CAPACITY is what a caller
with no reason to choose should pass.
Structs§
- Pamoja
Mesh Frame - An opaque handle to a mesh frame.
- Pamoja
Seen Cache - An opaque handle to a cache of recently seen packets.
Constants§
- PAMOJA_
MESH_ BROADCAST - The destination address that means every node.
- PAMOJA_
MESH_ DEFAULT_ HOP_ LIMIT - The hop limit a frame starts with unless one is set.
- PAMOJA_
MESH_ FRAME_ MAX - The largest mesh frame, in bytes, including its header and checksum.
- PAMOJA_
MESH_ HEADER_ LEN - The length of a mesh frame header, in bytes.
- PAMOJA_
MESH_ OVERHEAD - The bytes a frame spends on its header and checksum together.
- PAMOJA_
MESH_ PAYLOAD_ MAX - The largest payload a single mesh frame can carry, in bytes.
- PAMOJA_
MESH_ SEEN_ DEFAULT_ CAPACITY - A reasonable duplicate-cache size for a caller with no reason to choose one.
- PAMOJA_
MESH_ VERSION - The mesh protocol version this build speaks.
Functions§
- pamoja_
mesh_ ⚠crc16 - Computes the CRC-16 a mesh frame carries.
- pamoja_
mesh_ ⚠frame_ broadcast - Builds a mesh frame addressed to every node.
- pamoja_
mesh_ ⚠frame_ bytes - Returns a pointer to the whole frame as it goes on the air.
- pamoja_
mesh_ ⚠frame_ bytes_ len - Returns the length in bytes of the whole frame.
- pamoja_
mesh_ ⚠frame_ dst - Returns the address a frame is addressed to.
- pamoja_
mesh_ ⚠frame_ free - Releases a mesh frame handle.
- pamoja_
mesh_ ⚠frame_ hop_ limit - Returns how many further relays a frame may take.
- pamoja_
mesh_ ⚠frame_ id - Returns the sequence number that identifies a packet from its source.
- pamoja_
mesh_ ⚠frame_ is_ broadcast - Reports whether a frame is addressed to every node.
- pamoja_
mesh_ ⚠frame_ new - Builds a mesh frame addressed to one node.
- pamoja_
mesh_ ⚠frame_ parse - Parses a frame received off a radio.
- pamoja_
mesh_ ⚠frame_ payload - Returns a pointer to the payload a frame carries.
- pamoja_
mesh_ ⚠frame_ payload_ len - Returns the length in bytes of the payload a frame carries.
- pamoja_
mesh_ ⚠frame_ relayed - Returns the same frame with one hop spent, ready to forward.
- pamoja_
mesh_ ⚠frame_ set_ hop_ limit - Sets the number of relays a frame may still take.
- pamoja_
mesh_ ⚠frame_ src - Returns the address of the node a frame came from.
- pamoja_
mesh_ ⚠frame_ version - Returns the protocol version a frame declares.
- pamoja_
mesh_ ⚠seen_ capacity - Returns how many packets a duplicate cache remembers.
- pamoja_
mesh_ ⚠seen_ contains - Reports whether a packet is currently remembered, without recording it.
- pamoja_
mesh_ ⚠seen_ free - Releases a duplicate cache handle.
- pamoja_
mesh_ seen_ new - Creates an empty duplicate cache.
- pamoja_
mesh_ ⚠seen_ record - Records a packet and reports whether it was new.