mqtt

package
v0.0.0-...-fc28734 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewObserver

func NewObserver(msgChs chan *models.MsgChan, log *log.Logger) mqtt.Observer

Types

type Client

type Client struct {
	*mqtt.Client
	// contains filtered or unexported fields
}

func NewMqtt

func NewMqtt(ctx dm.Context, cfg config.Config) (*Client, error)

func (*Client) Close

func (m *Client) Close() error

func (*Client) Offline

func (m *Client) Offline(ctx *comctx.Context, node string, info *dm.DeviceInfo) error

Online 报告设备离线状态

func (*Client) Online

func (m *Client) Online(ctx *comctx.Context, node string, info *dm.DeviceInfo) error

Online 报告设备在线状态

func (*Client) ReportDeviceProperties

func (m *Client) ReportDeviceProperties(ctx *comctx.Context, node string, info *dm.DeviceInfo, report v1.Report, topic string) error

ReportDeviceProperties 召测使用系统mqtt

func (*Client) Start

func (m *Client) Start(ch chan *models.MsgChan) error

Jump to

Keyboard shortcuts

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