mqttTest

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultClientInfo = ClientInfo{
		MqttBrokers:  []string{"tcp://106.15.225.172:1883"},
		ProductID:    "254pwnKQsvK",
		DeviceName:   "test5",
		DeviceSecret: "6skuocmEga94+OhVYRGWUphWlX0=",
	}
	SubDevice = ClientInfo{
		ProductID:    "255fCKEJ02I",
		DeviceName:   "subdeviceaaaa",
		DeviceSecret: "uygGxwKG84DIwS5LAluVLRa9Xow=",
	}
	DefaultGateway = ClientInfo{
		MqttBrokers:  []string{"tcp://106.15.225.172:1883"},
		ProductID:    "255fCsZtKEM",
		DeviceName:   "test1",
		DeviceSecret: "YZy3xOuvw4YfupMDnLA+PzmMTRA=",
	}

	DefaultRemoteConfig = ClientInfo{
		MqttBrokers:  []string{"tcp://106.15.225.172:1883"},
		ProductID:    "255fCsZtKEM",
		DeviceName:   "test1",
		DeviceSecret: "vsjl+0R8/kpkLd0PJ0my1HN8XDg=",
	}
)

Functions

func Assert

func Assert(mc mqtt.Client, info AssertInfo, assertFunc func(resp []byte) error) error

func GetMqttClient

func GetMqttClient(c *ClientInfo) (mc mqtt.Client, err error)

Types

type AssertInfo

type AssertInfo struct {
	SubTopic string
	PubTopic string
	Req      []byte
}

type ClientInfo

type ClientInfo struct {
	MqttBrokers  []string //mqtt服务器节点
	ProductID    string
	DeviceName   string
	DeviceSecret string //设备秘钥
}

Jump to

Keyboard shortcuts

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