meshtastic

package module
v0.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 6 Imported by: 2

README

Under heavy development. Consider these contracts written with a half-eaten crayon; they will change.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	LongName      string
	ShortName     string
	ID            uint32
	HardwareModel pbuf.HardwareModel
}

func (*Node) EncryptPacket

func (n *Node) EncryptPacket(pkt *pbuf.MeshPacket, channelName string, key []byte) *pbuf.MeshPacket

Not actually in use yet 😅

type NodeID

type NodeID uint32

NodeID holds the node identifier. This is a uint32 value which uniquely identifies a node within a mesh.

const (
	// BroadcastNodeID is the special NodeID used when broadcasting a packet to a channel.
	BroadcastNodeID NodeID = math.MaxUint32
)

func RandomNodeID

func RandomNodeID() (NodeID, error)

RandomNodeID returns a randomised NodeID. It's recommended to call this the first time a node is started and persist the result.

Hardware meshtastic nodes first try a NodeID of the last four bytes of the BLE MAC address. If that ID is already in use or invalid, a random NodeID is generated. Source: https://github.com/meshtastic/firmware/blob/d1ea58975755e146457a8345065e4ca357555275/src/mesh/NodeDB.cpp#L466

func (NodeID) Bytes

func (n NodeID) Bytes() []byte

Bytes converts the NodeID to a byte slice

func (NodeID) DefaultLongName

func (n NodeID) DefaultLongName() string

DefaultLongName returns the default long node name based on the NodeID. Source: https://github.com/meshtastic/firmware/blob/d1ea58975755e146457a8345065e4ca357555275/src/mesh/NodeDB.cpp#L382

func (NodeID) DefaultShortName

func (n NodeID) DefaultShortName() string

DefaultShortName returns the default short node name based on the NodeID. Last two bytes of the NodeID represented in hex. Source: https://github.com/meshtastic/firmware/blob/d1ea58975755e146457a8345065e4ca357555275/src/mesh/NodeDB.cpp#L382

func (NodeID) String

func (n NodeID) String() string

String converts the NodeID to a hex formatted string. This is typically how NodeIDs are displayed in Meshtastic UIs.

func (NodeID) Uint32

func (n NodeID) Uint32() uint32

Uint32 returns the underlying uint32 value of the NodeID.

Directories

Path Synopsis
Package lora provides utilities to assess the signal quality of LoRa (Long Range) communication based on RSSI (Received Signal Strength Indicator) and SNR (Signal-to-Noise Ratio) values.
Package lora provides utilities to assess the signal quality of LoRa (Long Range) communication based on RSSI (Received Signal Strength Indicator) and SNR (Signal-to-Noise Ratio) values.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL