A packet envelope sent/received over the mesh only payload_variant is sent in the payload portion of the LORA packet. The other fields are either not sent at all, or sent in the special 16 byte LORA header.

from message meshtastic.MeshPacket

Hierarchy

Constructors

  • Parameters

    Returns MeshPacket

Properties

channel: number

(Usually) If set, this indicates the index in the secondary_channels table that this packet was sent/received on. If unset, packet was on the primary channel. A particular node might know only a subset of channels in use on the mesh. Therefore channel_index is inherently a local concept and meaningless to send between nodes. Very briefly, while sending and receiving deep inside the device Router code, this field instead contains the 'channel hash' instead of the index. This 'trick' is only used while the payload_variant is an 'encrypted'.

from field: uint32 channel = 3;

Describe if this message is delayed

from field: meshtastic.MeshPacket.Delayed delayed = 13 [deprecated = true];

from: number

The sending node number. Note: Our crypto implementation uses this field as well. See crypto for details.

from field: fixed32 from = 1;

hopLimit: number

If unset treated as zero (no forwarding, send to adjacent nodes only) if 1, allow hopping through one node, etc... For our usecase real world topologies probably have a max of about 3. This field is normally placed into a few of bits in the header.

from field: uint32 hop_limit = 9;

hopStart: number

Hop limit with which the original packet started. Sent via LoRa using three bits in the unencrypted header. When receiving a packet, the difference between hop_start and hop_limit gives how many hops it traveled.

from field: uint32 hop_start = 15;

id: number

A unique ID for this packet. Always 0 for no-ack packets or non broadcast packets (and therefore take zero bytes of space). Otherwise a unique ID for this packet, useful for flooding algorithms. ID only needs to be unique on a per sender basis, and it only needs to be unique for a few minutes (long enough to last for the length of any ACK or the completion of a mesh broadcast flood). Note: Our crypto implementation uses this id as well. See crypto for details.

from field: fixed32 id = 6;

payloadVariant: {
    case: "decoded";
    value: Data;
} | {
    case: "encrypted";
    value: Uint8Array;
} | {
    case: undefined;
    value?: undefined;
}

Type declaration

  • case: "decoded"
  • value: Data

    TODO: REPLACE

    from field: meshtastic.Data decoded = 4;

Type declaration

  • case: "encrypted"
  • value: Uint8Array

    TODO: REPLACE

    from field: bytes encrypted = 5;

from oneof meshtastic.MeshPacket.payload_variant

pkiEncrypted: boolean

Indicates whether the packet was en/decrypted using PKI

from field: bool pki_encrypted = 17;

The priority of this message for sending. See MeshPacket.Priority description for more details.

from field: meshtastic.MeshPacket.Priority priority = 11;

publicKey: Uint8Array

Records the public key the packet was encrypted with, if applicable.

from field: bytes public_key = 16;

rxRssi: number

rssi of received packet. Only sent to phone for dispay purposes.

from field: int32 rx_rssi = 12;

rxSnr: number

Never sent over the radio links. Set during reception to indicate the SNR of this packet. Used to collect statistics on current link quality.

from field: float rx_snr = 8;

rxTime: number

The time this message was received by the esp32 (secs since 1970). Note: this field is never sent on the radio link itself (to save space) Times are typically not sent over the mesh, but they will be added to any Packet (chain of SubPacket) sent to the phone (so the phone can know exact time of reception)

from field: fixed32 rx_time = 7;

to: number

The (immediate) destination for this packet

from field: fixed32 to = 2;

viaMqtt: boolean

Describes whether this packet passed via MQTT somewhere along the path it currently took.

from field: bool via_mqtt = 14;

wantAck: boolean

This packet is being sent as a reliable message, we would prefer it to arrive at the destination. We would like to receive a ack packet in response. Broadcasts messages treat this flag specially: Since acks for broadcasts would rapidly flood the channel, the normal ack behavior is suppressed. Instead, the original sender listens to see if at least one node is rebroadcasting this packet (because naive flooding algorithm). If it hears that the odds (given typical LoRa topologies) the odds are very high that every node should eventually receive the message. So FloodingRouter.cpp generates an implicit ack which is delivered to the original sender. If after some time we don't hear anyone rebroadcast our packet, we will timeout and retransmit, using the regular resend logic. Note: This flag is normally sent in a flag bit in the header when sent over the wire

from field: bool want_ack = 10;

fields: FieldList
runtime: ProtoRuntime
typeName: "meshtastic.MeshPacket" = "meshtastic.MeshPacket"

Methods

  • Create a deep copy.

    Returns MeshPacket

  • Compare with a message of the same type. Note that this function disregards extensions and unknown fields.

    Parameters

    Returns boolean

  • Parse from binary data, merging fields.

    Repeated fields are appended. Map entries are added, overwriting existing keys.

    If a message field is already present, it will be merged with the new data.

    Parameters

    • bytes: Uint8Array
    • Optionaloptions: Partial<BinaryReadOptions>

    Returns this

  • Parse a message from a JSON value.

    Parameters

    • jsonValue: JsonValue
    • Optionaloptions: Partial<JsonReadOptions>

    Returns this

  • Parse a message from a JSON string.

    Parameters

    • jsonString: string
    • Optionaloptions: Partial<JsonReadOptions>

    Returns this

  • Retrieve the MessageType of this message - a singleton that represents the protobuf message declaration and provides metadata for reflection- based operations.

    Returns MessageType<MeshPacket>

  • Serialize the message to binary data.

    Parameters

    • Optionaloptions: Partial<BinaryWriteOptions>

    Returns Uint8Array

  • Override for serialization behavior. This will be invoked when calling JSON.stringify on this message (i.e. JSON.stringify(msg)).

    Note that this will not serialize google.protobuf.Any with a packed message because the protobuf JSON format specifies that it needs to be unpacked, and this is only possible with a type registry to look up the message type. As a result, attempting to serialize a message with this type will throw an Error.

    This method is protected because you should not need to invoke it directly -- instead use JSON.stringify or toJsonString for stringified JSON. Alternatively, if actual JSON is desired, you should use toJson.

    Returns JsonValue

  • Serialize the message to a JSON value, a JavaScript value that can be passed to JSON.stringify().

    Parameters

    • Optionaloptions: Partial<JsonWriteOptions>

    Returns JsonValue

  • Serialize the message to a JSON string.

    Parameters

    • Optionaloptions: Partial<JsonWriteStringOptions>

    Returns string

  • Parameters

    Returns boolean

  • Parameters

    • bytes: Uint8Array
    • Optionaloptions: Partial<BinaryReadOptions>

    Returns MeshPacket

  • Parameters

    • jsonValue: JsonValue
    • Optionaloptions: Partial<JsonReadOptions>

    Returns MeshPacket

  • Parameters

    • jsonString: string
    • Optionaloptions: Partial<JsonReadOptions>

    Returns MeshPacket