Module meshtastic::types

source ·
Expand description

This module exposes wrappers around common types that are used throughout the library. These wrappers are used to simplify the API of the library, and to provide additional type safety.

The NodeId struct is a wrapper around a u32 value that represents the ID of a node in the mesh. This struct is used to provide additional type safety when specifying node IDs.

The MeshChannel enum is a wrapper around a u32 value that represents the channel of the mesh. This struct is used to provide additional type safety when specifying mesh channels, as it will only allow channels with indices between 0 and 7, inclusive.

The EncodedMeshPacketData struct is a wrapper around a Vec<u8> value that represents the payload data of a mesh packet (e.g., a text message).

The EncodedToRadioPacket struct is a wrapper around a Vec<u8> value that represents the payload data of a packet that is intended to be sent to the radio. This struct does not represent the full packet that is sent to the radio, as it does not include the required packet header.

The EncodedToRadioPacketWithHeader struct is a wrapper around a Vec<u8> value that represents the payload data of a packet that is intended to be sent to the radio. This struct includes the required packet header, and can be sent to the radio.

Structs§

  • A struct that represents encoded binary data that will be used within the protobufs::Data field of an outgoing protobufs::MeshPacket.
  • A struct that represents the binary encoding of an outgoing protobufs::ToRadio packet. This data does not include a packet header.
  • A struct that represents the binary encoding of an outgoing protobufs::ToRadio packet. This encoding can be sent to a radio, as it includes the required 4-byte packet header.
  • A struct that represents incoming encoded data from a radio connection. The wrapped data may contain a whole packet, a partial packet, or multiple packets.
  • A struct that represents a messaging channel on the mesh. This struct is used to limit the valid channel indices to be in the range [0..7].
  • A helper struct representing the ID of a node in the mesh.