bemfa

package
v1.10.8 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Disconnected uint32 = iota
	Connecting
	Reconnecting
	Connected
)

Variables

This section is empty.

Functions

func UnRegisterPowerChangeCallback

func UnRegisterPowerChangeCallback(d *Device, topic, key string)

Types

type Device

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

func CreateDevice

func CreateDevice(secretKey string, secureVerify bool, httpClientTimeout int) *Device

func GetBemfaDevice

func GetBemfaDevice(secretKey string, httpClientSecureVerify bool, httpClientTimeout int) (*Device, error)

func (*Device) GetExtData

func (d *Device) GetExtData(key any) (val any, ok bool)

func (*Device) IsDisconnected

func (d *Device) IsDisconnected() bool

func (*Device) Login

func (d *Device) Login() error

func (*Device) OnLine

func (d *Device) OnLine() bool

func (*Device) ReceiveMessageHandler

func (d *Device) ReceiveMessageHandler(c MQTT.Client, m MQTT.Message)

func (*Device) ResigsterPowerChangeCallbackFunc

func (d *Device) ResigsterPowerChangeCallbackFunc(subTopic, key string, f func(string)) error

func (*Device) Stop

func (d *Device) Stop()

func (*Device) StoreExtData

func (d *Device) StoreExtData(key any, val any)

func (*Device) SubTopicOption

func (d *Device) SubTopicOption()

func (*Device) UnRegisterPowerChangeCallbackFunc

func (d *Device) UnRegisterPowerChangeCallbackFunc(subTopic, key string)

Jump to

Keyboard shortcuts

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