hwroma

package
v0.0.0-...-91c7ab2 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Run()
	GetConnectStatus() bool
	GetSubDeviceConnectStatus(deviceIdentifier string) bool
	SendDeviceAddWaitResponse(deviceInfo proto.DeviceInfo) error
	SendDeviceChangeStatusWaitResponse(deviceIdentifier string, connectStatus proto.DeviceConnectStatus) error
	SendDeviceQueryWaitResponse(deviceIdentifier string) (proto.DeviceInfo, error)
	SendDeviceCommandResponse(mid int, success bool, body interface{}) error
	SendDeviceData(deviceIdentifier string, services []proto.Service) error
}

func NewRoma

func NewRoma(conf proto.Config, messageHandler MessageHandler) Client

type MessageHandler

type MessageHandler interface {
	OnConnected()
	ConnectionLost()

	HandleDeviceDelete(deviceIdentifier string)
	HandleDeviceCommand(command proto.Command)
}

type Roma

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

func (*Roma) ConnectionLost

func (c *Roma) ConnectionLost(client MQTT.Client, err error)

func (*Roma) GetConnectStatus

func (r *Roma) GetConnectStatus() bool

func (*Roma) GetSubDeviceConnectStatus

func (r *Roma) GetSubDeviceConnectStatus(deviceIdentifier string) bool

func (*Roma) HandleDeviceCommand

func (c *Roma) HandleDeviceCommand(command proto.Command)

func (*Roma) HandleDeviceDelete

func (c *Roma) HandleDeviceDelete(deviceIdentifier string)

func (*Roma) OnConnected

func (c *Roma) OnConnected(client MQTT.Client)

func (*Roma) Run

func (r *Roma) Run()

func (*Roma) SendDeviceAddWaitResponse

func (r *Roma) SendDeviceAddWaitResponse(deviceInfo proto.DeviceInfo) error

func (*Roma) SendDeviceChangeStatusWaitResponse

func (r *Roma) SendDeviceChangeStatusWaitResponse(deviceIdentifier string, connectStatus proto.DeviceConnectStatus) error

func (*Roma) SendDeviceCommandResponse

func (r *Roma) SendDeviceCommandResponse(mid int, success bool, body interface{}) (err error)

func (*Roma) SendDeviceData

func (r *Roma) SendDeviceData(deviceIdentifier string, services []proto.Service) (err error)

func (*Roma) SendDeviceQueryWaitResponse

func (r *Roma) SendDeviceQueryWaitResponse(deviceIdentifier string) (device proto.DeviceInfo, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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