mqtt

package
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: 8 Imported by: 0

Documentation

Index

Constants

View Source
const MQTTProtoTopic = "/2/c/"

Variables

View Source
var DefaultClient = Client{
	// contains filtered or unexported fields
}

Functions

This section is empty.

Types

type Client

type Client struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewClient

func NewClient(url, username, password, rootTopic string) *Client

func (*Client) Connect

func (c *Client) Connect() error

func (*Client) GetChannelFromTopic

func (c *Client) GetChannelFromTopic(topic string) string

func (*Client) GetFullTopicForChannel

func (c *Client) GetFullTopicForChannel(channel string) string

func (*Client) Handle

func (c *Client) Handle(channel string, h HandlerFunc)

Register a handler for messages on the specified channel

func (*Client) Publish

func (c *Client) Publish(m *Message) error

Publish a message to the broker

func (*Client) TopicRoot

func (c *Client) TopicRoot() string

type HandlerFunc

type HandlerFunc func(message Message)

type Message

type Message struct {
	Topic    string
	Payload  []byte
	Retained bool
}

MQTT Message

type Node

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

Node implements a meshtastic node that connects only via MQTT

func NewNode

func NewNode(user *meshtastic.User) *Node

Jump to

Keyboard shortcuts

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