reticulum-js
    Preparing search index...

    Class Packet

    Represents a Reticulum packet.

    Holds the parsed header fields, destination hash, context byte and payload, and provides serialization/deserialization to and from the wire format.

    Index
    • Constructs a Reticulum packet from header, destination and payload fields.

      Parameters

      • options: {
            contextByte?: number;
            contextFlag?: boolean;
            destinationHash: Uint8Array<ArrayBufferLike>;
            destinationType?: number;
            headerType?: number;
            hops?: number;
            packetType: number;
            payload?: Uint8Array<ArrayBufferLike>;
            raw?: Uint8Array<ArrayBufferLike>;
            transportId?: Uint8Array<ArrayBufferLike>;
            transportType?: number;
        }

      Returns Packet

    contextByte: number
    contextFlag: boolean
    destinationHash: Uint8Array<ArrayBufferLike>
    destinationType: number
    headerType: number
    hops: number
    packetType: number
    payload: Uint8Array<ArrayBufferLike>
    raw: Uint8Array<ArrayBufferLike>
    transportId: Uint8Array<ArrayBufferLike> | undefined
    transportType: number
    • Returns the canonical bytes used to compute the packet hash (flags byte followed by the destination/context/payload portion).

      Returns Uint8Array<ArrayBuffer>

    • Serializes the Packet into the exact Reticulum wire format.

      Returns Uint8Array<ArrayBufferLike>

    • Parses a raw Reticulum wire-format packet into a Packet.

      Parameters

      • data: Uint8Array<ArrayBufferLike>

      Returns Packet