meshtastic

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRecvTimeout = os.ErrDeadlineExceeded

Recv reads one FromRadio packet from the connection. Blocks until a complete packet is received. ErrRecvTimeout is returned when a Recv call times out waiting for data.

Functions

func Run

func Run(ctx context.Context, logger *slog.Logger, _ string) error

Types

type Radio

type Radio struct {
	// contains filtered or unexported fields
}

Radio manages a connection to a meshtastic device.

func NewRadio

func NewRadio(conn io.ReadWriteCloser) *Radio

NewRadio creates a Radio from an io.ReadWriteCloser (e.g. HAL serial port).

func (*Radio) Close

func (r *Radio) Close() error

Close closes the underlying connection.

func (*Radio) NodeNum

func (r *Radio) NodeNum() uint32

NodeNum returns the local node number obtained during init.

func (*Radio) Recv

func (r *Radio) Recv() (*meshpb.FromRadio, error)

func (*Radio) RecvTimeout added in v0.0.19

func (r *Radio) RecvTimeout(timeout time.Duration) (*meshpb.FromRadio, error)

func (*Radio) Send

func (r *Radio) Send(msg *meshpb.ToRadio) error

Send marshals and frames a ToRadio message and writes it to the connection.

type RadioHandshake

type RadioHandshake struct {
	NodeNum       uint32
	LongName      string
	ShortName     string
	PublicKey     []byte
	Channels      []*meshpb.Chan
	Configs       []*meshpb.RadioConfig
	ModuleConfigs []*meshpb.ModConfig
}

RadioHandshake holds the configuration received during the init handshake.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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