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

    Class MavlinkMessage

    A message read and written by field name against a schema.

    Index
    • get messageId(): number

      The id of the message this carries.

      Returns number

    • get name(): string

      The name of the message this carries.

      Returns string

    • get payload(): Buffer

      The message's bytes as they go on the wire.

      Returns Buffer

    • Reads a field as a number.

      Every field reads this way. An integer field wider than 53 bits can exceed what a JavaScript number holds exactly, which no common-dialect field reaches in practice.

      Parameters

      • field: string

        The field name.

      • Optionalindex: number | null

        The element to read, or 0 for a scalar field.

      Returns number

      The value.

      If the message has no such field, or the element is past the end of an array.

    • Copies the raw bytes of a byte-wide array field out.

      Parameters

      • field: string

        The field name.

      Returns Buffer

      The bytes, including the zero padding.

      If the message has no such field, or it is not a byte-wide array.

    • Reads a char array as text, stopping at the padding.

      Parameters

      • field: string

        The field name.

      Returns string

      The text, without its padding.

      If the message has no such field, it is not a char array, or the bytes are not valid UTF-8.

    • Writes a number into a field, converting it to the field's type.

      A value bound for an integer field must be a whole number within that field's range, so a fractional or oversized value is refused rather than silently truncated.

      Parameters

      • field: string

        The field name.

      • value: number

        The value to store.

      • Optionalindex: number | null

        The element to write, or 0 for a scalar field.

      Returns void

      If the message has no such field, the element is past the end of an array, or an integer field cannot hold the value exactly.

    • Writes the raw bytes of a byte-wide array field, zero-padding the rest.

      Parameters

      • field: string

        The field name.

      • bytes: Buffer

        The bytes to store, at most the field's declared length.

      Returns void

      If the message has no such field, it is not a byte-wide array, or the bytes are longer than the field.

    • Writes text into a char array, padding the rest with zeros.

      Parameters

      • field: string

        The field name.

      • text: string

        The text to store, at most the field's declared length.

      Returns void

      If the message has no such field, it is not a char array, or the text is longer than the field.

    • Reads a message out of a frame payload.

      A payload shorter than the shape is zero-extended, as MAVLink 2 truncation requires, so a frame from a peer that trimmed trailing zeros or predates an extension field still decodes.

      Parameters

      • schema: MessageSchema

        The shape to read the payload as.

      • payload: Buffer

        The frame payload.

      Returns MavlinkMessage

      The decoded message.

      If the payload is longer than the shape describes.