pamoja for TypeScript - v0.1.17
    Preparing search index...

    Class MavlinkFrame

    One MAVLink frame, assembled or received.

    Index
    • get bytes(): Buffer

      The whole frame, ready to put on the wire.

      Returns Buffer

    • get incompatFlags(): number

      The incompatibility flags a v2 frame declares.

      Returns number

    • get messageId(): number

      The id of the message the frame carries.

      Returns number

    • get payload(): Buffer

      The message payload.

      A v2 frame drops trailing zero bytes, so a payload can arrive shorter than the message's full length; a decoder zero-extends it.

      Returns Buffer

    • get signature(): Buffer<ArrayBufferLike> | null

      The signature block, or null when the frame is not signed.

      Returns Buffer<ArrayBufferLike> | null

    • get signed(): boolean

      Whether the frame carries a signature.

      This says only that the frame was signed, not that the signature is good; a Verifier decides that.

      Returns boolean

    • Assembles a v1 frame, for a peer that predates MAVLink 2.

      A v1 frame only carries message ids below 256.

      Parameters

      • header: MavlinkHeader
      • msgid: number
      • payload: Buffer
      • crcExtra: number

      Returns MavlinkFrame

    • Assembles a v2 frame carrying a message.

      This is the current wire format and what a modern autopilot expects.

      Parameters

      • header: MavlinkHeader
      • msgid: number
      • payload: Buffer
      • crcExtra: number

      Returns MavlinkFrame

    • Parses one frame, checking it against a known CRC_EXTRA.

      Throws if the bytes are not a whole frame or the checksum does not match, which is what rejects a frame mangled in transit.

      Parameters

      • bytes: Buffer
      • crcExtra: number

      Returns MavlinkFrame

    • Parses one frame, looking its CRC_EXTRA up as it goes.

      This is what a receiver holding many message types uses: the id comes out of the frame, and the seed comes from the dialect or the common registry.

      Parameters

      • bytes: Buffer
      • Optionaldialect: Dialect | null

      Returns MavlinkFrame

    • Assembles a v2 frame carrying a message this build does not type.

      The escape hatch a private dialect needs: supply the id, the payload, and the seed, and the frame is built and checked like any other.

      Parameters

      • header: MavlinkHeader
      • msgid: number
      • crcExtra: number
      • payload: Buffer

      Returns MavlinkFrame