test

package
v0.0.0-...-e7a313f Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CallBack mqtt.MessageHandler = func(client mqtt.Client, msg mqtt.Message) {
	fmt.Printf("2 topic: %s\n", msg.Topic())
	fmt.Printf("2 msg  : %s\n", msg.Payload())
}

Functions

func Check

func Check(sn string) *mqtt.Client

func InBound

func InBound(sn string, topic string) bool

InBound 数据入站 订阅消息 qos:0

func Init

func Init(sn string, server string) *mqtt.Client

Init 初始化客户端

func Pub

func Pub(sn string, topic string, data string) bool

Pub 数据出站 发布消息 qos:0 retained:false

func Start

func Start(sn string, server string)

Start 启动引擎 启动客户端连接

func Stop

func Stop(sn string) bool

Stop 关闭引擎 断开客户端连接

func Sub

func Sub(sn string, topic string, callback mqtt.MessageHandler) bool

func UnSub

func UnSub(sn string, topic string) bool

UnSub 取消订阅,指定主题

Types

This section is empty.

Jump to

Keyboard shortcuts

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